<?php
	$ts = new DateTime('first day of this month');
?>
<div class="inner-wrapper">
	<section role="main" class="content-body">
		<header class="page-header">
			<h2><?php echo $sdil[23]; //Muhasebe?></h2>
			
			<div class="right-wrapper text-right">
				<ol class="breadcrumbs">
					<li>
						<a href=".">
							<i class="fa fa-home"></i>
						</a>
					</li>
					<li><span><?php echo $sdil[23]; //Muhasebe?></span></li>
					<li><span><?php echo $_SESSION["fName"]?></span></li>
					<li><span><?php echo translate("Fiş Listesi")?></span></li>
				</ol>
				
				<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
			</div>
		</header>
		<?php if($_GET["durum"]=="ok"){?>
			<div class="alert alert-success">
				<?php echo $sdil[212]; //Islem Basariyla Gerçeklestirilmistir !?>
			</div>
		<?php }?>
		
		<div class="row">
			<div class="col">
				<section class="card">
					<header class="card-header">
						<div class="card-actions">
							<?php include("modules/public/filter.php");?>
						</div>
						
						<h2 class="card-title cb"><?php echo translate("Fiş Listesi")?> {<?php echo $_SESSION["fName"]?>}</h2>
						<p class="card-subtitle">...</p>
					</header>
					<div class="card-body">
<?php if($_GET["ts1"]=="" and $_GET["ts2"]==""){?>
						<div class="alert alert-warning">#<?php echo translate("Son 30 Gün Listeniyor.")?></div>
<?php }?>
						<table class="table table-no-more table-bordered table-striped mb-0" style="<?php if($_SESSION["fID"]==""){?>filter: blur(1px);<?php }?>">
							<thead>
								<tr>
									<th class="black-cell w6">Fiş No</span></th>
									<th scope="col" class="w8">Fiş Tarihi</th>
									<th scope="col" class="w8">Belge No</th>
									<th scope="col" class="w8">Belge Tarihi</th>
									<th scope="col" class="w8">Belge Tipi</th>
									<th scope="col" class="w15">Açıklama</th>
									<th scope="col" class="w8 tar">Tutar</th>
								</tr>
							</thead>
							<tbody>
								<?php
								$ts1="";$ts2="";
								$sqlf = mysqli_query($conn, "select * from t4 where ne='fis' and s1=".$_SESSION["fID"]." and n1 like '%".$_GET["key"]."%' order by t9 desc"); while($rsf=mysqli_fetch_assoc($sqlf)){
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and $rsf["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsf["t9"]>=$_GET["ts1"] and $rsf["t9"]<=$_GET["ts2"])){
									$sqlm = mysqli_query($conn, "select * from t5 where id=".$rsf["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm);
									$sql19 = mysqli_query($conn, "select * from t5 where id=".$rsf["s19"]." order by id desc"); $rs19=mysqli_fetch_assoc($sql19);
									?>
									<tr class="mfrm cp" data-toggle="modal" data-target="#myModal" data-title="<?php echo $_SESSION["fName"]?> Fiş Detay {<?php echo $rs19["t1"]?>}" data-url="modules/accounting/accounting_voucher.php?id=<?php echo $rsf["id"]?>">
										<th class="black-cell w6"><?php echo i2a($rsf["id"],7);?></th>
										<th scope="col" class="w8"><?php echo dtarih($rsf["t9"],"gg.aa.yyyy","/")?></th>
										<th scope="col" class="w8"><?php echo $rsf["t4"]?></th>
										<th scope="col" class="w8"><?php echo dtarih($rsf["t3"],"gg.aa.yyyy","/")?></th>
										<th scope="col" class="w8"><?php echo $rsf["t2"]?></th>
										<th scope="col" class="w15"><?php echo $rsf["n1"]?></th>
										<th scope="col" class="w8 tar"><?php echo number_format($rsf["pb1"],2, ',', '.')?></th>
									</tr>
								<?php }}?>
							</tbody>
						</table>
					</div>
				</section>
			</div>
		</div>
		<!-- end: page -->
	</section>
</div>
<aside id="sidebar-right" class="sidebar-right">
	<div class="nano">
		<div class="nano-content">
			<a href="#" class="mobile-close d-md-none">
				Collapse <i class="fa fa-chevron-right"></i>
			</a>
			<div class="sidebar-right-wrapper">
				...
			</div>
		</div>
	</div>
</aside>
</section>
<?php include("../public/log.php");?>