<?php
if($_GET["mode"]=="modal"){
	$path="../../";
	include("../../map.php");
	include("../../scripts.php");
?>
<style> .adress tr>td, .delivery tr>td {padding:5px 0px;} </style>
<?php }?>
<div id="ysevkiyat" class="container" style="width:210mm !important; height:297mm !important; overflow:hidden;">
	<div style="cursor:pointer; position:absolute; right:10px; margin-top:5px;" title="Sevkiyat Yazdır" onclick="divyaz('ysevkiyat')" class="btn btn-success"><i class="fa fa-print"></i></div>
<?php
	if($_GET["ship"]=="all"){$sor="ne='siparis' and s4=1";}else{$sor="ne='siparis' and id=".$_GET["id"]."";}
	if($_GET["storeID"]<>""){$ssorgu="and s19='".$_GET["storeID"]."'";}
	$sqlo = mysqli_query($conn, "select * from eticaret where $sor"); while($siparis=mysqli_fetch_assoc($sqlo)){
	$Rs = mysqli_query($conn, "update eticaret set s10='2' where id=".$siparis["id"]."");
	$sqlm = mysqli_query($conn, "select * from t5 where id=".$siparis["s1"].""); $rsm=mysqli_fetch_assoc($sqlm);
if($_GET["storeID"]<>""){
	$sqls = mysqli_query($conn, "select * from t5 where id=".$_GET["storeID"].""); $store=mysqli_fetch_assoc($sqls); $jsi = json_decode($store["n17"],true);
	$firma=$jsi["ifirma"];
	$fadres=$jsi["iadres"];
	$ftel=$store["t7"];
	$fgsm=$store["t4"];
	$logo=medya($store["id"],1,"resim","t1","",$weburl);
}
	$jsml=json_decode($rsm["n16"],true);
	$jsmi=json_decode($rsm["n17"],true);
	$path="../../";
	include("../ecommerce/ecommerce_order_calc.php");
	$sqlc=mysqli_query($conn, "select * from genel where ne='kargo' and id=".$siparis["s9"]." order by s10 asc"); $rsc=mysqli_fetch_assoc($sqlc);
?>
		<table style="border: 1px dashed #c39f30; width: 98%; margin-left: 1%; margin-top:8%; min-width:500px; height: 110px" class="noshadow">
			<tr>
				<td style="width:30%; margin-top:15px;">
					<center><img src="<?php echo $logo?>"  style="max-height:200px;"></center>
				</td>
				<td style="height: 110px; border-left: 2px solid #000 !important; padding-left: 10px;">
					<table style="width:100%;" class="adress">
						<tr><td><b><?php echo $firma?></b></td></tr>
						<tr><td><?php echo $fadres?></td></tr>
						<tr><td><?php if($ftel<>""){echo $ftel;}?> <?php if($fgsm<>""){echo " | ".$fgsm;}?></td></tr>
					</table>
				</td>
				<td>
					<div style="transform: rotate(90deg); font-size: 20px; margin-top: 70px;"><?php echo translate("Gönderen")?></div>
				</td>
			</tr>
			<tr>
				<td colspan="3"><hr></td>
			</tr>
			<tr>
				<td style="width:30%">
					<center><img src="<?php echo qrCode($weburl."/order/".$siparis["t4"]."",140);?>" style="width:50%"></center>
				</td>
				<td style="height: 110px; border-left: 2px solid #000 !important; padding-left: 10px;">
					<?php 
					$sqla=mysqli_query($conn, "select * from t1 where ne='adress' and t2='".$_SESSION['lang']."' and id=".$siparis["s11"].""); $adress=mysqli_fetch_assoc($sqla);
					 if(mysqli_num_rows($sqla)==0){
					?>
						<table style="width:100%;" class="adress">
							<tr><td><b><?php echo $rsm["t1"]?> <?php if($jsmi["i1"]<>""){?>(<?php echo $jsmi["i1"]?>)<?php }?></b></td></tr>
							<tr><td><?php echo order_adress($siparis["id"],"delivery");?></td></tr>
							<tr><td><?php if($rsm["t4"]<>""){echo $rsm["t4"];}?> <?php if($rsm["t7"]<>""){echo " | ".$rsm["t7"];}?></td></tr>
						</table>
					<?php }else{?>
						<table style="width:100%;">
							<tr><td><?php echo order_adress($siparis["id"],"delivery");?></td></tr>
						</table>
					<?php }?>
				</td>
				<td>
					<div style="transform: rotate(90deg); font-size: 20px; margin-top: 25px;"><?php echo translate("Alıcı")?></div>
				</td>
			</tr>
			<tr>
				<td colspan="3"><hr></td>
			</tr>
			<tr>
				<td colspan="3">
					<table style="width:100%;" class="v3-bg-warning">
						<tr>
							<td style="width:33%; padding:10px;"><b>Ödeme Türü</b><br><?php echo $siparis["t10"]?></b> {<?php echo $siparis["t5"]?>}</td>
							<td style="width:33%; padding:10px;"><b>Kargo Firması</b><br><?php echo $rsc["t1"];?></td>
							<td style="width:33%; padding:10px;"><b>Kargo Tipi</b><br><?php if($rsc["s4"]==0){echo "Gönderici Ödemeli Kargo";}elseif($rsc["s4"]==1){echo "Ücretsiz Kargo";}elseif($rsc["s4"]==2){echo "Alıcı Ödemeli Kargo";}?></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
<?php }?>
	</div>