<?php
$path="../../";
include("../../map.php");
include("../../scripts.php");
$sqlo = mysqli_query($conn, "select * from eticaret where ne='siparis' and id=".$_GET["id"].""); $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);
$jsml=json_decode($rsm["n16"],true);
$jsmi=json_decode($rsm["n17"],true);
$path="../../";
include("../ecommerce/ecommerce_addition_calc.php");
?>
<style>
	td {height:24px}
	table {width:100%;}
	.uinfo tr td:nth-child(1) {width:25%;}
	.uinfo tr td:nth-child(2) {text-align:right;}
</style>
<div style="cursor:pointer; position:absolute; right:10px; margin-top:5px;" title="Sipariş Yazdır" onclick="divyaz('ysiparis')" class="btn btn-success noprint"><i class="fa fa-print"></i></div>
<div id="ysiparis">
<table class="uinfo noshadow" style="font-size:12px;">
<tr>
	<td><?php echo $sdil[115]; //Tarih?></td> <td colspan=2><?php echo $siparis["ts1"]?></td>
</tr>
<tr>
	<td><?php echo $sdil[143]; //Sipariş No?></td> <td colspan=2><?php echo $siparis["t4"]?></td>
</tr>
<tr>
	<td colspan="2"><hr style="margin: 5px;"></td>
</tr>
<tr>
<?php if($h5<>1){?>
	<td><?php echo $t25s[0]; //Müşteri?></td> <td colspan=2><?php echo $rsm["t1"]?></td>
</tr>
<tr>
	<td><?php echo $sdil[96]; //Telefon?></td> <td colspan=2><?php echo $rsm["t4"]?></td>
</tr>
<tr>
	<td><?php echo $sdil[98]; //Konum?></td> <td colspan=2><?php echo loc($jsml["sehir"])?> / <?php echo loc($jsml["ilce"])?></td>
</tr>
<tr>
	<td><?php echo $sdil[105]; //Adres?></td> <td colspan=2><?php echo $rsm["n5"]?></td>
</tr>
</table>
<table class="odetail" style="font-size:12px;">
<?php
}else{
	$sqla=mysqli_query($conn, "select * from t1 where ne='adress' and t2='".$_SESSION['lang']."' and id=".$siparis["s11"].""); $adress=mysqli_fetch_assoc($sqla);
	echo "<tr><td>".$t25s[0]."</td> <td colspan=2>(".$adress["n1"].") ".$adress["n2"]."</td></tr>";
	echo "<tr><td>".$sdil[96]."</td> <td colspan=2>".$adress["n7"]."</td></tr>";
	echo "<tr><td>".$sdil[98]."</td> <td colspan=2>".loc($adress["n3"])." / "; echo "".loc($adress["n4"])." / "; echo "".loc($adress["n5"])."</td></tr>";
	echo "<tr><td>".$sdil[105]."</td> <td colspan=2>".$adress["n6"]."</td></tr>";
}
?>
<tr>
	<td colspan="2"><hr style="margin: 5px;"></td>
</tr>
<?php
				$sqls = mysqli_query($conn, "select * from eticaret where ne='sepet' and s5=".$_GET["id"].""); while($siparissep=mysqli_fetch_assoc($sqls)){
					$sqlu = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' and id=".$siparissep["s3"].""); $rsu=mysqli_fetch_assoc($sqlu);
					if($siparis["t5"]=="pos" and $siparis["pb5"]<>0 or $siparis["t5"]=="payu" and $siparis["pb5"]<>0){
						if($s11==1){
							$ufiyat=($siparissep["pb1"]/((100+$siparissep["s4"])/100))*((100+$siparis["pb5"])/100);
						}else{
							$ufiyat=$siparissep["pb1"]*((100+$siparis["pb5"])/100);
						}
					}else{
						if($s11==1){
							$ufiyat=$siparissep["pb1"]/((100+$siparissep["s4"])/100);
						}else{
							$ufiyat=$siparissep["pb1"];
						}
					}
?>
<tr>
<td><?php echo $siparissep["n1"]?><br><?php echo $siparissep["n2"]?></td><td><center>X<?php echo $siparissep["s2"]?></center></td> <td style="text-align:right"><?php echo number_format($ufiyat*$siparissep["s2"],2)?></td>
</tr>
<?php }?>
<tr>
	<td colspan="2"><hr style="margin: 5px;"></td>
</tr>
<tr>
<td><?php echo $sdil[102]; //indirim?> %<?php echo intval($siparis["pb3"]*100)-100?></td><td colspan=2 style="text-align:right"><?php echo number_format(($indirim),2)?></td>
</tr>
<tr>
<td><?php echo $sdil[176]; //G.Toplam?></td><td colspan=2 style="text-align:right"><?php echo number_format(($gtoplam),2)?></td>
</tr>
<tr>
<td colspan="3"><center><?php echo translate("Teşekkürler");?><center></td>
</tr>
<tr>
<td colspan="3"><center><img src="../barcode/line/?f=svg&s=ean-128&d=<?php echo $siparis["t4"]?>" style="max-width:100%;"><center></td>
</tr>
</table>
</div>