<?php
 session_start();
  
 $id=$_GET['id'];
 setcookie("id",$id);
 $table="customer_cash_op";
 include("db.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'];
 $transacttype=$row['transacttype'];
 //=========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: 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: 500px; 
    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'>
	<div id="content">
	<div id="space">&nbsp;</div>
	<div id="title">
	
		<table border="0" style="margin: auto; width: 500px" dir="rtl">
		
		<tr>
			<td style="width: 126px"> 
			     <table border="0" dir="rlt" class="details">
				 <tr>
				     <td rowspan="3" style="font-size: 13px">تلفن</td>
				 </tr>
				 <tr>
				     <td style="font-size: 13px">0700401404</td>
				 </tr>
				 <tr>
				     <td style="font-size: 13px">0707070757</td>
				 </tr>
				 </table>
			</td>
			<th style="font-weight: bold;width: 272px"><span style="text-align: center;font-size: 13px;" class="details" > <?php include("info/companyName.php"); ?><br><br>چک اسعار خزانه</span></th>
		    <td style="width:100px"></td>	  
				 
			
		</tr>
		 
		</table>
		<table border="0" style="500px" dir="rtl" class="details">
        <tr>
            <td style="width: 166px;font-size: 16px">تاریخ:<?php echo   $date ?></td>
            <td style="width: 166px;font-size: 16px"></td>
            <td style="width: 166px;font-size: 16px">شماره:<?php echo   $id ?></td>
        </tr>
        </table>		
		<!--===================================================================================================-->
		<table border="1" cellpadding='0' cellspacing='0' style="margin: 10px auto; width: 500px;font-size: 14px" class="details">
		<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> 
		</tr>
			  
			<td style="height: 80px;text-align: center;font-size: 17px" class="number"><?php echo  $description ;   ?></td>
		 
			 
			<td style="height: 80px;text-align: center;font-size: 17px" class="number" dir='rtl'><?php echo number_format($amount)."&nbsp;"; echo $currencyName;   ?></td>
			<td style="height: 80px;text-align: center;" dir="rtl" >
			 <input type="text" value="<?php if($transacttype==1){ echo "رسید شده به".$customerName; }?>" style="border:hidden;font-size: 17px;">
			 <input type="text" value="<?php if($transacttype==2){ echo "بردگی شد از".$customerName; }?>" style="border:hidden;font-size: 17px">
			</td>
		</tr>
		<tr>
			 
		</tr> 
		</table>
	 
		 
		<table border="0" style="margin: auto; width: 500px;margin-top: 9px;direction: rtl;font-size: 14px" class="details" >
		 
		<tr>
			<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: 500px;margin-top: 9px;direction: rtl;font-size: 14px" class="details" > 
		<tr>
		   <td>  <input name='submit' src='img/prent.png' type='image' border='0'  style='width:40px; height:40px'  title='Print'     class='dontPrint' onclick='window.print();return false;'/> </td>
		</tr>
        </table>		
	     
	</div>
	
	
	</div>
	
	</div>
</body>
</html>