<?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>
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
.style3 {
	font-size: 14;
	font-weight: bold;
}
.style11 {	font-size: 18px;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<?php 
		  $dresult=mysql_query("select * from income WHERE id='$_GET[id]'");
		  $drow=mysql_fetch_array($dresult);
		  ?>
<br />
..<br />
<br />
<br />
<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td colspan="3" align="center" bgcolor="#FFFFFF"><span class="style11">Money Receipt </span></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">Serial No</td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF" class="bottom_border"><span class="link"><?php echo $drow[id];?></span></td>
  </tr>
  <tr>
    <td width="28%" bgcolor="#FFFFFF">Date</td>
    <td width="2%" bgcolor="#FFFFFF">:</td>
    <td width="70%" bgcolor="#FFFFFF" class="bottom_border"><span class="link">
      <?php 
			 echo dtformat($drow[cdate]);
			?>
    </span></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">Received with thanks from </td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF" class="bottom_border"><?php echo $krow[rfname]; ?></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">On against of </td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF" class="bottom_border"><span class="link style3">
      <?php 
		  $aresult=mysql_query("select * from income_type WHERE id='$drow[cost_type]' limit 1");
		  $arow=mysql_fetch_array($aresult);
			
			echo $arow[cost]; ?>
      , <span class="link">
        <?php 
			 echo $drow[comments];
			?>
      </span></span></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">The sum of amount </td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF" class="bottom_border"><?php 

			$tamount=$krow[amount];

			if($tamount!="0"){

			$totamo=round($tamount,0);

			$num = new NumberToWord($totamo);

			echo $num->word;

			}else{echo "zero";}

			?>
      Taka Only </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">Pay Methode </td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="26%" class="bottom_border"><span class="link">
          <?php  
			$wresult=mysql_query("select * from bank_deposit 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])";?>
        </span></td>
        <?php if($krow[pay_methode] == 'Paid By'){?>
        <td width="23%"> Check No: </td>
        <td width="21%" class="bottom_border"><?php echo $krow[checkno]; ?></td>
        <td width="8%">Bank:</td>
        <td width="22%" class="bottom_border"><?php echo $krow[bank]; ?>&nbsp;</td>
        <?php }?>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">BDT </td>
    <td bgcolor="#FFFFFF">:</td>
    <td bgcolor="#FFFFFF"><table width="150" cellpadding="0" cellspacing="0" style="border:1px solid #000000;">
      <tr>
        <td height="25" valign="middle" class="smoll"><span 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];
			?>
        </span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="3" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="40" colspan="3"><?php if($krow[pay_methode] == 'Paid By'){echo 'Money Receipt will valid after Cheque Cash';}?></td>
      </tr>
      <tr>
        <td width="29%" align="center">&nbsp;</td>
        <td width="37%" align="center">&nbsp;</td>
        <td width="34%" align="center">On behalf of
          <?php 
			  $result=mysql_query("select * from company order by company asc");
			$row=mysql_fetch_array($result);
			echo $row[company];
			  ?>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<br />
<br />
 ..
</body>
</html>
<?php }?>