<style>
.names{float:left;margin-right:10px; width: 40px;}
.image-container { position: relative; display: flex; flex-direction: row-reverse; }
.image-container img { height: 45px; width: 45px; border-radius: 50%; float: right; margin-left: -28px; border: 1px solid; transition: transform 0.3s ease, z-index 0.3s ease; position: relative; z-index: 1; }
.image-container img:hover { transform: scale(1.5); z-index: 10; }
</style>
<meta http-equiv="refresh" content="180">
<div class="inner-wrapper">
    <?php
    if(!empty($_POST["s5"])){$s5=$_POST["s5"];}else{$s5="";}
    if(!empty($_GET["show"])){$slmt=$_GET["show"];}else{$slmt=$module["slmt"];}
    $sayfa = $_GET['sayfa'];
    if($_GET['sayfa'] == "") {$sayfa = 0; $ss = 1;}else{$sayfa = ($sayfa-1) * $slmt; $ss = $_GET['sayfa'];}
    $order = "order by id desc";
	$sorgu = "";
    if ($_GET["islem"] == "siparisler") {
		$sorgu = "(ne='siparis' OR ne='storesales' OR ne='mobilesales')";
    } elseif ($_GET["islem"] == "storesales") {
		$sorgu = "(ne='storesales')";
    } elseif ($_GET["islem"] == "mobilesales") {
		$sorgu = "(ne='mobilesales')";
	}
	if (!empty($_GET["key"])) {
		$sorgu .= " and t4='" . $_GET["key"] . "'";
	} elseif (!empty($_GET["order"])) {
		$order .= "order by " . qa($_GET["order"]);
	} elseif ($_GET["s4"] <> "") {
		$sorgu .= " and s4='" . $_GET["s4"] . "'";
	}
    if(!empty($_GET["key"])){
        $sorgu .= "and (id LIKE '%".$_GET["key"]."%' or t4 LIKE '%".$_GET["key"]."%' or t5 LIKE '%".$_GET["key"]."%')"; 
    }
    if(!empty($_GET["t5"])){
        $sorgu .= "and (t5 LIKE '%".$_GET["t5"]."%')"; 
    }
    //echo "eticaret where ".$sorgu." ".$lorders." ".$order." limit ".$sayfa.",".$slmt."";
    $sql = mysqli_query($conn, "select * from eticaret where $sorgu $lorders $order limit $sayfa,$slmt");
    $sqls = mysqli_query($conn, "select id from eticaret where $sorgu $order"); $rcount=mysqli_num_rows($sqls);
    ?>
    <section role="main" class="content-body">
        <header class="page-header">
            <h2><?php echo ctranslate("Siparişler")?></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("E-Ticaret");?></span></li>
                    <li><span><?php echo ctranslate("Siparişler");?></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">
                <?php echo ctranslate("Siparişteki Ürün(ler) Stokta Yok");?>
            </div>
        <?php }?>
        <div class="alert alert-warning" id="err" style="display:none;"></div>
        <div class="v3-row" id="process"></div>
        <div class="row">
            <div class="col">
                <section class="card">
                    <header class="card-header v3-bg-info">
                        <div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
                            <button tabindex="-1" class="btn btn-success" id="order_total" style="margin-right: 5px;<?php if((mysqli_num_rows($sqlx)>0 and $_SESSION["ProjeID"]=="" and $_SESSION["kim"]=="yonetici") or (mysqli_num_rows($sqlx)>0 and $_SESSION["ProjeID"]<>$jsi["ProjectID"])){echo "display:none"; }?>" type="button">0.00 <?php echo $ikpb?></button>
                            <?php include("modules/public/filter.php");?>
                            <a tabindex="-1" class="mb-1 mt-1 mr-1 btn btn-warning mfrm <?php if($f3<>1){echo "dn";}?>" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_ship.php?mode=modal&ship=all" data-title="<?php echo translate("+#Kargo Fişi Yazdır")?>" title="<?php echo translate("+#Kargo Fişi Yazdır")?>"><i class="fa fa-truck" aria-hidden="true"></i></a>
                            <a tabindex="-1" class="mb-1 mt-1 mr-1 btn btn-warning mfrm" data-toggle="modal" data-title="<?php echo ctranslate("Eticaret Rapor");?>" data-target="#myModal" data-url="modules/xls/exporter.php?ne=report_ecommerces&path=reports/" title="<?php echo ctranslate("Eticaret Rapor");?>"><i class="fas fa-chart-pie" aria-hidden="true"></i></a>
                            <div class="btn-group flex-wrap">
                                <button tabindex="-1" data-toggle="dropdown" class="mb-1 mt-1 mr-1 btn btn-warning" style="margin-left: 2px;" type="button" aria-expanded="false">
                                    <span class="mdn"><?php echo $sdil[5]; //Siparişler?></span> <i class="fa fa-ellipsis-v"></i>
                                </button>
                                <div class="dropdown-menu dropdown-menu-right" x-placement="top-end" style="position: absolute; transform: translate3d(105px, -2px, 0px); top: 0px; left: 0px; will-change: transform;">
                                    <a class="dropdown-item 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;?></strong><span class=""> <?php echo translate("+#Onay Bekliyor")?></span></a>
                                    <a class="dropdown-item btn btn-success mt5 mmt5" 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;?></strong><span class=""> <?php echo translate("+#Onaylandı")?></span></a>
                                    <a class="dropdown-item btn btn-info mt5 mmt5 <?php if($f3<>1){echo "dn";}?>" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=3" title=""><i class="fa fa-truck" aria-hidden="true"></i> <strong><?php echo $rs3;?></strong><span class=""> <?php echo translate("+#Sevkiyatta")?></span></a>
                                    <a class="dropdown-item btn btn-default mt5 mmt5" 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;?></strong><span class=""> <?php echo translate("+#Teslim Edildi")?></span></a>
                                    <a class="dropdown-item btn btn-danger mt5 mmt5" 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;?></strong><span class=""> <?php echo translate("+#İptal")?></span></a>
                                    <a class="dropdown-item btn btn-danger mt5 mmt5 <?php if($module["order_return"]<>1){echo "dn";}?>" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=5" title=""><i class="fa fa-arrow-down" aria-hidden="true"></i> <strong><?php echo $rs5;?></strong><span class=""> <?php echo translate("+#İade")?></span></a>
                                    <?php if(translate("+#order_extra")<>""){?><a class="dropdown-item btn btn-default mt5 mmt5" href="?islem=<?php echo $_GET["islem"];?>&ne=<?php echo $_GET["ne"];?>&s4=6" title=""><i class="fa fa-life-ring" aria-hidden="true"></i> <strong><?php echo $rs6;?></strong><span class=""> <?php echo translate("+#order_extra")?></span></a><?php }?>
                                    <a class="dropdown-item btn btn-default mt5 mmt5" href="?islem=storesales&ne=<?php echo $_GET["ne"];?>" title=""><i class="fa fa-shop" aria-hidden="true"></i> <span class=""> <?php echo ctranslate("Mağaza Satışları")?></span></a>
                                    <a class="dropdown-item btn btn-default mt5 mmt5" href="?islem=mobilesales&ne=<?php echo $_GET["ne"];?>" title=""><i class="fas fa-mobile-alt" aria-hidden="true"></i> <span class=""> <?php echo ctranslate("Uygulama Satışları")?></span></a>
                                </div>
                            </div>
                            <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"];?>&t5=<?php echo $_GET["t5"];?>&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 mdn">
                                <select onChange="self.location.href=this.options[this.selectedIndex].value;" class="form-control v3-input-xs sna" style="padding:0px; height: 21px;">
                                    <?php
                                    $rsay=$rcount/$slmt;
                                    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"];?>&t5=<?php echo $_GET["t5"];?>&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"];?>&t5=<?php echo $_GET["t5"];?>&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 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?> <span class="text-danger fs14"><?php if($_GET["ts1"] == "" && $_GET["ts2"] == ""){echo "Son 7 Gün";}else{echo "".dtarih($_GET["ts1"],"gg ka yy")." > ".dtarih($_GET["ts2"],"gg ka yy")."";}?></span></h2>
                    </header>
                    <div class="card-body w1600" style="">
                        <table class="v3-table" style="font-size:14px;">
                            <thead>
                                <tr class="mdn <?php if($_SESSION["kim"]=="Admin" or ($_SESSION["kim"]=="yonetici" and $_SESSION["y15"]<>0)){echo "cols";}?>" data-ne="<?php echo $_GET["ne"]?>">
                                    <th class="w6 mw6" 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 class=""> <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="w12 mw12 tar <?php if($cols["c_eticaret_client"]==""){echo "dn";}?>"><?php echo $t25s[0]; //Müşteri?></th>
                                    <th class="w8 mw10 tar <?php if($cols["c_eticaret_ototal"]==""){echo "dn";}?>"><?php echo $sdil[144]; //Tutar?></th>
                                    <th class="w3 mw5 tac <?php if($cols["c_eticaret_ptype"]==""){echo "dn";}?>"><?php echo $sdil[222]; //Ödeme Şekli?></th>
                                    <th class="w3 mw5 tac <?php if($cols["c_eticaret_oship"]==""){echo "dn";}?>"><?php echo translate("Kargo Firması")?></th>
                                    <th class="w10 mw10 tac <?php if($cols["c_eticaret_odate"]==""){echo "dn";}?>" scope="col"><?php echo $sdil[115]; //Tarih/Saat?></th>
                                    <th class="w10 mw12 tar"></th>
                                    <th class="w9 mw8 tar"><?php echo $sdil[213]; //İşlemler?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    while($siparis=mysqli_fetch_assoc($sql)){
									//Filtreleme -------------------
									$ts1 = $_GET["ts1"] ?? ""; $ts2 = $_GET["ts2"] ?? "";
									$siparis_tarih = dtarih($siparis["ts1"], "yyyy-aa-gg"); $otuz_gun_once = date('Y-m-d', strtotime('-7 days'));
									if ((($ts1 == "" && $ts2 == "") && $siparis_tarih >= $otuz_gun_once) || (($ts1 != "" && $ts2 != "") && ($siparis_tarih >= $ts1 && $siparis_tarih <= $ts2))) {
									
                                    if($h3==1){
                                        $s140=0;$s141=0;$s142=0;$s143=0;$s144=0;$s145=0;
                                        $sqlb = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$siparis["id"].""); $icount = mysqli_num_rows($sqlb); while($sepet=mysqli_fetch_assoc($sqlb)){
                                            if($sepet["s14"]==0){$s140=$s140+1;} if($sepet["s14"]==1){$s141=$s141+1;} if($sepet["s14"]==2){$s142=$s142+1;} if($sepet["s14"]==3){$s143=$s143+1;} if($sepet["s14"]==4){$s144=$s144+1;}
                                        }
                                    }
                                    $jsob=json_decode($siparis["n12"],true);    //bildirim
                                    $jso=json_decode($siparis["n11"],true);
                                    $jsb=json_decode($siparis["n16"],true); //sepet
                                    $gtoplam=0;
                                    $sqlm = mysqli_query($conn, "select id,t1,t13,n17 from t5 where id=".$siparis["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm); $jsci=json_decode($rsm["n17"],true);
                                    $sqlb = mysqli_query($conn, "select id,t1 from t5 where id=".$siparis["s19"]." order by id desc"); $rsb=mysqli_fetch_assoc($sqlb);
                                    include("ecommerce_order_calc.php");
										$hide = false;
										if (mysqli_num_rows($sqlx) > 0) {
											if ($_SESSION["kim"] == "yonetici") {
												// Yönetici: ProjeID boşsa veya eşleşmiyorsa gizle
												if ($_SESSION["ProjeID"] == "" || $_SESSION["ProjeID"] != $jsi["ProjeID"]) {
													$hide = true;
												}
											} else {
												// Yönetici değilse: ProjeID eşleşmiyorsa gizle
												if ($_SESSION["ProjeID"] !="" && $_SESSION["ProjeID"] != $jsi["ProjeID"]) {
													$hide = true;
												}
											}
										}
                                    ?>
                                    <tr id="tr_<?php echo $siparis["id"]?>" data-id="<?php echo $siparis["id"];?>" 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";}?>" style="<?php if ($hide) { echo "display:none"; }?>">
                                        <th class="th table-check-cell cp v3-text-info mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-url="modules/ecommerce/ecommerce_order.php?ne=<?php echo $_GET["ne"];?>&islem=siparis&id=<?php echo $siparis["id"];?>" data-title="<?php echo translate("+#Sipariş Detay")?>"><span class="mdn"><?php echo i2a($siparis["id"],5)?></span><i class="ddn fas fa-eye"></i></th>
                                        <td class="mdn">
                                            <span class="fl" style="margin-top: 12px;"><?php echo $siparis["t4"];?><br><?php echo [ "siparis"     => '<i class="fas fa-dumpster-fire"></i> Online Satış', "storesales"  => '<i class="fas fa-dumpster"></i> Mağaza Satış', "mobilesales" => '<i class="fas fa-mobile-alt"></i> Mobil Satış' ][$siparis["ne"]] ?? '<i class="fas fa-question-circle"></i> Bilinmeyen'; ?></span>
                                            <?php if($siparis["t6"]<>""){?>
                                                <span class="badge bg-warning ml15 fl mdn"><?php echo $siparis["t9"]?></span>
                                            <?php }?>
                                            <?php if($siparis["n10"]<>""){?>
                                                <span class="badge bg-warning ml15 fl mdn"><?php echo $siparis["n10"]?></span>
                                            <?php }?>
                                            <?php if($jsob["browser"]<>1 and $jsob["desktop"]<>1){?>
                                                <i class="fas fa-fire text-danger" style="margin-left:5px;margin-top: 7px;"></i>
                                            <?php }?>
                                            <?php if($cols["c_eticaret_orderimages"]<>""){?>
												<div class="image-container">
                                                <?php $i=0;foreach($images as $image){$i++;?>
                                                    <?php if($i<11){?>
                                                    <img src="<?php echo $image; ?>">
                                                    <?php }?>
                                                <?php }?>
                                                <?php if(count($images)>10){?>
                                                <i class="fas fa-plus" title="<?php echo count($images)?>" style="background: white;height: 45px; width: 45px; border-radius: 50%; float: right; border: 1px solid; font-size: 40px; padding: 3px; color: darkgreen;"></i>
                                                <?php }?>
												</div>
                                            <?php }?>
                                        </td>
                                        <td class="tar mtal cp tdhi <?php if($cols["c_eticaret_client"]==""){echo "dn";}?>">
                                        <div class="hicons">
                                            <a href="#" class="v3-btn-xs v3-btn-info mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-title="<?php echo ctranslate("Detay")?>" data-url="modules/clients/client.php?id=<?php echo $rsm["id"]?>" style="border: 1px solid;" title="Müşteri Detay"><i class="fas fa-user" aria-hidden="true"></i></a>
                                            <a href="#" class="v3-btn-xs v3-btn-success mfrm" data-toggle="modal" data-target="#myModal" data-title="<?php echo ctranslate("Sipariş(ler)")?>" data-url="modules/clients/client_orders.php?id=<?php echo $rsm["id"]?>" style="border: 1px solid;" title="Müşteri Siparişleri"><i class="fas fa-dumpster" aria-hidden="true"></i></a>
                                            <a href="#" class="v3-btn-xs v3-btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-title="<?php echo ctranslate("Sepet")?>" data-url="modules/clients/client_basket.php?id=<?php echo $rsm["id"]?>" style="border: 1px solid;" title="Müşteri Sepeti"><i class="fa fa-shopping-basket" aria-hidden="true"></i></a>
                                        </div>
                                        <?php if($rsm["t13"]<>""){echo "<i class=\"fas fa-medal\"></i>";}?> <?php if(mysqli_num_rows($sqlm)>0){echo "".$rsm["t1"]."";}else{echo $jso["Name"]." ".$jso["Surname"];}?><?php if(mysqli_num_rows($sqlb)>0 and $siparis["s19"]<>0){echo " >> ".$rsb["t1"];}?>
                                        <?php if($cols["c_eticaret_firm"]<>""){echo "<br><span class=\"mdn\" style=\"font-size:11px;\">".kisalt($jsci["ifirma"],3)."</span><span class=\"ddn\" style=\"font-size:11px;\">".kisalt($jsci["ifirma"],2)."</span>";}?>
                                        </td>
                                        <td class="tar mw25 <?php if($cols["c_eticaret_ototal"]==""){echo "dn";}?>">
                                            <div style=""><?php echo wprice($gtoplam)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></div>
                                        </td>
                                        <td class="mdn tac <?php if($cols["c_eticaret_ptype"]==""){echo "dn";}?>"><?php if($siparis["t5"]<>""){ echo translate("#".$siparis["t5"]); }else{echo "...";}?><br /><?php echo ihb($siparis["t3"]);?></td>
                                        <td class="mdn tac <?php if($cols["c_eticaret_oship"]==""){echo "dn";}?>"><?php echo $siparis["t12"]?></td>
                                        <td class="mdn tac <?php if($cols["c_eticaret_odate"]==""){echo "dn";}?>"><?php echo dtarih($siparis["ts1"],"gg ka time");?><br /><?php echo dtarih($siparis["ts2"],"gg ka  time");?></td>
                                        <td class="mdn tar">
                                        <?php if($siparis["s4"]=="0"){?>
                                            <a  class="btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-url="fonksiyon.php?islem=order_reminder&id=<?php echo $siparis["id"];?>" data-title="Havale Hatırlatma" title="Havale Hatırlatma"><i class="fas fa-envelope"></i></a>
                                        <?php }?>
                                            <a  class="btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_order.php?mode=modal&id=<?php echo $siparis["id"];?>" data-title="Sipariş Yazdır" title="Sipariş Yazdır"><i class="fa fa-print"></i></a>
                                        <?php if($f3>0){?>
                                            <a  class="btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_ship.php?mode=modal&id=<?php echo $siparis["id"];?>" data-title="Kargo Fişi Yazdır" title="Kargo Fişi Yazdır"><i class="fa fa-truck"></i></a>
                                        <?php }?>

                                        <?php if($module["posnet"]=="1"){?>
                                            <a  class="btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-url="modules/print/print_ticket.php?id=<?php echo $siparis["id"];?>"  title="Ticket"><i class="fa fa-ticket"></i></a>
                                        <?php }?>
                                            <a id="del1_<?php echo $siparis["id"];?>" data-href="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=2" class="btn btn-danger mbtn  cp btn-delete-row" title="Kaldır" style="display:none;"><i class="fa fa-times"></i></a>
                                        <?php if(($siparis["s4"]==2 and $_SESSION["y2"]>2) or ($siparis["s4"]==2 and $_SESSION["kim"]=="Admin") ){?>
                                            <a id="del0_<?php echo $siparis["id"];?>" data-href="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=2" class="btn btn-danger mbtn  cp btn-delete-row" title="Kaldır" style=""><i class="fa fa-times"></i></a>
                                        <?php }else{?>
                                            <a id="view_<?php echo $siparis["id"];?>" class="btn btn-warning mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-url="modules/ecommerce/ecommerce_order.php?ne=<?php echo $_GET["ne"];?>&islem=siparis&id=<?php echo $siparis["id"];?>" data-title="<?php echo translate("+#Sipariş Detay")?>" title="Sipariş Detay"><i class="fa fa-eye"></i></a>
                                        <?php }?>
                                        </td>
                                        <td class="table-actions tar">
                                        <form id="o<?php echo $siparis["id"];?>" style="">
                                            <div id="note<?php echo $siparis["id"];?>" style="display:none;position: absolute; top: 0px; background: currentColor; right: 0px; width: 300px; height: 300px; z-index: 9;">
                                                <textarea name="note" class="v3-form-control" placeholder="İptal Nedeni" style="height:90px; margin-bottom:5px;"></textarea>
                                                <button type="button" class="v3-btn-xs v3-btn-danger fr mfr" onclick="AjaxPResult('modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=2&ototal=<?php echo wprice($gtoplam)?>','#o<?php echo $siparis["id"];?>','#process','');hide('note<?php echo $siparis["id"];?>')"><?php echo translate("+#İptal")?></button>
                                                <button type="button" class="v3-btn-xs v3-btn-warning fr mfr mr5 mmr5" onclick="hide('note<?php echo $siparis["id"];?>')">Vazgeç</button>
                                            </div>
                                            <select class="form-control sna tar" id="s<?php echo $siparis["id"];?>" style="padding: 0px;">
                                                <option data-bg="alert-warning" data-status="0" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=0&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==0){echo "Selected";}?>><i class="fa fa-pause" aria-hidden="true"></i> <?php echo translate("+#Onay Bekliyor")?></option>
                                                <option data-bg="alert-success" data-status="1" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=1&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==1){echo "Selected";}?>><i class="fa fa-check" aria-hidden="true"></i> <?php echo translate("+#Onaylandı")?></option>
                                                <?php if($f3>0){?>
                                                <option data-bg="alert-info" data-status="3" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=3&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==3){echo "Selected";}?>><i class="fa fa-truck" aria-hidden="true"></i> <?php echo translate("+#Sevkiyatta")?></option>
                                                <?php }?>
                                                <option data-bg="alert-default" data-status="4" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=4&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==4){echo "Selected";}?>><i class="fa fa-check" aria-hidden="true"></i> <?php echo translate("+#Teslim Edildi")?></option>
                                                <option data-bg="alert-danger" data-status="2" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=2&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==2){echo "Selected";}?>><i class="fa fa-ban" aria-hidden="true"></i> <?php echo translate("+#İptal")?></option>
                                                <?php if($module["order_return"]>1){?>
                                                <option data-bg="alert-danger" data-status="5" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=5&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==5){echo "Selected";}?>><i class="fa fa-ban" aria-hidden="true"></i> <?php echo translate("+#İade")?></option>
                                                <?php }?>
                                                <?php if(translate("+#order_extra")<>""){?>
                                                <option data-bg="alert-default" data-status="6" value="modules/ecommerce/ajax.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $siparis["id"];?>&durum=onay&s4=6&ototal=<?php echo wprice($gtoplam)?>" <?php if($siparis["s4"]==6){echo "Selected";}?>><i class="fa fa-life-ring" aria-hidden="true"></i> <?php echo translate("#order_extra")?></option>
                                                <?php }?>
                                            </select>
                                        </form>
                                            <?php if($h3==1 and $siparis["ne"]=="siparis"){?>
                                            <div class="mfs10 fs12" style="position: absolute; width: 100%; text-align: center; bottom: 0px;">
                                                <?php if($icount==$s140){echo "Satıcı(lar) Onayı Bekliyor";}elseif($icount==$s141){echo "Satıcı(lar) Onayladı";}elseif($icount==$s142){echo "Ürün(ler) Kargoya Verildi";}elseif($icount==$s144){echo "Sipariş Tamamlandı";}else{echo "Sipariş Devam Ediyor";}?>
                                            </div>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <script>
                                        jQuery('#s<?php echo $siparis["id"];?>').on('change', function() {
                                            notice('CrmPlus+','<?php echo trim($sdil[212])?>','fa fa-check-square-o','success');
                                            var bg = jQuery(this).find(':selected').data('bg');
                                            var status = jQuery(this).find(':selected').data('status');
                                            jQuery("#tr_<?php echo $siparis["id"];?>").removeClass();
                                            jQuery("#tr_<?php echo $siparis["id"];?>").addClass(bg);
                                            <?php if($authority<>0){?>
                                                if(status==2){
                                                    jQuery("#del1_<?php echo $siparis["id"];?>").fadeIn();
                                                    jQuery("#view_<?php echo $siparis["id"];?>").fadeOut();
                                                }else{
                                                    jQuery("#view_<?php echo $siparis["id"];?>").fadeIn();
                                                    jQuery("#del1_<?php echo $siparis["id"];?>").fadeOut();
                                                    jQuery("#del0_<?php echo $siparis["id"];?>").fadeOut();
                                                }
                                            <?php }?>
                                                AjaxPResult(this.value,'#o<?php echo $siparis["id"];?>','#process','');
                                        });
                                    </script>
                                    <?php $total=0; $stutar=""; $ototal=$ototal+$gtoplam; }}?>
                                    <script>jQuery(document).ready(function(){jQuery('#order_total').html('Toplam : <?php echo wprice($ototal)?> <?php echo $ikpb?>');});</script>
                                </tbody>
                            </table>
                            <div class="tar mt10">
                                <span class="fl fs11">Toplam : <?php echo $rcount?> Kayıt</span>
                                <div class="" id="">
                                    <select onChange="self.location.href=this.options[this.selectedIndex].value;" class="mb-1 mt-1 mr-1 btn btn-default sna">
                                        <option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&show=<?php echo $module["slmt"];?>" <?php if($_GET["show"]=="" or $_GET["show"]==$module["slmt"]){echo "selected";}?>><?php echo $module["slmt"];?></option>
                                        <option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&show=<?php echo ($module["slmt"]*2);?>" <?php if($_GET["show"]==($module["slmt"]*2)){echo "selected";}?>><?php echo $module["slmt"]*2;?></option>
                                        <option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&show=<?php echo ($module["slmt"]*4);?>" <?php if($_GET["show"]==($module["slmt"]*4)){echo "selected";}?>><?php echo $module["slmt"]*4;?></option>
                                        <option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&sayfa=<?php echo $_GET["sayfa"];?>&show=<?php echo ($module["slmt"]*10);?>" <?php if($_GET["show"]==($module["slmt"]*10)){echo "selected";}?>><?php echo $module["slmt"]*10;?></option>
                                    </select>
                                    <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 $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&show=<?php echo $_GET["show"];?>&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 sna" style="padding:0px; height: 21px;">
                                            <?php for ($i = 0; $i <= $rsay; $i++) { $x=$i+1; ?>
                                                <option value="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&show=<?php echo $_GET["show"];?>&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 $_SESSION["key"];?>&t5=<?php echo $_GET["t5"];?>&s4=<?php echo $_GET["s4"];?>&show=<?php echo $_GET["show"];?>&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>
                                </div>
                            </div>
                        </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>