<?php
    include("../include/session.php");
    if(!$session->isAdmin()) {
        header("Location: ../main.php");
    }
    else {
    	include("../reportHeader.php");
//        include("../include/db.php");
		$position = mysql_real_escape_string($_POST['position']);
		$q = "SELECT * FROM employees WHERE empPos = '$position'";
		$result = execsql($q);
		$num = mysql_num_rows($result);
		$i = 0;
		

?>		

<table id="test1" cellpadding="0" cellspacing="0" border="0" class="rowstyle-alt colstyle-alt no-arrow">
    <thead>
      <tr>
        <th class="sortable-text">Name</th>
        <th class="sortable-text">Age</th>
<!--        <th class="sortable-text">Sex</th>-->
        <th class="sortable-date-ymd">Date Employed</th>
        <th class="sortable-text">Section</th>
<!--        <th class="sortable-text">Position</th>-->
        <th class="sortable-numeric">Rate of Pay</th>
      </tr>
    </thead>
    <?php 
    	while($i < $num){			
			$f1=mysql_result($result, $i, "empId");
			$f2=mysql_result($result,$i,"empFName");
			$f3=mysql_result($result,$i,"empLName");
//			$f4=mysql_result($result,$i,"empContact");
			$f5=mysql_result($result,$i,"empAge");
//		    $f6=mysql_result($result, $i, "empSex");
//		    $f7=mysql_result($result, $i, "empPos");
		    $f8=mysql_result($result, $i, "empSection");
		    $f9=mysql_result($result, $i, "empDateEmp");
		    $f10=mysql_result($result, $i, "empRate");
  
    ?>
   
    
    <tbody>
    <tr>
        <td><a href="../HR/searchAndDisplayE.php?id=<?=$f1?>"><?php echo "$f2  $f3";?></a></td>
        <td><?=$f5?></td>
<!--        <td><?=$f6?></td>-->
        <td><?=$f9?></td>
        <td><?=$f8?></td>
<!--        <td><?=$f7?></td>-->
        <td><?=$f10?></td>
    </tr> 
<?php 
			$i++;
		}
?></tbody></table>
<?php 
	include("../footer.html");
	}
?>