<?php
 session_start();
  
 $id=$_GET['editID'];
 setcookie("id",$id);
 $table="customerpayment";
 include("db.php");
 $info_sql="select * from `transaction` where id='$id'";
 $info_query= $db->query($info_sql);
 $row=$info_query ->fetch_array();
 $date=$row['date'];
 $id=$row['id'];
 $price=$row['amount'];
 $counterAmount=ucfirst($row['counterAmount']);
 $date=$row['date'];  
 $counterCurrency=$row['counterCurrency'];  
 $rate=$row['rate'];   
 $baseAmount=$row['baseAmount'];  
 $baseCurrency=$row['baseCurrency'];  
//==================find customer
 
 $currencyName_sql="select * from `currencies`  where id='$counterCurrency'  ";
 $currencyName_query= $db ->query($currencyName_sql);
 $currencyNamerow_c=$currencyName_query->fetch_array();
 $currencyName=$currencyNamerow_c['name'];
 
 $baseCurrencyName_sql="select * from `currencies`  where id='$baseCurrency'  ";
 $baseCurrencyName_query= $db ->query($baseCurrencyName_sql);
 $baseCurrencyNamerow_c=$baseCurrencyName_query->fetch_array();
 $baseCurrencyName=$baseCurrencyNamerow_c['name'];
 
//currency
 $currency_name_sql="select name from currencies where id='$transactCurrency'";
 $currency_name_query=$db ->query($currency_name_sql);
 $currency_name_row=$currency_name_query->fetch_array();
 $currency_name=$currency_name_row['name']; 
?>
<!DOCTYPE html>
<html>
<head>
<title> </title>
<style>
body{
     
	margin: 0px;
	padding: 0px;
}
@font-face {
	  font-family: 'number';
	  src: url('font/BZar.ttf'); /* IE */
      src: local('BZar-Bold'), url('font/BZar.ttf') format('truetype'); /* non-IE */
      font-weight:normal;
}
.number{
   color: #000;
    font-family: 'number';
    font-size: 20px;	
}
 
 
#wrap{
	width: 900px;
	background: #FFF;
	margin: 0px auto;
	padding-bottom: 20px;
	 border: 1px solid #FFF;
}
#content{
	 width: 880px;
	 background: #FFF;
	 margin: 0px auto;
	 border: 1px solid #FFF;
    
}
#title{
	 width: 880px; 
    border: 2px solid #000;
	margin: auto;
	
	 
}
#space{
    
}
p{
 text-align:center;
}
@media all{
.page-break{display:none;}
}
@media print{
.page-break{display:block;page-break-after:always;}
.dote img {visibility: visible;}
}
 
@page 
{
   size: auto;   /* auto is the initial value */
    margin: 3mm;  /* this affects the margin in the printer settings */
 }
  @media print {
    html, body {
        height: 99%;    
    }
}
</style>
</head>
<body>
	<div id='wrap'>
	<div id="content">
	<div id="space">&nbsp;</div>
	<div id="title">
	
		<table border="0" style="margin: auto; width: 880px">
		
		<tr>
			<td><img src="img/tash.png" width="140px" height="130px"></td>
			<th><span style="text-align: center;font-size: 25px;" class="number" > <?php include("info/companyName.php"); ?><br><br>رسید خرید</span></th>
		    <td>	  
				<table border="0" class="number" style="float: right;direction: rtl" >
				<tr>
					<th rowspan="2">تلفن:</th>
					<td>
					 <input type="text" class="number" style="border: hidden;font-weight: bold;direction: ltr" value="0700441500">
					</td>
					
				</tr>
				<tr>
					<td>
					 <input type="text" class="number" style="border: hidden;font-weight: bold;direction: ltr" value="0795292400">
					</td>
				</tr>
				<tr>
					<th>شماره دیجیتال:</th>
					<td>
					 <input type="text" class="number" style="border: hidden;font-weight: bold" value="040-225654">
					</td>
					</tr>
					<tr>
					<th>&nbsp;</td>
					<td>
					  
					</td>
					
				</tr>
				 
				
				</table>
			</td>
		</tr>
		<tr>
			<td class="number" style="width: 293px">
			  <table border="0" width="100%"  >
				   <tr>
					   <td style="width: 60px">شماره:</td>
					   <td><?php echo"<span style='border-bottom: 1px dashed #000;'>". $id ."</span>" ?></td> 
				   </tr>
				  
			  </table>
			
			</td>
			<td  >&nbsp;</td>
			<td class="number" style="width: 293px">
			  <table border="0"   style="width: 230px;float: right;direction: rtl">
				   <tr>
					   <td>تاریخ</td>
					   <td><input type="text" class="number" style="border: hidden;font-weight: bold " value="<?php echo   $date ?>"></td>
				   </tr>
				   
			  </table>
			
			</td>
			
		</tr>
		</table>
		<table border="1" cellpadding='0' cellspacing='0' style="margin: 10px auto; width: 870px" class="number">
		<tr>
			<th style="padding: 4px;width: 218px;background: silver">مجموع</th>
			<th style="padding: 4px;width: 218px;background: silver">فی</th>
			<th style="padding: 4px;width: 218px;background: silver">نوعیت پول</th> 
			<th style="padding: 4px;width: 218px;background: silver">مبلغ خریداری</th>
			
			 
			<th style="padding: 4px;width: 218px;background: silver">پرداخت کننده</th> 
		</tr>
			<td style="height: 80px;text-align: center"><?php echo number_format($baseAmount)."&nbsp;".$baseCurrencyName   ?></td>
			 
			<td style="height: 80px;text-align: center"><?php echo  number_format($rate,2) ;   ?></td>
		 
			<td style="height: 80px;text-align: center"><?php echo $currencyName;   ?></td>
			<td style="height: 80px;text-align: center"><?php echo number_format($counterAmount);   ?></td>
			<td style="height: 80px;text-align: center"><input type="text" style="border: hidden;text-align: center;font-size: 20px" ></td>
		</tr>
		<tr>
			<!--<td colspan="7"> 
				<table border="0" style="float: right;direction:rtl; " >
				<tr>
				    <td>مجموع پرداختی:</td>
					<td class="number" style="font-size: 13px;font-weight: bold"><?php  include("ppayment_litter_read.php"); ?> </td>
				</tr>
			    </table>
			
			
			</td>-->
		</tr> 
		</table>
	 
		 
		<table border="0" style="margin: auto; width: 870px;margin-top: 9px;direction: rtl" class="number" >
		 
		<tr>
			<td style="width: 370px">امضا دریافت کننده:<input type="text" style="border: hidden;font-weight: bold;border-bottom: 1px dashed #000"> 
									 
			</td>
			<td style="width: 150px">&nbsp;</td>
			<td style="width: 370px">امضاحسابدار:<input type="text" style="border: hidden;font-weight: bold;border-bottom: 1px dashed #000">
				 
				  
			</td> 
		</tr>
		</table>
		<table border="0" style="margin: auto; width: 870px;margin-top: 9px;direction: rtl" class="number" >
		 
			 
		<tr>
		<td>نوت: بدون مهر و امضا قابل اعتبار نیست.</td>	
		</tr>
		</table>
		<br>
			
	    
	     
	</div>
	
	
	</div>
	
	</div>
</body>
</html>