<?php include('connection/conn.php');
$id=$_GET['sell_j_id'];
$get="select * from `sell_j`,`customer` where `customer_id`=`sell_j_customer` and `sell_j_id`=$id";
$get_r=$conn->query($get);
$get_row=mysqli_fetch_array($get_r);
$type=$get_row['type'];
$payed=$get_row['payed'];
?>
<html>
	<head>
		<style>
		@media print {body {-webkit-print-color-adjust: exact;}}
		</style>
	</head>
	<body>
		<div style="width:750px;font-family:'nrt';"  id="right">
			<table dir=rtl id="mydiv" height="" width="100%" border=0 style="vertical-align:middle">
				<tr>
					<td >
						<center>
						<img width=100px src="icon/hermes.png">
						</center>
					</td>
					<th style="font-size:50px; color:red" width=85px>Polo</th>
					<td width=50px><img width=50px src="icon/logo2.png"></td>
					<th style="font-size:50px; color:red"width=95px >Aras</th>
					<td >
						<center>
						<img width=100px src="icon/lacoste.png">
						</center>
					</td>
					
				
				</tr>
				<tr>
					<td >
						<center>
						<img width=100px src="icon/prada.png">
						</center>
					</td>
					<th  colspan=3 style="font-size:18px; background-color:skyblue"><br>بۆ فرۆشتنی جلوبەرگی پیاوان بە کۆ<br><br>هەولێر/ بازاڕی داون تاون نهۆمی خوارەوە</th>
					<td >
						<center>
						<img width=100px src="icon/armani.png">
						</center>
					</td>
				
				</tr>
				</table>
				
				
				<table width=100%>
				<tr>
					<th colspan=3>
						<hr>
						ژمارە<?php echo "(".$id.")  ".$get_row['sell_j_date'];?>
					</th>
				</tr>
			</table>
			<table dir=rtl id="mydiv" height="" width="750px" border=0 style="font-size:16pt">
				<tr style="text-align:right" bgcolor="#f0f0f0">
					<th width=350px>کڕیار(<?php echo $get_row['customer_name'];?>)</th>
					<th  width=200px><?php echo $get_row['customer_address'];?></th>
					<th  width=200px><?php echo $get_row['customer_mobile'];?></th>
				</tr>
			</table>
			
			<br>	
			<table id='mydiv' width='700px' dir=rtl align="right">					
				<tr bgcolor="lightblue">
					<td></td>
					<td>کۆد</td><td>ژمارەی سێت</td><td>ژمارە</td>
					<td>نرخ</td>
					
					<td>تۆتاڵ</td>
				</tr>
				<?php 
				$count=1;
				$sum=0;
				$gett=$conn->query("select * from `sell_j_item`,`items` where `sell_j_i_code`=`code` and `sell_j`=$id ");
				while($get_row=mysqli_fetch_array($gett)){ ?>
				<tr>
					<td><?php echo $count; $count++;?></td>
					<td><?php echo $get_row['sell_j_i_code'];?> - <?php echo $get_row['name'];?><br><?php echo $get_row['sell_j_i_note'];?></td><td><?php echo $n=$get_row['sell_j_i_set'];?></td><td><?php echo $n=$get_row['sell_j_i_number'];?></td>
					<td><?php echo number_format($p=$get_row['sell_j_i_price'],2);?>$</td>
					
					<td><?php echo number_format($t=$p*$n,2); $sum+=$t;?>$</td>
				</tr>
				<?php }?>
				<tr bgcolor="lightgrey">
					<td></td>
					<td colspan=3></td>
					<td > کۆی گشتی</td>
					<td><?php echo number_format($sum,2);?>$</td>
				</tr>
				<tr bgcolor="lightgrey">
					<td></td>
					<td colspan=3></td>
					<td >واصلکراو</td>
					<td><?php echo number_format($payed,2);?>$</td>
				</tr>
				<tr bgcolor="lightgrey">
					<td></td>
					<td colspan=3></td>
					<td >باقی پسووڵە</td>
					<td><?php echo number_format($sum-$payed,2);?>$</td>
				</tr>
			</table>
			<br><br><br><br><br>
			<?php if($payed==0){?><h1 style="text-align:center; color:red">غیر واصل</h1> <?php } ?>
			<br><br><br>
			<table width=100%>
				<tr>
					<th>واژووی ژمێریار</th>
				</tr>
			</table>
			<br><br>
			<table width=100%>
				<tr style="font-size:10pt" bgcolor="#f0f0f0">
					<th width=60%>07504529902 - 07504686054</th>
					<th width=40%>info@araspolo.com</th>
				</tr>
			</table>
		</div>
	</body>
</html>


