muhirfan

Artikel.php

Mar 5th, 2017
1,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1.  
  2. <?php //include 'class.php';
  3.  
  4. //echo "$sql"?>
  5.  <div class="box">
  6.     <div class="box-header">
  7.         <h3 class="box-title">Tampil Artikel</h3>
  8.     </div>
  9.    
  10.     <div id="response"></div>
  11.        
  12.       <div id="table-data" style="margin-left: 90px;">
  13.     <div class="row">
  14.     <div class="box-body">
  15.         <table id="myTable" class="table table-striped table-bordered table-condensed display nowrap dataTable dtr-inline">
  16.             <thead>
  17.                 <tr>
  18.                     <th> No</th>
  19.                     <th> Judul</th>
  20.                     <th> Kategori</th>
  21.                     <th> Tanggal</th>
  22.                     <th> Isi</th>
  23.                     <th> Action</th>
  24.                 </tr>
  25.             </thead>
  26.             <tbody>
  27.  
  28.  
  29.                 <?php
  30.  
  31.                     $index = 1;
  32.                     $ar= new artikel();
  33.                    
  34.                     foreach ($ar->tampil_artikel() as $data){
  35.                    
  36.                         echo"
  37.                             <tr>
  38.                                 <th>  $index </th>
  39.                                 <th>  $data[Judul] </th>
  40.                                 <th>  $data[Namakategori] </th>
  41.                                 <th>  $data[Tanggal]</th>
  42.                                 <th>  $data[Isi] </th>
  43.                                 <th>
  44.                                     <a href='admin.php?modul=ubahartikel&Idartikel=$data[Idartikel]' class='btn btn-info'><i class='fa fa-pencil'></i>Ubah</a>
  45.                                     <a href='modul/proses.php?aksi=hapus&Idartikel=$data[Idartikel]' class='btn btn-danger'><i class='fa fa-remove'></i>Hapus</a>
  46.                                 </th>
  47.                             </tr>";
  48.                             $index++;
  49.                     }
  50.                 ?>
  51.             </tbody>
  52.         </table>
  53.         <br>
  54.         <a href="admin.php?modul=tambahartikel" class="btn btn-primary"><i class="fa fa-plus"></i> Tambah</a>
  55.     </div>
  56.     </div>
  57.     </div>
  58.    
  59.  </div>
  60.  
  61. <script type="text/javascript">
  62. //pageSetUp();
  63.  
  64.   $(document).ready(function(){
  65.     $('#myTable').DataTable({
  66.             //"sDom": "<'row'<'col-sm-12'<'form-group'<f>>>>tr<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
  67.             sDom: 'T<"row view-filter"<"col-sm-12"<"pull-left"l><"clearfix">>>t<"row view-pager"<"col-sm-12"<"pull-right"ip>>>',
  68.             PaginationType : "bootstrap",
  69.             scrollX : true,
  70.             'searching': false,
  71.             'bPaginate': true
  72.  
  73.         });
  74. });
  75.  
  76.  
  77.  
  78. </script>
Advertisement
Add Comment
Please, Sign In to add comment