<?php
session_start();
include("pdate.php");
  $date=pdate("Y-m-d");
  $otherdate=date("Y-m-d");
 $newdate = strtotime ( '-1 day' , strtotime ($otherdate) ) ;
 $previousDate = pdate ( 'Y-m-d' , $newdate );
  
  
/* $newdate = strtotime ( '-1 day' , strtotime ( $date ) ) ;
echo $newdate = pdate ( 'Y/m/j' , $newdate );   */
?>
 <!DOCTYPE html>
<html>
	<head>
	<link href="css/fontstyle.css" rel="stylesheet" type="text/css"/>	 
	<title>تفصیلات روزانــه</title>
	</head>
	<body>
	 <!--<form method="post" action="">
		<table border="0" align="center"  dir="rtl">
			<tr>
				<th>تــاریخ:</td>
				<td style="direction:ltr"><input type="text" class='font' name="date" value=' <?php   echo  $pdate = pdate("Y-m-d");   ?>'>
				<td><input type="submit" name="submit" class='font' value=" جستـجــــوی ">
			</tr>
		</table>
	</form>-->
	
		<?php
		include("payable_Receivable_Account.php");
		include("payable_Receivable_AccountDollar.php");
		
		$allDollarPayable;
	    
		$allDollarRecivable;
	  
		$differentPaybaleAccount=$all_totaldollarPayable-$allDollarPayable;
		 
		$differentReciveableAccount=(-$all_totaldollarRecivable)-(-$allDollarRecivable);
	     
		$customer_CyrcleAccount=$differentPaybaleAccount-$differentReciveableAccount;
	 
		include("payable_Receivable_AccountCustomerSeal.php");
		 //========================================================
		       $different_Asset_now_sql="select totalAsset from dailyprofit where date='$date'";
		       $different_Asset_now_query=$db-> query($different_Asset_now_sql);
			   $different_Asset_now_Row=$different_Asset_now_query->fetch_array();
			   $different_Asset_now=$different_Asset_now_Row['totalAsset'];
		        
		 //========================================================
	    //========================================================
		       $different_Asset_yesterday_sql="select totalAsset from dailyprofit where date='$previousDate'";
		       $different_Asset_yesterday_query=$db-> query($different_Asset_yesterday_sql);
			   $different_Asset_yesterday_Row=$different_Asset_yesterday_query->fetch_array();
			   $different_Asset_yesterday=$different_Asset_yesterday_Row['totalAsset'];
		 
		 //========================================================
	    $dayDifferents=$different_Asset_now-$different_Asset_yesterday;
         //=======================================================
		 echo "<table border='1' class='fotntitle' width='700px' dir='rtl' cellpadding='0' cellspacing='0'>
		      <tr>
			      <td style='text-align: center' colspan='2' >
				   <h3 class='fotntitle'> تفصیلات روز</h3>
				   <h3 class='fotntitle'>مــــورخ</h3>
				   <h3>". $date."</h3>
				  
				  </td>
			  </tr>
			 
			  <tr>
					 
			  </tr>
			  
			   
			  	  
			  <tr>
			      <td > 
				  <ul>
				     <li class='fotntitle'><a href='payable_Receivable_AccountCustomerSealDetails.php?date=$date & treatment=1' ' target='_'>خریدو فروش مشتریان</a></li>
				     
				    
				  </ul>
				  </td>
				  <td>
                   <ul>				  
				     <li class='fotntitle'><a href='payable_Receivable_AccountCustomerSealDetails.php?date=$date & treatment=1' ' target='_'>".number_format($customer_Buy_Sale,2)."</a></li>
				     
				      
				  </ul>
				  </td>
			  </tr>
			   <tr>
			      <td> 
				   <ul>
				      <li class='fotntitle'>
					    حساب در گردش مشتریان
					  </li>
					</ul>
					  </td>
			      <td> 
				     <ul>
				      <li style='color: #003366;font-weight: bold'>
					      ".number_format($customer_CyrcleAccount,2)."  
						 
					  </li>
					</ul>
				  
				  </td>
			  </tr > <tr>
			      <td> 
				   <ul>
				      <li class='fotntitle'>
					   تفاوت در نقدینگی نسبت به روز گذشته
					  </li>
					</ul>
					  </td>
			      <td> 
				     <ul>
				      <li style='color: #003366;font-weight: bold'>
					      ".number_format($dayDifferents,2)."  
						 
					  </li>
					</ul>
				  
				  </td>
			  </tr ></table>";
			   
		//}	  
		 
?>
</div>
 
</div>
</body>
</html>