<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>.:SPK_Potensi Wilayah Bidang Pertanian:.</title>
	<link rel="shortcut icon" type="image/x-icon" href="css/images/pavicon.png" />
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
	<link rel="stylesheet" href="css/tabel.css" type="text/css" media="all" />
	<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="all" />
	
	<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
	<!--[if lt IE 9]>
		<script src="js/modernizr.custom.js"></script>
	<![endif]-->
	<script src="js/jquery.flexslider-min.js" type="text/javascript"></script>
	<script src="js/functions.js" type="text/javascript"></script>
</head>
<body>
	<!-- wrapper -->
	<div  id="wrapper">
		<!-- header -->
		<header>
			<div class="shell">
				<h1 id="logo"><a href="#">Core</a></h1>
				
			</div>	
		</header>
		<!-- end of header -->
		<!-- navigation -->
		<nav id="navigation">
			<div class="shell">
				<ul>
					<li><a href="tabel_user.php"><span class="bottom-arr"></span>USER</a></li>				
					<li><a href="kriteria/tabel_kriteria.php"><span class="bottom-arr"></span>KRITERIA</a></li>
					<li><a href="sub_kriteria/tabel_sub.php"><span class="bottom-arr"></span>SUB KRITERIA</a></li>
					<li><a href="wilayah/tabel_wilayah.php"><span class="bottom-arr"></span>WILAYAH</a></li>
					<li><a href="penilaian/penilaian.php"><span class="bottom-arr"></span>PENILAIAN</a></li>
					<li><a href="penilaian/hasil_akhir.php""><span class="bottom-arr"></span>RANGKING</a></li>
				<li><a href="../../logout.php"><span class="bottom-arr"></span>LOG OUT</a></li>
									</ul>
			</div>	
		</nav>
		<!-- end of navigation -->
		<!-- slider-holder --><!-- end of slider-holder -->
        <!-- services -->
<section class="services">


<table>
<tr><td class="baris-ganjil" colspan="6"><a href="tambah_user.php"><img src="add.png" title="tambah user baru"></a></td></tr>
</td></tr>
<caption><h3>Tabel Pengguna</h3></caption>
    <tr>
        <th>NO</th>
        <th>Nama lengkap</th>
        <th>User Name</th>
		<th>Level</th>
		<th>Status</th>
		<th>Pilihan</th>	
    </tr>
	<?php
include "../../koneksi.php";
$query = mysql_query("SELECT * FROM user");
if(!$query){
	die( mysql_error() );
}
$i=1;
while($row = mysql_fetch_array($query)){
    $clas='baris-ganjil';
    echo "<tr class=$clas>
				  <td >$i</td>
				  <td >".$row['nama_lengkap']."</td>
				<td >".$row['username']."</td>
				<td >".$row['level']."</td>
				<td >".$row['status_admin']."</td>
				<td ><center>";
			$status =$row['status_admin'];
			if($status=="Aktif")
			{
		 echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href='edit_level.php?action=aktifasi_pengguna&id=".$row['id']."'><img src='mos-css/img/user.png'></a>&nbsp;&nbsp;";
			}
			else if ($status=="Tunggu Di Konfirmasi")
			{
		echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href='edit_level.php?action=aktifasi_pengguna&id=".$row['id']."'><img src='mos-css/img/user_delete.png'></a>&nbsp;&nbsp;";
			}
			?>
			</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo "edit_user.php?id=".$row['id']."";?>"><img src='mos-css/img/user_edit.png'></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="<?php echo "hapus.php?action=hapus_pengguna&id=".$row['id']."";?>" onClick="return confirm('Apakah anda yakin akan menghapus data ini?')"><img src='mos-css/img/garbage.png'></a></td>
	<?php
				
				
		echo	"</tr>";
			$i=$i+1;
			if ($clas=='baris-ganjil') 
		     { 
			 $clas='baris-ganjil2';
			 }
		}	
	    echo "</table>";
			mysql_close();
		
			 
	?>















</section>
		<!-- end of services -->
		<!-- main -->
	  <div class="main"></div>
		<!-- end of main -->
		<div id="footer-push"></div>
	</div>
	<!-- end of wrapper -->
	<div id="footer">
		<div class="shell">
			
			<p class="copy">Copyright &copy; 2017 fikom unisan</a></p>
			<div class="cl">&nbsp;</div>
		</div>
	</div>
</body>
</html>