<?php 
$url_cancel= "index.php?route=SubContractors/Masters/contractor_category_index".$rurl;
$url_add= "index.php?route=SubContractors/Masters/contractor_category".$rurl;
     if(isset($_POST['save']))
	 {
		extract($_REQUEST['tbl_subcontractor_contractor_category']);
		$s->RecordInsert('tbl_subcontractor_contractor_category',$_REQUEST['tbl_subcontractor_contractor_category']);
		$_SESSION['success_msg']="Saved Successfully";
		echo "<script>location.href='$url_cancel'</script>";
	 }
	 if(isset($_REQUEST['action']) && isset($_REQUEST['isid']))
{
	if($_REQUEST['action']=='edit' && !empty($_REQUEST['isid']))
	{	
		$recEdit=DB_fetch_array($s->GetRecordById('tbl_subcontractor_contractor_category','id='.$_REQUEST['isid']));
		extract($recEdit);
		
	}
}
if(isset($_REQUEST['update']))
{
	 $s->RecordEdit('tbl_subcontractor_contractor_category',$_REQUEST['tbl_subcontractor_contractor_category'],"id=".$_REQUEST['tbl_subcontractor_contractor_category']['id']);
		$_SESSION['success_msg']="Update Successfully";
		echo "<script>location.href='$url_cancel'</script>";
}
?>
<form name="" id="" method="POST">
<div align="center">
<p align="left"><strong>Contractor Category</strong></p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="padding:5px"><!-- General details -->
      <table width="60%" cellspacing="4" cellpadding="4" border="0" style="color:#FF0000" align="center">
        <tr>
          <td style="padding:5px; text-align:center;" colspan="4" align="right"></td>
        </tr>
        <tr>
          <td style="text-align:center;" colspan="4"> <input type="hidden" value="<?php if($_REQUEST['action']=='edit') echo $id; ?>" name="tbl_subcontractor_contractor_category[id]"><b></b></td>
        </tr>
         
          <tr style="height:25px">
          <th> Contract Category Name </th>
          <td>&nbsp;</td>
          <td width="60%" align="left">
      <input type="text" name="tbl_subcontractor_contractor_category[Contractor_category_name]" id="Contractor_category_name" class="detailedViewTextBox" style="width:100%;"
       value="<?php echo $Contractor_category_name; ?>">
          
          
          </td>
          <td><font style="color:red; font-weight: bold;">*</font></td>
          </tr>
          
       
      </table></td>  
  </tr>
  <tr><td>
  	<table    style="margin-left: 270px;">
  	<tr>
           <th> Active </th>
           <td  style="margin-left: 2px;"></td>
           <td><input type="radio" name="tbl_subcontractor_contractor_category[status]" id="status"   value="true" <?php if($status=='true'){ ?> checked="checked" <?php }?> ></td>
         <td></td>
         </tr>
         <tr>
        
        	 <th>InActive </th>
        	   <td  style="margin-left: 2px;"></td>
          <td><input type="radio" name="tbl_subcontractor_contractor_category[status]" id="status"  value="false" <?php if($status=='false'){ ?> checked="" <?php }?>></td>
          <td></td>
        </tr>	
  		
  		
  	</table>
  </td></tr>
</table>
</div>

<p align="center">
		<input type="hidden" name="tbl_subcontractor_contractor_category[created]" value="<?php echo date('Y-m-d')?>">
		   <input type="hidden" name="tbl_subcontractor_contractor_category[created_by]" value="<?php echo $_SESSION['UserID']?>">

          
		  <input type="submit" value="Save" name="<?php if($_REQUEST['action']=='edit') echo 'update'; else echo 'save'; ?>" class="add">    <a href="<?php echo $url_cancel;?>"><input type="button" value="Cancel" name="button" class="add"></a>
</p></form>

