<?php
if($_GET["mode"]=="modal" or $_GET["mode"]=="basic"){
	$path="../../";
	include("../../map.php");
	$sorgu = is_numeric($_GET["id"]) ? "AND id = {$_GET["id"]}" : "AND t4 LIKE '%{$_GET["id"]}%'";
	$sqlo = mysqli_query($conn, "select * from eticaret where ne='siparis' $sorgu"); $siparis=mysqli_fetch_assoc($sqlo);
	echo "<title>".$siparis["t4"]."</title>";
	$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);
	$jssi=json_decode($siparis["n11"],true);
	$dpath="../../";
	include("../ecommerce/ecommerce_order_calc.php");
	$sqlb=mysqli_query($conn, "select * from genel where ne='banka' and id=".$jssi["Order_Bank_Id"]." order by s10 asc"); $banka=mysqli_fetch_assoc($sqlb);
	if($_GET["storeID"]<>""){$ssorgu="and s19='".$_GET["storeID"]."'";}
}
if($_GET["op"]<>"xls"){
	include("../../scripts.php");
	?>
	<?php if($_GET["type"]=="qr"){?>
	<style> .message-box {display:none;} </style>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<?php }?>
	<?php if($_GET["mode"]=="modal" and $_GET["type"]<>"qr"){?>
		<a style="cursor:pointer; position:absolute; right:10px; margin-top:5px; padding: 5px 7px; font-size:14px;" title="Sipariş Yazdır" onclick="divyaz('ysiparis')" class="btn btn-success noprint"><i class="fa fa-print"></i></a>
		<?php if($_GET["storeID"]<>""){?>
		<a href="print_ship.php?mode=<?php echo $_GET["mode"]?>&id=<?php echo $_GET["id"]?>&storeID=<?php echo $_GET["storeID"]?>" style="cursor:pointer; position:absolute; right:76px; margin-top:5px; padding: 5px 7px; font-size:14px;" title="Sevkiyat Fişi Yazdır" class="btn btn-success noprint"><i class="fa fa-truck"></i></a>
		<?php }?>
		<a href="?mode=<?php echo $_GET["mode"]?>&id=<?php echo $_GET["id"]?>&op=xls" style="cursor:pointer; position:absolute; right:45px; margin-top:5px; padding: 5px 7px; font-size:14px;" title="xls" class="btn btn-success noprint"><i class="fas fa-file-excel"></i></a>
	<?php }?>
	<div class="container-fluid mt-3" id="ysiparis">
		<div class="p10" style="margin-top: 15px;">
			<table class="table noshadow" style="">
				<tr>
					<td style=""> <img src="<?php echo $logo;?>" style="max-height:65px; max-width:150px;"></td>
					<td style="width:60%; text-align: right;"> <b><?php echo $firma;?></b><br><?php echo $fadres;?><br><?php echo $ftel;?></td>
				</tr>
			</table>
			<table class="table noshadow" style="">
				<tr class="warning">
					<th class="qfont"><?php echo translate('Adı')?></th>
					<?php if($_GET["mode"]<>"basic"){?>
						<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Fiyat')?></th>
					<?php }?>
					<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Miktar')?></th>
					<?php if($_GET["mode"]<>"basic"){?>
						<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Tutar')?></th>
					<?php }?>
				</tr>
				<?php
				$sqlb = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$siparis["id"]." ".$ssorgu.""); while($sepet=mysqli_fetch_assoc($sqlb)){
					$sqlu = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and id=".$sepet["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
					include("../deppo/tools/script/order_calc.php");
					$ufiyat=($sepet["pb1"]);
					$jsi = json_decode($sepet["n17"], true);
					?>
					<tr>
						<td style="vertical-align:middle;"><?php echo badge($sepet["n1"])?>
						<?php if($sepet["n5"]<>""){echo "<a href=\"".$weburl."/deppo/dosya/".$sepet["n5"]."\" class=\"fa fa-download\"></a>";}?>
						<?php if($sepet["n17"]<>""){?>
							<br><span style="font-size:10px;">
								<?php
								foreach($jsi as $key=>$value){
									if($value[1]<>""){ $values = explode(',',$value); }else{ $values = explode(',',$value[0]); }
									?>
									<?php echo $values[0];?> <?php if($values[1]<>0){echo "<b>+".$values[1]." ".$ikpb."</b>";}?>, 
								<?php }?>
							</span>
						<?php }elseif($sepet["n17"]=="" and $rsu["n2"]<>""){?>
							<br>
							<span style="font-size:10px;"><?php echo kisalt($rsu["n2"],5)?></span>
							<?php }?></td>
							<?php if($_GET["mode"]<>"basic"){?>
								<td style="vertical-align:middle; text-align: right;"><?php echo wprice($ufiyat)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></td>
							<?php }?>
							<td style="vertical-align:middle; text-align: right;"><?php echo $sepet["s2"]?> <?php echo $rsu["t10"]?></td>
							<?php if($_GET["mode"]<>"basic"){?>
								<td style="vertical-align:middle; text-align: right;"><?php echo wprice($ufiyat*$sepet["s2"])?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></td>
							<?php }?>
						</tr>
					<?php }?>
				</table>
			</div>
			
			<div class="p10" style="margin-top: 15px;">
				<table class="table noshadow" style="">
					<?php if($_GET["mode"]<>"basic"){?>
						<tr>
							<td class="qfont" style="text-align: right;"><?php echo translate('Ara Toplam')?></td>
							<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($stutar)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
						</tr>
						<?php if($kargof<>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Sevkiyat')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($kargof)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if($vadef<>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Komisyon')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($vadef)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if(!empty($kdv)){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Kdv')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($kdv)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						
						<?php if($hindirim>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Havale indirim')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont">-<?php echo wprice($hindirim)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if($kindirim>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('İndirim Kodu')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont">-<?php echo wprice($kindirim)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<tr>
							<td class="qfont" style="text-align: right;"><?php echo translate('Genel Toplam')?></td>
							<td class="" style="text-align: right; width:15%;"><span class="qfont"><b><?php echo wprice($gtoplam)?></b> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
						</tr>
					<?php }?>
				</table>
			</div>
			<div class="p10" style="margin-top: 15px;">
				<div class="row">
					<div class="col-md-6 col-xs-6">
						<?php if($rsm2["t1"]<>""){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('İlgili')?></b></div>
							<div class="col-md-8 col-xs-6"> : <?php echo $rsm2["t1"]?></div>
						<?php }?>
						<?php if($siparis["t5"]<>""){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('Ödeme Tipi')?></b> </div>
							<div class="col-md-8 col-xs-6"> : <b><?php echo translate("#".$siparis["t5"]);?></b> <?php if($siparis["t5"]=="pos" and $siparis["pb5"]<>0 or $siparis["t5"]=="payu" or $siparis["t5"]=="iyzipay" and $siparis["pb5"]<>0){?> <?php echo $siparis["t10"]?> <?php echo $siparis["t11"]?> Taksit <?php }?></div>
						<?php }?>
						<?php if($f3==1){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('Sevkiyat')?></b></div>
							<div class="col-md-8 col-xs-6"> : <b><?php echo $jssi["Order_Cargo"]?></b> <?php if($siparis["t13"]<>""){?><a class="<?php if($f3<>1){echo "dn";}?>" href="<?php echo cargotracking($siparis["t12"],$siparis["t13"])?>" target="_blank"><?php echo $siparis["t13"]?></a><?php }?></div>
						<?php }?>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Sipariş No')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $siparis["t4"]?></div>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Sipariş Tarihi')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo dtarih($siparis["ts1"],"gg ka yy time")?></div>
					</div>
					<div class="col-md-6 col-xs-6" style="padding-left:0px;">
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Müşteri Adı')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $rsm["t1"]?></div>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Müşteri Telefon')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $rsm["t4"]?></div>
					</div>
				</div>
			</div>
			<div class="p10" style="border: 1px solid lightgrey; margin-top: 15px;">
				<div class="row">
					<div class="col-md-12">
						<div  class="col-md-6 col-xs-6">
							<b><?php echo translate('Teslimat Adresi')?></b><br>
							<?php echo order_adress($siparis["id"],"delivery")?><br>
						</div>
						<div  class="col-md-6 col-xs-6">
							<b><?php echo translate('Fatura Adresi')?></b><br>
							<?php echo order_adress($siparis["id"],"invoice")?><br>
							<?php echo order_adress($siparis["id"],"invoice","fvdvn")?>
						</div>
						<?php if($_GET["mode"]<>"basic"){?>
							<?php if($siparis["t5"]=="havale"){?>
								<div style="padding: 10px;">
									<b><?php echo translate('Havale/Eft')?></b><br>
									<?php echo $siparis["t10"]?><br>
									<?php echo $banka["n4"]?><br>
									<?php echo $banka["n3"]?>
								</div>
							<?php }elseif($siparis["t5"]=="pos"){?>
								<div style="padding: 10px;">
									<b><?php echo translate('Kredi Kartı')?> (3D)</b><br>
									<?php echo $siparis["t10"]?><br>
									<?php if($siparis["t15"]<>""){?> {XXXX XXXX XXXX <?php echo substr($siparis["t15"], -4)?>}<br><?php }?>
									<?php if($jssi["Order_Installment"]==1){echo "tek çekim";}else{echo $jssi["Order_Installment"]." taksit";}?>
								</div>
							<?php }?>
						<?php }?>
					</div>
				</div>
			</div>
			<table class="table noshadow" style="display:none;">
				<?php
				$arrays = json_decode($siparis["n11"], true);
				foreach($arrays as $key=>$value){
					?>
					<tr>
						<td class="w30 mw50"><b><?php echo $key;?></b></td>
						<td> : <?php echo $value;?></td>
					</tr>
				<?php }?>
			</table>
		</tr>
	</table>
