<?php
$path="../../";
include("../../map.php");
?>
<script>
    jQuery(document).ready(function () {
        jQuery(".mfrm").on("click", function () {
            var target = jQuery(this).data("target"),
			theModal = jQuery(target),
			title = jQuery(this).data("title"),
			width = jQuery(this).data("width"),
			frmSRC = jQuery(this).data("url"),
			refSRC = jQuery(this).data("ref");
            theModal.fadeIn().addClass("in");
            theModal.find(".v3-modal-title").text(title);
            
            <?php if ($mobile == "") { ?>
                if (width !== undefined) { theModal.css("width", width); }
            <?php } ?>
            if (refSRC !== undefined) { theModal.find(".mcbtn").attr("onclick", "location.href='" + refSRC + "'"); }
            theModal.find("iframe").attr("src", frmSRC);
            theModal.find(".close").on("click", function () { theModal.find("iframe").attr("src", "about:blank"); });
        });
    });
</script>
	<table class="v3-table" style="">
		<tr class="mdn">
			<th class="w13 mw13"><?php echo ctranslate("Sipariş No")?></th>
			<th><?php echo ctranslate($t25s[0]);?></th>
			<th class="w25 mw30"><?php echo ctranslate("Özet")?></th>
			<th class="w10 mw10"><?php echo ctranslate("Tarih")?></th>
			<th class="w15 mw15 tar mtar"><?php echo ctranslate("Tutar")?> (<?php echo $ikpb;?>)</th>
		</tr>
	<tbody>
		<?php
			$sts=0; $sts1=0;$gtoplam=0;
			$sql = mysqli_query($conn, "select * from eticaret where ne='siparis' $luye order by id desc"); while($siparis=mysqli_fetch_assoc($sql)){
			if(dtarih($siparis["ts1"],"yyyy-aa-gg") == date('Y-m-d')){
			$sqlm = mysqli_query($conn, "select * from t5 where id=".$siparis["s1"]." order by id desc"); $rsm=mysqli_fetch_assoc($sqlm); $jsci=json_decode($rsm["n17"],true);
			$dpath="../../";include("../ecommerce/ecommerce_order_calc.php");
			if($siparis["s4"]==0){
				$sts0 = $sts0+$gtoplam;
			}elseif($siparis["s4"]==1 or $siparis["s4"]==4){
				$sts1 = $sts1+$gtoplam;
			}
		?>
				<script> jQuery(document).ready(function() { jQuery('#ecommerce0').html('<?php echo wprice($sts0)?>'); jQuery('#ecommerce1').html('<?php echo wprice($sts1)?>'); }); </script>
			<tr  class="mfrm" data-toggle="modal" data-target="#myModal" data-width="90%" data-url="modules/ecommerce/ecommerce_order.php?ne=<?php echo $_GET["ne"];?>&islem=siparis&id=<?php echo $siparis["id"];?>" data-title="#<?php echo $rs['id']?>">
				<td class="mdn"><?php echo $siparis["t4"];?></td>
				<td><?php echo $rsm["t1"];?><?php if($jsci["ifirma"]<>""){echo "<br><span style=\"font-size:11px;\">".kisalt($jsci["ifirma"],3)."</span>";}?></td>
				<td>
					<span class="badge bg-warning"><?php echo translate($siparis["t5"])?></span>
					<?php if($siparis["s4"]==0){?>
						<span class="badge bg-warning"><?php echo translate("#Beklemede")?></span>
					<?php }elseif($siparis["s4"]==1){?>
						<span class="badge bg-success"><?php echo translate("#Onaylandı")?></span>
					<?php }elseif($siparis["s4"]==3){?>
						<span class="badge bg-info"><?php echo translate("#Sevkiyatta")?></span>
					<?php }elseif($siparis["s4"]==4){?>
						<span class="badge bg-info"><?php echo translate("#Tamamlandı")?></span>
					<?php }elseif($siparis["s4"]==3){?>
						<span class="badge bg-danger"><?php echo translate("#İptal")?></span>
					<?php }?>
				</td>
				<td class="">
						<div title="<?php echo dtarih($siparis["ts1"],"gg ka yyyy");?>" class="v3-date"><span><?php echo dtarih($siparis["ts1"],"gg");?></span><span><?php echo dtarih($siparis["ts1"],"ka");?></span></div>
				</td>
				<td class="mtar tar">
					<span class="digi"><?php echo $ikpb;?> <?php echo wprice($gtoplam)?></span>
				</td>
			</tr>
		<?php $stutar="";}}?>
	</tbody>
</table>