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

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

}


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

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



?>
<style>
.label{
background-color: #B7B7B7;
    color: #000000;
    font-size: 10.5px;
    font-weight: bold !important;
    padding: 5px 10px;
    text-align: left;
}
</style>
<h1> Other Addition Master</h1>
<div align="center">
<form action="" method="post">
<table width="70%" border="0" cellspacing="2" cellpadding="2" align="center"><tr><td>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
  <td width="39%" class="label"><strong>Other Addition Name  <font color="#FF0000" size="3"> * </font> </strong></td>
    <td width="61%"><input type="text" name="sub_other_addition_master[other_addition_name]" id="other_addition_name" value="<?php echo $other_addition_name;?>" size="30" /></td>
  </tr>
  <tr>
   <td width="39%" class="label"><strong>Default Rate</strong></td>
    <td width="61%"><input type="text" name="sub_other_addition_master[default_rate]" id="default_rate" value="<?php echo $default_rate;?>" size="30" /></td>
  </tr>
  <tr>
   <td width="39%" class="label"><strong>Tally Ledger  </strong></td>
    <td width="61%"><input type="text" name="sub_other_addition_master[tally_ledger]" id="tally_ledger" value="<?php echo $tally_ledger;?>" size="30" /></td>
  </tr>
  <tr>
    <td class="label"><strong>Remarks</strong></td>
    <td colspan="6"><textarea name="sub_other_addition_master[remarks]" style="width:400; height:80;"><?php echo $remarks;?></textarea></td>
  </tr>
   <tr>
  
	<td><input type="checkbox" name="sub_contractor_definition[active]" id="active" /> <strong>Is Active</strong></td>
  </tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td>
    <td align="center"><input type="submit" value="<?php if($_REQUEST['action']=='edit') echo 'update'; else echo '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/Masters/Other_Addition_Master_index&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>"><input type="button" name="back" value="Cancel" /></a></td>
  </tr>
</table>
</td></tr></table>
</form>
</div>