Advertisement
freddy0512

model

Jan 30th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  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.  
  10. function remove_checked_indonesia() {
  11. $action = $this->input->post('hapus');
  12. if ($action) {
  13. $delete = $this->input->post('item');
  14. for ($i=0; $i < count($delete) ; $i++) {
  15. $this->db->where('id', $delete[$i]);
  16. $this->db->delete('tabel_indonesia');
  17. }
  18. }
  19. }
  20.  
  21. function link_photo()
  22. {
  23. $action = $this->input->post('hapus');
  24. if ($action) {
  25. $delete = $this->input->post('item');
  26. for ($i=0; $i < count($delete) ; $i++) {
  27. $this->db->where('id', $delete[$i]);
  28. $query = $getData = $this->db->get('tabel_indonesia');
  29. if($getData->num_rows() > 0)
  30. return $query;
  31. else
  32. return null;
  33. }
  34. }
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement