<script>
    $( document).ready(function() {
        $("#delete_msg").fadeOut(2000);
    });
    
</script>
<?php 
$msg='';
if(isset($_REQUEST['did'])){
 //   echo $_REQUEST['did'];
DB_query("delete from hr_job_criteria where id='".$_REQUEST['did']."'",$db);
DB_query("delete from hr_job_criteria_details where masterid='".$_REQUEST['did']."'",$db);
   $s->pageLocation("index.php?route=HRModule/Master/job_criteria_index".$rurl.'&delete=true');
 
}
  if($_REQUEST['delete']=="true")
{ 
    $msg='Record Successfully Deleted !';
   
}
else{
    $msg='';
}
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div"> 
    <?php
    
    if($msg!='')
    {
    ?>
     <div style="width:100%;height:30px;background-color: #74F0FA;padding-top: 10px;font-size: medium;display:block" id="delete_msg">
        <?php echo $msg; ?> 
    </div>
       <?php }     ?>
<h1>Job Criteria Master</h1>	
<p align="left"><a href="index.php?route=HRModule/Master/job_criteria_master&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>"><button type="button">Add New</button></a></p>
<table width="100%" cellpadding="3" cellspacing="0" border="1" style="border:#808080 1px solid; border-collapse:collapse;">
<tr>
    <th width="4%"><strong>S. No.</strong></th>
	<th><strong>Branch</strong></th>
	<th width="12%"><strong>Desigantion</strong></th>
	<th width="12%"><strong>Department</strong></th>
    <th width="12%"><strong>Job Type</strong></th>
    <th width="4%" style="text-align:center;"><strong>Edit</strong></th>
    <th width="4%" style="text-align:center;"><strong>Delete</strong></th>
	<!--<td>
		<table width="50%" cellpadding="3" cellspacing="0">
		<tr>
			<td colspan="2" style="text-align:center;"><strong>Action</strong></td>
		</tr>
		<tr>
			<td style="text-align:center;" class="tabledata1">Edit</td>
			<td style="text-align:center;" class="tabledata1">Delete</td>
		</tr>
		</table>
	</td>-->
</tr>
<?php $i=0; $SQL=DB_query("SELECT * FROM hr_job_criteria where companyid='".$_SESSION['ACGCompanyId']."'",$db);
if(DB_num_rows($SQL)>0){
while($GetRec=DB_fetch_array($SQL)) {?>
<tr bgcolor="#fff">
	<td><?php echo $i+1; ?></td>
	<td><?php echo $sitename=$s->GetFieldValue('locations',"loccode='".$GetRec['branch']."'",'locationname'); ?></td>
    <td><?php if($GetRec['designation']!="0"){ echo $s->GetFieldValue('desigmaster',"id='".$GetRec['designation']."'",'designame'); } else{ echo "All" ;} ?></td>
    <td><?php if($GetRec['designation']!="0"){ $deptid=$s->GetFieldValue('desigmaster',"id='".$GetRec['designation']."'",'mst_departmentid'); echo $s->GetFieldValue('deptmaster',"id='".$deptid."'",'deptname'); } else{ echo "All" ;} ?></td>
    <td><?php if($GetRec['job_type']=="p") echo "Permanent"; else echo "Contract"; ?></td>
	<!--<td>
		<table width="50%" cellpadding="3" cellspacing="0">
		<tr>
			<td style="text-align:center;">
			<a href="index.php?route=HRModule/ESI_Master<?php echo $rurl; ?>&action=Edit&EID=<?php echo $GetRec['id']; ?>"><img src="images/icon_edit.gif"></a></td>
			<td style="text-align:center;">
			<a href="index.php?route=HRModule/ESI_Master<?php echo $rurl; ?>&action=Delete&DELID=<?php echo $GetRec['id']; ?>"><img src="images/Icon_Delete3.gif"></a></td>
		</tr>
		</table>
	</td>-->
    <td style="text-align:center;"><a href="index.php?route=HRModule/Master/job_criteria_master_edit&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>&eid=<?php echo $GetRec['id']; ?>"><img src="images/icon-edit.png" height="15" width="15" title="Edit Document" /></a></td>        
    <td style="text-align:center;">
        <?php $pre= DB_query("select * from hr_criteria_form_table where parameter_id='".$GetRec['id']."'",$db); if(DB_num_rows($pre)==0){ ?>
        <a href="index.php?route=HRModule/Master/job_criteria_index&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>&did=<?php echo $GetRec['id']; ?>"><img  onclick="javascript:return confirm('Sure you want to continue ?')" src="images/Icon_Delete.png"  width="15" height="15"title="Delete Document" /></a><?php } else{ ?> 
        <img src='images/Icon_Delete.png' width="15" height="15" title="No Permission to Delete Document" style="opacity:0.5;" />
        <?php } ?>
    </td>
</tr>
<?php $i++;} }else{?>
<tr>
    <td colspan="7">No Result Found.</td>
</tr>
<?php } ?>
</table>
</div>
</div>

