Exemple #1
0
 function listing()
 {
     $date = date('Y-m-d');
     $this->_fields = "so.id,so.customer_id,so.order_status,so.created_date,so.total_amount,so.total_items,so.payment_type,u.name";
     $this->db->from('sales_order so');
     $this->db->join('users u', 'so.customer_id=u.id');
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'id':
                 $this->db->like('so.id', $value);
                 break;
             case 'name':
                 $this->db->like('u.name', $value);
                 break;
             case 'order_status':
                 $this->db->like('so.order_status', $value);
                 break;
             case 'payment_type':
                 $this->db->like('so.payment_type', $value);
                 break;
         }
     }
     return parent::listing();
 }
Exemple #2
0
 function listing()
 {
     $user_id = $this->session->userdata('admin_data')['id'];
     $role = $this->session->userdata('admin_data')['role'];
     if ($role == '2') {
         $user_id = $this->session->userdata('admin_data')['id'];
     } else {
         $user_id = '8';
     }
     $id = $this->session->userdata('id');
     $this->_fields = "*,id as id, IF(is_display='1','Active','Inactive') as is_display";
     if ($role == '2') {
         $this->db->where('created_user', $user_id);
     } else {
         $this->db->where('updated_user', $user_id);
     }
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'title':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
Exemple #3
0
 function listing()
 {
     $this->_fields = "*";
     //from
     $this->db->from($this->_table);
     //joins
     //where
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'product_name':
                 $this->db->like("jwb_views.product_name", $value);
                 break;
             case 'description':
                 $this->db->like("jwb_views.description", $value);
                 break;
             case 'price':
                 $this->db->like("jwb_views.price", $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $user_id = $this->session->userdata('admin_data')['id'];
     $this->_fields = "sf.*,u.name";
     $this->db->from('submitted_forms sf');
     $this->db->join('users u', 'u.id=sf.client_id');
     if ($user_id != 8) {
         $this->db->where('client_id', $user_id);
     }
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'sf.title':
                 $this->db->like('sf.title', $value);
                 break;
             case 'u.name':
                 $this->db->like('u.name', $value);
                 break;
             case 'sf.created_date':
                 $this->db->like('sf.created_date', $value);
                 break;
         }
     }
     return parent::listing();
 }
Exemple #5
0
 function listing()
 {
     $this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'lang':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $date = date('Y-m-d');
     $this->_fields = "*,id as id";
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'cat_name':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $id = $this->session->userdata('admin_client_id');
     $this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     $this->db->where(array('role' => '3', "created_id" => $id));
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'name':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $id = $this->session->userdata('id');
     $this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     $this->db->where('poster_id', $id);
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'language':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $date = date('Y-m-d');
     $user_id = $this->session->userdata('admin_data')['id'];
     $role = $this->session->userdata('admin_data')['role'];
     if ($role == '2') {
         $user_id = $this->session->userdata('admin_data')['id'];
     } else {
         $user_id = '8';
     }
     //$this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     $this->_fields = "l.*,l.id as id,a.language,la.id as laid,la.lang, IF(l.is_active='1','Active','Inactive') as is_active";
     $this->db->from('lession l');
     $this->db->join('lession_attachment a', 'a.lession_id=l.id', 'left');
     $this->db->join('language la', 'la.id=a.language', 'left');
     $this->db->group_by('l.id');
     if ($role == '2') {
         $this->db->where('l.created_user', $user_id);
         $this->db->where('l.from <=', $date);
         $this->db->where('l.to_date >=', $date);
     } else {
         $this->db->where('l.updated_user', $user_id);
         $this->db->where('l.to_date >=', $date);
     }
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             /*case 'title':
                   $this->db->like($key, $value);
               break; */
             case 'l.title':
                 $this->db->like('l.title', $value);
                 break;
             case 'la.lang':
                 $this->db->like('la.lang', $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $user_id = $this->session->userdata('admin_data')['id'];
     $role = $this->session->userdata('admin_data')['role'];
     if ($role == '2') {
         $user_id = $this->session->userdata('admin_data')['id'];
     } else {
         $user_id = '8';
     }
     $id = $this->session->userdata('id');
     // $this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     $this->_fields = "ld.*,l.name,ld.id as id,IF(ld.is_active='1','Active','Inactive') as is_active";
     $this->db->from('employee ld');
     $this->db->join('users l', 'l.id=ld.created_user');
     $this->db->group_by('ld.id');
     if ($role == '2') {
         $this->db->where('ld.created_user', $user_id);
     } else {
         $this->db->where('ld.created_user', $this->session->userdata("clientid"));
     }
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'employee_name':
                 $this->db->like('ld.employee_name', $value);
                 break;
             case 'employee_email':
                 $this->db->like('ld.employee_email', $value);
                 break;
             case 'emp_id':
                 $this->db->like('ld.emp_id', $value);
                 break;
             case 'name':
                 $this->db->like('l.name', $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $date = date('Y-m-d');
     $this->_fields = "a.attr_name,b.id,b.attr_id,b.attr_val,IF(b.is_active='1','Active','Inactive') as is_active";
     $this->db->from('attribute a');
     $this->db->join('attribute_value b', 'a.id=b.attr_id');
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'attr_name':
                 $this->db->like($key, $value);
                 break;
             case 'attr_val':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
Exemple #12
0
 function listing()
 {
     $this->_fields = "*,id as id, IF(is_active='1','Active','Inactive') as is_active";
     $id = $this->session->userdata('admin_data')['id'];
     $role = $this->session->userdata('admin_data')['role'];
     if ($role == 1) {
         $this->db->where('role', 2);
     } else {
         $this->db->where(array('role' => 2, 'id' => $id));
     }
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'name':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $id = $this->session->userdata('id');
     $this->_fields = "a.id as id,l.id as lid,a.language,l.lang, IF(a.is_active='1','Active','Inactive') as is_active";
     $this->db->from('language l');
     $this->db->join('lession_attachment a', 'a.language=l.id', 'right');
     $this->db->group_by('a.id');
     $this->db->where('a.lession_id', $id);
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             /* case 'lang':
                    $this->db->like($key, $value);
                break; */
             case 'l.lang':
                 $this->db->like('l.lang', $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $user_id = $this->session->userdata('admin_data')['id'];
     $this->_fields = "ld.*,u.name,le.title";
     $this->db->from('sign_off ld');
     $this->db->join('employee l', 'l.id=ld.employee_id');
     $this->db->join('users u', 'u.id=ld.client_id');
     $this->db->join('lession le', 'le.id=ld.lesson_id');
     if ($user_id != 8) {
         $this->db->where('client_id', $user_id);
     }
     $this->session->set_userdata('search_field', $this->criteria['search_type']);
     $this->session->set_userdata('search_value', $this->criteria['search_text']);
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'l.employee_name':
                 $this->db->like('l.employee_name', $value);
                 break;
             case 'le.title':
                 $this->db->like('le.title', $value);
                 break;
             case 'ld.created_date':
                 $this->db->like('ld.created_date', $value);
                 break;
             case 'u.name':
                 $this->db->like('u.name', $value);
                 break;
             case 'ld.emp_id':
                 $this->db->like('ld.emp_id', $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $date = date('Y-m-d');
     $this->_fields = "a.id,a.attr_id,a.cat,a.name,a.desc,a.sku,b.cat_name, IF(a.is_active='1','Active','Inactive') as is_active";
     $this->db->from('products a');
     $this->db->join('category b', 'a.cat=b.id');
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'cat_name':
                 $this->db->like($key, $value);
                 break;
             case 'name':
                 $this->db->like($key, $value);
                 break;
             case 'sku':
                 $this->db->like($key, $value);
                 break;
         }
     }
     return parent::listing();
 }
 function listing()
 {
     $user_id = $this->session->userdata('admin_data')['id'];
     $this->_fields = "u.id,f.id as form_id,u.name,f.type,f.filename,f.client_id,f.created_date";
     $this->db->from('users u');
     $this->db->join('forms f', 'f.client_id=u.id');
     $this->db->order_by("f.created_date", "desc");
     if ($user_id != 8) {
         $this->db->where('u.id', $user_id);
     }
     $this->session->set_userdata('search_field', $this->criteria['search_type']);
     $this->session->set_userdata('search_value', $this->criteria['search_text']);
     foreach ($this->criteria as $key => $value) {
         if (!is_array($value) && strcmp($value, '') === 0) {
             continue;
         }
         switch ($key) {
             case 'u.name':
                 $this->db->like('u.name', $value);
                 break;
             case 'f.created_date':
                 $this->db->like('f.created_date', $value);
                 break;
             case 'f.type':
                 $this->db->like('f.type', $value);
                 break;
         }
     }
     return parent::listing();
 }