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

?>



<link rel="stylesheet" type="text/css" href="SubContractors/css/paginate.css" />

<style>
.label{
background-color: #B7B7B7;
    color: #000000;
    font-size: 10.5px;
    font-weight: bold !important;
    padding: 5px 10px;
    text-align: left;
}
</style>

<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">

<?php
if($_REQUEST['action']=='' && $_REQUEST['odec']=='')
{
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1> Other Addition Master</h1>

<h1><a href="index.php?route=SubContractors/Masters/Other_Addition_Master_add&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>" style="text-decoration:none;cursor:pointer;corsor:hand;"><input type="button" class="search" value="Add New"></a>

	</h1>



<div align="center">
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="inborder">

	<tr>
		<th width="30%">Other Addition Name</th>
		<th width="20%">Default Rate</a></th>
		<th width="20%">Tally Ledger</th>
		<th width="5%">View</th>
		<th width="5%">Edit</th>
		<th width="5%">Delete</th>
		
	</tr>

	<?php 
          	
			$rpp = 5; // results per page
			$adjacents = 4;
			
			$page = intval($_GET["page"]);
			if($page<=0) $page = 1;
			
			$reload ="index.php?route=SubContractors/Masters/Other_Addition_Master_index".$rurl;
			
			
			// select appropriate results from DB:
			$sql = "SELECT * FROM sub_other_addition_master";
			$result =DB_query($sql,$db);
			
			// count total number of appropriate listings:
			$tcount = DB_num_rows($result);
			
			// count number of pages:
			$tpages = ($tcount) ? ceil($tcount/$rpp) : 1; // total pages, last page number
			
			$count = 0;
			$i = ($page-1)*$rpp;
			while(($count<$rpp) && ($i<$tcount)) {
				DB_data_seek($result,$i);
				$query = DB_fetch_array($result);
			
				extract($query);
				
 
	?>
	<tr>
		<td width="30%" ><?php echo $other_addition_name; ?></td>
		<td width="20%"><?php echo $default_rate; ?></td>
		<td width="20%"><?php echo $tally_ledger; ?></td>
		<td width="5%"><a href="index.php?route=SubContractors/Masters/Other_Addition_Master_index<?php echo $rurl;?>&action=view&adm=<?php echo $id; ?>"> <img src="images/search.gif"  width="20" height="20"/></a></td>
		
		<td width="5%"><a href="index.php?route=SubContractors/Masters/Other_Addition_Master_add<?php echo $rurl;?>&action=edit&adm=<?php echo $id; ?>"> <img src="images/icon-edit.png" height="15" width="15"></a></td>
		<td width="5%"><a href="index.php?route=SubContractors/Masters/Other_Addition_Master_index<?php echo $rurl;?>&action=delete&adm=<?php echo $id; ?>"> <img src="images/Icon_Delete.png" /></a></td>
	</tr>
	
	<?php  $i++;  $count++; }
	// call pagination function:

//echo paginate_two($reload, $page, $tpages, $adjacents);
	 ?>

</table>
</div>
<?php

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

?>
<h1> Other Deduction Master</h1>

<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 Deduction 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" readonly="true" /></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" readonly="true"/></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" readonly="true"/></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;" readonly="readonly"><?php echo $remarks;?></textarea></td>
  </tr>
   <tr>
  
	<td><input type="checkbox" name="sub_contractor_definition[active]" id="active" readonly="true"/> <strong>Is Active</strong></td>
  </tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td>
    <td align="center"><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>


<?php }

?>





<?php if(isset($_SESSION['success_msg']))
{ ?>
	<script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
}	unset($_SESSION['success_msg']);
?>



