<?php session_start();?>
<?php  include_once('ml_inc.function.php'); ?>
<!--link href='blue/style.css' rel='stylesheet' type='text/css' /-->
<link href='css/imagetable.css' rel='stylesheet' type='text/css' />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css"></style>
<script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
    $('#myTable').dataTable();
});
</script>

<?php require_once('open_connection.php');?>
<html>
<head>
       <title>PICCSB e-Directory System</title>
</head>
<body bgcolor="#333333"> 
<table width="100%" border="0" align="center">
<tr>
<td width="15%" bgcolor="#333333">&nbsp;</td>
<td width="70%" align="center" bgcolor="#FFFFFF" > 

<table width="100%" border="0" align="center">

<!-- row for header picc 1 -->
<tr>  
     <th width="100%" colspan="4"><img src="images/header-cox.jpg" width="100%" height="auto"></th>
</tr>

<!-- row for header picc 2 -->
<tr>
     <th width="100%" colspan="4"><img src="images/eoffice-cox.jpg" width="100%"  height="auto"></th>
</tr>
<!-- calling frame -->	
<tr>
    <td colspan="1" width="10%" align="center"><?php include("header.php");?></td>
	
</tr>
<tr>
    <td  width="10%" align="right">
	<a href="http://www.hitwebcounter.com" target="_blank">
   <img src="http://hitwebcounter.com/counter/counter.php?page=6313530&style=0002&nbdigits=5&type=page&initCount=40" title="webs counters" Alt="webs counters"   border="0" >
	</a>                                        
	<br/>
    <!-- hitwebcounter.com -->
	<a href="http://www.hitwebcounter.com" title="Total Count" target="_blank" style="font-family: sans-serif, Arial, Helvetica; 
    font-size: 9px; color: #6D6C72; text-decoration: none ;"><strong>Total Count </strong>
                                        </a>   
</td>
	
</tr>

<tr>

<td colspan="3" width="90%" align="center" >
<tr><td>

<h2 align="center">STAFF DIRECTORY LIST</h2>

<form action="staff_search.php" method="post">
<table border=0 align=center class="imagetable" >
<tr><td>INFO SEARCH</td>
<td><input type="text" name="directory" />
<input type="submit" class="myButton"  value="SEARCH"/>&nbsp;
<!--input type="button" class="myButton"  value="INSERT"  onClick="window.location.href='staff_insert.php'"-->&nbsp;
<!--input type="button" class="myButton"  value="HOME"    onClick="window.location.href='index.php'"-->
<input type="button" class="myButton"  value="GROUP EMAIL"    onClick="window.location.href='staff_groupemail.php'">
<input type="hidden" name="staff_id" value="<?php echo $staff_id; ?>">
 </td>
</tr>
</table>
</form>
<br>

<!--hr /-->
<div align="right">
<div class=table-responsive>
  <?php

					$result=mysql_query("SELECT * from tbl_dir_staff WHERE staff_name LIKE '%".$_POST[directory]."%' OR staff_section LIKE '%".$_POST[directory]."%' 
					                     OR staff_designation LIKE '%".$_POST[directory]."%' OR staff_emel LIKE '%".$_POST[directory]."%' 
										 OR staff_ext LIKE '%".$_POST[directory]."%' OR staff_hp LIKE '%".$_POST[directory]."%' 
										 OR staff_assign LIKE '%".$_POST[directory]."%' ORDER BY staff_id, staff_ext DESC ");
		
		  			$i=0;
		  
echo "<center><table id=myTable  class=imagetable style=background-color:003333;>";
echo "<thead>";
echo"<tr align=center id=listTableHeader style=color:FFFFFF;><td>NO</td><th>NAME</th><th>SECTION</th><th>DESIGNATION</th><th>EXT NUMBER</th><th>HP NUMBER</th><th>EMAIL</th></tr>";
echo "</thead>";
echo "<tbody>";	 
while($row=mysql_fetch_array($result))
{
					 $staff_id = $row['staff_id']; 
		 		   $staff_name = $row['staff_name'];
		        $staff_section = $row['staff_section'];
		    $staff_designation = $row['staff_designation'];
				    $staff_ext = $row['staff_ext'];
			         $staff_hp = $row['staff_hp'];
			 	   $staff_emel = $row['staff_emel'];
			$i++;
					echo"<tr>";
						echo "<td align=center>".$i."</td>";
						echo "<td align=left >".$row['staff_name']."</td>";
						echo "<td align=left >".$row['staff_section']."</td>";
						echo "<td align=left >".$row['staff_designation']."</td>";
						echo "<td align=left>".$row['staff_ext']."</td>";
						echo "<td align=left>".$row['staff_hp']."</td>";
						echo "<td align=left >".$row['staff_emel']."</td>";
					echo"</tr>";
					}
					echo "</span></table>";
echo "</tbody>";
//mysql_close($con);

?>
  <tr><td>
  
  </td>
  </tr>
  
</div>
</div>
  </td></tr>
  
  </div>
  </td></tr>
<!-- row for footer -->	
<tr>
	<th align="center" colspan="4">
	<?php include ('footer.php'); ?>
		
	</th>
</tr>

<!--- end for ruang kerja 80% -->
</table>

</td>

<td width="20%" bgcolor="#333333">&nbsp;</td>

</tr>

<!--- end for ruang kerja 100% -->
</table>

</body>
</html>