	<?php
	$sql=mysqli_query($conn, "select * from genel where ne='extre'"); $rs=mysqli_fetch_assoc($sql);
	if(mysqli_num_rows($sql)==0){
		$sql = $conn->query("insert into genel (ne) values ('extre')");
	}
	?>
	<div class="inner-wrapper">
		<!-- start: sidebar -->
		<aside id="sidebar-left" class="sidebar-left">
			<div class="sidebar-header">
				<div class="sidebar-title">
					Menu
				</div>
				<div class="sidebar-toggle hidden-xs" data-toggle-class="sidebar-left-collapsed" data-target="html" data-fire-event="sidebar-left-toggle">
					<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
				</div>
			</div>
			<?php include('menu.php');?>
		</aside>
		<!-- end: sidebar -->
		<section role="main" class="content-body card-margin">
			<header class="page-header">
				<h2><?php echo translate("E-Ekstre")?></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><?php echo translate("E-Ekstre")?></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">
						<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");?>
							<!--
								<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"><span style="text-transform:capitalize;"> <?php echo translate("E-Ekstre")?> </span></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-file-text-o"></i><span> Banka Hareketleri</span></a></li>
								<li class=""><a href="#tab2" title=""><i class="fa fa-file-text-o"></i><span> Pos Hareketleri</span></a></li>
								<li class=""><a href="#tab3" title=""><i class="fa fa-wrench"></i><span> <?php echo $sdil["30"]?></span></a></li>
								<li class=""><a href="?ne=eticaret&islem=odeme" title=""><i class="fa fa-university"></i><span> <?php echo translate("Bankalar")?></span></a></li>
							</ul>
						</ul>
					</div>
					<div class="v8-col200pxL-right">
						<div id="tab1" 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;">
										<?php if($_GET["ts1"]=="" and $_GET["ts2"]==""){echo "#".translate("Son 30 Gün Listeniyor.");}else{echo $sdil["38"];}?>
									</span>
								</div>
								<div class="v3-panel-body" style="">
