Advertisement
Guest User

jquery mobile

a guest
Jun 11th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.59 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. error_reporting(1);
  6.  
  7. include 'inc/koneksi.php';
  8.  
  9. //cek apakah sessionnya admin
  10.  
  11. if ($_SESSION['level'] != "admin"){
  12.  
  13. header("Location:index.php");
  14.  
  15. }
  16.  
  17. ?>
  18.  
  19.  
  20. <!doctype html>
  21. <html>
  22. <link rel="shortcut icon" type="image/x-icon" href="images/lamp-b.ico" />
  23. <head>
  24. <meta charset="utf-8">
  25. <title>Lights Controll</title>
  26. <meta name="viewport" content="width=device-width, initial-scale=1">
  27. <link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css">
  28. <link href="jquery-mobile/style.css" rel="stylesheet" type="text/css">
  29. <script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
  30. <script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
  31. <style type="text/css">
  32.     table { width:35%; font-size:13px }
  33.     table caption { text-align:left;  }
  34.     table thead th { text-align:left; border-bottom-width:1px; border-top-width:1px; }
  35.     table th, td { text-align:left; padding:6px;}
  36.     table th{font-size:15px }
  37. </style>
  38. </head>
  39. <div data-role="page" id="index" data-theme="e">
  40.   <div data-role="header" data-position="fixed" data-theme="a">
  41.  
  42.     <h1>ADMIN PANEL</h1>
  43.     <a href="index.php" data-role="button" data-transition="flip"><img src="images/home.png"  style="float:center;display:inline"/></a>
  44.     <a href="change-password.php" data-transition="pop" data-rel="dialog"><img src="images/gir.png"  style="float:left;display:inline"/> </a>
  45. </div>
  46.  
  47.   <div data-role="navbar">
  48.     <ul>
  49.       <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>
  50. </div>
  51. </li>
  52. <table data-role="table" class="ui-responsive">
  53.       <thead>
  54.         <tr style="background:#999;">
  55.           <th>Username</th>
  56.           <th>Name</th>
  57.           <th>Email</th>
  58.           <th>Level</th>
  59.         </tr>
  60.       </thead>
  61. <tbody>
  62.  <?php
  63. $sql = "SELECT * FROM tbl_user";
  64. $query = mysql_query($sql) or die(mysql_error());
  65. $hitung = mysql_num_rows($query);
  66.   while($data = mysql_fetch_array($query)):;  
  67.   echo '<tr>
  68.            <td>'.$data['username'].'</td>
  69.            <td>'.$data['realname'].'</td>
  70.            <td>'.$data['email'].'</td>
  71.            <td>'.$data['level'].'</td>
  72.  
  73. <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>
  74.  
  75.        </tr>
  76. </tbody>';
  77.   endwhile;
  78.   ?>
  79.   </table>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement