<?php
	include("../include/session.php");
    if(!$session->isAdmin()) {
        header("Location: ../main.php");
    }
    else {
    	include("../reportHeader.php");
//        include("../include/db.php");
        $id = mysql_real_escape_string($_POST['name']);
		$q = "SELECT empId FROM employees WHERE empId = '$id'";
		$result = execsql($q);
		$empId = mysql_result($result,0,"empId");
		$q1 = "SELECT * FROM minorviolations WHERE empId = '$empId'";
		$r = execsql($q1);
		$num = mysql_num_rows($r);
		?>
		
	<table id="test1" cellpadding="0" cellspacing="0" border="0" class="rowstyle-alt colstyle-alt no-arrow">
    <thead>
      <tr>
        <th class="sortable-numeric">Employee Id</th>
        <th class="sortable-text">Violation Type</th>
        <th class="sortable-text">Details</th>
        <th class="sortable-date-ymd">Violation Date</th>
      </tr>
    </thead>	

<?php 

$i = 0;
while ($i < $num) {
	$f1=mysql_result($r,$i,"vioId");
	$f2=mysql_result($r,$i,"vioType");
	$f3=mysql_result($r,$i,"vioDetails");
	$f4=mysql_result($r,$i,"vioDate");
?>

     <tbody>
    <tr><td><a href="../HR/searchAndDisplayE.php?id=<?=$f1?>"><?=$f1?></td>
        <td><?=$f2?></td>
        <td><?=$f3?></td>
        <td><?=$f4?></td>
    </tr> 
    	<?php 
			$i++;
		}
?></tbody></table>
<?php 
	include("../footer.html");
	}
?>