<?php
	$path="../../";
	include("../../map.php");
?>
<script>
    jQuery(document).ready(function () {
        jQuery(".mfrm").on("click", function () {
            var target = jQuery(this).data("target"),
			theModal = jQuery(target),
			title = jQuery(this).data("title"),
			width = jQuery(this).data("width"),
			frmSRC = jQuery(this).data("url"),
			refSRC = jQuery(this).data("ref");
            theModal.fadeIn().addClass("in");
            theModal.find(".v3-modal-title").text(title);
            
            <?php if ($mobile == "") { ?>
                if (width !== undefined) { theModal.css("width", width); }
            <?php } ?>
            if (refSRC !== undefined) { theModal.find(".mcbtn").attr("onclick", "location.href='" + refSRC + "'"); }
            theModal.find("iframe").attr("src", frmSRC);
            theModal.find(".close").on("click", function () { theModal.find("iframe").attr("src", "about:blank"); });
        });
    });
</script>
<table class="v3-table" style="">
	<thead style="">
		<tr class="mdn">
			<th class="w8 mw8">ID</th>
			<th class=""><?php echo ctranslate(telefon($t25s[0]));?></th>
			<th class="w20 mw20"><?php echo ctranslate("Gsm No")?></th>
			<th class="w10 mw10"><?php echo ctranslate("Ziyaret");?></th>
		<?php if($e8<>0){?>
			<th class="w15 mw15 tar"><?php echo ctranslate("Bakiye")?></th>
		<?php }?>
		</tr>
	</thead>
<?php
	if($_GET["q"]<>""){
		$order="order by t1 asc";
	}else{
		if($_GET["order"]=="yeni"){
			$order="order by ts3 asc, id desc limit 0,10";
		}else{
			$order="order by s4 asc, id desc limit 0,10";
		}
	}
	$sql=mysqli_query($conn, "select * from t5 where t1 like '%".$_GET["q"]."%' $luye $ls1 $order"); while($rs=mysqli_fetch_assoc($sql)){
?>
		<tr class="mfrm" data-toggle="modal" data-target="#myModal" data-width="90%" data-url="modules/clients/client.php?islem=duye&ne=uye&id=<?php echo $rs['id']?>" data-title="#<?php echo $rs['id']?>" style="cursor:pointer;">
			<td class="mdn"><?php echo i2a($rs["id"],7)?></td>
			<td><?php echo $rs["t1"]?></td>
			<td class="mdn"><?php echo $rs["t4"]?></td>
			<td class="mdn"><div title="<?php echo dtarih($rs["ts3"],"gg ka yyyy");?>" class="v3-date"><span><?php echo dtarih($rs["ts3"],"gg");?></span><span><?php echo dtarih($rs["ts3"],"ka");?></span></div></td>
			<?php
			if($e8<>0){
				$sch=mysqli_query($conn, "select * from t4 where ne='cari' and s1=".$rs["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
					include("../clients/client_current_calc2.php");
				}
				$bakiye=($cpb1-$cpb2)-($cpb3-$cpb4);
				$usql = mysqli_query($conn, "update t5 set pb1='".$bakiye."' where id=".$rs["id"]."");
			?>
			<td class="tar"><span class="digi"><?php echo wprice($bakiye)?> <?php echo $ikpb?></span></td>
			<?php $bakiye=0;$cpb1=0; $cpb2=0; $cpb3=0; $cpb4=0;}?>
		</tr>
	<?php }?>
	<tbody>
	</tbody>
</table>