<?php  include('includes/fun-php.php')?><fieldset>
<legend>Revised Employee salary</legend>
<!-- Table start 1 --><div>
<form action="" method="post">
<table width="100%%" border="0" cellspacing="1" cellpadding="2" align="left">
  <tr>
    <th>Branch</th>
    <td>  <select name="site" id="site" style="width:107px" onchange="ShowDiv(this.value,'hid-empdiv','GetEmployee.php?sheet_type=1');">
          <option value="000">---ALL---</option>
          <?php 
  $site_sql=DB_query("Select loccode, locationname from locations",$db); 
while($site_row=DB_fetch_array($site_sql)){
?>
          <option value="<?php echo $site_row['loccode'];?>"<?php echo ($_REQUEST['site']==$site_row['loccode']?'selected':'');?>><?php echo $site_row['locationname'];?></option>
          <?php } ?>
        </select>	</td>
    <th>Employee Name</th> <!--onchange="ShowDiv(this.value,'hid_revised','revised_salary.php')"-->
     <td><div id='hid-empdiv'><select name="empcode" id="empcode" style="width:107px">
          <option value="All">--All--</option>
          <?php 
		$emp_sql=DB_query("Select id, emp_code,emp_name from empmaster order by emp_name ASC",$db);
		while($emp_row=DB_fetch_array($emp_sql))
		{?>
          <option value="<?php echo $emp_row['id'];?>"<?php if($_REQUEST['empcode']==$emp_row['id'])echo "selected";?>><?php echo $emp_row['emp_name'].' ( '.$emp_row['emp_code'].' ) ' ;?></option>
          <?php 	
		}
		?>
        </select></div>	</td>
		<td><input name="SearchData" value="Search" type="submit"></td>
    </tr>
</table>
</form>
<div style="clear:both; margin:0px;"></div>
</div> 
 
<div style="clear:both;"></div>
<?php if($_REQUEST['SearchData']){

 $filter=array();
 if($_REQUEST['empcode']!='All')
{
  $filter[]="A.id='".$_REQUEST['empcode']."'";
}

if($_REQUEST['applicable_month']!='')
{
  $filter[]="B.applicable_month='".$_REQUEST['applicable_month']."'";
}

if($_REQUEST['applicable_year']!='')
{
  $filter[]="B.applicable_year='".$_REQUEST['applicable_year']."'";
}
if(count( $filter)>0)
{
    $serlist=implode(" and ", $filter);
	$condition="  A.id=B.empid and $serlist";
}
else{
   	$condition="   A.id=B.empid";
	}
	//echo "select *  from empmaster_revised_sal B,empmaster A where $condition";
	$result=DB_query("select A.emp_code ,A.emp_name,B.*  from empmaster_revised_sal B,empmaster A where $condition ",$db);

 ?>
 
 <table width="100%" border="0">
  <tr>
    <td><strong>Emp Code </strong></td>
    <td><strong>Name</strong></td>
    <td><strong>Month</strong></td>
    <td><strong>Year</strong></td>
    <td><strong>Increment Amount</strong></td> <td><strong>View</strong></td>

  </tr>
  <?php $i=1;
while($rowdata=DB_fetch_array($result))
{?>
	<td><?php echo $rowdata['emp_code'] ?></td>
	<td><?php echo $rowdata['emp_name'] ?></td>
	<td><?php echo GetMonth($rowdata['applicable_month']); ?></td>
	<td><?php echo $rowdata['applicable_year'] ?></td>
	<td><?php echo $rowdata['increment_amount'] ?></td>
	<td>
	<?php
	   $locked=$rowdata['locked'];
	 
	  if($locked=='Y'){echo "Locked";}else{
	 ?>
	<a href="index.php?route=HRModule/ViewRevisedSal&&id=<?php echo $rowdata['id']."&empid=".$rowdata['empid'].$rurl; ?>" target="_blank"><img src="images/1307425350_Junior_Icon_52_2.png" width="20" height="20"></a>
	<?php } ?>
	</td>
	
 <?php  } ?>
</table>

 <?php  } ?>

</fieldset>

 