<div class="inner-wrapper">
	<section role="main" class="content-body card-margin">
		<header class="page-header">
			<h2><?php echo $sdil[23]; //muhasebe?> <?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 $sdil[23]; //muhasebe?> <?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 $sdil[23]; //muhasebe?> <?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 $sdil[24]; //Faturalar?></legend>
							<?php
							$sqlf = mysqli_query($conn, "select * from t4 where (ne='afatura' or ne='sfatura' or ne='ifatura') ".$sorgu." ".$luye." order by id 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 $rsf["t9"]=="")) 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);	
									if($rsf["ne"]=="sfatura"){
										$sfatura=$sfatura+$rsf["pb2"];
									}elseif($rsf["ne"]=="afatura"){
										$afatura=$afatura+$rsf["pb2"];
									}elseif($rsf["ne"]=="ifatura"){
										$ifatura=$ifatura+$rsf["pb2"];
									}
								}
							}
							?>
							<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("Satış Faturaları")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($sfatura,2)?></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("Alış Faturaları")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($afatura)?></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("İptal Faturalar")?></h4>
												<div class="info">
													<strong class="amount"><?php echo wprice($ifatura)?></strong>
												</div>
											</div>
										</div>
									</div>
								</div>
							</section>
						</fieldset>
						<fieldset style="position:relative; min-height:100px;">
							<legend><?php echo ctranslate("Gelir / Gider")?></legend>
							<?php
							//-- Bakiye Hesapla -->
							$sqlu=mysqli_query($conn, "select * from t5 where ne='uye' $luye order by t1 asc"); while($rsu=mysqli_fetch_assoc($sqlu)){$u++; $users[] = $rsu; }
							$cpb1=0;$cpb2=0;$cpb3=0;$cpb4=0;
							foreach($users as $key=>$value){
								$sch=mysqli_query($conn, "select * from t4 where ne='cari' and s1=".$value["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
									include("modules/clients/client_current_calc2.php");
								}
							}
							$alacak=($cpb1-$cpb2);
							$gelir=$cpb3;
							$gider=$cpb4;
							$cpb1=0;$cpb2=0;$cpb3=0;$cpb4=0;
							foreach($users as $key=>$value){
								$sch=mysqli_query($conn, "select * from t4 where ne='cari' and t1='Nakit' and s1=".$value["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($hcari["t4"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $hcari["t4"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($hcari["t4"]>=$_GET["ts1"] and $hcari["t4"]<=$_GET["ts2"])){
										include("modules/clients/client_current_calc2.php");
									}
									$nakit=$cpb3;
								}
							}
							$cpb1=0;$cpb2=0;$cpb3=0;$cpb4=0;
							foreach($users as $key=>$value){
								$sch=mysqli_query($conn, "select * from t4 where ne='cari' and t1='Pos' and s1=".$value["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($hcari["t4"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $hcari["t4"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($hcari["t4"]>=$_GET["ts1"] and $hcari["t4"]<=$_GET["ts2"])){
										include("modules/clients/client_current_calc2.php");
									}
								}
								$pos=$cpb3;
							}
							$cpb1=0;$cpb2=0;$cpb3=0;$cpb4=0;
							foreach($users as $key=>$value){
								$sch=mysqli_query($conn, "select * from t4 where ne='cari' and t1='Banka' and s1=".$value["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($hcari["t4"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $hcari["t4"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($hcari["t4"]>=$_GET["ts1"] and $hcari["t4"]<=$_GET["ts2"])){
										include("modules/clients/client_current_calc2.php");
									}
									$banka=$cpb3;
								}
							}
							$cpb1=0;$cpb2=0;$cpb3=0;$cpb4=0;
							foreach($users as $key=>$value){
								$sch=mysqli_query($conn, "select * from t4 where ne='cari' and t1='Taksit' and s1=".$value["id"]." order by id desc"); while($hcari=mysqli_fetch_assoc($sch)){
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($hcari["t4"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $hcari["t4"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($hcari["t4"]>=$_GET["ts1"] and $hcari["t4"]<=$_GET["ts2"])){
										include("modules/clients/client_current_calc2.php");
									}
									$cek=$cpb3;
								}
							}
							$vadesidolan=0; $vadesidolancari=0;
							foreach($users as $key=>$value){
								$sqlf = mysqli_query($conn, "select * from t4 where (ne='sfatura' or ne='afatura') and s1=".$value["id"]." order by id desc"); while($rsf=mysqli_fetch_assoc($sqlf)){
									if($rsf["t6"]<>"" and tfark2(date("Y-m-d"),vade($rsf["t9"],$rsf["t6"]))<=0){$vadesidolan=$vadesidolan+$rsf["pb2"];}
								}
								$sqlc=mysqli_query($conn, "select * from t4 where ne='cari' and t12<>'' and s1=".$value["id"]." order by t12 asc"); while($rsc=mysqli_fetch_assoc($sqlc)){
									if($rsc["t12"] <= date("Y-m-d") and ($rsc["pb1"]<>'0.00' and $rsc["pb2"]=='0.00')){$vadesidolancari=$vadesidolancari+$rsc["pb1"];}
								}
							}
							//-- Bakiye Hesapla -->
							?>
							<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; background: #47a447; border-radius: 5px 5px 0px 0px; color:white;"><?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 cw"><?php echo $nakit?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #6ebd6e;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; background: #6ebd6e; border-radius: 5px 5px 0px 0px; color:white;"><?php echo $sdil[161]; //Banka?></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 cw"><?php echo $banka?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #98da98;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; background: #98da98; border-radius: 5px 5px 0px 0px; color:white;"><?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"])?> cw" style="font-size: 24px;"></i></div>
									<div class="v3-col-md-9 v3-col-xs-10"><span class="count digi fs30 cw"><?php echo $pos?></span></div>
								</div>
								<div class="v3-col-md-3 v3-col-xs-12" style="font-size: 12px; padding: 12px; background: #bfecbf;">
									<div style="position: absolute; top: -20px; text-align: center; right: 0px; width: 75px; height: 20px; background: #bfecbf; border-radius: 5px 5px 0px 0px; color:white;"><?php echo $sdil[227]; //Taksit?></div>
									<div class="v3-col-md- 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 cw"><?php echo $cek?></span></div>
								</div>
							</div>
							<div class="v3-row" style="height:222px; margin-top:80px;">
								<div class="v3-col-md-4">
									<div class="card-body" style="background:#ffffff08;">
										<div class="widget-summary mmt20">
											<div class="widget-summary-col widget-summary-col-icon">
												<div class="summary-icon alert-success">
													<i class="fa fa-<?php echo StrToLower($module["currency"])?>"></i>
												</div>
											</div>
											<div class="widget-summary-col mmt20">
												<div class="summary">
													<h4 class="title"><?php echo ctranslate("Toplam Alacak")?></h4>
													<div class="info">
														<strong class="amount" style="<?php if(($_SESSION["kim"]=="Admin") or $_SESSION["kim"]=="yonetici" and $_SESSION["y8"]<>0){}else{?>text-shadow: 0 0 14px rgba(0,0,0,0.5); color:transparent;<?php }?>"><?php echo wprice($alacak);?> <?php echo $ikpb?></strong>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="v3-col-md-4">
									<div class="card-body" style="background:#ffffff08;">
										<div class="widget-summary">
											<div class="widget-summary-col widget-summary-col-icon">
												<div class="summary-icon alert-success">
													<i class="fa fa-<?php echo StrToLower($module["currency"])?>"></i>
												</div>
											</div>
											<div class="widget-summary-col">
												<div class="summary">
													<h4 class="title"><?php echo ctranslate("Toplam Gelir")?></h4>
													<div class="info">
														<strong class="amount"style="<?php if(($_SESSION["kim"]=="Admin") or $_SESSION["kim"]=="yonetici" and $_SESSION["y8"]<>0){}else{?>text-shadow: 0 0 14px rgba(0,0,0,0.5); color:transparent;<?php }?>"><?php echo wprice($gelir);?> <?php echo $ikpb?></strong>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="v3-col-md-4">
									<div class="card-body" style="background:#ffffff08;">
										<div class="widget-summary">
											<div class="widget-summary-col widget-summary-col-icon">
												<div class="summary-icon alert-success">
													<i class="fa fa-<?php echo StrToLower($module["currency"])?>"></i>
												</div>
											</div>
											<div class="widget-summary-col">
												<div class="summary">
													<h4 class="title"><?php echo ctranslate("Toplam Gider")?></h4>
													<div class="info">
														<strong class="amount"style="<?php if(($_SESSION["kim"]=="Admin") or $_SESSION["kim"]=="yonetici" and $_SESSION["y8"]<>0){}else{?>text-shadow: 0 0 14px rgba(0,0,0,0.5); color:transparent;<?php }?>"><?php echo wprice($gider);?> <?php echo $ikpb?></strong>
													</div>
												</div>
											</div>
										</div>
									</div>
								</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>