<div class="inner-wrapper">
	<section role="main" class="content-body card-margin">
		<header class="page-header">
			<h2><?php echo ctranslate("PosNet")?> <?php echo $sdil[38]; //rapor?></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 ctranslate("PosNet")?> <?php echo $sdil[38]; //rapor?></span></li>
				</ol>
				<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
			</div>
		</header>
		<!-- start: page -->
		<div class="row">
			<div class="col">
				<section class="card form">
					<header class="card-header" style="text-align: start">
						<div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
							<?php include("modules/public/filter.php")?>
							<!--
								<a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
								<a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
							-->
						</div>
						<h2 class="card-title mdn"><?php echo ctranslate("PosNet")?> <?php echo $sdil[38]; //rapor?></h2>
						<p class="card-subtitle">...</p>
					</header>
					<div class="card-body">
						<fieldset style="position:relative; min-height:100px; overflow:hidden;">
							<legend><?php echo ctranslate("Adisyonlar")?></legend>
							<?php
							$paket=0;$self=0;$masa=0;$pos=0;$nakit=0;$yk=0; $cari=0;
							$sqlf = mysqli_query($conn, "select * from eticaret where ne='adisyon' and s4=4 ".$sorgu." ".$luye." order by id desc"); while($siparis=mysqli_fetch_assoc($sqlf)){
								$total=0;
								if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($siparis["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $siparis["t9"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($siparis["t9"]>=$_GET["ts1"] and $siparis["t9"]<=$_GET["ts2"])){
									$sqlm = mysqli_query($conn, "select * from t5 where id=".$siparis["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm);	
									include("modules/ecommerce/posnet_calc.php");
									$jsoi = json_decode($siparis["n12"], true);
									if($siparis["t3"]=="1"){
										$paket=$paket+$total;
									}elseif($siparis["t3"]=="0"){
										$self=$self+$total;
									}elseif($siparis["t3"]>1){
										$masa=$masa+$total;
									}
									if($jsoi["Cash"]<>""){
										$nakit=$nakit+$total;
									}elseif($jsoi["CreditCard"]<>""){
										$pos=$pos+$total;
									}elseif($jsoi["Ticket"]<>""){
										$yk=$yk+$total;
									}elseif($jsoi["Account"]<>""){
										$cari=$cari+$total;
									}
								}
							}
							?>
							<section class="v3-col-md-4">
								<div class="bg-secondary" style="padding: 10px;">
									<div class="widget-summary">
										<div class="widget-summary-col widget-summary-col-icon">
											<div class="summary-icon">
												<i class="fa fa-<?php echo strtolower($kpb)?>"></i>
											</div>
										</div>
										<div class="widget-summary-col">
											<div class="summary">
												<h4 class="title"><?php echo ctranslate("Paket")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($paket)?></strong>
												</div>
											</div>
										</div>
									</div>
								</div>
							</section>
							<section class="v3-col-md-4 mmt10">
								<div class="bg-secondary" style="padding: 10px;">
									<div class="widget-summary">
										<div class="widget-summary-col widget-summary-col-icon">
											<div class="summary-icon">
												<i class="fa fa-<?php echo strtolower($kpb)?>"></i>
											</div>
										</div>
										<div class="widget-summary-col">
											<div class="summary">
												<h4 class="title"><?php echo ctranslate("Self Servis")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($self)?></strong>
												</div>
											</div>
										</div>
									</div>
								</div>
							</section>
							<section class="v3-col-md-4 mmt10">
								<div class="bg-secondary" style="padding: 10px;">
									<div class="widget-summary">
										<div class="widget-summary-col widget-summary-col-icon">
											<div class="summary-icon">
												<i class="fa fa-<?php echo strtolower($kpb)?>"></i>
											</div>
										</div>
										<div class="widget-summary-col">
											<div class="summary">
												<h4 class="title"><?php echo ctranslate("Masa")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($masa)?></strong>
												</div>
											</div>
										</div>
									</div>
								</div>
							</section>
						</fieldset>
						<fieldset style="position:relative; min-height:100px;">
							<legend><?php echo $sdil[23]; //muahsebe?> <?php echo $sdil[38]; //rapor?></legend>
							<div class="card-body" style="padding:0px;">
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #47a447;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; border-radius: 5px 5px 0px 0px;"><?php echo $sdil[160]; //Nakit?></div>
									<div class="v3-col-md-2 v3-col-xs-1"><i class="fa fa-<?php echo StrToLower($module["currency"])?> cw" style="font-size: 24px;"></i></div>
									<div class="v3-col-md-9 v3-col-xs-10"><span class="count digi fs30"><?php echo $nakit?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #62e262;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; border-radius: 5px 5px 0px 0px;"><?php echo $sdil[162]; //Pos?></div>
									<div class="v3-col-md-2 v3-col-xs-1"><i class="fa fa-<?php echo StrToLower($module["currency"])?>" style="font-size: 24px;"></i></div>
									<div class="v3-col-md-9 v3-col-xs-10"><span class="count digi fs30"><?php echo $pos?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #6aec6a;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; border-radius: 5px 5px 0px 0px;"><?php echo ctranslate("Yemek Kartı")?></div>
									<div class="v3-col-md- v3-col-xs-1"><i class="fa fa-<?php echo StrToLower($module["currency"])?>" style="font-size: 24px;"></i></div>
									<div class="v3-col-md-9 v3-col-xs-10"><span class="count digi fs30"><?php echo $yk?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #7ed57e;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; border-radius: 5px 5px 0px 0px;"><?php echo ctranslate("Hesap")?></div>
									<div class="v3-col-md- v3-col-xs-1"><i class="fa fa-<?php echo StrToLower($module["currency"])?>" style="font-size: 24px;"></i></div>
									<div class="v3-col-md-9 v3-col-xs-10"><span class="count digi fs30"><?php echo $cari?></span></div>
								</div>
							</div>
						</fieldset>
						<fieldset style="position:relative; min-height:100px;">
							<legend><?php echo $sdil[38]; //rapor?></legend>
							<div class="card-body" style="padding:0px;">
								<div class="v3-col-md-4 v3-col-xs-12" style="font-size: 12px; padding: 12px;">
<table class="table">
<thead>
	<tr class="bg-warning">
		<td>Ürün Grupları</td>
		<td style="text-align:center;">Adet</td>
		<td style="text-align:right;">Toplam</td>
	</tr>
</thead>
	<?php
		$sqlx=mysqli_query($conn, "select * from kategoriler where ne='ukategori' order by sira asc"); while($rsx=mysqli_fetch_assoc($sqlx)){$x++;
			$total=0;$qty=0;
		$sqlu=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and s13=1 and s9='".$rsx["Cat_ID"]."'"); while($rsu=mysqli_fetch_assoc($sqlu)){
			$sqlo=mysqli_query($conn, "select * from eticaret where ne='items' and s3='".$rsu["id"]."'"); while($rso=mysqli_fetch_assoc($sqlo)){
				if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rso["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $rso["t9"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rso["t9"]>=$_GET["ts1"] and $rso["t9"]<=$_GET["ts2"])){
					$total=$total+($rso["pb1"]*$rso["s2"]);
					$qty=$qty+$rso["s2"];
				}
			}
		}
	?>
	<tr>
		<td><?php echo $rsx["Cat_".$_SESSION['lang'].""];?></td>
		<td style="text-align:center;"><?php echo $qty;?> Adet</td>
		<td style="text-align:right;"><?php echo wprice($total);?> <?php echo $ikpb?></td>
	</tr>
	<?php }?>
</table>
								</div>
								<div class="v3-col-md-4 v3-col-xs-12" style="font-size: 12px; padding: 12px;">
<table class="table">
	<tr class="bg-warning">
		<td>Ürünler</td>
		<td style="text-align:center;">Adet</td>
		<td style="text-align:right;">Toplam</td>
	</tr>
<?php 
	$p=0; $sql=mysqli_query($conn, "Select DISTINCT s3 from eticaret where ne='items'"); while($items=mysqli_fetch_assoc($sql)){ $p++;
	$total=0;$qty=0;
	$sqlc=mysqli_query($conn, "select * from eticaret where ne='items' and s3='".$items["s3"]."'"); while($rsc=mysqli_fetch_assoc($sqlc)){
		if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rsc["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $rsc["t9"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsc["t9"]>=$_GET["ts1"] and $rsc["t9"]<=$_GET["ts2"])){
			$total=$total+($rsc["pb1"]*$rsc["s2"]);
			$qty=$qty+$rsc["s2"];
		}
	}
	$sqlu=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where id=".$items["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
?>
	<tr>
		<td><?php echo kisalt($rsu["t1"],4);?></td>
		<td style="text-align:center;"><?php echo $qty; ?> Adet</td>
		<td style="text-align:right;"><?php echo wprice($total); ?> <?php echo $ikpb?></td>
	</tr>
<?php } ?>
</table>
								</div>
								<div class="v3-col-md-4 v3-col-xs-12" style="font-size: 12px; padding: 12px;">
<table class="table">
	<tr class="bg-warning">
		<td>Personel</td>
		<td style="text-align:center;">Adisyon</td>
		<td style="text-align:right;">Toplam</td>
	</tr>
<?php 
	$p=0; $sql=mysqli_query($conn, "select * from t5 where s2<>0"); while($rsc=mysqli_fetch_assoc($sql)){ $p++;
	$jstotal=0;$i=0;
	$sqlo=mysqli_query($conn, "select * from eticaret where ne='adisyon' and s19='".$rsc["id"]."'"); while($rso=mysqli_fetch_assoc($sqlo)){
		if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rso["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $rso["t9"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rso["t9"]>=$_GET["ts1"] and $rso["t9"]<=$_GET["ts2"])){
			$i++;
			$jsoi = json_decode($rso["n12"], true);
			$jstotal=$jstotal+($jsoi["Cash"]+$jsoi["CreditCard"]+$jsoi["Ticket"]+$jsoi["Account"]);
		}
	}
?>
	<tr>
		<td><?php echo $rsc["t1"];?></td>
		<td style="text-align:center;"><?php echo $i;?> Adet</td>
		<td style="text-align:right;"><?php echo wprice($jstotal);?> <?php echo $ikpb?></td>
	</tr>	
<?php } ?>
</table>
								</div>
							</div>
						</fieldset>
						<div class="alert alert-info">
							Bu Sayfa <strong>İstatistik Bilgileri</strong>, için Geliştirilmiştir.
						</div>
						
					</div>
				</div>
			</div>
		</div>
	</section>
</div>
</div>
</section>
<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>
</div>
</section>