<?php session_start();



if($_SESSION[invcox] == ""){



header("location:login.php?action=need");



}else{







include("config.php");?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">



<head>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />



<title>Arnim Holidays Accounting Software</title>



<link href="style.css" rel="stylesheet" type="text/css" />

 


<SCRIPT LANGUAGE="JavaScript">







<!-- Begin



function popUp(URL) {

day = new Date();
id = day.getTime();



eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=yes,width=950,height=650,left = 100,top = 100');");



}



// End -->



</script>

<style type="text/css">

<!--

.style2 {color: #DC147B;

	font-weight: bold;

}

.style3 {color: #000000}

-->

</style>
<?php include("calendar.php"); ?>
</head>







<body>



<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" class="box-wrap">



  <tr>



    <td><?php include("top.php")?></td>



  </tr>



  <tr>



    <td>&nbsp;</td>



  </tr>



  <tr>



    <td class="center_page_white"><table width="100%" border="0" cellspacing="1" cellpadding="0">



      <tr>



        <td valign="top"><br /></td>



      </tr>



      <tr>



        <td height="30">&nbsp;</td>



      </tr>



      <tr>
        <td align="center" class="round_box"><strong><?php echo $_GET[pay_methode]?></strong> Details <strong><?php echo dtformat($_GET[date1]);?></strong> to <strong><?php echo dtformat($_GET[date2]);?> </strong></td>
      </tr>
  
 
		
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>



        <td class="round_box"><table width="100%" border="0" cellpadding="3" cellspacing="1" class="list_table">
          <tr>
            <th width="7%" align="center" >Sr</th>
            <th width="10%" align="center" >Date</th>
            <th width="4%" align="center" >ID</th>
            <th width="51%" align="center" >Source</th>
            <th width="28%" align="center" >Amount</th>
          </tr>
          <?php 
$ds=$_GET[date1];
$de=$_GET[date2];
	
$pay_methode="and pay_methode='$_GET[pay_methode]' ";
$pay_methode2="and cost_type='$_GET[pay_methode]' ";
		// opening balance -------------    
$opening_balance=0;
	

// opening balance -------------     

		  if($ds!=""){

		  
		  
		$d="and cdate>='$ds' and cdate<='$de' ";}else{$d="";}

		  
 


		 
		  $total=0; 

$fresult=mysql_query("select * from restaurant_transfar WHERE amount!='0'  $d $pay_methode2");
 $frow=mysql_fetch_array($fresult);
 

	if($frow!=""){
	do{
			 $sr=$sr+1;	  ?>
          <tr>
            <td width="7%" align="center" class="link"><?php echo $sr; ?></td>
            <td width="10%" align="center" class="link norwap"><?php echo dtformat($frow[cdate]);?></td>
            <td width="4%" align="center" class="link norwap"><?php echo $frow[id];?></td>
            <td width="51%" align="center" class="link">Transfar to- <?php echo $frow[pay_methode];?></td>
            <td width="28%" align="center" class="link"><?php 


echo number_format($frow[amount]);

$total=$total+$frow[amount];

			?></td>
          </tr>
          <?php 
	
	 }while( $frow=mysql_fetch_array($fresult));
	}
	 

$fresult=mysql_query("select * from restaurant_withdraw WHERE amount!='0'  $d $pay_methode2");
 $frow=mysql_fetch_array($fresult);
 

	if($frow!=""){
	do{
			 $sr=$sr+1;	  ?>
          <tr>
            <td width="7%" align="center" class="link"><?php echo $sr; ?></td>
            <td width="10%" align="center" class="link norwap"><?php echo dtformat($frow[cdate]);?></td>
            <td width="4%" align="center" class="link norwap"><?php echo $frow[id];?></td>
            <td width="51%" align="center" class="link">Withdraw to- <?php echo $frow[cost_type];?></td>
            <td width="28%" align="center" class="link"><?php 


echo number_format($frow[amount]);

$total=$total+$frow[amount];

			?></td>
          </tr>
          <?php 
	
	 }while( $frow=mysql_fetch_array($fresult));
	}
	 
$dc="and restaurant_cost.cdate>='$ds' and restaurant_cost.cdate<='$de' ";
$pay_methodec="and restaurant_cost.pay_methode='$_GET[pay_methode]' ";



	  if($ds!=""){

	 
		$d="and restaurant_cost.cdate>='$ds' and restaurant_cost.cdate<='$de' ";}else{$d="";}
 
 
 
$dresult=mysql_query("SELECT 
    restaurant_cost_type.cost, 
    restaurant_cost.amount,
	restaurant_cost.id,
	restaurant_cost.cost_type,
	restaurant_cost.cdate,
	restaurant_cost.pt
FROM restaurant_cost 
JOIN restaurant_cost_type 
    ON restaurant_cost.cost_type = restaurant_cost_type.id
WHERE restaurant_cost.amount != 0 
    $d $pay_methode
ORDER BY restaurant_cost.cdate ASC");
          $drow=mysql_fetch_array($dresult);
if($drow!=""){
	do{
		$sr=$sr+1;		  ?>
          <tr>
            <td align="center"  class="link"><?php echo $sr; ?></td>
            <td align="center"  class="link norwap"><?php echo dtformat($drow[cdate]);?></td>
            <td align="center"  class="link norwap"><?php echo $drow[id];?></td>
            <td align="center"  class="link"><?php echo $drow[cost];?> - <?php echo $drow[pt];?></td>
            <td align="center"  class="link"><?php echo number_format($drow[amount]);?></td>
          </tr>
          <?php 
$total=$total+$drow[amount];
		
}while($drow=mysql_fetch_array($dresult));
}
				  ?>
          <tr>
            <td colspan="4" align="right"  class="link"><strong>Cash in  Total :</strong></td>
            <td align="center"  class="link"><strong><?php echo number_format($total); ?></strong></td>
          </tr>
        </table></td>



      </tr>
      <tr>
        <td >&nbsp;</td>
      </tr>
      <tr>
        <td class="round_box">&nbsp;</td>
      </tr>



    </table></td>



  </tr>



  <tr>



    <td><?php include("bot.php")?></td>



  </tr>



</table>



</body>



</html>



<?php }?>