Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.  
  3. class Crud extends CI_Controller
  4. {
  5.  
  6.     function index(){
  7.  
  8.         $data["people"]=$this->crud_model->read();
  9.         $this->load->view("crud_view",$data);
  10.  
  11.     }
  12.  
  13.     function create(){
  14.         echo json_encode(array("id"=>$this->crud_model->create()));
  15.     }
  16.  
  17.     function update(){
  18.         $id= $this->input->post("id");
  19.         $value= $this->input->post("value");
  20.         $modul= $this->input->post("modul");
  21.         $this->crud_model->update($id,$value,$modul);
  22.         echo "{}";
  23.     }
  24.  
  25.     function delete(){
  26.         $id= $this->input->post("id");
  27.         $this->crud_model->delete($id);
  28.         echo "{}";
  29.     }
  30.  
  31. }