<?php }else{
	header("Content-type: application/vnd.ms-excel");
	$file="".$siparis["t4"].".xls";
	header("Content-type: application/vnd.ms-excel");
	header("Content-Disposition: attachment; filename=".$file."");
	header("Pragma: no-cache");
	header("Expires: 0");
 echo "\xEF\xBB\xBF"; //UTF-8 BOM
 echo $out;
 ?>
 <table style="width:100%;">
 	<thead>
 		<tr>
 			<th><?php echo $t24;?></th>
 			<th style="text-align: right;"><?php echo $sdil[88]; //Birim?></th>
 			<th style="text-align: right;"><?php echo $sdil[86]; //kdv?></th>
 			<th style="text-align: right;"><?php echo $sdil[85]; //Fiyat?></th>
 			<th style="text-align: right;"><?php echo $sdil[144]; //Tutar?></th>
 		</tr>
 	</thead>
 	<tbody>
 		<?php
 		$sqls = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$_GET["id"].""); while($sepet=mysqli_fetch_assoc($sqls)){
 			$sqlu = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and id=".$sepet["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
 			$ufiyat=$sepet["pb1"];
 			?>
 			<tr>
 				<td><?php echo $sepet["n1"]?></td>
 				<td style="text-align: right;"><?php echo $sepet["s2"]?></td>
 				<td style="text-align: right;">% <?php echo $sepet["s4"]?></td>
 				<td style="text-align: right;"><?php echo number_format(($ufiyat),2, ',', '.')?></td>
 				<td style="text-align: right;"><?php echo number_format($ufiyat*$sepet["s2"],2, ',', '.')?></td>
 			</tr>
 		<?php }?>
 	</tbody>
 </table>
 <?php }?><?php
