Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: heri
- * Date: 11/15/17
- * Time: 10:27 PM
- */
- require APPPATH . 'libraries/REST_Controller.php';
- class Jsonandroid extends REST_Controller
- {
- function __construct($config = 'rest')
- {
- parent::__construct($config);
- // $this->load->database();
- $this->load->model('/crudandroid/jsonandroidmodel');
- }
- function index_get(){
- $id = $this->get('npm');
- if ($id == ''){
- $database = $this->db->get('tb_mahasiswa')->result();
- }else{
- $this->db->where('npm', $id);
- $database = $this->db->get('tb_mahasiswa')->result();
- }
- $this->response($database, 200);
- }
- public function index_delete(){
- $npm = $this->uri->segment(3);
- $delete = $this->jsonandroidmodel->delete($npm);
- $this->response($delete);
- }
- //
- }
Add Comment
Please, Sign In to add comment