<?php
$path="../../";
include("../../map.php");
?>
<style>
table tr td {border:1px solid #ccc;}
body {font-family: tahoma;}
</style>
<table style="width:100%;">
	<thead>
		<tr>
			<th class="black-cell" style="width:8%; text-align:center;">ID</span></th>
			<th scope="col" style=""><?php echo $sdil[24]; //Faturalar?> No</th>
			<th scope="col" style="width:15%"><?php echo $t25; //Cari?></th>
			<th scope="col" style="width:10%"><?php echo $sdil[24]; //Faturalar?></th>
			<th scope="col" style="width:15%"><?php echo $sdil[24]; //Faturalar?> <?php echo $sdil[115]; //Tarihi?></th>
			<th scope="col" style="width:10%">Gecikme</th>
			<th scope="col" style="width:10%; text-align:right;"><?php echo $sdil[176]; //tutar?></th>
		</tr>
	</thead>
	
	<tbody>
		<?php
		$ts1="";$ts2="";
		$sqlf = mysqli_query($conn, "select * from t4 where ne='afatura' or ne='sfatura' or ne='ifatura' ".$luye." order by id desc"); while($rsf=mysqli_fetch_assoc($sqlf)){
			if($rsf["t9"]>=$_POST["ts1"] and $rsf["t9"]<=$_POST["ts2"]){
				$sqlm = mysqli_query($conn, "select * from t5 where id=".$rsf["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm);
									//if($rsf["t6"]<>"" and tfark2(date("Y-m-d"),vade($rsf["t9"],$rsf["t6"]))<=0){
				?>
				<tr style="cursor:pointer;" onclick="location.href='?ne=muhasebe&islem=<?php echo $rsf["ne"]?>&id=<?php echo $rsf["id"]?>'">
					<th scope="row" class="table-check-cell"><?php echo i2a($rsf["id"],7);?></th>
					<td><?php echo $rsf["t1"]?></td>
					<td><?php echo $rsm["t1"]?></td>
					<td><?php if($rsf["ne"]=="afatura"){?><?php echo $sdil[149]; //Alış?><?php }elseif($rsf["ne"]=="sfatura"){?><?php echo $sdil[148]; //Satış?><?php }elseif($rsf["ne"]=="ifatura"){?><?php echo $sdil[139]; //İptal?><?php }?> <?php echo $sdil[24]; //Faturalar?></td>
					<td><?php echo dtarih($rsf["t9"],"gg.ka.yy")?>-<?php echo dtarih(vade($rsf["t9"],$rsf["t6"]),"gg.ka.yy")?></td>
					<td style="text-align:center;"><?php echo tfark2(date("Y-m-d"),vade($rsf["t9"],$rsf["t6"]))?></td>
					<td style="text-align:right;"><?php echo wprice($rsf["pb2"]);?> <?php echo $ikpb?></td>
				</tr>
			<?php }}?>
		</tbody>
	</table>