if($_GET["mode"]=="modal" or $_GET["mode"]=="basic"){
	$path="../../";
	include("../../map.php");
	$sqlo = mysqli_query($conn, "select * from eticaret where ne='siparis' and (id=".$_GET["id"]." or t4='".$_GET["id"]."')"); $siparis=mysqli_fetch_assoc($sqlo);
	echo "<title>".$siparis["t4"]."</title>";
	$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);
	$jsml=json_decode($rsm["n16"],true);
	$jsmi=json_decode($rsm["n17"],true);
	$jssi=json_decode($siparis["n11"],true);
	$dpath="../../";
	include("../ecommerce/ecommerce_order_calc.php");
	$sqlb=mysqli_query($conn, "select * from genel where ne='banka' and id=".$jssi["Order_Bank_Id"]." order by s10 asc"); $banka=mysqli_fetch_assoc($sqlb);
}
if($_GET["op"]<>"xls"){
	include("../../scripts.php");
	?>
	<?php if($_GET["mode"]=="modal"){?>
		<a style="cursor:pointer; position:absolute; right:10px; margin-top:5px; padding: 5px 7px; font-size:14px;" title="Sipariş Yazdır" onclick="divyaz('ysiparis')" class="btn btn-success noprint"><i class="fa fa-print"></i></a>
		<a href="?mode=<?php echo $_GET["mode"]?>&id=<?php echo $_GET["id"]?>&op=xls" style="cursor:pointer; position:absolute; right:45px; margin-top:5px; padding: 5px 7px; font-size:14px;" title="xls" class="btn btn-success noprint"><i class="fas fa-file-excel"></i></a>
	<?php }?>
	<div class="container" id="ysiparis" style="margin-top:10px;">
		<div class="p10" style="border: 1px solid lightgrey; margin-top: 15px;">
			<table class="table noshadow" style="">
				<tr>
					<td style=""> <img src="<?php echo $logo;?>" style="max-height:65px; max-width:150px;"></td>
					<td style="width:60%; text-align: right;"> <b><?php echo $firma;?></b><br><?php echo $fadres;?><br><?php echo $ftel;?></td>
				</tr>
			</table>
			<table class="table noshadow" style="font-family:arial;font-size:12px !important;">
				<tr class="warning">
					<th class="qfont"><?php echo translate('Adı')?></th>
					<?php if($_GET["mode"]<>"basic"){?>
						<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Fiyat')?></th>
					<?php }?>
					<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Miktar')?></th>
					<?php if($_GET["mode"]<>"basic"){?>
						<th class="qfont" style="width:15%; text-align: right;"><?php echo translate('Tutar')?></th>
					<?php }?>
				</tr>
				<?php
				$sqlb = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$siparis["id"]." ".$ssorgu.""); while($sepet=mysqli_fetch_assoc($sqlb)){ $jsi = json_decode($sepet["n17"], true);
					$sqlu = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and id=".$sepet["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
					include("../deppo/tools/script/order_calc.php");
					$ufiyat=string_to_float($sepet["pb1"]);
					?>
					<tr>
						<td style="vertical-align:middle;"><?php echo badge($sepet["n1"])?>
						<?php if($sepet["n5"]<>""){echo "<a href=\"".$weburl."/deppo/dosya/".$sepet["n5"]."\" class=\"fa fa-download\"></a>";}?>
						<?php if($sepet["n17"]<>""){?>
							<br><span style="font-size:10px;">
								<?php
								foreach($jsi as $key=>$value){
									if($value[1]<>""){ $values = explode(',',$value); }else{ $values = explode(',',$value[0]); }
									?>
									<?php echo $values[0];?> <?php if($values[1]<>0){echo "<b>+".$values[1]." ".$ikpb."</b>";}?>, 
								<?php }?>
							</span>
						<?php }elseif($sepet["n17"]=="" and $rsu["n2"]<>""){?>
							<br>
							<span style="font-size:10px;"><?php echo kisalt($rsu["n2"],5)?></span>
							<?php }?></td>
							<?php if($_GET["mode"]<>"basic"){?>
								<td style="vertical-align:middle; text-align: right;"><?php echo wprice($ufiyat)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></td>
							<?php }?>
							<td style="vertical-align:middle; text-align: right;"><?php echo $sepet["s2"]?> <?php echo $rsu["t10"]?></td>
							<?php if($_GET["mode"]<>"basic"){?>
								<td style="vertical-align:middle; text-align: right;"><?php echo wprice($ufiyat*$sepet["s2"])?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></td>
							<?php }?>
						</tr>
					<?php }?>
				</table>
			</div>
			
			<div class="p10" style="border: 1px solid lightgrey; margin-top: 15px;">
				<table class="table noshadow" style="">
					<?php if($_GET["mode"]<>"basic"){?>
						<tr>
							<td class="qfont" style="text-align: right;"><?php echo translate('Ara Toplam')?></td>
							<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($stutar)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
						</tr>
						<?php if($kargof<>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Sevkiyat')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($kargof)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if($vadef<>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Komisyon')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($vadef)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if(!empty($kdv)){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Kdv')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont"><?php echo wprice($kdv)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						
						<?php if($hindirim>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('Havale indirim')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont">-<?php echo wprice($hindirim)?>&nbsp;<i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<?php if($kindirim>0){?>
							<tr>
								<td class="qfont" style="text-align: right;"><?php echo translate('İndirim Kodu')?></td>
								<td class="" style="text-align: right; width:15%;"><span class="qfont">-<?php echo wprice($kindirim)?> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
							</tr>
						<?php }?>
						<tr>
							<td class="qfont" style="text-align: right;"><?php echo translate('Genel Toplam')?></td>
							<td class="" style="text-align: right; width:15%;"><span class="qfont"><b><?php echo wprice($gtoplam)?></b> <i class="fa fa-<?php echo strtolower($siparis["t2"]);?>"></i></span></td>
						</tr>
					<?php }?>
				</table>
			</div>
			<div class="p10" style="border: 1px solid lightgrey; margin-top: 15px;">
				<div class="row">
					<div class="col-md-6 col-xs-6">
						<?php if($rsm2["t1"]<>""){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('İlgili')?></b></div>
							<div class="col-md-8 col-xs-6"> : <?php echo $rsm2["t1"]?></div>
						<?php }?>
						<?php if($siparis["t5"]<>""){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('Ödeme Tipi')?></b> </div>
							<div class="col-md-8 col-xs-6"> : <b><?php echo translate("#".$siparis["t5"]);?></b> <?php if($siparis["t5"]=="pos" and $siparis["pb5"]<>0 or $siparis["t5"]=="payu" or $siparis["t5"]=="iyzipay" and $siparis["pb5"]<>0){?> <?php echo $siparis["t10"]?> <?php echo $siparis["t11"]?> Taksit <?php }?></div>
						<?php }?>
						<?php if($f3==1){?>
							<div class="col-md-4 col-xs-6"><b><?php echo translate('Sevkiyat')?></b></div>
							<div class="col-md-8 col-xs-6"> : <b><?php echo $jssi["Order_Cargo"]?></b> <?php if($siparis["t13"]<>""){?><a class="<?php if($f3<>1){echo "dn";}?>" href="<?php echo cargotracking($siparis["t12"],$siparis["t13"])?>" target="_blank"><?php echo $siparis["t13"]?></a><?php }?></div>
						<?php }?>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Sipariş No')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $siparis["t4"]?></div>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Sipariş Tarihi')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo dtarih($siparis["ts1"],"gg ka yy time")?></div>
					</div>
					<div class="col-md-6 col-xs-6" style="padding-left:0px;">
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Müşteri Adı')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $rsm["t1"]?></div>
						<div class="col-md-4 col-xs-6"><b><?php echo translate('Müşteri Telefon')?></b></div>
						<div class="col-md-8 col-xs-6"> : <?php echo $rsm["t4"]?></div>
					</div>
				</div>
			</div>
			<div class="p10" style="border: 1px solid lightgrey; margin-top: 15px;">
				<div class="row">
					<div class="col-md-12">
						<div  class="col-md-6 col-xs-6">
							<b><?php echo translate('Teslimat Adresi')?></b><br>
							<?php echo order_adress($siparis["id"],"delivery")?><br>
						</div>
						<div  class="col-md-6 col-xs-6">
							<b><?php echo translate('Fatura Adresi')?></b><br>
							<?php echo order_adress($siparis["id"],"invoice")?><br>
							<?php echo order_adress($siparis["id"],"invoice","fvdvn")?>
						</div>
						<?php if($_GET["mode"]<>"basic"){?>
							<?php if($siparis["t5"]=="havale"){?>
								<div style="padding: 10px;">
									<b><?php echo translate('Havale/Eft')?></b><br>
									<?php echo $siparis["t10"]?><br>
									<?php echo $banka["n4"]?><br>
									<?php echo $banka["n3"]?>
								</div>
							<?php }elseif($siparis["t5"]=="pos"){?>
								<div style="padding: 10px;">
									<b><?php echo translate('Kredi Kartı')?> (3D)</b><br>
									<?php echo $siparis["t10"]?><br>
									<?php if($siparis["t15"]<>""){?> {XXXX XXXX XXXX <?php echo substr($siparis["t15"], -4)?>}<br><?php }?>
									<?php if($jssi["Order_Installment"]==1){echo "tek çekim";}else{echo $jssi["Order_Installment"]." taksit";}?>
								</div>
							<?php }?>
						<?php }?>
					</div>
				</div>
			</div>
			<table class="table noshadow" style="display:none;">
				<?php
				$arrays = json_decode($siparis["n11"], true);
				foreach($arrays as $key=>$value){
					?>
					<tr>
						<td class="w30 mw50"><b><?php echo $key;?></b></td>
						<td> : <?php echo $value;?></td>
					</tr>
				<?php }?>
			</table>
		</tr>
	</table>
