<?php
if($_REQUEST['save'])
{
	//print_r($_REQUEST); exit;
	if($_REQUEST['sub_retention_posting']['payment_mode']!='')
	
	{	
			
			extract($_REQUEST['sub_retention_posting']);
			
		if($s->RecordInsert('sub_retention_posting',$_REQUEST['sub_retention_posting']))
		{
		
		}
				unset($_REQUEST['sub_retention_posting']);	
				//print_r($_REQUEST); exit;
				$_SESSION['success_msg']="Saved Successfully";	
				echo "<script>location.href='index.php?route=SubContractors/retentionRelease/retention_release_posting_index&modid=".$_REQUEST['modid']."&frmid=".$_REQUEST['frmid']."'</script>";

	}
	else
	{
		echo "<script>alert('Try Again');</script>";
	}

}


	if($_REQUEST['action']=='edit' && !empty($_REQUEST['ret']))
	{	
		$recEdit=DB_fetch_array($s->GetRecordById('sub_retention_posting','id='.$_REQUEST['ret']));
		extract($recEdit);
		
	}

if(isset($_REQUEST['update']))
{
		
	 $s->RecordEdit('sub_retention_posting',$_REQUEST['sub_retention_posting'],"id=".$_REQUEST['ret']);
		$_SESSION['success_msg']="Update Successfully";
		
		echo "<script>location.href='index.php?route=SubContractors/retentionRelease/retention_release_posting_index&modid=".$_REQUEST['modid']."&frmid=".$_REQUEST['frmid']."'</script>";
}



?>
<h3>Retention Release Posting</h3>
<form action="" method="post">


<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td><table width="80%" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td width="12%" class="label"><strong>Cash</strong></td>
        <td width="26%"><input type="radio" name="sub_retention_posting[payment_mode]" value="Cash" <?php if($payment_mode=='Cash'){ echo "checked"; }?> /></td>
		<td><strong>Cheque</strong></td>
		<td><input type="radio" name="sub_retention_posting[payment_mode]" value="Cheque" <?php if($payment_mode=='Cheque') {echo "checked"; }?> /></td>
      </tr>
	  <tr>
        <td width="12%" class="label"><strong>Cash / Bank . </strong></td>
        <td width="26%"><select name="sub_retention_posting[cash_bank]" id="cash_bank">
          <option value="">Select Voucher Date</option>
        </select>
		</td>
		 <td width="24%" class="label"><strong>Voucher Date </strong></td>
        <td width="38%"><select name="sub_retention_posting[voucher_date]" id="voucher_date">
          <option value="">Select Voucher Date</option>
        </select></td>
      </tr>
    </table>
	<br />
	
	
	<table width="100%" border="0" cellspacing="2" cellpadding="2" >
      <tr class="label">
        <td width="8%" height="65"><strong>Select</strong></td>
        <td width="9%"><strong>Contractor Name  </strong></td>
        <td width="9%"><strong>Retention Req No. . </strong></td>
        <td width="10%"><strong>Retention Req Date </strong></td>
        <td width="10%"><strong>Retention Amount </strong></td>
        <td width="11%"><strong>e Amount </strong></td>
       
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        
      </tr>
	
    </table>
	
	</td>
  </tr>
</table>
<p align="center"> <input type="submit" value="Save" name="<?php if($_REQUEST['action']=='edit') echo 'update'; else echo 'save'; ?>"><input type="reset" name="cancel" value="Reset" /><a href="index.php?route=SubContractors/retentionRelease/retention_release_posting_index&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>"><input type="button" name="back" value="Cancel" /></a></p>
</form>