<?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: 'font';
	  src: url('../font/DroidNaskh-Regular.ttf'); /* IE */
      src: local('DroidNaskh-Regular'), url('../font/DroidNaskh-Regular.ttf') format('truetype'); /* non-IE */
      font-weight:normal;
}
.font{
   color: #000;
    font-family: 'font';
     
}
 
 
#wrap{
	width: 900px;
	background: #FFF;
	margin: 1px auto;
	padding-bottom: 20px;
	 border: 2px solid #000;
}
#content{
	 width: 880px;
	 background: #FFF;
	 margin: 0px auto;
	 border: 1px solid #FFF;
    
}
#title{
	width: 900px; 
    border: 2px solid #000;
	margin: auto;
	border-top: 0px;
	border-right: 0px;
	border-left: 0px;
	height: 135px;
	
	 
}
#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="title"> 
			        <div   style="width:150px;border: 0px solid #000;float:left"> </div>
			        <div   style="width:500px;border: 0px solid #000;float: left"> 
					    <table border="0" style="width: 100%">
						<tr>
						    <td class="font" style="text-align:center"><h3><?php  include("../info/companyName.php"); ?></h3>
							<h3>رسید از تسلیم پولی</h3></td>
						  
						</tr>
						</table>
					</div>
			        <div   style="width:240px;border: 0px solid #000;float: left"> 
					    <table border="0" style="float: right" dir="rtl">
						    <tr>
							   <th rowspan="2" class="font"> تلفن:</th>
							    <td style="width: 40px; ">
								  <input type="text" class="number" style="border: hidden;font-weight: bold;direction: ltr;text-align: right" size= "7" value="0700401404">
								</td>
							</tr>
							<tr>
									<td style="width: 40px;">
									 <input type="text" class="number" style="border: hidden;font-weight: bold;direction: ltr;text-align: right" value="0402222972">
									</td>
							</tr>
						    
						</table>
					
					</div>
			         
			
			</div>
	       <div id="data" width="100%" style="height: 20px"> 
		            <table border="0" style="float: right" dir="rtl">
				    <tr>
					   <td class="font" style="font-size: 14px">تاریخ</td>
					   <td><input type="text" class="number" style="border: hidden;font-weight: bold " value="<?php echo   $date ?>"></td>
				    </tr>
				    </table>
				  <table style="float: left">
				    <tr>
					  
					   <td><?php echo"<span style='border-bottom: 1px dashed #000;'>". $id ."</span>" ?></td> 
				        <td style="width: 60px" class="font" dir="rtl">شماره:</td>
					</tr>
				  </table>
				  
		   </div>
		   <div id="content" style="width: 100%;border: 2px solid #000;height: 235px;margin-top: 10px;border-right: 0px;border-left: 0px;border-bottom: 0px"> 
		    <table border="1" cellpadding='0' cellspacing='0' style="margin: 10px auto; width: 870px" class="font">
		<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> 
		</tr>
			<td style="height: 80px;text-align: center"><?php echo ucwords($description)   ?></td>
			 
			<td style="height: 80px;text-align: center"><?php echo  $currency_name ;   ?></td>
		 
			<td style="height: 80px;text-align: center"><?php echo number_format($price);   ?></td>
			<td style="height: 80px;text-align: center"><?php echo ucwords($customer_name);   ?></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" class="font">امضا دریافت کننده:<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" class="font">امضاحسابدار:<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 class="font" style="font-size: 11px;font-weight: bold">سند موجود اعتبار پولی ندارد و صرف جهت اطلاعات می باشد</td>	
		</tr>
		</table>
		   
		   
		   
		   </div>
	</div>
</body>
</html>