<?php
$path="../../";
include("../../map.php");
?>
<table class="table table-bordered table-striped" style="min-width: 500px;">
	<thead style="">
		<tr>
			<th class="w8 mw8">ID</th>
			<th class=""><?php echo ctranslate(telefon($t25s[0]));?></th>
			<th class="w20 mw20"><?php echo ctranslate("Ziyaret");?></th>
			<th class="w20 mw20"><?php echo ctranslate("Gsm No")?></th>
			<?php if($e8<>0){?>
				<th class="w15 mw15"><?php echo ctranslate("Bakiye")?> (<?php echo $ikpb;?>)</th>
			<?php }?>
		</tr>
	</thead>
	<?php
	if($_GET["q"]<>""){
		$sorgu=" where t1 like '%".$_GET["q"]."%'";
	}
	$sql=mysqli_query($conn, "select * from t5 ".$sorgu." order by s4 asc, id desc"); while($rs=mysqli_fetch_assoc($sql)){  ?>
		<tr onclick="location.href='?islem=duye&ne=uye&id=<?php echo $rs['id']?>'" style="cursor:pointer;">
			<td class=""><?php echo i2a($rs["id"],7)?></td>
			<td><?php echo kisalt($rs["t1"],3)?></td>
			<td><?php echo dtarih($rs["ts3"],"gg.ka.yyyy")?></td>
			<td class=""><?php echo $rs["t4"]?></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"]."");
				?>
				<th class=""><span class="digi"><?php echo wprice($bakiye)?></span></th>
				<?php $bakiye=0;$cpb1=0; $cpb2=0; $cpb3=0; $cpb4=0;}?>
			</tr>
		<?php }?>
		<tbody>
		</tbody>
	</table>