<?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=700,height=500,left = 100,top = 100');");
}
// End -->
</script>
</head>

<body>
<?php 
		  $dresult=mysql_query("select * from cost WHERE id='$_GET[id]'");
		  $drow=mysql_fetch_array($dresult);
		  ?>
<br />
..<br />
<br />
<br />
<table width="95%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#999999">
  <tr>
    <td width="30%" align="left" >Cost Type </td>
    <td width="70%" align="left" ><span class="link">
      <?php 
		  $aresult=mysql_query("select * from cost_type WHERE id='$drow[cost_type]' limit 1");
		  $arow=mysql_fetch_array($aresult);
			
			echo $arow[cost]; ?>
    </span></td>
  </tr>

  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Paid To </td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php echo $drow[pt]; ?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Total Cost</td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php 
			 /*$bresult=mysql_query("select SUM(amount) as amount from cost WHERE cost_type='$drow[cost_type]' and dt='$dt'");
		 	 $brow=mysql_fetch_array($bresult);*/
			 echo $drow[amount];
			 $total=$total+$drow[amount];
			?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Date</td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php 
			 echo dtformat($drow[cdate]);
			?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Comments</td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php 
			 echo $drow[comments];
			?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Pay Method </td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php  echo $drow[pay_methode];?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Pay From Account </td>
    <td align="left" bgcolor="#FFFFFF" class="link"><?php  
			$wresult=mysql_query("select * from bank_widrow WHERE id='$drow[chid]'");
		    $wrow=mysql_fetch_array($wresult);
			
			$gresult=mysql_query("select * from bank_acc WHERE id='$wrow[acc_no]'");
		    $grow=mysql_fetch_array($gresult);
		    echo $grow[accname]." ($grow[accno])";?></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#FFFFFF" class="link">Debited Trx ID</td>
    <td align="left" bgcolor="#FFFFFF" class="link">&nbsp;</td>
  </tr>
</table>
<br />
<br />
..
</body>
</html>
<script language="javascript">

window.print();

</script>
<?php }?>