<?php 
include ('config.php');
if(!isset($_SESSION['emp_name']))
	 {
	  echo("<script language='javascript'>window.location.href='index.php'</script>");
	  exit;
	 }
if(isset($_REQUEST['delete'])!='')
{
	$del_cat=mysqli_query($conn,"delete from tbl_statement where sno='".$_REQUEST['delete']."'");
	if($del_cat)
	{
      header("location:employee.php");
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="css/grid.css" tppabs="" media="screen" />
        <!-- Main stylesheet -->
        <link rel="stylesheet" type="text/css" href="css/styles.css" tppabs="" media="screen" />
	
	<body>
    	<!-- Header -->
        <?php include('header.php');?>
		<div class="container_12">
         <div class="float-right">
                    </div>
        
               <!-- Example table -->
                <div class="module">
                </br>
                	<h2><span>Employee Details</span></h2>
                    
                    <div class="module-table-body">
                    	<form action="">
                        <table id="myTable" >
                        	<thead>
                                <tr>
                                   <th style="width:1%">S.No</th>
                                   <th style="width:5px">Emp AccNo</th>
                                   <th style="width:5px">Emp Name</th>
                                   <th style="width:5px">View</th>
                                   <th style="width:5px">Delete</th>
                                </tr>
                            </thead>
									<?php
                                    $i=1; 
                                    $select_query=mysqli_query($conn,"select * from tbl_statement");
                                    while($result=mysqli_fetch_array($select_query))
                                    {
                                    ?>
                            <tbody>
                                <tr>
                                    <td align="center"><?php echo $i;  ?></td>
                                  <td align="center"><?php echo $result['emp_acc'];?></td>
                                 <td align="center"><?php echo $result['emp_name'];?></td>
                                    <td align="center" class="table_text"><a href="view_employee.php?id=<?php echo $result['sno']; ?>&rpage=<?php echo base64_encode($cont); ?>" ><img src="gwenview.png"  border="0"  width="30" height="30"/></a></td>  
                                   
                              <td align="center" class="table_text">
                    <a href="employee.php?delete=<?php echo $result['sno']; ?>"  onclick="return confirm('Are you sure to delete');"><img src="delete.png" width="14"  border="0" /></a>
                    </td>
                           <?php $i++;}?>
                                </tr>
                            </tbody>
                        </table>
                        </form>
                        <div style="clear: both"></div>
                     </div> <!-- End .module-table-body -->
                </div> <!-- End .module -->
			</div> <!-- End .grid_12 -->
            <div style="clear:both;"></div>
        </div> <!-- End .container_12 -->
		
           
        <!-- Footer -->
      <!-- End #footer -->
	</body>
</html>