Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include'../koneksi.php';
- if(!isset($_SESSION['user']) || !isset($_SESSION['password'])){
- header('location:index.php');
- }else{
- $sql=mysql_query("select*from user");
- }
- ?>
- <html>
- <head>
- <title>Data User</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <table border="1" align="center" width="600">
- <tr>
- <th>USER ID</th>
- <th>USERNAME</th>
- <th>PASSWORD</th>
- <th>HAK AKSES</th>
- <th colspan="2">AKSINYA</th>
- </tr>
- <?php
- $no=1;
- while($aray=mysql_fetch_array($sql)){
- if($aray['hak_akses']==1){
- $hak="ADMINISTRATOR";
- }else{
- $hak="USER";
- }
- ?>
- <tr bgcolor="#00ffff">
- <td><?=$aray['id_user'];?></td>
- <td><?=$aray['username'];?></td>
- <td><?=$aray['password'];?></td>
- <td><?=$hak;?></td>
- <td><a href="home.php?menu=user&id=<?=$aray['id_user'];?>" name="edit_user">EDIT</a></td>
- <td><a href="home.php?menu=data_user&id=<?=$aray['id_user'];?>" name="edit_user">HAPUS</a></td></td>
- </tr>
- <?php
- $id=isset($_GET['id']) ? $_GET['id'] : 0;
- if($_GET['id']){
- $delete=mysql_query("delete from user where id_user=$id");
- ?>
- <script type="javascript">
- top.location='home.php?menu=data_user';
- </script>
- <?php
- }
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment