<?php 
error_reporting(0);
session_start();
if(!isset($_SESSION['admin']) || ($_SESSION['admin'] == "") )
{
	?>
    <script language="javascript">window.location.href="index.php";</script>
    <?php 
}
include "config.php";
?><!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
 
<meta charset="utf-8">
<title>Admin List</title>


<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-touch-icon-57x57-precomposed.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-precomposed.png">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/plugins.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/themes.css">
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
<body>
<div id="page-container">

<?php include 'header.php' ?>

<div id="inner-container">

<?php include 'left_menu.php' ?>

<div id="page-content">
<ul id="nav-info" class="clearfix">
<li><a href="index.html"><i class="icon-home"></i></a></li>
<li class="active"><a href="">Admin List</a></li>
</ul>
<button id="addRow" class="btn btn-success" onClick="location.href = 'admin_add.php';"><i class="icon-plus"></i> Add New Admin</button>

<table id="example-datatables" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="span1">Action</th>
 <th> Username</th>
<th class="hidden-phone hidden-tablet">Password</th>
<th>Employee name</th>
<th> Contact/Address</th>
<th> utype</th>

<th> Status</th>
</tr>
</thead>
<tbody>

	<?php
		$ure=mysql_query("select * from adminmaster");	
		while($urow=mysql_fetch_array($ure))
		 {
	?>   
        
        <tr>
<td class="span1">
<div class="btn-group">
<a href="admin_add.php?reg=<?php echo $urow[0]; ?>" data-toggle="tooltip" title="Edit" class="btn btn-mini btn-success" style="margin-right:10px;"><i class="icon-pencil"></i></a>
<?php echo "<a href='#' data-toggle='tooltip' title='Delete' class='btn btn-mini btn-danger' onclick='del(this,$urow[0])'>" ?><i class="icon-remove"></i></a>
</div>
</td>
 <td><?php echo $urow['username']; ?></td>
<td class="hidden-phone hidden-tablet"><?php echo $urow['password']; ?></td>
<td><?php echo $urow['emp_name']; ?></td>
<td><?php echo $urow['contact']; ?> / <?php echo $urow['address']; ?></td>
<td><?php echo $urow['utype']; ?></td>
<td><?php echo $urow['status']; ?></td>
</tr>

<?php } ?>



</tbody>
</table>


<script language="javascript">
function del(obj,id)
{
        if(confirm("Are You Sure To Delete ?"))
        {
            obj.href="admin_list.php?id="+id;
        }
    
}
</script>
<?php
if(isset($_GET['id']))
	{
		$delquery="select * from  adminmaster where adminid=".$_GET['id'];
$dusr="delete from  adminmaster where adminid=$_GET[id]";
		$dre=mysql_query($dusr);
		?>
    <script language="javascript">window.location.href="admin_list.php";</script>
  
   
    <?php 
		
	}
	?>	
</div>

<?php include 'footer.php' ?>

</div>
</div>

<?php include 'profile_popup.php' ?>


<!--[if lte IE 8]><script src="js/helpers/excanvas.min.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/vendor/jquery-1.9.1.min.js"%3E%3C/script%3E'));</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script><script>$(function(){$("#example-datatables").dataTable({aoColumnDefs:[{bSortable:!1,aTargets:[0]}]}),$("#example-datatables2").dataTable(),$("#example-datatables3").dataTable()});</script>


</body>
</html>