<?php if($_GET["ts1"]=="" and $_GET["ts2"]==""){?>
									<div class="v3-col-md-6" style="padding:0px;">
										<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
										<script type="text/javascript">
											google.charts.load('current', {'packages':['corechart']});
											google.charts.setOnLoadCallback(drawChart);
											function drawChart() {
												var data = google.visualization.arrayToDataTable([
													['Task', 'Hours per Day'],
													<?php $sqld=mysqli_query($conn, "select DISTINCT t6 from genel where ne='dekont' and t6<>'' order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){ ?>
														<?php $rsd0 = mysqli_query($conn, "select count(DISTINCT t6) from genel where ne='dekont' and t6='".$rsd["t6"]."' order by id desc"); $rssd0=mysqli_fetch_assoc($rsd0);?>
														['<?php echo $rsd["t6"]?>',     <?php echo $rssd0[0]?>],
													<?php }?>
													]);
												var options = {
													title: 'Banka Tercihleri'
												};
												var chart = new google.visualization.PieChart(document.getElementById('piechart'));
												chart.draw(data, options);
											}
										</script>
										<div id="piechart" style="width: 100%; <?php if($mobile==""){?>height: 500px;<?php }?>"></div>
									</div>
									<div class="v3-col-md-6" style="padding:0px;padding-top: 60px;">
										<?php
										$sqld=mysqli_query($conn, "select * from t1 where ne='dekont' order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
											$ts1 = explode(' ',$rsd["ts1"]); $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[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="card-body 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-try"></i>
														</div>
													</div>
													<div class="widget-summary-col">
														<div class="summary">
															<h4 class="title"><?php echo $sdil["184"]?></h4>
															<div class="info">
																<strong class="amount count"><?php echo $pay_bugun?></strong>
															</div>
														</div>
													</div>
												</div>
											</div>
										</section>
										<section class="card mb-4">
											<div class="card-body 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-try"></i>
														</div>
													</div>
													<div class="widget-summary-col">
														<div class="summary">
															<h4 class="title"><?php echo $sdil["187"]?></h4>
															<div class="info">
																<strong class="amount count"><?php echo $pay_ay?></strong>
															</div>
														</div>
													</div>
												</div>
											</div>
										</section>
									    <section class="card mb-4">
											<div class="card-body 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-try"></i>
														</div>
													</div>
													<div class="widget-summary-col">
														<div class="summary">
															<h4 class="title"><?php echo $sdil["71"]?></h4>
															<div class="info">
																<strong class="amount count"><?php echo $pay_yil?></strong>
															</div>
														</div>
													</div>
												</div>
											</div>
										</section>
										<section class="card mb-4">
											<div class="card-body bg-primary" style="padding: 10px;">
												<div class="widget-summary">
													<div class="widget-summary-col widget-summary-col-icon">
														<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 count"><?php echo $pay_toplam?></strong>
															</div>
														</div>
													</div>
												</div>
											</div>
										</section>
									</div>
<?php }?>
									<div class="v3-row" style="<?php if($mobile<>""){?>overflow:auto;<?php }?>">
<?php if($mobile==""){?>
										<table class="table table-no-more table-bordered table-striped mb-0">
<?php }else{?>
										<table class="table table-bordered" style="width:650px">
<?php }?>
											<thead>
												<tr>
													<th class="" style=""><?php echo $sdil["40"]?></th>
													<th class="" style="text-align:right;"><?php echo $sdil["115"]?></th>
													<th class="" style="text-align:right;">Banka</th>
													<th class="" style="text-align:right;"><?php echo $sdil["144"]?></th>
													<th class="" 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["q"]."%' order by id desc"); while($rsd=mysqli_fetch_assoc($sqld)){
													if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and $rsd["t15"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rsd["t15"]>=$_GET["ts1"] and $rsd["t15"]<=$_GET["ts2"])){
													if(($_SESSION["kim"]=="Admin") or ($_SESSION["kim"]=="yonetici" and $_SESSION["y12"]==3)){
														if ($authority==0){
															$yetki=0;
														}else{
															$yetki=1;
														}
													}else{
														$yetki=0;
													}
													?>
														<tr data-id="<?php echo $rsd["id"];?>" style="height:25px;">
															<td> <?php echo $rsd["n1"];?> </td>
															<td  style="text-align:right;"> <?php echo dtarih($rsd["ts1"],"gg.ka.yy+time"," ")?></td>
															<td  style="text-align:right;"> <?php echo $rsd["t6"];?> </td>
															<td  style="text-align:right;"><?php echo $rsd["pb1"];?> <i class="fa fa-<?php echo strtolower($rsd["t9"]);?>"></i></td>
															<td  style="text-align:right;">
																<a class="v3-btn v3-btn-warning v3-btn-xs mfrm cw" data-toggle="modal" data-target="#myModal" data-url="fonksiyon.php?islem=dekont&id=<?php echo $rsd["id"];?>"><i class="fa fa-eye"></i> <?php echo $sdil["207"]?></a>
															<?php if ($yetki==1){?>
																<a class="v3-btn v3-btn-danger v3-btn-xs cw 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 cw" href="#"><i class="fa fa-ban"></i></a>
															<?php }?>
															</td>
														</tr>
													<?php }}?>
												</tbody>	
											</table>
										</div>
									</div>
								</div>
							</div>
							<div id="tab3" class="v8-tabs-content" style="min-height: 450px;">
								<form class="form" method="post" action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=kaydet">
									<div class="v3-row">
										<fieldset class="side-by-side v3-col-md-12">
											<legend>URL</legend>
											<input type="text" name="n1" class="form-control" placeholder="Url" value="<?php echo $rs["n1"];?>">
										</fieldset>
										<fieldset class="side-by-side v3-col-md-12">
											<legend>Text <?php if($rs["n2"]<>""){echo "+";}?></legend>
											<textarea name="n2" class="form-control"><?php if($rs["n2"]<>""){echo $rs["n2"];}else{echo "Sayın; {ad} {soyad} {firma} dan almış olduğunuz hizmetle ilgili {tutar} {pb} tutarındaki ödemeyi yapmak icin lütfen aşağıdaki linke tıklayınız.";}?></textarea>
										</fieldset>
										<fieldset class="grey-bg v3-col-md-4">
											<legend>Üyeliksiz <span style="font-size:8px; color:#ccc;">(s1)</span></legend>
											<div class="switch switch-sm switch-success">
												<input type="checkbox" name="s1" id="s1" value="1" data-plugin-ios-switch="" <?php if($rs["s1"]=="1") {?>checked<?php }?>>
											</div>
										</fieldset>
										<fieldset class="grey-bg v3-col-md-4">
											<legend>Yeni Üye <span style="font-size:8px; color:#ccc;">(s2)</span></legend>
											<div class="switch switch-sm switch-success">
												<input type="checkbox" name="s2" id="s2" value="1" data-plugin-ios-switch="" <?php if($rs["s2"]=="1") {?>checked<?php }?>>
											</div>
										</fieldset>
										<fieldset class="grey-bg v3-col-md-4">
											<legend>3D Güvenlik <span style="font-size:8px; color:#ccc;">(s3)</span></legend>
											<div class="switch switch-sm switch-success">
												<input type="checkbox" name="s3" id="s3" value="1" data-plugin-ios-switch="" <?php if($rs["s3"]=="1") {?>checked<?php }?>>
											</div>
										</fieldset>
									</div>
									<button class="button" type="submit" style="float: right; margin-top:20px;" <?php if($e10==1 and $_SESSION["user"]<>V3d('TWFzdGVy')){?>disabled<?php }?>><i class="fa fa-paper-plane-o" aria-hidden="true"></i> Gönder</button>
								</form>
							</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">
	var $u = jQuery.noConflict();
	$u(document).ready(function (){
		$u("#tgsm").mask("(999) 999-9999");
	});
</script>
<?php
if($_GET["durum"]=="kaydet"){
	$Rs = mysqli_query($conn, "update genel set s1='".$_POST["s1"]."', s2='".$_POST["s2"]."', s3='".$_POST["s3"]."', n1='".$_POST["n1"]."', n2='".$_POST["n2"]."' where ne='tahsilat'");
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok#&tab3",self,500,1);
}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);
}
?>