<?php }else{
	header("Content-type: application/vnd.ms-excel");
	$file="".$siparis["t4"].".xls";
	header("Content-type: application/vnd.ms-excel");
	header("Content-Disposition: attachment; filename=".$file."");
	header("Pragma: no-cache");
	header("Expires: 0");
 echo "\xEF\xBB\xBF"; //UTF-8 BOM
 echo $out;
 ?>
 <table style="width:100%;">
 	<thead>
 		<tr>
 			<th><?php echo $t24;?></th>
 			<th style="text-align: right;"><?php echo $sdil[88]; //Birim?></th>
 			<th style="text-align: right;"><?php echo $sdil[86]; //kdv?></th>
 			<th style="text-align: right;"><?php echo $sdil[85]; //Fiyat?></th>
 			<th style="text-align: right;"><?php echo $sdil[144]; //Tutar?></th>
 		</tr>
 	</thead>
 	<tbody>
 		<?php
 		$sqls = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$_GET["id"].""); while($sepet=mysqli_fetch_assoc($sqls)){
 			$sqlu = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and id=".$sepet["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
 			$ufiyat=$sepet["pb1"];
 			?>
 			<tr>
 				<td><?php echo $sepet["n1"]?></td>
 				<td style="text-align: right;"><?php echo $sepet["s2"]?></td>
 				<td style="text-align: right;">% <?php echo $sepet["s4"]?></td>
 				<td style="text-align: right;"><?php echo number_format(($ufiyat),2, ',', '.')?></td>
 				<td style="text-align: right;"><?php echo number_format($ufiyat*$sepet["s2"],2, ',', '.')?></td>
 			</tr>
 		<?php }?>
 	</tbody>
 </table>
 <?php }?>