Advertisement
zpoeng

pinjam

Nov 27th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. <?php
  2. include('config.php');
  3. include('cek-login.php');
  4. ?>
  5.  
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>Tutorial Hak Akses - Nurwahyudin.Com</title>
  11. <link rel="stylesheet" href="css/reset.css" type="text/css" />
  12. <link rel="stylesheet" href="css/normalize.css" type="text/css" />
  13. <link rel="stylesheet" href="css/permata-ui-kit.css" type="text/css" />
  14. <link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
  15. <link rel="stylesheet" href="css/style.css" type="text/css" />
  16. </head>
  17.  
  18. <body>
  19. <div style="margin:auto; padding:50px 0 30px; text-align:center">
  20. <h1>Sistem Informasi Perpustakaan</h1>
  21. <p>Dimas Rangga Respati</p>
  22. </div>
  23. <div style="margin:auto">
  24. <div class="rounded_3 shadow_3 content">
  25. <?php
  26. $username = $_SESSION['username'];
  27. $query_user_login = mysql_query("select * from anggota where username='$username'");
  28.  
  29. $user_login = mysql_fetch_array($query_user_login);
  30. ?>
  31. <h3>Selamat Datang <?php echo $user_login['nm_anggota']; ?></h3>
  32. <br />
  33.  
  34. <?php
  35. $message = $_GET['msg'];
  36.  
  37. if ($message == 'success') {
  38. ?>
  39. <div class="info">Success</div>
  40. <?php } else if ($message == 'failed') {?>
  41. <div class="error">Error</div>
  42. <?php }
  43. if ($_SESSION['role'] == 'admin') {
  44. ?>
  45.  
  46. <a href="tambahb.html" class="left">Tambah buku</a>
  47. <?php } ?>
  48. <a href="logout.php" class="right">Logout</a>
  49. <br />
  50. <table class="view">
  51. <thead>
  52. <tr>
  53. <th width="20">No.</th>
  54. <th>Tanggal Pinjam</th>
  55. <th>Jumlah Pinjam</th>
  56. <th>Nama Peminjam</th>
  57. <th>Buku</th>
  58. <th>Aksi</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62.  
  63.  
  64.  
  65.  
  66. <?php
  67. $query = "select * from meminjam,buku,anggota
  68. where meminjam.id_anggota = anggota.id_anggota and
  69. meminjam.kd_buku = buku.kd_buku and meminjam.kembali = 1
  70. order by id_pinjam";
  71. $sql = mysql_query ($query);
  72. $no = 1;
  73. while ($data=mysql_fetch_array($sql)) {
  74. ?>
  75. <tr>
  76. <td><?php echo $no?></td>
  77. <td><?php echo $data['tgl_pinjam'];?></td>
  78. <td><?php echo $data['jumlah_pinjam'];?></td>
  79.  
  80. <td><?php echo $user_login['nm_anggota'];?></td>
  81. <td class="center"><?php echo $data['judul_buku'];?></td>
  82.  
  83. </tr>
  84. <?php
  85. $no++;
  86. }
  87. ?>
  88. </tbody>
  89. </table>
  90. </div>
  91. </div>
  92. <div class="clear"></div>
  93. <div style="padding-bottom:50px;"></div>
  94. </body>
  95. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement