<?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 -->







function cash(i){



document.getElementById('Cheque').style.display = 'none';



document.getElementById(i).style.display = 'block';



}



</script>


<?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><table width="100%" border="0" cellspacing="0" cellpadding="0">



      <tr>



        <td height="30" background="images/place_bg.jpg" class="link2"><strong>&nbsp;&nbsp;<a href="index.php">Home</a> &gt; <a href="accounts.php">Accounts &gt; </a>  Edit Income</strong></td>



      </tr>



    </table></td>



  </tr>



  <tr>



    <td>&nbsp;</td>



  </tr>



  <tr>



    <td align="center" valign="top" class="round_box"><form action="update_income.php" method="post" enctype="multipart/form-data" name="form1" id="form1">



      <span class="red"><strong><?php if($_GET[info] == 'y'){echo 'Added Successfully';}?></strong></span>



      <table width="100%" border="0" cellpadding="2" cellspacing="1" >



        <tr>



          <td width="9%" ><strong>Edit Income</strong></td>



          <td width="91%" >&nbsp;</td>
          </tr>



<?php 



$dresult=mysql_query("select * from income WHERE id='$_GET[id]' limit 1");

$drow=mysql_fetch_array($dresult);



?>



        <tr>
          
          
          
          <td width="9%" height="30" >Income Type </td>
          
          
          
          <td width="91%" height="30"  class="input200"><select name="cost_type" id="cost_type">
            <?php 



		  $result=mysql_query("select * from income_type order by id asc");



		  $row=mysql_fetch_array($result);



		  do{



		  ?>
            <option value="<?php echo $row[id]; ?>"  <?php if($drow[cost_type] == "$row[id]"){echo 'selected="selected"';}?>><?php echo $row[cost]; ?></option>
            <?php 



		  }while($row=mysql_fetch_array($result));



		  ?>
          </select></td>
          
          </tr>
        <tr>
          <td height="30" >Recieved From </td>
          <td height="30"  class="input200"><input name="pt" type="text" id="pt" value="<?php echo $drow[pt];?>" size="20" /></td>
          </tr>
        <tr>
          <td height="30" >Amount</td>
          <td height="30"  class="input200"><input name="amount" type="text" id="amount" value="<?php echo $drow[amount];?>" size="15" /></td>
          </tr>
        <tr>
          <td height="30" >Date</td>
          <td height="30"  class="input200"> 
            <table width="180" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="70%"><input name="cdate" type="text" id="cdate" size="15"  value="<?php echo dtformat($drow[cdate]);?>" required="required"/></td>
                <td width="30%" align="center"><a title="Calendar" onclick="displayDatePicker('cdate', this);" href="javascript:;"><img src="images/calendar.gif" width="20" height="20" border="0" /></a></td>
                </tr>
            </table></td>
          </tr>
        <tr>
          <td height="30" > Comments</td>
          <td height="30"  class="input200"><input name="comments" type="text" id="comments" value="<?php echo $drow[comments];?>" />
            <input name="id" type="hidden" id="id" value="<?php echo $drow[id]?>" /></td>
          </tr>
        <tr>
          <td height="30" >Pay Method</td>
          <td height="30"  class="input200"><span class="input200">
           <select name="pay_methode" id="pay_methode">
<?php 
$rresult=mysql_query("select * from bank_acc order by bank asc");
$rrow=mysql_fetch_array($rresult);
do{
	?>
		<option value="<?php echo $rrow[bank];?> - <?php echo $rrow[accname];?> - <?php echo $rrow[accno];?>" <?php if($drow[pay_methode] == "$rrow[bank] -  $rrow[accname] - $rrow[accno]"){echo 'selected="selected"';}?>><?php echo $rrow[bank];?> - <?php echo $rrow[accname];?> - <?php echo $rrow[accno];?></option>
<?php }while($rrow=mysql_fetch_array($rresult));?>
                           
                        </select>
			  
			
          </span></td>
          </tr>
        <tr>
          <td height="30" >&nbsp;</td>
          <td height="30" ><input name="Update" type="submit" id="Update" value="Update" /></td>
          </tr>

      </table>



    </form></td>



  </tr>



  <tr>



    <td >&nbsp;</td>



  </tr>



  <tr>



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



  </tr>



</table>



</body>

</html>



<?php }?>