<?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: 700px;font-size: 14px;font-weight: bold">
			 
			 <ul>
			 <table border="0" width="600px" style="line-height: 40px">
			

			<?php
			$date=$_GET['date'];
			echo" <tr>
				<td  colspan='3' style='font-size: 25px;font-weight: bold'>جــزئیـات مصـارف بـه تـاریـخ&nbsp;$date</td>
			</tr>";
			
			
			
			              
					     $consume_sql="SELECT * FROM others WHERE  typeOthers='1' and date='$date' ";
						 $consume_query= $db ->query($consume_sql);
						 while($consume_row=$consume_query ->fetch_array()){
						         $expensesId=$consume_row['expensesId'];
						         $currencyId=$consume_row['currencyId'];
						         $amount=$consume_row['amount'];
		     
						    //=========================================
							    $currencyName_sql="select * from currencies where id='$currencyId'";
								$currencyName_query= $db ->query($currencyName_sql);
								$currencyName_row=$currencyName_query ->fetch_array();
								$currencyName=$currencyName_row['name'];
													  
						    //=========================================
							//=========================================
							    $expencesName_sql="select * from expensesname where id='$expensesId'  ";
								$expencesName_query= $db ->query($expencesName_sql);
								$expencesName_row=$expencesName_query ->fetch_array();
								$expencesName=$expencesName_row['name'];
													  
						    //=========================================
						          
						  echo "
						  
						    <tr>
								<td style='width: 200px'><li>$expencesName-($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>