<?php
 session_start();
  
 $id=$_GET['id'];
 setcookie("id",$id);
 $table="customerpayment";
 include("db.php");
 $info_sql="select * from `$table` where id='$id'";
 $info_query= $db->query($info_sql);
 $row=$info_query ->fetch_array();
 $customer_id=$row['customerId'];
 $id=$row['id'];
 $price=$row['amount'];
 $description=ucfirst($row['description']);
 $date=$row['date'];  
 $voucher_number=$row['f_number'];  
 $transactCurrency=$row['transactCurrency'];   
 $transaction_type=$row['transacttype'];  
//==================find customer
 
 $customer_sql="select * from `customers`  where id='$customer_id'  ";
 $customer_query= $db ->query($customer_sql);
 $row_c=$customer_query->fetch_array();
 $name=$row_c['name'];
 $lname=$row_c['fname'];
 $customer_name=$name."&nbsp;".$lname ;
 
//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: 20px;" class="number" >Marhoom Nazar Mohammad Ghalenoi Exchanger<br><br>Voucher</span></th>
		    <td>	  
				<table border="0" class="number" style="float: right;direction: ltr" >
				<tr>
					<th rowspan="2"><span style="font-size: 13px">Mobail:</span></th>
					<td>
					 <input type="text" size='8'  style="border: hidden;font-weight: bold;direction: ltr" value="0700441500">
					</td>
				</tr>
				<tr>
					<td>
					 <input type="text"  size='8' style="border: hidden;font-weight: bold;direction: ltr" value="0795292400">
					</td>
				</tr>
				<tr>
					<th><span style="font-size: 13px">office Phone:</span></th>
					<td>
					 <input type="text" size='8'  style="border: hidden;font-weight: bold" value="040-225654">
					</td>
				</tr>
				 
				
				</table>
			</td>
		</tr>
		<tr>
			<td   style="width: 293px">
			  <table border="0" width="100%"  >
				   <tr>
					   <td style="width: 60px"><span style="font-size: 13px;font-weight: bold">No:</span></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><span style="font-size: 13px;font-weight: bold">Date:</span></td>
					   <td><input type="text"   style="border: hidden;font-weight: bold " value="<?php echo   $date ?>"></td>
				   </tr>
				   
			  </table>
			
			</td>
			
		</tr>
		</table>
		<table border="1" cellpadding='0' dir='rtl' cellspacing='0' style="margin: 10px auto; width: 870px"  >
		<tr>
			<th style="padding: 4px;width: 218px;background: silver">Description</th>
			
			<th style="padding: 4px;width: 218px;background: silver">Currency</th> 
			<th style="padding: 4px;width: 218px;background: silver">Amount</th>
			
 
			<th style="padding: 4px;width: 218px;background: silver">Customer Name</th> 
		</tr>
			<td style="height: 80px;text-align: center"><input type="text" style="text-align: center;border: hidden" value="<?php echo ucwords($description);   ?>"> </td>
			 
			<td style="height: 80px;text-align: center"><input type="text" style="text-align: center;border: hidden" value="<?php echo ucwords($currency_name);   ?>"></td>
		 
			<td style="height: 80px;text-align: center;font-weight:bold"><?php echo number_format($price,2);   ?></td>
			<td style="height: 80px;text-align: center"><input type="text" style="text-align: center;border: hidden" value="<?php echo ucwords($customer_name);   ?>"></td>
		</tr>
		<tr>
			<td colspan="7"> 
				<table border="0" style="float: left;direction:ltr; " >
				<tr>
				    <td><span style="font-weight: bold">Total Payment:</td>
					<td class="number" style="font-size: 13px;font-weight: bold"><input type="text" style="text-align: center;border: hidden" value="<?php include("ppayment_litter_read.php");   ?>">  </td>
				</tr>
			    </table>
			
			
			</td>
		</tr> 
		</table>
	 
		 
		<table border="0" style="margin: auto; width: 870px;margin-top: 9px;direction: ltr" class="number" >
		 
		<tr>
			<td style="width: 370px;font-weight: bold">customer signature:<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;font-weight: bold">Accountant signature:<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: ltr" class="number" >
		 
			 
		<tr>
		<td><span style="width: 370px;font-weight: bold">Not: With out any stamp and signature is not valid.</span></td>	
		</tr>
		</table>
		<br>
			
	    
	     
	</div>
	
	
	</div>
	
	</div>
</body>
</html>