Guest User

Untitled

a guest
Dec 12th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: heri
  5. * Date: 11/15/17
  6. * Time: 10:27 PM
  7. */
  8.  
  9. require APPPATH . 'libraries/REST_Controller.php';
  10. class Jsonandroid extends REST_Controller
  11. {
  12. function __construct($config = 'rest')
  13. {
  14. parent::__construct($config);
  15. $this->load->model('/crudandroid/jsonandroidmodel');
  16. }
  17.  
  18. function index_get()
  19. {
  20. $id = $this->get('npm');
  21. if ($id == '') {
  22. $database = $this->db->get('tb_mahasiswa')->result();
  23. } else {
  24. $this->db->where('npm', $id);
  25. $database = $this->db->get('tb_mahasiswa')->result();
  26. }
  27. $this->response($database, 200);
  28.  
  29. }
  30.  
  31. public function index_delete()
  32. {
  33.  
  34. // $npm = $_GET['npm'];
  35. $npm = $this->uri->segment(3);
  36. $delete = $this->jsonandroidmodel->getdeletedatabase($npm);
  37. $this->response($delete);
  38. }
  39. }
Add Comment
Please, Sign In to add comment