���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/adimi/application/modules/dashboard/models/ |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class States extends CI_Model { public function __construct() { parent::__construct(); } public function count_states($filter = []) { $this->db->select('id'); $this->db->from('states'); if(!empty($filter['country'])){ $this->db->where('country_id', $filter['country']); } if(!empty($filter['state'])){ $this->db->like('name', $filter['state'], 'both'); } $result = $this->db->count_all_results(); return $result; } public function get_states($limit = 20, $start = 0, $filter = []) { $this->db->select('a.*, b.name as country_name'); $this->db->from('states a'); $this->db->join('countries b','a.country_id=b.id','left'); if(!empty($filter['country'])){ $this->db->where('a.country_id', $filter['country']); } if(!empty($filter['state'])){ $this->db->like('a.name', $filter['state'], 'both'); } $this->db->limit($limit, $start); $this->db->order_by('a.id','desc'); $result = $this->db->get()->result_array(); return $result; } public function get_stateinfo_by_id($state_id) { $this->db->select('*'); $this->db->from('states'); $this->db->where('id',$state_id); $result = $this->db->get()->row_array(); return $result; } public function get_country_list() { $this->db->order_by('name','asc'); $result = $this->db->get('countries')->result_array(); return $result; } }