<?php
 session_start();
  
 $id=$_GET['id'];
 setcookie("id",$id);
 $table="customer_cash_op";
 include("db.php");
 include("jdf.php");
 $info_sql="select * from `customerpayment` where id='$id' ";
 $info_query= $db->query($info_sql);
 $row=$info_query ->fetch_array();
 $date=$row['date'];
 $sender=$row['havale_sender'];
 $reciver=$row['havale_reciver'];
 $havale_no=$row['havale_num'];
 $name=$row['name'];
 $payment_place=$row['payment_place'];
 $transactorId=$row['transactorId'];
 $currencyId=$row['transactCurrency'];
 $amount=$row['amount'];
 $transact_type=$row['transact_type'];
  $type=$row['type'];
 $description=$row['description'];
 $customerId=$row['customerId'];
 $payment_place=$row['payment_place'];
 //change date to miladi
 $explodeDate=explode("-",$date);
 $year_explode  =$explodeDate[0];
 $month_explode =$explodeDate[1];
 $day_explode   =$explodeDate[2];
 
 $miladiDate=jalali_to_gregorian($year_explode,$month_explode,$day_explode,'-');
 //=========customerName=======================================
  $customerName_sql="select * from customers where id='$customerId'";
  $customerName_query= $db ->query($customerName_sql);
  $customerName_row=$customerName_query ->fetch_array();
  $customerName=$customerName_row['name'];
 
 //=========customerName=======================================
    
//==================find customer
 
 $currencyName_sql="select * from `currencies`  where id='$currencyId'  ";
 $currencyName_query= $db ->query($currencyName_sql);
 $currencyNamerow_c=$currencyName_query->fetch_array();
 $currencyName=$currencyNamerow_c['name'];
  
  
?>
<!DOCTYPE html>
<html>
<head>
<title>سند حواله</title>
<style>
body{
     
	margin: 0px;
	padding: 0px;
}
@font-face {
	  font-family: 'number';
	  src: url('font/BHomaAncient.ttf'); /* IE */
      src: local('BHomaAncient'), url('font/BHomaAncient.ttf') format('truetype'); /* non-IE */
      font-weight:normal;
}
.number{
   color: #000;
    font-family: 'number';
    font-size: 15px;	
}
 @font-face {
	  font-family: 'details';
	  src: url('font/DroidNaskh-Regular.otf'); /* IE */
      src: local('DroidNaskh-Regular'), url('font/DroidNaskh-Regular.ttf') format('truetype'); /* non-IE */
      font-weight:normal;
}
.details{
   color: #000;
    font-family: 'details';
    font-size: 20px;	
}
 
 
#wrap{
	width: 400px;
	background: #FFF;
	margin: 0px auto;
	padding-bottom: 20px;
	border: 2px   dashed #000;
}
#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 {

   .dontPrint {
       display:none;
    }

    }
	
	@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'> 
	    <table border="0" width="100%" dir="rtl" style="margin-top: 5px" class="details">
		<tr>
		    <td style="width: 100px"><?php echo $date; ?></td>
		    <td style="text-align: center; font-size: 23px;color: red;width: 200px" ><input type="text" class="details" style="width: 97%;border: hidden;text-align: center;color: red;font-weight: bold" value="کابل"></td>
		    <td style="text-align: left;width: 100px"><?php echo $miladiDate ?></td>
		</tr>
		<tr>
		    <td colspan="3"><hr style="width:70%;text-align:center;margin-top: 15px;border: 3px solid #8c8c8c " ></td>
		<tr>
		<tr>
		    <td style="width: 80px;font-size: 16px">&nbsp;از طرف:</td>
		    <td colspan="2" style="text-align: right;width: 320px;font-size: 16px"><?php echo $sender ?></td>
		</tr>
		
		<tr>
		    <td style="width: 80px;font-size: 16px">&nbsp;برای:</td>
		    <td colspan="2" style="text-align: right;width: 320px;font-size: 16px"><?php echo $reciver ?></td>
		</tr>
		<tr>
		    <td style="width: 80px;font-size: 16px">&nbsp;مبلغ:</td>
		    <td colspan="2" style="text-align: right;width: 320px;color: #80b3ff;font-size: 16px"><?php echo $amount."(".$currencyName.")" ?></td>
		</tr>
		<tr>
		    <td style="width: 80px;font-size: 16px">&nbsp;نمبر حواله:</td>
		    <td colspan="2" style="text-align: right;width: 320px;color: #80b3ff;font-size: 16px"><?php echo $havale_no;?></td>
		</tr>
		<tr>
		    <td style="width: 80px;font-size: 16px">&nbsp;آدرس:</td>
		    <td colspan="2" style="text-align: right;width: 320px;color: #80b3ff">
			<input type="text" class="details" style="width: 97%;border: hidden;;font-size: 15px">
		</td>
		</tr>
		<tr>
		    <td style="width: 80px"><input type="text" class="details" style="width: 97%;border: hidden;font-size: 16px" value="کمیشن:"></td>
		    <td colspan="2" style="text-align: right;width: 320px;color: #80b3ff">
			<input type="text" class="details" style="width: 97%;border: hidden;font-size: 15px">
		</td>
		</tr>
		<tr>
		    <td style="width: 84px"><input type="text" class="details" style="width: 97%;border: hidden;font-size: 15px" value="مبلغ مجموعی:"></td>
		    <td colspan="2" style="text-align: right;width: 320px;color: #80b3ff">
			<input type="text" class="details" style="width: 97%;border: hidden;color: red;font-size: 15px">
		</td>
		</tr>
		<tr>
		    <td style="width: 80px"><input type="text" class="details" style="width: 97%;border: hidden;font-size: 16px" value="نوت:"></td>
		    <td colspan="2"  style="text-align: right;width: 320px;color: #80b3ff;">
			<input type="text" class="details" style="width: 97%;border: hidden;color: red;font-size: 15px">
		</td>
		</tr>
		
		
		
		</table>
	</div>
	 
</body>
</html>