<?PHP 
include("header.php");
include "checksession.php";
include "include/db-connect.php";
?>
  <div id="content">
  <div class="breadcrumb">
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png"/> Cash Balance</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:93%; margin-left:70px;">
  <table class="list" cellspacing="0" > 
			<thead> 
                 <tr>
                <td class="left">Date</td> 
   				<td class="left">Opening Cash</td>
                <td class="left">Collection</td>
                <td class="left">Expense</td> 
                <td class="left">Closing Cash</td> 
              </tr>
              </thead>
			<tbody> 
      <?php 
			$start_date=$_REQUEST['sdate'];
        	$end_date=$_REQUEST['edate'];

		$qur="SELECT * FROM ".$CASH." WHERE `cash_date` Between '$start_date' and '$end_date' order by `id` desc"; 
		$result = mysql_query($qur)or die('Have an error in viewing data'.mysql_error());
		while ($row_section = mysql_fetch_array($result)) 
			{
			  		 $cash_date= $row_section['cash_date'];
				   $open_cash= $row_section['open_cash'];
				   $collection= $row_section['collection'];
					$expense= $row_section['expense'];
					$close_cash= $row_section['close_cash'];
			  ?>	    
			    <tr> 
				<td class="left"><?php echo $cash_date; ?> </td>
                <td class="left"><?php echo $open_cash; ?> </td>
                <td class="left"><?php echo $collection; ?> </td>
                <td class="left"><?php echo $expense; ?> </td>
                <td class="left"><?php echo $close_cash; ?> </td>
				</tr> 	 
<?php } ?> 
			</tbody> 
			</table>
        </div>
      </div>
                </div></div>
 				</form>
      </div></div></div>
    </div>
  </div>
</div>
</div>
<?  include("footer.php"); ?>