<div class="inner-wrapper">
	<?php
		$sqls = mysqli_query($conn, "select id FROM eticaret where ne='adisyon' ".$sorgu." ".$order.""); $rsay=mysqli_num_rows($sqls);
		$sql0 = mysqli_query($conn, "select id FROM eticaret where ne='adisyon' and s4=0"); $rs0=mysqli_num_rows($sql0);
		$sql1 = mysqli_query($conn, "select id FROM eticaret where ne='adisyon' and s4=1"); $rs1=mysqli_num_rows($sql1);
	?>
	<section role="main" class="content-body">
		<header class="page-header">
			<h2><?php echo translate("Adisyonlar")?></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 translate("Eticaret")?></span></li>
					<li><span><?php echo translate("Adisyonlar")?></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]; //İşlem Başarıyla Gerçekleştirilmiştir !?>
			</div>
		<?php }elseif($_GET["durum"]=="hata"){?>
			<div class="alert alert-warning">
				Siparişteki Ürün(ler) Stokta Yok !
			</div>
		<?php }?>
		<div class="alert alert-warning" id="err" style="display:none;"></div>
		<div class="row">
			<div class="col p0">
				<section class="card">
					<header class="card-header">
						<div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
							<a class="mb-1 mt-1 mr-1 btn btn-default" href="<?php if($_GET["sayfa"]=="" or $_GET["sayfa"]==1){?>#<?php }else{?>?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&s4=<?php echo $_GET["s4"];?>&key=<?php echo $_GET["key"];?>&order=<?php echo $_GET["order"];?>&sayfa=<?php echo $ss-1;?><?php }?>" title="<?php echo $sdil[146]; //Önceki?>"><i class="fa fa-chevron-circle-left" aria-hidden="true"></i></a>
							<div class="mb-1 mt-1 mr-1 btn btn-default">
								<select onChange="self.location.href=this.options[this.selectedIndex].value;" class="form-control v3-input-xs" style="padding:0px; height: 21px;">
									<?php
									$rsay=$rsay/20;
									for ($i = 0; $i <= $rsay; $i++) {
										$x=$i+1;
										?>
										<option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&order=<?php echo $_GET["order"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $x;?>" <?php if(($_GET["sayfa"]=="" and $x==1) or $_GET["sayfa"]==$x){?>selected<?php }?>><?php echo $x;?></option>
									<?php }?>
								</select>
							</div>
							<a class="mb-1 mt-1 mr-1 btn btn-default" href="<?php if($x >= $ss+1){?>?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&order=<?php echo $_GET["order"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $ss+1;?><?php }else{?>#<?php }?>"  title="<?php echo $sdil[147]; //Sonraki?>"><i class="fa fa-chevron-circle-right" aria-hidden="true"></i></a>
							<a class="mb-1 mt-1 mr-1 btn btn-warning" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=0" title=""><i class="fa fa-pause" aria-hidden="true"></i> <strong><?php echo $rs0[0];?></strong><span class="mdn"> <?php echo translate("Adisyon"); //Adisyon?></span></a>
							<a class="mb-1 mt-1 mr-1 btn btn-success" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=1" title=""><i class="fa fa-check" aria-hidden="true"></i> <strong><?php echo $rs1[0];?></strong><span class="mdn"> <?php echo translate("Hazırlanıyor"); //Hazırlanıyor?></span></a>
							<a class="mb-1 mt-1 mr-1 btn btn-default" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=4" title=""><i class="fa fa-thumbs-o-up" aria-hidden="true"></i> <strong><?php echo $rs4[0];?></strong><span class="mdn"> <?php echo translate("Tamamlandı"); //Tamamlandı?></span></a>
							<a class="mb-1 mt-1 mr-1 btn btn-danger" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=2" title=""><i class="fa fa-thumbs-o-down" aria-hidden="true"></i> <strong><?php echo $rs2[0];?></strong><span class="mdn"> <?php echo $sdil[139]; //İptal Edilen?></span></a>
<!--
								<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"><?php echo $sdil[5]; //Siparişler?></h2>
					</header>
					<div class="card-body">
						<table class="table table-no-more table-bordered table-striped mb-0">
							<thead>
								<tr>
									<th class="w6" style="text-align:center;">ID
										<div class="order">
											<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=pb1+asc" class="fa fa-sort-asc"></a>
											<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=pb1+desc" class="fa fa-sort-desc"></a>
										</div>
									</th>
									<th> <span class="column-sort"> <a href="#" title="Sort up" class="sort-up"></a> <a href="#" title="Sort down" class="sort-down"></a> </span> <?php echo $sdil[143]; //Sipariş No?> </th>
									<th class="w15"><?php echo $t25s[0]; //Müşteri?></th>
									<th class="w10"><?php echo $sdil[144]; //Tutar?></th>
									<th class="w15"scope="col"><?php echo $sdil[115]; //Tarih/Saat?></th>
									<th class="w10"><?php echo $sdil[222]; //Ödeme Şekli?></th>
									<th class="w5">Print</th>
									<th class="w5"><?php echo $sdil[213]; //İşlemler?></th>
								</tr>
							</thead>
							<tbody>
								<?php
								if(!empty($_POST["s5"])){$s5=$_POST["s5"];}else{$s5="";}
								$slmt=25;
								$sayfa = $_GET['sayfa'];
								if($_GET['sayfa'] == "") {$sayfa = 0; $ss = 1;}else{$sayfa = ($sayfa-1) * $slmt; $ss = $_GET['sayfa'];}
								if($_GET["s4"]==""){
									$order="order by id desc";
								}elseif($_POST["key"]<>""){
									$order="order by id desc";
									$sorgu=" and t4='".$_POST["key"]."'";
								}elseif($_GET["order"]<>""){
									$order="order by ".qa($_GET["order"])."";
									$sorgu=" and s4='".$_GET["s4"]."'";
								}else{
									$order="order by id desc";
									$sorgu=" and s4='".$_GET["s4"]."'";
								}
								$sql = mysqli_query($conn, "select * from eticaret where ne='adisyon' ".$sorgu." ".$order."  limit $sayfa,$slmt"); while($siparis=mysqli_fetch_assoc($sql)){
									$sqls = mysqli_query($conn, "select count(*) FROM eticaret where ne='adisyon' ".$sorgu." ".$order."  limit $sayfa,$slmt"); $rsay=mysqli_fetch_assoc($sqls);
									$sqlm = mysqli_query($conn, "select * from t5 where id=".$siparis["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm);
									$sqlu = mysqli_query($conn, "select * from t5 where id=".$siparis["s19"]." order by id desc"); $puser=mysqli_fetch_assoc($sqlu);
									$sqlt = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where id=".$siparis["t3"]." order by id desc"); $table=mysqli_fetch_assoc($sqlt);
									include("posnet_calc.php");
									$jsoi = json_decode($siparis["n12"], true);
									?>
									<tr class="alert alert-<?php if($siparis["s4"]=="0"){echo "warning";}elseif($siparis["s4"]=="1"){echo "success";}elseif($siparis["s4"]=="2"){echo "danger";}elseif($siparis["s4"]=="3"){echo "info";}elseif($siparis["s4"]=="4"){echo "default";}?>">
										<td class="th table-check-cell mfrm" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_addition.php?id=<?php echo $siparis["id"];?>&ne=adisyon" style="cursor:pointer;"><?php echo i2a($siparis["id"],7)?>
									</td>
									<td><a class="with-tip" title="Sipariş Detay">
										<div class="keywords">
											<span class="badge badge-success"><?php echo $siparis["t4"];?></span>
										</div>
									</a>
								</td>
								<td>
									<?php echo $puser["t1"];?> {#<?php echo $siparis["s2"];?> <?php echo kategori($siparis["s2"]);?>}
									<br /><?php echo $table["t1"];?>
								</td>
								<td>
									<input type="text" name="t2" value="<?php echo number_format(($total),2)?>" style="width:70px; border:0px;"> <?php echo $kpb;?>
								</td>
								<td><?php echo dtarih($siparis["ts1"],"gg.aa.yyyy+time",".");?><br /><?php echo dtarih($siparis["ts2"],"gg.aa.yyyy+time",".");?></td>
								<td>
								<?php if($jsoi["Cash"]<>""){ echo "<button class=\"bg-success\" title=\"".ctranslate("Nakit")."\"><i class=\"fas fa-wallet\"></i> ".$jsoi["Cash"]." ".$ikpb."</button>"; } if($jsoi["CreditCard"]<>""){ echo "<button class=\"bg-warning\" title=\"".ctranslate("Kredi Kartı")."\"><i class=\"far fa-credit-card\"></i> ".$jsoi["CreditCard"]." ".$ikpb."</button>"; } if($jsoi["Ticket"]<>""){ echo "<button class=\"bg-info\" title=\"".ctranslate("Ticket")."\"><i class=\"fas fa-ticket-alt\"></i> ".$jsoi["Ticket"]." ".$ikpb."</button>"; } if($jsoi["Account"]<>""){ echo "<button class=\"bg-danger\"  title=\"".ctranslate("Cari")."\"><i class=\"fas fa-cash-register\"></i> ".$jsoi["Account"]." ".$ikpb."</button>"; }?>
								</td>
								<td>
									<a  class="btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_addition.php?id=<?php echo $siparis["id"];?>&ne=adisyon"  title="Ticket"><i class="fa fa-ticket"></i></a>
								</td>
								<td class="table-actions" style="display: flow-root;">
									<a onclick="AjaxGResult('modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&s1=<?php echo $siparis["s1"];?>&sno=<?php echo $siparis["t4"];?>&durum=sil&s4=<?php echo $siparis["s4"];?>','','');" class="btn btn-danger" title="Kaldır" style="cursor:pointer;"><i class="fa fa-times"></i><span class="ddn"><?php echo $sdil[204]; //kaldır?> </span></a>
								</td>
							</tr>
							<?php $total=0;$stutar="";}?>
						</tbody>
					</table>
				</form>
			</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>