Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- error_reporting(1);
- include 'inc/koneksi.php';
- //cek apakah sessionnya admin
- if ($_SESSION['level'] != "admin"){
- header("Location:index.php");
- }
- ?>
- <!doctype html>
- <html>
- <link rel="shortcut icon" type="image/x-icon" href="images/lamp-b.ico" />
- <head>
- <meta charset="utf-8">
- <title>Lights Controll</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css">
- <link href="jquery-mobile/style.css" rel="stylesheet" type="text/css">
- <script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
- <script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
- <style type="text/css">
- table { width:35%; font-size:13px }
- table caption { text-align:left; }
- table thead th { text-align:left; border-bottom-width:1px; border-top-width:1px; }
- table th, td { text-align:left; padding:6px;}
- table th{font-size:15px }
- </style>
- </head>
- <div data-role="page" id="index" data-theme="e">
- <div data-role="header" data-position="fixed" data-theme="a">
- <h1>ADMIN PANEL</h1>
- <a href="index.php" data-role="button" data-transition="flip"><img src="images/home.png" style="float:center;display:inline"/></a>
- <a href="change-password.php" data-transition="pop" data-rel="dialog"><img src="images/gir.png" style="float:left;display:inline"/> </a>
- </div>
- <div data-role="navbar">
- <ul>
- <li><a href="addakun.php" data-transition="pop" data-rel="dialog" data-theme="a"><img src="images/add.png"/><center>Add New User</center></a>
- </div>
- </li>
- <table data-role="table" class="ui-responsive">
- <thead>
- <tr style="background:#999;">
- <th>Username</th>
- <th>Name</th>
- <th>Email</th>
- <th>Level</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $sql = "SELECT * FROM tbl_user";
- $query = mysql_query($sql) or die(mysql_error());
- $hitung = mysql_num_rows($query);
- while($data = mysql_fetch_array($query)):;
- echo '<tr>
- <td>'.$data['username'].'</td>
- <td>'.$data['realname'].'</td>
- <td>'.$data['email'].'</td>
- <td>'.$data['level'].'</td>
- <td><a href="update.php?id='.$data['id_user'].'" data-role="button" data-mini="true" data-inline="true" data-icon="edit" data-transition="flip"></a><a href="delete.php?id='.$data['id_user'].'" data-role="button" data-mini="true" data-inline="true" data-icon="delete"></a></td>
- </tr>
- </tbody>';
- endwhile;
- ?>
- </table>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement