showing results for - "codeigniter ajax crud using datatables"
Meg
17 Mar 2019
1 <?php  
2 class Crud_model extends CI_Model  
3 {  
4      var $table = "users";  
5      var $select_column = array("id", "first_name", "last_name", "image");  
6      var $order_column = array(null, "first_name", "last_name", null, null);  
7      function make_query()  
8      {  
9           $this->db->select($this->select_column);  
10           $this->db->from($this->table);  
11           if(isset($_POST["search"]["value"]))  
12           {  
13                $this->db->like("first_name", $_POST["search"]["value"]);  
14                $this->db->or_like("last_name", $_POST["search"]["value"]);  
15           }  
16           if(isset($_POST["order"]))  
17           {  
18                $this->db->order_by($this->order_column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);  
19           }  
20           else  
21           {  
22                $this->db->order_by('id', 'DESC');  
23           }  
24      }  
25      function make_datatables(){  
26           $this->make_query();  
27           if($_POST["length"] != -1)  
28           {  
29                $this->db->limit($_POST['length'], $_POST['start']);  
30           }  
31           $query = $this->db->get();  
32           return $query->result();  
33      }  
34      function get_filtered_data(){  
35           $this->make_query();  
36           $query = $this->db->get();  
37           return $query->num_rows();  
38      }       
39      function get_all_data()  
40      {  
41           $this->db->select("*");  
42           $this->db->from($this->table);  
43           return $this->db->count_all_results();  
44      }  
45      function insert_crud($data)  
46      {  
47           $this->db->insert('users', $data);  
48      }  
49      function fetch_single_user($user_id)  
50      {  
51           $this->db->where("id", $user_id);  
52           $query=$this->db->get('users');  
53           return $query->result();  
54      }  
55      function update_crud($user_id, $data)  
56      {  
57           $this->db->where("id", $user_id);  
58           $this->db->update("users", $data);  
59      }  
60 }  
61
queries leading to this page
codeigniter 4 crud datatables modal codeigniter crud using ajaxcodeigniter 4 crud datatablelcrud in codeigniter 4 using ajaxcodeigniter ajax crud using datatables update edit datacrud using datatable ajax in codeigniter 4 2020ajax crud in codeigniter 3ajax crud codeignitercodeigniter databales crudsimple ajax codeigniter crud applicationcodeigniter ajax crud using datatables update edit datacrud operations in codeigniter 4 using ajaxcodeigniter 4 datatable crud 2020crud in codeigniter with datatables ajaxcrud in codeigniter using ajaxcrud datatable ajax codeigniter 4codeigniter ajax crud using datatablescodeigniter 4 datatable crud non ajaxcodeigniter 4 datatable crudcodeigniter 4 crud datatablecrud datatable ajax codeigniter 4 2020crud datatable codeignitercrud using ajax in codeigniter datatablescodeigniter datatable crudscure ajax crud and codeigniter 4crud datatables codeigniterhow to edit data in codeigniter php using jquery and ajaxcodeigniter 4 datatable crud ajax validationjquery ajax crud operations in codeigniterajax crud in codeigniter 4 with datatablescodeigniter 4 datatable crud modalcrud operation in codeigniter using ajaxcrud datatable non ajax codeigniter 4crud datatables library codeigniter 4codeigniter ajax crud with data tables and bootstrapcodeigniter 4 ajax crud with datatables and bootstrap modalsdatatable crud codeigniter 4 2021codeigniter 4 datatable crud modal 2020ajax crud operation in codeigniter 4codeigniter ajax crud using datatables insert 2f add datadatatables crud in codeigniter 3crud system with codeigniter using ajaxsecure crud using datatable ajax in codeigniter 4codeigniter crud ajaxcodeigniter datatable crud tutorialcrud datatables server side codeignitercodeigniter ajax crud using datatables create tableajax crud in codeigniter 3 with datatablescrud using model in codeigniter 4 using ajaxcodeigniter ajax crudcodeigniter ajax crud tutorialsimple crud operation in codeigniter using ajaxajax crud with jquery datatables by using codeigniterdatatables codeigniter ajax crud examplecodeigniter crud example using jquery 2fajaxdatatable crud codeigniter 4 dengan ajax 2021datatable in codeigniter using ajaxdatatables codeigniter ajax example phpcodeigniter 4 crud datatable librarycrud using ajax in codeigniterhow to use ajax datatable with laravelcrud operation in codeigniter using ajax mvcajax crud in codeigniter 4 with datatables insert datacrud application in codeigniter using with datatable ajaxcodeigniter datatables ajaxdatatable crud in codeigniter 3codeigniter crud with ajaxcodeigniter ajax crud using datatables