<?php 
session_start();
include('db.php'); 
 
  

?>
<title> جزئیات بردگی های مشتریان</title>
<link href="css/fontstyle.css" rel="stylesheet" type="text/css"/>	
<div align="center"  ><h1 class='fotntitle'>صـــرافی حـــاجـــی عبـــدالحکیــــــم وبـــرادران</h1></div>
<div>
   <fieldset  dir='rtl' style="border: 1px solid #000;font-size: 16px;font-weight: bold">
  <legend class='fotntitle'>جـزئیــات بــردگیـــهای مشتــــریــان</legend>
 

  <blockquote class='fotntitle' dir='rtl' style="border: 1px solid #000;width: 900px;font-size: 14px;font-weight: bold">
			 
			 <ul>
			 <table border="0" width="800px" style="line-height: 40px">
			

			<?php
			$date=$_GET['date'];
			echo" <tr>
				<td  colspan='3' style='font-size: 25px;font-weight: bold'>جزئیات بـردگیهای مشتـریـان بـه تـاریـخ&nbsp;$date</td>
			</tr>";
			
			
			
			              
					     $customer_debit_sql="SELECT * FROM customerpayment WHERE  transacttype='2' and date='$date' and customersell_id='0' ";
		                 $customer_debit_query= $db ->query($customer_debit_sql);
				        while($customer_debit_row=$customer_debit_query ->fetch_array()){
		         
						          $customerId=$customer_debit_row['customerId'];
						          $amount    =$customer_debit_row['amount'];
						          $transactCurrency    =$customer_debit_row['transactCurrency'];
						    //=========================================
							    $currencyName_sql="select * from currencies where id='$transactCurrency'  ";
								$currencyName_query= $db ->query($currencyName_sql);
								$currencyName_row=$currencyName_query ->fetch_array();
								$currencyName=$currencyName_row['name'];
													  
						    //=========================================
							//=========================================
							    $customerName_sql="select * from customers where id='$customerId'  ";
								$customerName_query= $db ->query($customerName_sql);
								$customerName_row=$customerName_query ->fetch_array();
								$customerName=$customerName_row['name'];
													  
						    //=========================================
						          
						  echo "
						  
						    <tr>
								<td style='width: 200px'><li>$customerName-($currencyName)</li></td>
								<td style='width: 300px'><hr style='height:1px;border:none;color:#333;background-color:#333;'></td>
								<td style='width: 100px;text-align: right'>".number_format($amount,2)." </td>
							</tr>";
						  
						  
						   
						  
						  
						  
						  
						  
						  }

                          
						  


					    
			?>
	
		
			 
			  
			 
			 
			 
							
			 
			</table>
			</ul>
			
		</blockquote>
		 
	  
	</table>
	</fieldset>
	</div>