Advertisement
freddy0512

model

Jan 31st, 2015
389
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class Indonesia_model extends CI_Model {
  3. function __construct() { parent::__construct(); }
  4. function getAllIndonesia() {
  5. $this->db->from("tabel_indonesia");
  6. return $this->db->get();
  7. }
  8.  
  9. function remove_checked_indonesia() {
  10. $action = $this->input->post('hapus');
  11. if ($action) {
  12. $delete = $this->input->post('item');
  13. for ($i=0; $i < count($delete) ; $i++) {
  14. $this->db->where('id', $delete[$i]);
  15. $this->db->delete('tabel_indonesia');
  16. }
  17. }
  18. }
  19.  
  20. function link_photo()
  21. {
  22. $action = $this->input->post('hapus');
  23. if ($action) {
  24. $delete = $this->input->post('item');
  25. for ($i=0; $i < count($delete) ; $i++) {
  26. $this->db->where('id', $delete[$i]);
  27. $query = $getData = $this->db->get('tabel_indonesia');
  28. if($getData->num_rows() > 0)
  29. return $query;
  30. else
  31. return null;
  32. }
  33. }
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. }
Advertisement
RAW Paste Data Copied
Advertisement