	<?php
	$sql=mysqli_query($conn, "select * from genel where ne='tahsilat'"); $rs=mysqli_fetch_assoc($sql);
	if(mysqli_num_rows($sql)==0){
		$sql = $conn->query("insert into genel (ne) values ('tahsilat')");
	}
	$ts = new DateTime('first day of this month');
	if(($_SESSION["kim"]=="Admin") or ($_SESSION["kim"]=="yonetici" and $_SESSION["y12"]==3)){
		if ($authority==0){
			$yetki=0;
		}else{
			$yetki=1;
		}
	}else{
		$yetki=0;
	}
	?>
	<style>
		.title{margin-bottom: 10px !important;}
		.bg-secondary, .bg-primary{border-radius:5px;}
		.cw{padding-top:10px; margin-bottom: 0px;}
		#labelmail:hover{color:#ea4335 !important; -webkit-filter: blur(0.7px);}
		#labelsms:hover{color:#020a6c !important; -webkit-filter: blur(0.7px);}
		#labelwhatsapp:hover{color:#25D366 !important; -webkit-filter: blur(0.7px);}
		#labelmanuel:hover{color:#32363b !important; -webkit-filter: blur(0.7px);}
		#labelkaydet:hover{color:#d3eedf !important; -webkit-filter: blur(0.7px);}
	</style>
	<div class="inner-wrapper">
		
		<section role="main" class="content-body card-margin">
			<header class="page-header">
				<h2>E-Tahsilat</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[4]; //Eticaret?></span></li>
						<li><span>E-Tahsilat</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="v3-row" id="process"></div>
			<div class="row">
				<div class="col">
					<section class="card">
						<header class="card-header v3-bg-info" style="text-align: start">
							<div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
								<?php include("modules/public/filter.php");?>
								<?php if($module["etahsilat_xls"]==1){?>
									<a data-url="modules/reports/report_payment.php?key=<?php echo $_GET["key"]?>&ts1=<?php echo $_GET["ts1"]?>&ts2=<?php echo $_GET["ts2"]?>" data-toggle="modal" data-target="#myModal" class="cp mfrm mb-1 mt-1 mr-1 btn btn-success xlsfilter_btn"><i class="fa fa-file-excel-o " aria-hidden="true"></i></a>
								<?php }?>
									<a href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=temizle" class="msa cp mfrm mb-1 mt-1 mr-1 btn btn-danger"><i class="fa fa-trash" aria-hidden="true"></i></a>
							</div>
							<h2 class="card-title mdn"><span style="text-transform:capitalize;"> <?php if($_GET["ne"]=="sayfa"){echo $t21s[0];}elseif($_GET["ne"]=="haber"){echo $t22s[0];}elseif($_GET["ne"]=="msayfa"){echo $n8s[0];}?> </span> <?php echo $sdil[207]; //İşlemleri?></h2>
						</header>
						<div class="v8-columns">
							<div class="v8-col200pxL-left">
								<ul class="v8-side-tabs v8-js-tabs v8-same-height">
									<li class=""><a href="#tab1" title=""><i class="fa fa-bolt"></i><span> <?php echo translate("Keşfet")?></span></a></li>
									<li class=""><a href="#tab4" title=""><i class="fa fa-calendar"></i><span> <?php echo translate("Tahsilat Rapor")?></span></a></li>
									<li class=""><a href="#tab2" title=""><i class="fa fa-link"></i><span> <?php echo translate("Hızlı link")?></span></a></li>
								</ul>
							</ul>
						</div>
						<div class="v8-col200pxL-right">
							<?php
							$tlink=surl("".$rs["n1"]."/?tahsilat/freetour/api/".base64_encode("".$_POST["tutar"]."+".$_POST["Email"]."+".$_POST["Gsm"]."+".$_POST["Ad"]."+".$_POST["Soyad"]."+".$_POST["pb"]."++".$_POST["Aciklama"]."+".$_POST["lang"]."")."");
							$data = json_decode($tlink, true);
							$arr=array('tutar'=>$_POST["tutar"], 'email'=>$_POST["Email"], 'gsm'=>$_POST["Gsm"], 'ad'=>$_POST["Ad"], 'soyad'=>$_POST["Soyad"], 'pb'=>$_POST["pb"], 'aciklama'=>$_POST["Aciklama"], 'lang'=>$_POST["lang"]);
							$jset = json_encode($arr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
							if($_GET["durum"]=="gonder"){
								function rpay($metin){
									global $firma;
									$metin = str_replace("{ad}", $_POST["Ad"], $metin);
									$metin = str_replace("{soyad}", $_POST["Soyad"], $metin);
									$metin = str_replace("{tutar}", $_POST["tutar"], $metin);
									$metin = str_replace("{aciklama}", $_POST["Aciklama"], $metin);
									$metin = str_replace("{pb}", $_POST["pb"], $metin);
									$metin = str_replace("{firma}", $firma, $metin);
									return $metin;
								}
								$tmesaj="".rpay($rs["n2"])." ".$tlink."";
								if($_POST["tip"]=="sms"){
									echo smsgonder($tmesaj,telefon($_POST["Gsm"]));
									echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
								}elseif($_POST["tip"]=="mail"){
									$konu			= "Tahsilat Bildirimi";
									$gonderen	= $firma;
									$malici			= $_POST["Email"];
									$mgonderen	= $mail;
									$mesaj			= $tmesaj;
									$mesaj			= $design_top.$mesaj.$design_bottom;
									include("../deppo/tools/script/mail.php");
									echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
								}elseif($_POST["tip"]=="whatsapp"){
									echo "<script>jQuery(document).ready(function() {window.open('https://web.whatsapp.com/send?phone=90".telefon($_POST["Gsm"])."&text=".$tmesaj."');});</script>";
								}elseif($_POST["tip"]=="kaydet"){
										$konu			= "Tahsilat Bildirimi";
										$gonderen	= $firma;
										$malici			= $_POST["Email"];
										$mgonderen	= $mail;
										$mesaj			= "Sayın Müşterimiz; Aldığınız hizmet ile ilgili ödeme linki kullanıcı panelinize tanımlanmıştır.";
										$mesaj			= $design_top.$mesaj.$design_bottom;
										include("../deppo/tools/script/mail.php");
										$sqli = $conn->query("insert into genel(ne,t4,n1,n2,s1,s13,s19,ts1) values ('ntahsilat', '".$_POST["ts1"]."', '".$tlink."', '".addslashes(stripslashes($jset))."', '".$_POST["s1"]."', '1', '".$_SESSION["user_id"]."', now())");
										echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok#&tab2",self,500,1);
									}
								}
								?>
								<div class="alert alert-warning" style="margin-top: 5px; margin-bottom: 0px; <?php if($_POST["tip"]<>"manuel"){echo "display:none;";}?>"><?php echo $data['shortlink'];?></div>
								<div id="tab2" class="v8-tabs-content">
									<form class="form" id="mform" method="post" action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=gonder#&tab2">
										<input type="hidden" name="s1" id="s1" value="0">
										<?php if($_GET["durum"]=="ok"){?>
											<div class="alert alert-success">
												<?php echo $sdil[212]; //islem Basariyla Gerçeklestirilmistir !?>
											</div>
										<?php }?>
										<div class="v3-row">
											<fieldset class="v3-col-md-4">
												<legend>Ad/Name</legend>
												<input type="text" list="tselect" name="Ad" id="tad" class="form-control" placeholder="Ad">
												<datalist id="tselect" style="display:none;">
													<?php
													$sql5=mysqli_query($conn, "select * from t5 order by t1 asc"); while($rs5=mysqli_fetch_assoc($sql5)){
														$bol = explode(' ',$rs5["t1"]); $uad=$bol[0]; $usoyad=$bol[1];
														?>
														<option value="<?php echo $rs5["t1"];?>" data-mail="<?php echo v3d($rs5["t2"]);?>" data-gsm="<?php echo $rs5["t4"];?>" data-ad="<?php echo $uad?>" data-soyad="<?php echo $usoyad?>" data-id="<?php echo $rs5["id"]?>"></option>
													<?php }?>
												</datalist>
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend>Soyad/Surname</legend>
												<input type="text" name="Soyad" class="form-control" id="tsoyad" placeholder="Soyad">
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend>Email</legend>
												<input type="text" name="Email" class="form-control" id="tmail" placeholder="Email">
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend>Gsm</legend>
												<input type="text" id="gsm" data-plugin-masked-input="" data-input-mask="<?php echo $module["pmask"];?>" placeholder="<?php echo $module["pmask"];?>" name="Gsm" class="form-control" id="tgsm">
											</fieldset>
											<fieldset class="v3-col-md-4 radios" style="display: flex;">
												<legend>Gönderim Tipi/Type</legend>
												<?php if($module["etahsilat_email"]==1){?>
													<label id="labelmail" for="mail" style="min-height: 55px; padding-top: 3px; text-align: center; border: 1px solid #604860; border-radius: 5px; margin-right: 10px; color:#ea4335; position: relative; cursor: pointer;">
														<i class="fas fa-envelope" title="Mail yoluyla göndermek için seçiniz" style="font-size:30px; margin-bottom: 5px;"></i>
														<input type="radio" id="mail" name="tip" value="mail" checked style="display:none;"><br>
														<div style="font-size:9px; margin-top: -6px;">Mail</div>
													</label>
												<?php }?>
												<?php if($module["etahsilat_sms"]==1){?>
													<label id="labelsms" for="sms"  style="min-height: 55px; padding-top: 3px; text-align: center; border: 1px solid #604860; border-radius: 5px; margin-right: 10px; position: relative; cursor: pointer;">
														<i class="fas fa-sms" title="Sms yoluyla göndermek için seçiniz" style="font-size:30px; margin-bottom: 5px;"></i>
														<input type="radio"  id="sms" name="tip" value="sms" style="display:none;"> <br>
														<div style="font-size:9px; margin-top: -6px;">Sms</div>
													</label>
												<?php }?>
												<?php if($module["etahsilat_whatsapp"]==1){?>
													<label id="labelwhatsapp" for="whatsapp"  style="min-height: 55px; padding-top: 3px; text-align: center; border: 1px solid #604860; border-radius: 5px; margin-right: 10px; position: relative; cursor: pointer;">
														<i class="fab fa-whatsapp-square" title="Whatsapp yoluyla göndermek için seçiniz" style="font-size:30px; margin-bottom: 5px;"></i>
														<input type="radio"  id="whatsapp" name="tip" value="whatsapp" style="display:none;"><br>
														<div style="font-size:9px; margin-top: -6px;">Whatsapp</div>
													</label>
												<?php }?>
												<label id="labelmanuel" for="manuel"  style="min-height: 55px; padding-top: 3px; text-align: center; border: 1px solid #604860; border-radius: 5px; margin-right: 10px; position: relative; cursor: pointer;">
													<i class="fas fa-copy" title="Manuel olarak linki kopyalayıp, paylaşabilirsiniz." style="font-size:30px; margin-bottom: 5px;"></i>
													<input type="radio"  id="manuel" name="tip" value="manuel" style="margin-right: 17px;  display:none;"><br>
													<div style="font-size:9px; margin-top: -6px;">Manuel</div>
												</label>
												<label id="labelkaydet" for="kaydet"  style="min-height: 55px; padding-top: 3px; text-align: center; border: 1px solid #604860; border-radius: 5px; margin-right: 10px; position: relative; cursor: pointer;">
													<i class="fas fa-save" title="Tahsilat bildirimi kullanıcı paneline düşmesi için kullanılır" style="font-size:30px; margin-bottom: 5px;"></i>
													<input type="radio"  id="kaydet" name="tip" value="kaydet" style="display:none;"><br>
													<div style="font-size:9px; margin-top: -6px;">Kaydet</div>
												</label>
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend><?php echo translate("#Tarih")?></legend>
												<input type="date" name="ts1" class="form-control" value="<?php echo date("Y-m-d")?>" placeholder="<?php echo translate("#Tarih")?>">
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend><?php echo translate("#Açıklama")?></legend>
												<input type="text" name="Aciklama" class="form-control" placeholder="<?php echo translate("#Açıklama")?>">
											</fieldset>
											<fieldset class="v3-col-md-4">
												<legend>Tutar/Total</legend>
												<div class="v3-input-group">
													<input type="text" class="v3-form-control" placeholder="Tutar" name="tutar" aria-describedby="basic-addon2" style="border: solid 1px #ccc !important; height: 39px;">
													<span class="v3-input-group-addon" style="min-width: 100px; padding: 0px">
														<select name="pb" class="v3-form-control" style="background:transparent; border:none; box-shadow: none;">
															<option value="TRY" <?php if($module["currency"]=="TRY"){echo "selected";}?>>TRY</option>
															<?php if($module["etahsilat_doviz"]==1){?>
																<option value="USD" <?php if($module["currency"]=="USD"){echo "selected";}?>>USD</option>
																<option value="EUR" <?php if($module["currency"]=="EUR"){echo "selected";}?>>EUR</option>
																<option value="GBP" <?php if($module["currency"]=="GBP"){echo "selected";}?>>GBP</option>
															<?php }?>
														</select>
													</span>
												</div>
											</fieldset>
											<div class="v3-col-md-4">
												<button class="v3-btn v3-btn-success" type="submit" style="float: right; margin-top:20px;"><i class="fa fa-paper-plane-o" aria-hidden="true"></i> <?php echo $sdil["112"]?></button>
											</div>
											<div style="clear:both; "></div>
										</div>
									</form>
									
									<div style="overflow:auto;">
										<table class="table" style="min-width:600px;">
											<?php
											$sqln=mysqli_query($conn, "select * from genel where ne='ntahsilat' order by id desc"); while($rsn=mysqli_fetch_assoc($sqln)){ $jsn = json_decode($rsn["n2"],true);
											$sql5=mysqli_query($conn, "select * from t5 where id=".$rsn["s1"].""); $rs5=mysqli_fetch_assoc($sql5);
											?>
											<tr>
												<th class="w8">ID</th>
												<th><?php echo translate("Açıklama")?></th>
												<th class="w15"><?php echo translate("Ad Soyad")?></th>
												<th class="w10"><?php echo translate("Tutar")?></th>
												<th class="w10"><?php echo translate("Tahsilat Tarihi")?></th>
												<th class="w10"><?php echo translate("İşlem Tarihi")?></th>
												<th class="w5"></th>
											</tr>
											<tr data-id="<?php echo $rsd["id"];?>" class="bg-<?php if($_SESSION["s13"]==1){echo "warning";}else{echo "success";}?>">
												<td><?php echo $rsn["id"]?></td>
												<td><?php echo $jsn["aciklama"]?></td>
												<td><?php echo $rs5["t1"]?></td>
												<td><?php echo $jsn["tutar"]?> <?php echo $jsn["pb"]?></td>
												<td><?php echo dtarih($rsn["t4"],"gg ka yy")?></td>
												<td><?php echo dtarih($rsn["ts1"],"gg ka yy time")?></td>
												<td>
													<?php if ($yetki==1){?>
														<a class="v3-btn v3-btn-danger v3-btn-xs  btn-delete-row" style="padding:unset;" data-href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=nsil&id=<?php echo $rsn["id"];?>"><i class="fa fa-times"></i></a></td>
													<?php }else{?>
														<a class="v3-btn v3-btn-danger v3-btn-xs " href="#"><i class="fa fa-lock"></i></a>
													<?php }?>
												</td>
											</tr>
										<?php }?>
									</table>
								</div>
							</div>
							<div id="tab4" class="v8-tabs-content">
								<div class="v3-panel v3-panel-default" style="width: 99%; margin-left: auto; margin-right: auto;">
									<div class="v3-panel-heading" style="min-height: 40px;">
										<span style="float:left;">
											Aylık
										</span>
									</div>
									<div class="v3-panel-body" style="">
										<div class="row">
											<div class="col-md-6">
												<table class="v3-table">
													<?php
													$array = ['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'];
													foreach( $array as $value ){
														$w=0;$pay_aylik=0;$sqld=mysqli_query($conn, "select * from t1 where ne='dekont' and s13=1 order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
															$ts1 = explode(' ',$rsd["t15"]); $tarih = explode('-',$ts1[0]);
															$pay_toplam=$pay_toplam+$rsd["pb1"];
															if($tarih[1]==$value and $tarih[0]==date('Y')){
																$pay_aylik=$pay_aylik+$rsd["pb1"];
																$w++;
															}
														}
														?>
														<tr>
															<td><?php echo $value?>.Ay</td>
															<td><?php if($w>0){echo $w." Adet İşlem";}else{echo "-";}?> </td>
															<td class="tar"><?php echo wprice($pay_aylik);?> <?php echo $ikpb?></td>
															<tr>
															<?php }?>
														</table>
													</div>
													<div class="col-md-6">
														<table class="v3-table">
															<tr>
															<?php 
																$sqlld=mysqli_query($conn, "select * from t1 where ne='dekont' and s13=1 order by id desc"); while($rsld=mysqli_fetch_assoc($sqlld)){
																	$rs1[] = $rsld['s1'];
																	$rt6[] = $rsld['t6']; $rt7[] = $rsld['t7'];
																	$rpb1[] = $rsld['pb1'];
																}
																sort($rs1); $bot_s1 = array_slice($rs1,0,1);
																arsort($rs1); $top_s1 = array_slice($rs1,0,1);
																sort($rt6); $bot_t6 = array_slice($rt6,0,1);
																arsort($rt6); $top_t6 = array_slice($rt6,0,1);
																sort($rpb1); $bot_pb1 = array_slice($rpb1,0,1);
																arsort($rpb1); $top_pb1 = array_slice($rpb1,0,1);
																arsort($rt7); $top_t7 = array_slice($rt7,0,1);
																$sqlb=mysqli_query($conn, "select * from t5 where id=".$bot_s1[0].""); $buser=mysqli_fetch_assoc($sqlb);
																$sqlt=mysqli_query($conn, "select * from t5 where id=".$top_s1[0].""); $tuser=mysqli_fetch_assoc($sqlt);
															?>
																<td><i class="fa fa-long-arrow-up v3-text-success" aria-hidden="true"></i> En Çok İşlem Yapan Kullanıcı</td>
																<td><?php if($top_s1[0]>0){echo $tuser["t1"];}else{echo "Üyeliksiz";}?></td>
															</tr>
															<tr>
																<td><i class="fa fa-long-arrow-down  v3-text-danger" aria-hidden="true"></i> En Az İşlem Yapan Kullanıcı</td>
																<td><?php if($bot_s1[0]<>0){echo $buser["t1"];}else{echo "Üyeliksiz";}?></td>
															</tr>
															<tr>
																<td><i class="fa fa-long-arrow-up v3-text-success" aria-hidden="true"></i> En Çok İşlem Yapan Pos</td>
																<td><?php echo $top_t6[0];?></td>
															</tr>
															<tr>
																<td><i class="fa fa-long-arrow-down v3-text-danger" aria-hidden="true"></i> En Az İşlem Yapan Pos</td>
																<td><?php echo $bot_t6[0];?></td>
															</tr>
															<tr>
																<td><i class="fa fa-long-arrow-up v3-text-success" aria-hidden="true"></i> En Yüksek İşlem</td>
																<td><?php echo wprice($top_pb1[0]);?></td>
															</tr>
															<tr>
																<td><i class="fa fa-long-arrow-down v3-text-danger" aria-hidden="true"></i> En Düşük İşlem</td>
																<td><?php echo wprice($bot_pb1[0]);?></td>
															</tr>
<!--
															<tr>
																<td><i class="fa fa-long-arrow-up v3-text-success" aria-hidden="true"></i> En Çok Tercih Edilen Taksit Sayısı</td>
																<td><?php echo $top_t7[0];?></td>
															</tr>
-->
														</table>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div id="tab1" class="v8-tabs-content mp10">
										<div class="v3-panel v3-panel-default" style="">
											<div class="v3-panel-heading" style="min-height: 40px;" onclick="toggle('#erapor');">
												<span class="mfs12">
													<?php if($_GET["ts1"]=="" and $_GET["ts2"]==""){echo "<b>".dtarih($ts->format('Y-m-d'),"gg ua yyyy")."</b> ile <b>".dtarih(date('Y-m-d'),"gg ua yyyy")."</b> Arası İşlemler";}else{echo $sdil["38"];}?> <i class="fas fa-angle-double-down fr ddn"></i>
												</span>
											</div>
											<div class="v3-panel-body" id="erapor" style="<?php if($mobile<>""){echo "display:none;";}?>">
												<?php if($_GET["durum"]==""){?>
													<div class="v3-col-md-6" style="padding:0px;">
														<script src="https://code.highcharts.com/highcharts.js"></script>
														<script src="https://code.highcharts.com/modules/exporting.js"></script>
														<script src="https://code.highcharts.com/modules/accessibility.js"></script>
														<figure class="highcharts-figure">
															<div id="container"></div>
														</figure>
														<script>
															Highcharts.chart('container', {
																chart: {
																	type: 'pie'
																},
																title: {
																	text: 'Banka bazında ödemeler'
																},
																tooltip: {
																	valueSuffix: '%'
																},
																subtitle: {
																	text: ''
																},
																plotOptions: {
																	series: {
																		allowPointSelect: true,
																		cursor: 'pointer',
																		dataLabels: [{
																			enabled: true,
																			distance: 20
																		}, {
																			enabled: true,
																			distance: -40,
																			format: '{point.percentage:.1f}%',
																			style: {
																				fontSize: '1.2em',
																				textOutline: 'none',
																				opacity: 0.7
																			},
																			filter: {
																				operator: '>',
																				property: 'percentage',
																				value: 10
																			}
																		}]
																	}
																},
																series: [
																{
																	name: 'Oran',
																	colorByPoint: true,
																	data: [
																		<?php
																		    $sqld=mysqli_query($conn, "select DISTINCT t6 from t1 where ne='dekont' order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
																			$d=0;$total2=0;$sqld2=mysqli_query($conn, "select * from t1 where ne='dekont' and t6='".$rsd["t6"]."' and s13=1"); while($rsd2=mysqli_fetch_assoc($sqld2)){
																				if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rsd2["t15"] <= date('Y-m-d') and $rsd2["t15"] >= $ts->format('Y-m-d'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsd2["t15"]>=$_GET["ts1"] and $rsd2["t15"]<=$_GET["ts2"])){
																					$d++; $total2=$total2+$rsd2["pb1"];
																				}
																			}
																		?>
																		{
																			name: '<?php echo $rsd["t6"]?><br><?php echo wprice($total2)." ".$kpb;?>',
																			y: <?php echo $d?>
																		},
																	<?php $total2=0;}?>
																	]
																}
																]
															});
														</script>
													</div>
													<div class="v3-col-md-6" style="padding:0px;padding-top: 60px;">
														<?php
														$pay_toplam=0; $pay_ay=0; $pay_gecenay=0; $pay_bugun=0; $pay_yil=0;
														$sqld=mysqli_query($conn, "select * from t1 where ne='dekont'  and s13=1 order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
															$ts1 = explode(' ',$rsd["t15"]); $tarih = explode('-',$ts1[0]);
															$pay_toplam=$pay_toplam+$rsd["pb1"];
															if($tarih[1]==date('m') and $tarih[0]==date('Y')){
																$pay_ay=$pay_ay+$rsd["pb1"];
															}
															if($tarih[1]==(date('n')-1) and $tarih[0]==date('Y')){
																$pay_gecenay=$pay_gecenay+$rsd["pb1"];
															}
															if($tarih[2]==date('d') and $tarih[1]==date('m') and $tarih[0]==date('Y')){
																$pay_bugun=$pay_bugun+$rsd["pb1"];
															}
															if($tarih[0]==date('Y')){
																$pay_yil=$pay_yil+$rsd["pb1"];
															}
														}
														?>
														<section class="card mb-4">
															<div class="bg-secondary cp" style="padding: 10px;" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=filtre&ts1=<?php echo date("Y-m-d")?>&ts2=<?php echo date("Y-m-d")?>'">
																<div class="widget-summary">
																	<div class="widget-summary-col widget-summary-col-icon" style="vertical-align: middle !important;">
																		<div class="summary-icon">
																			<i class="fa fa-try"></i>
																		</div>
																	</div>
																	<div class="widget-summary-col">
																		<div class="summary">
																			<h4 class="title"><?php echo $sdil["184"]?> <?php echo translate("Toplam")?></h4>
																			<div class="info">
																				<strong class="amount" style="font-size: 24px;"><?php echo wprice($pay_bugun)?></strong>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</section>
														<section class="card mb-4">
															<div class="row">
																<div class="col-md-6 fl">
																	<div class="bg-secondary cp" style="padding: 10px;" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=filtre&ts1=<?php echo $ts->format('Y-m-d')?>&ts2=<?php echo date("Y-m-d")?>'">
																		<div class="widget-summary">
																			<div class="widget-summary-col widget-summary-col-icon" style="vertical-align: middle !important;">
																				<div class="summary-icon">
																					<i class="fa fa-try"></i>
																				</div>
																			</div>
																			<div class="widget-summary-col">
																				<div class="summary">
																					<h4 class="title"><?php echo aylar(date('n'))?> <?php echo translate("ayı Toplam")?></h4>
																					<div class="info">
																						<strong class="amount" style="font-size: 24px;"><?php echo wprice($pay_ay)?></strong>
																						<p class="cw"><i class="fa fa-pie-chart" aria-hidden="true"></i> <?php echo wprice($pay_ay-$pay_gecenay);?></p>
																					</div>
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
																<div class="col-md-6 fl mmt25">
																	<div class="bg-secondary cp" style="padding: 10px;" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=filtre&ts1=<?php echo $ts->format('Y-m-d')?>&ts2=<?php echo date("Y-m-d")?>'">
																		<div class="widget-summary">
																			<div class="widget-summary-col widget-summary-col-icon" style="vertical-align: middle !important;">
																				<div class="summary-icon">
																					<i class="fa fa-try"></i>
																				</div>
																			</div>
																			<div class="widget-summary-col">
																				<div class="summary">
																					<h4 class="title"><?php echo aylar(date('n')-1)?> <?php echo translate("ayı Toplam")?></h4>
																					<div class="info">
																						<strong class="amount" style="font-size: 24px;"><?php echo wprice($pay_gecenay)?></strong>
																						<p class="cw">..</p>
																					</div>
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</section>
														<section class="card mb-4">
															<div class="bg-secondary cp" style="padding: 10px;" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=filtre&ts1=<?php echo date('Y-m-d', strtotime('first day of january this year'))?>&ts2=<?php echo date("Y-m-d")?>'">
																<div class="widget-summary">
																	<div class="widget-summary-col widget-summary-col-icon" style="vertical-align: middle !important;">
																		<div class="summary-icon">
																			<i class="fa fa-try"></i>
																		</div>
																	</div>
																	<div class="widget-summary-col">
																		<div class="summary">
																			<h4 class="title"><?php echo date("Y")?> <?php echo translate("Toplam")?></h4>
																			<div class="info">
																				<strong class="amount " style="font-size: 24px;"><?php echo wprice($pay_yil)?></strong>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</section>
														<section class="card mb-4">
															<div class="bg-primary" style="padding: 10px;">
																<div class="widget-summary">
																	<div class="widget-summary-col widget-summary-col-icon" style="vertical-align: middle !important;">
																		<div class="summary-icon">
																			<i class="fa fa-try"></i>
																		</div>
																	</div>
																	<div class="widget-summary-col">
																		<div class="summary">
																			<h4 class="title"><?php echo $sdil["176"]?></h4>
																			<div class="info">
																				<strong class="amount" style="font-size: 24px;"><?php echo wprice($pay_toplam)?></strong>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</section>
													</div>
												<?php }?>
												<div class="v3-row <?php if($_GET["durum"]==""){echo "clr";}?>">
													<?php
													$sqlbc=mysqli_query($conn, "select * from genel where ne='banka' and s2<>0"); $rsbc=mysqli_num_rows($rsbc);
													if($rsbc==1){$col="12"; }elseif($rsbc==2){ $col="6"; }elseif($rsbc==3){ $col="4"; }elseif($rsbc==4){ $col="3"; }elseif($rsbc>4){ $col="2"; }
													$sqlb=mysqli_query($conn, "select * from genel where ne='banka' and s2<>0 order by s10 asc limit 0,6"); while($banka=mysqli_fetch_assoc($sqlb)){
														$total=0;$sqld=mysqli_query($conn, "select * from t1 where ne='dekont' and t6='".$banka["t1"]."'  and s13=1 order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
															if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rsd["t15"] <= date('Y-m-d') and $rsd["t15"] >= $ts->format('Y-m-d'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsd["t15"]>=$_GET["ts1"] and $rsd["t15"]<=$_GET["ts2"])){
																$total=$total+$rsd["pb1"];
															}
														}
														?>
														<div class="v3-col-md-2 cp" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=filtre&key=<?php echo $banka["t1"]?>&ts1=<?php echo $ts->format('Y-m-d')?>&ts2=<?php echo date("Y-m-d")?>'" style="background-color:#<?php echo $banka["t3"]?>50; color:#000; padding: 15px 5px; font-size: 16px;"><img src="https://cdn.<?php echo $cdnurl?>/images/banks/ib<?php echo $banka["s1"]?>.png"> <?php echo $banka["t1"]?> <span class="v3-badge fr" style="margin-top:20px;"><?php echo wprice($total)?> <?php echo $ikpb?></span></div>
													<?php }?>
												</div>
											</div>
											<div class="" style="<?php if($mobile<>""){?>overflow:auto;<?php }?>">
												<table class="table table-bordered" style="">
													<thead>
														<tr class="mdn">
															<th class="w8" style="">İşlem No</th>
															<th class="" style=""><?php echo $sdil["40"]?></th>
															<th class="w25" style=""><?php echo $t25s[0]?></th>
															<th class="w10" style="text-align:right;"><?php echo $sdil["115"]?></th>
															<th class="w10" style="text-align:right;">Banka</th>
															<th class="w10" style="text-align:right;"><?php echo $sdil["144"]?></th>
															<th class="w10" style="text-align:right;"><?php echo $sdil["213"]?></th>
														</tr>
													</thead>
													<tbody>
														<?php
															$sqld=mysqli_query($conn, "select * from t1 where ne='dekont' and (n1 like '%".$_GET["key"]."%' or t3 like '%".$_GET["key"]."%' or t6 like '%".$_GET["key"]."%' or pb1 like '%".$_GET["key"]."%' or n11 like '%".$_GET["key"]."%') order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
															$sqlu2=mysqli_query($conn, "select * from t5 where id=".$rsd["s1"].""); $rsu2=mysqli_fetch_assoc($sqlu2);
															$sqlu19=mysqli_query($conn, "select * from t5 where (id=".$rsd["s19"]." or id=".$rsu2["s19"].")"); $rsu19=mysqli_fetch_assoc($sqlu19);
															if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rsd["t15"] <= date('Y-m-d') and $rsd["t15"] >= $ts->format('Y-m-d'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsd["t15"]>=$_GET["ts1"] and $rsd["t15"]<=$_GET["ts2"])){
																?>
																<tr class="<?php if($rsd["s13"]=="0"){echo "alert-warning";}elseif($rsd["s13"]=="2"){echo "alert-danger";}elseif($rsd["s13"]=="1"){echo "alert-success";}?>" data-id="<?php echo $rsd["id"];?>" style="height:25px;">
																	<td class="mdn mfrm cp" data-toggle="modal" data-target="#myModal" data-url="fonksiyon.php?islem=dekont&id=<?php echo $rsd["id"];?>"> <?php echo $rsd["t8"];?> </td>
																	<td class="mdn"> <?php echo $rsd["n1"];?>
																	<?php if($rsd["s13"]==0){?>
																	<br><span style="font-size:9px"><i class="far fa-clock"></i> Bankadan işlem sonucu bekleniyor...</span>
																	<?php }elseif($rsd["s13"]==1){?>
																	<br><span style="font-size:9px"><i class="fas fa-check"></i> İşlem Başarılı</span>
																	<?php }elseif($rsd["s13"]==2){?>
																	<br><span style="font-size:9px"><i class="fas fa-exclamation-circle"></i> Hata : <?php echo v3d($rsd["n2"])?></span>
																	<?php }?>
																	</td>
																	<td> <?php if(mysqli_num_rows($sqlu2)==0 and mysqli_num_rows($sqlu19)==0){echo "".$rsd["t3"]." {".translate("Üyeliksiz")."}";}elseif(mysqli_num_rows($sqlu2)==0 and mysqli_num_rows($sqlu19)<>0){echo "".$rsu19["t1"]." {".$rsd["t3"]."}";}elseif(mysqli_num_rows($sqlu2)<>0 and mysqli_num_rows($sqlu19)<>0){echo "".$rsu2["t1"]." {".$rsu19["t1"]."}";}else{echo $rsu2["t1"];}?> </td>
																	<td class="tar mdn"> <?php echo dtarih($rsd["ts1"],"gg ka yy time"," ")?></td>
																	<td class="tar mdn"> <?php echo $rsd["t6"]?></td>
																	<td class="tar"> <?php echo wprice($rsd["pb1"]);?> <i class="fa fa-<?php echo strtolower($rsd["t9"]);?>"></i><span class="mdn fs11"><br><?php echo $rsd["t7"]?>x<?php echo wprice($rsd["pb1"]/$rsd["t7"]);?></span></td>
																	<td class="tar">
																		<a class="v3-btn v3-btn-info v3-btn-xs mfrm dn" href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=fatura&id=<?php echo $rsd["id"];?>"><i class="fa fa-file-text-o"></i></a>
																		<a class="v3-btn v3-btn-warning v3-btn-xs mfrm " data-toggle="modal" data-target="#myModal" data-url="fonksiyon.php?islem=dekont&id=<?php echo $rsd["id"];?>"><i class="fa fa-search"></i><span class="mdn"> <?php echo $sdil["207"]?></span></a>
																		<?php if ($yetki==1){?>
																			<a class="v3-btn v3-btn-danger v3-btn-xs  btn-delete-row" style="padding:unset;" data-href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=sil&id=<?php echo $rsd["id"];?>"><i class="fa fa-times"></i></a></td>
																		<?php }else{?>
																			<a class="v3-btn v3-btn-danger v3-btn-xs" href="#"><i class="fa fa-lock"></i></a>
																		<?php }?>
																	</td>
																</tr>
															<?php }}?>
														</tbody>	
													</table>
												</div>
											</div>
										</div>
												
										<ul class="alert alert-info">
											<li>...</li>
										</ul>
									</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>
		<script type="text/javascript">
			jQuery(function(){
				jQuery("#tad").on('change',function(){
					var val=jQuery('#tad').val();
					var ad= jQuery('#tselect').find('option[value="'+val+'"]').attr('data-ad');
					var soyad= jQuery('#tselect').find('option[value="'+val+'"]').attr('data-soyad');
					var gsm= jQuery('#tselect').find('option[value="'+val+'"]').attr('data-gsm');
					var mail= jQuery('#tselect').find('option[value="'+val+'"]').attr('data-mail');
					var id= jQuery('#tselect').find('option[value="'+val+'"]').attr('data-id');
				if (typeof id !== "undefined") {
					jQuery('#tad').val(ad);
					jQuery('#tsoyad').val(soyad);
					jQuery('#tmail').val(mail);
					jQuery('#gsm').val(gsm);
					jQuery('#s1').val(id);
				}
				});
			});
			var $u = jQuery.noConflict();
			jQuery( document ).ready(function() {
				jQuery( ".radios" ).change(function() {
					if(jQuery("#mail").is(":checked")){
						jQuery("#labelmail").css("color","#ea4335");
						jQuery("#labelsms").css("color","#808080");
						jQuery("#labelwhatsapp").css("color","#808080");
						jQuery("#labelkaydet").css("color","#808080");
						jQuery("#labelmanuel").css("color","#808080");
					}else if (jQuery("#sms").is(":checked")){
						jQuery("#labelsms").css("color","#020a6c");
						jQuery("#labelmail").css("color","#808080");
						jQuery("#labelwhatsapp").css("color","#808080");
						jQuery("#labelkaydet").css("color","#808080");
						jQuery("#labelmanuel").css("color","#808080");
					}else if (jQuery("#whatsapp").is(":checked")){
						jQuery("#labelwhatsapp").css("color","#25D366");
						jQuery("#labelmail").css("color","#808080");
						jQuery("#labelsms").css("color","#808080");
						jQuery("#labelkaydet").css("color","#808080");
						jQuery("#labelmanuel").css("color","#808080");
					}else if (jQuery("#manuel").is(":checked")){
						jQuery("#labelmanuel").css("color","#32363b");
						jQuery("#labelwhatsapp").css("color","#808080");
						jQuery("#labelsms").css("color","#808080");
						jQuery("#labelmail").css("color","#808080");
						jQuery("#labelkaydet").css("color","#808080");
					}else if (jQuery("#kaydet").is(":checked")){
						jQuery("#labelkaydet").css("color","#d3eedf");
						jQuery("#labelmail").css("color","#808080");
						jQuery("#labelsms").css("color","#808080");
						jQuery("#labelwhatsapp").css("color","#808080");
						jQuery("#labelmanuel").css("color","#808080");
					}
				});
			});
		</script>
		<?php
		if($_GET["durum"]=="kaydet"){
			if($_POST["s1"]==""){$s1=0;}else{$s1=$_POST["s1"];}
			if($_POST["s2"]==""){$s2=0;}else{$s2=$_POST["s2"];}
			if($_POST["s3"]==""){$s3=0;}else{$s3=$_POST["s3"];}
			if($_POST["s4"]==""){$s4=0;}else{$s4=$_POST["s4"];}
			if($_POST["s5"]==""){$s5=0;}else{$s5=$_POST["s5"];}
			if($_POST["s6"]==""){$s6=0;}else{$s6=$_POST["s6"];}
			$Rs = mysqli_query($conn, "update genel set s1='".$s1."', s2='".$s2."', s3='".$s3."', s4='".$s4."', s5='".$s5."', s6='".$s6."', n1='".$_POST["n1"]."', n2='".$_POST["n2"]."', n3='".$_POST["n3"]."' where ne='tahsilat'");
			echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok#&tab3",self,500,1);
		}elseif($_GET["durum"]=="fatura"){
			$sqld=mysqli_query($conn, "select * from t1 where id=".$_GET["id"]." order by id desc"); $rsd=mysqli_fetch_assoc($sqld);
			$sqli = $conn->query("insert into t4(t1,t9,n2,ne,ts1,s1,s2,s17,pb1,pb2,pb3,pb4) values ('".$rsd["t8"]."', '".date("Y-m-d")."', '".$rsd["t8"]." Tahsilat', 'sfatura', now(), '".$rsd["s1"]."', '".$rsd["id"]."', '".$_SESSION["user_id"]."', '0', '".$rsd["pb1"]."', '0', '0')");
			$sqlf = mysqli_query($conn, "select * from t4 where id='".mysqli_insert_id()."'"); $rsf=mysqli_fetch_assoc($sqlf);
			$sqlip = $conn->query("insert into t4(t1,ne,ts1,s1,s2,s3,s4,s5,pb1) values ('sfatura', 'furun', now(), '".$rsf["id"]."', '0', '0', '0', '1', '".$rsd["pb1"]."')");
		}elseif($_GET["durum"]=="sil"){
			$sql = mysqli_query($conn, "delete from t1 where id=".$_GET["id"]."");
			echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok#none",self,500,1);
		}elseif($_GET["durum"]=="temizle"){
			$sql = mysqli_query($conn, "delete from t1 where ne='dekont'");
			echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok#none",self,500,1);
		}elseif($_GET["durum"]=="nsil"){
			$sql = mysqli_query($conn, "delete from genel where id=".$_GET["id"]."");
			echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok#none",self,500,1);
		}
		?>