Advertisement
ukrenzz

code#1

Mar 22nd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.61 KB | None | 0 0
  1. <link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap.css">
  2. <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  3. <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css">
  4. <!-- Font Awesome -->
  5. <link rel="stylesheet" href="assets/css/font-awesome.min.css">
  6. <!-- Ionicons -->
  7. <link rel="stylesheet" href="assets/bootstrap/css/ionicons.min.css">
  8. <!-- Theme style -->
  9. <link rel="stylesheet" href="assets/dist/css/AdminLTE.min.css">
  10. <!-- AdminLTE Skins. Choose a skin from the css/skins
  11. folder instead of downloading all of them to reduce the load. -->
  12. <link rel="stylesheet" href="assets/dist/css/skins/_all-skins.min.css">
  13. <!-- iCheck -->
  14. <link rel="stylesheet" href="assets/plugins/iCheck/flat/blue.css">
  15. <!-- Morris chart -->
  16. <link rel="stylesheet" href="assets/plugins/morris/morris.css">
  17. <!-- jvectormap -->
  18. <link rel="stylesheet" href="assets/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  19. <!-- Date Picker -->
  20. <link rel="stylesheet" href="assets/plugins/datepicker/datepicker3.css">
  21. <link rel="stylesheet" href="assets/plugins/colorpicker/bootstrap-colorpicker.min.css">
  22. <!-- Bootstrap time Picker -->
  23. <link rel="stylesheet" href="assets/plugins/timepicker/bootstrap-timepicker.min.css">
  24. <!-- Daterange picker -->
  25. <link rel="stylesheet" href="assets/plugins/daterangepicker/daterangepicker.css">
  26. <!-- bootstrap wysihtml5 - text editor -->
  27. <link rel="stylesheet" href="assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  28. <link rel="stylesheet" href="assets/plugins/select2/select2.min.css">
  29. <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
  30. <!-- Font Awesome -->
  31. <!-- DataTables -->
  32. <link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap.css">
  33. <!-- Theme style -->
  34. <link rel="stylesheet" href="assets/dist/css/AdminLTE.min.css">
  35. <!-- AdminLTE Skins. Choose a skin from the css/skins
  36. folder instead of downloading all of them to reduce the load. -->
  37. <link rel="stylesheet" href="assets/dist/css/skins/_all-skins.min.css">
  38. <section class="content-header">
  39. <h1>
  40. Daftar Anggota
  41. <small>Jemaat</small>
  42. </h1>
  43. <ol class="breadcrumb">
  44. <li><a href="?p=dashboard"><i class="fa fa-dashboard"></i> Home</a></li>
  45. <li><a href="#">Data</a></li>
  46. <li class="active">Data Jemaat</li>
  47. </ol>
  48. </section>
  49.  
  50. <!-- Main content -->
  51. <section class="content">
  52. <div class="row">
  53. <div class="col-xs-12">
  54. <div class="box">
  55. <!-- /.box-header -->
  56. <div class="box-body table-responsive">
  57. <?php if(@$_SESSION['admin'] || @$_SESSION['pengurus']){ ?>
  58. <div class="col-lg-12">
  59. <a href="?p=anggota&act=tambah">
  60. <button class="btn btn-success">
  61. <i class="fa fa-plus-square"></i> Tambah Jemaat
  62. </button>
  63. </a>
  64. </div>
  65. <?php } ?>
  66. <table id="table_id" class="table table-bordered table-hover table-striped">
  67. <thead>
  68. <tr>
  69. <th>No</th>
  70. <th>Nama</th>
  71. <th>Alamat</th>
  72. <th>Kelompok</th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76.  
  77. <?php
  78. $jml_data = mysql_num_rows(mysql_query("SELECT * FROM tbl_anggota"));
  79. $batas = 15;
  80. $pg = isset( $_GET['pg'] ) ? $_GET['pg'] : "";
  81.  
  82. if ( empty( $pg ) ) {
  83. $posisi = 0;
  84. $pg = 1;
  85. } else {
  86. $posisi = ( $pg - 1 ) * $batas;
  87. }
  88. $query = mysql_query("SELECT * FROM tbl_anggota limit $posisi, $batas");
  89. $q_cek = mysql_num_rows($query);
  90.  
  91. if($q_cek == 0){
  92. echo "<tr><td colspan='5' align='center'>Data Kosong</td></tr>";
  93. } else{
  94. $no = 1+$posisi;
  95. while ($data = mysql_fetch_array($query)) {
  96. echo "<tr>";
  97. echo "<td>".$no."</td>";
  98. echo "<td><a href='?p=anggota&act=detail&id_anggota=".$data['id_anggota']."'>".$data['nama_anggota']."</a></td>";
  99. echo "<td>";
  100. if(strlen($data['alamat']) >= 25){
  101. echo substr_replace($data['alamat'], "...", 25);
  102. } else {
  103. echo $data['alamat'];
  104. }
  105. echo "</td>";
  106. echo "<td>".$data['kel_jemaat']."</td>";
  107. ?>
  108. <?php if(@$_SESSION['admin'] || @$_SESSION['pengurus']){ ?>
  109. <td>
  110. <a onclick="return confirm('Yakin Ingin Mengedit Data <?php echo $data['nama_anggota']; ?>?')" href="?p=anggota&act=edit&id_anggota=<?php echo $data['id_anggota']; ?>" >
  111. <span class='btn btn-primary btn-xs'><i class='fa fa-edit'></i> Edit</span>
  112. </a>
  113. <a onclick="return confirm('Yakin Ingin Menghapus Data <?php echo $data['nama_anggota']; ?>?')" href="?p=anggota&act=hapus&id_anggota=<?php echo $data['id_anggota']; ?>">
  114. <span class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> Hapus</span>
  115. </a>
  116. <td>
  117. <?php } ?>
  118. <?php
  119. echo "<tr>";
  120.  
  121. $no++;
  122. }
  123. }
  124. ?>
  125. </tbody>
  126. </table>
  127. <div class="col-sm-5">
  128. <div class="dataTables_info" id="example2_info" role="status" aria-live="polite">
  129. <?php echo "Jumlah Data : ". $jml_data; ?>
  130. </div>
  131. </div>
  132. <div class="col-sm-7">
  133. <div class="dataTables_paginate paging_simple_numbers" id="example2_paginate">
  134. <?php
  135.  
  136. $JmlHalaman = ceil($jml_data/$batas);
  137. if ( $pg > 1 ) {
  138. $link = $pg-1;
  139. $prev = 1;
  140. } else {
  141. $prev = "";
  142. }
  143.  
  144. $nmr = '';
  145.  
  146.  
  147. if ( $pg < $JmlHalaman ) {
  148. $link = $pg + 1;
  149. $next = 1;
  150. } else {
  151. $next = "";
  152. }
  153.  
  154. ?>
  155. <ul class="pagination">
  156. <?php
  157. if($prev == 1){
  158. echo '<li class="paginate_button previous" id="example2_previous">';
  159. echo "<a href='?p=anggota&pg=$link' aria-controls='example2' data-dt-idx='0' tabindex='0'>Sebelumnya </a></li>";
  160. } else if($prev == ""){
  161. echo '<li class="paginate_button previous disabled" id="example2_previous">';
  162. echo "<a href='#' aria-controls='example2' data-dt-idx='0' tabindex='0'>Sebelumnya </a></li>";
  163. }
  164. for ( $i = 1; $i<= $JmlHalaman; $i++ ){
  165.  
  166. if ( $i == $pg ) {
  167. echo '<li class="paginate_button active">';
  168. echo "<a href='#' >$i</a></li>";
  169. } else {
  170. echo '<li class="paginate_button">';
  171. echo "<a href='?p=anggota&pg=$i' aria-controls='example2' data-dt-idx='0' tabindex='0'>$i</a></li>";
  172. }
  173. }
  174. if($next == 1){
  175. echo '<li class="paginate_button next" id="example2_previous">';
  176. echo "<a href='?p=anggota&pg=$link' aria-controls='example2' data-dt-idx='0' tabindex='0'>Selanjutnya </a></li>";
  177. } else if($next == ""){
  178. echo '<li class="paginate_button next disabled" id="example2_previous">';
  179. echo "<a href='#' aria-controls='example2' data-dt-idx='0' tabindex='0'>Selanjutnya </a></li>";
  180. }
  181. ?>
  182. </ul>
  183. </div>
  184. </div>
  185. </div>
  186. <!-- /.box-body -->
  187. </div>
  188. </div>
  189. <!-- /.col -->
  190. </div>
  191. <!-- /.row -->
  192. </section>
  193.  
  194. <link rel="stylesheet" type="text/css" href="DataTables/datatables.css">
  195.  
  196. <script type="text/javascript" charset="utf8" src="DataTables/datatables.js"></script>
  197. <script type="text/javascript" charset="utf8" src="DataTables/DataTables-1.10.13/js/jquery.dataTables.js"></script>
  198. <script>
  199. $(document).ready( function () {
  200. $('#table_id').DataTable();
  201. } );
  202. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement