<?php
$modid=$_REQUEST['modid'];
$frmid=$_REQUEST['frmid'];
$url="&modid=".$modid."&frmid=".$frmid;
$targetpage="index.php?route=HRModule/professional_tax".$url;
if($_REQUEST['action'] == 'delete')
{
	$del_query = "DELETE FROM professional_tax WHERE id='".$_REQUEST['id']."'";
	$del_query_res = DB_query($del_query,$db) or die(DB_error());
	$del=DB_query("DELETE FROM professional_tax_details WHERE parentid='".$_REQUEST['id']."'",$db);
	
	if(DB_affected_rows($del_query_res)>0)
	{
	echo "<script>alert('Successfully Deleted');</script>";
	}
}
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<style type="text/css">
.padd{text-align:left; padding-left:3px;}
</style>
<div class="body_contain">
<div class="tab_div">
<h3>Professional Tax Slab Index </h3>
<p align="left"><?php if($_SESSION['frmcreate']=='1'){?><a href="<?php echo $targetpage; ?>&amp;action=Addnew">
<input type="button" name="Add New" value="Add New" class="search" /></a><?php } ?></p>

<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border:#999999 1px solid;">
  <tr>
    <th align="left" valign="top" width="5%" class="padd"><strong>Sr. No.</strong></th>
    <th align="left" valign="top" class="padd" width="10%"><strong>Branch</strong></th>
	<th align="left" valign="top" class="padd" width="10%"><strong>Effective  Date </strong></th>
	<th align="left" valign="top" class="padd" width="9%"><strong>Grade </strong></th>
    
    <th align="left" valign="top" class="padd" width="12%"><strong>State </strong></th>
	<th align="left" valign="top" class="padd"><strong>Created By</strong></th>
   
    <th align="left" valign="top" class="padd"><strong>Edit</strong></th>
	
	<th align="left" valign="top" class="padd"><strong>Delete</strong></th>
  </tr>
  <?php 
       $GetRecord = "Select * from professional_tax order by id DESC";
   $ResultData = DB_query($GetRecord,$db);
   $i=1;
   
   
   if(DB_num_rows($ResultData)==0)
   echo "<td  colspan='11'><center>--No Record--</center></td>";
  
   while($myrow = DB_fetch_array($ResultData))
   {    	
			
	?>
	
  <tr>
    <td align="left" valign="top"><?php echo $i; ?></td>
    <td align="left" valign="top"><?php echo $s->getField('locations','loccode',$myrow['site'],'locationname'); ?></td>
	<td align="left" valign="top"><?php echo ConvertSQLDate($myrow['effective_date']); ?></td>
	<td align="left" valign="top"><?php echo $s->getField('emp_grade','id',$myrow['grade'],'grade_name');?></td>
 
    <td align="left" valign="top"><?php echo $s->getField('state_master','id',$myrow['state'],'state'); ?></td>
    <td align="left" valign="top"><?php echo $s->getField('www_users','id',$myrow['created_by'],'realname');?></td>
	<td align="left" valign="top">	
	<?php if($_SESSION['frmEdit']=='1'){?><a href="index.php?route=HRModule/professional_tax_edit&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid']?>&action=Edit&id=<?php echo $myrow['id']; ?>" ><img src="images/icon-edit.png"width="15" height="15"></a><?php }else{echo "No Permission";} ?></td>
	
	
	<td align="left" valign="top"><?php if($_SESSION['frmDelete']=='1'){?><a href="index.php?route=HRModule/view_rofessional_tax_indes&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid']?>&id=<?php echo $myrow['id'];?>&action=delete">
	  <input type="image" src="images/Icon_Delete.png"></a><?php }else{echo "No Permission";} ?></td>
  </tr>
  
  	
	<?php  $i++;  $count++; }


 ?>
</table>
</div>
</div>