<meta charset="UTF-8">
<?php
$path="../../";
include("../../map.php");
?>
<style>
table tr td {border:1px solid #ccc;}
body {font-family: tahoma;}
</style>
<table style="width:100%;">
    <tr>
        <th style="width:8%">ID</th>
        <th style=""><?php echo $sdil[39]; //Başlık?></th>
        <th style="width:10%"><?php echo ctranslate("Durum"); //Giriş?></th>
<?php if($c7==1){?>
        <th style="width:10%"><?php echo ctranslate("Giris"); //Giriş?></th>
        <th style="width:10%"><?php echo ctranslate("Cikis"); //Çıkış?></th>
        <th style="width:10%"><?php echo ctranslate("Konsinye"); //Konsinye?></th>
<?php }?>
        <th style="width:10%"><?php echo ctranslate("Yönetici"); //Giriş?></th>
    </tr>
    <?php
    if($_POST["s9"]<>""){ $sorgu="and s9='".$_POST["s9"]."'"; }
	$sql = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' ".$sorgu." ".$luye." order by id desc"); while($rs=mysqli_fetch_assoc($sql)){
	$sout=0;$sin=0;$sother=0;
	$sqle=mysqli_query($conn, "select * from t5 where s19=".$rs["s19"].""); $rse=mysqli_fetch_assoc($sqle);
	$sqlreport = mysqli_query($conn, "select * from t4 where s2=".$rs["id"]." order by id desc"); while($report=mysqli_fetch_assoc($sqlreport)){
	$sqlf=mysqli_query($conn, "select * from t4 where id=".$report["s1"].""); $rsf=mysqli_fetch_assoc($sqlf);
	$sqlm=mysqli_query($conn, "select * from t5 where id=".$rsf["s1"].""); $rsm=mysqli_fetch_assoc($sqlm);
    if($rsf["ne"]=="sfatura"){$sout=$sout+$report["s5"];}else{$sin=$sin+$report["s5"];}
    if($report["s3"]=="1"){$sother=$sother+$report["s5"];}
  }
  ?>
  <tr>
    <td><?php echo i2a($rs["id"],7);?></td>
    <td><?php echo $rs["t1"]?></td>
    <td><?php if($rs["s13"]==0) {echo ctranslate("#Pasif");}elseif($rs["s13"]==1) {echo ctranslate("#Aktif");}elseif($rs["s13"]==3) {echo ctranslate("#Tedarik Edilemiyor");}?></td>
<?php if($c7==1){?>
    <td><?php echo $sin?></td>
    <td><?php echo $sout?></td>
    <td><?php echo $sother?></td>
<?php }?>
    <td><?php if(mysqli_num_rows($sqle)>0){echo $rse["t1"];}else{echo "Admin";}?></td>
</tr>
<?php }?>
</table>