Advertisement
shev_anto

v_produk

Sep 22nd, 2017
3,515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <div class="x_panel">
  2.     <div class="x_title">
  3.     <h2><button type="button" class="add btn btn-primary"><i class="fa fa-plus-square"></i> Tambah Data </button></h2>
  4. <div class="clearfix"></div>
  5. </div>
  6. <table class="table table-striped table-responsive" id="datatables">
  7. <thead>
  8.     <tr>
  9.         <th>Nomor</th>
  10.         <th>Kode Produk</th>
  11.         <th>Nama Produk</th>
  12.         <th>Action</th>
  13.     </tr>
  14. </thead>
  15. <tbody>
  16.     <?php $no=1;
  17.     foreach($datatables->result() as $row){
  18.         echo "<tr>";
  19.         echo "<td>".$no."</td>";
  20.         echo "<td>".$row->kode_produk."</td>";
  21.         echo "<td>".$row->nama_produk."</td>";
  22.         echo "<td>
  23.             <button type='button' class='btn btn-primary btn-xs' onclick=edit('".$row->id_produk."') ><i class='fa fa-edit'></i></button>
  24.             <button type='button' class='btn btn-warning btn-xs' onclick=del('".$row->id_produk."') ><i class='fa fa-trash'></i></button>
  25.             </td>";
  26.         echo "</tr>";
  27.        
  28.     $no++;} ?>
  29. </tbody>
  30. </table>
  31. </div>
  32.  
  33. <!-- Data tables -->
  34. <style type="text/css">@import url("<?php echo base_url() . 'js/datatables/jquery.dataTables.min.css'; ?>");</style>
  35. <script type='text/javascript' src="<?php echo base_url(); ?>js/datatables/jquery.dataTables.min.js"></script>
  36. <script type='text/javascript' src="<?php echo base_url(); ?>js/datatables/dataTables.bootstrap.js"></script>
  37. <script type="text/javascript">
  38.           $(document).ready(function() {
  39.             $('#datatables').dataTable();
  40.           });
  41.      
  42.         </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement