Advertisement
freddy0512

view

Jan 31st, 2015
459
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script language="javascript">
  2. function check_all()
  3. {
  4. var chk = document.getElementsByName('item[]');
  5. for (i = 0; i < chk.length; i++)
  6. chk[i].checked = true ;
  7. }
  8.  
  9. function uncheck_all()
  10. {
  11. var chk = document.getElementsByName('item[]');
  12. for (i = 0; i < chk.length; i++)
  13. chk[i].checked = false ;
  14. }
  15. </script>
  16.  
  17.  
  18.  
  19.  
  20. <form name="indonesia" action="<?php echo site_url('admin/indonesia/delete_multiple'); ?>" method="post">
  21. <button type="submit" class="btn btn-danger" name="hapus" value="hapus">Hapus</button>
  22. <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
  23. <thead>
  24. <tr>
  25. <th>
  26. <button type="button" class="btn btn-info" onClick="check_all()" >Check</button>
  27. <button type="button" class="btn btn-success" onClick="uncheck_all()" >Un-Check</button>
  28. </th>
  29. <th>judul</th>
  30. <th>penulis</th>
  31. <th>stat</th>
  32. <th>Tgl</th>
  33. </tr>
  34. </thead>
  35.  
  36. <tbody>
  37. <?php
  38. foreach ($ListIndonesia->result() as $row)
  39. {
  40. ?>
  41. <tr>
  42. <td><input type="checkbox" name="item[]" id="item[]" value="<?=$row->id ?>"></td>
  43. <td><?=$row->judul ?></td>
  44. <td><?=$row->penulis ?></td>
  45. <td><?=$row->stat ?></td>
  46. <td><?=tgl_indo($row->tgl) ?></td>
  47. </tr>
  48. <?php } ?>
  49. </tbody>
  50. </table>
Advertisement
RAW Paste Data Copied
Advertisement