| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_projetos/sopizzas/application/models/ |
Upload File : |
<?php
Class location_model extends CI_Model {
function get_state_list($params = array(), $action = '') {
$this->db->select('*');
$this->db->from('rt_state');
if ($action == '1' || $action == '0') {
$this->db->where('state_status', $action);
}
else if ($action == '12') {
$this->db->order_by('statecode', 'ASC');
}
else if ($action == '21') {
$this->db->order_by('statecode', 'DESC');
}
else if ($action == '13') {
$this->db->order_by('state_id', 'ASC');
}
else if ($action == '31') {
$this->db->order_by('state_id', 'DESC');
}
else if ($action == '14') {
$this->db->order_by('state_status', 'DESC');
}
else if ($action == '41') {
$this->db->order_by('state_status', 'ASC');
}
else if ($action == '19') {
$this->db->order_by('statename', 'ASC');
}
else if ($action == '91') {
$this->db->order_by('statename', 'DESC');
}
else {
$this->db->order_by('state_id', 'DESC');
}
if(array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit'],$params['start']);
}elseif(!array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit']);
}
$query = $this->db->get();
return ($query->num_rows() > 0)?$query->result_array():FALSE;
}
function isStateCodeExist($state_id, $statecode) {
$this->db->select('*');
$this->db->from('rt_state');
$this->db->where('state_id !=', $state_id);
$this->db->where('statecode', $statecode);
$query = $this->db->get();
return ($query->num_rows() > 0)?TRUE:FALSE;
}
function isStateNameExist($state_id, $statename) {
$this->db->select('*');
$this->db->from('rt_state');
$this->db->where('state_id !=', $state_id);
$this->db->where('statename', $statename);
$query = $this->db->get();
return ($query->num_rows() > 0)?TRUE:FALSE;
}
function get_city_list($params = array(), $action = '') {
$this->db->select('*');
$this->db->from('rt_city');
if ($action == '1' || $action == '0') {
$this->db->where('city_status', $action);
}
else if ($action == '12') {
$this->db->order_by('statecode', 'ASC');
}
else if ($action == '21') {
$this->db->order_by('statecode', 'DESC');
}
else if ($action == '13') {
$this->db->order_by('city_id', 'ASC');
}
else if ($action == '31') {
$this->db->order_by('city_id', 'DESC');
}
else if ($action == '14') {
$this->db->order_by('city_status', 'DESC');
}
else if ($action == '41') {
$this->db->order_by('city_status', 'ASC');
}
else if ($action == '19') {
$this->db->order_by('cityname', 'ASC');
}
else if ($action == '91') {
$this->db->order_by('cityname', 'DESC');
}
else {
$this->db->order_by('city_id', 'DESC');
}
if(array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit'],$params['start']);
}elseif(!array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit']);
}
$query = $this->db->get();
return ($query->num_rows() > 0)?$query->result_array():FALSE;
}
function isCityNameExist($city_id, $cityname) {
$this->db->select('*');
$this->db->from('rt_city');
$this->db->where('city_id !=', $city_id);
$this->db->where('cityname', $cityname);
$query = $this->db->get();
return ($query->num_rows() > 0)?TRUE:FALSE;
}
function get_zipcode_list($params = array(), $action = '') {
$this->db->select('*');
$this->db->from('rt_zipcode');
if ($action == '1' || $action == '0') {
$this->db->where('zipcode_status', $action);
}
else if ($action == '12') {
$this->db->order_by('statecode', 'ASC');
}
else if ($action == '21') {
$this->db->order_by('statecode', 'DESC');
}
else if ($action == '57') {
$this->db->order_by('areaname', 'ASC');
}
else if ($action == '75') {
$this->db->order_by('areaname', 'DESC');
}
else if ($action == '13') {
$this->db->order_by('zipcode_id', 'ASC');
}
else if ($action == '31') {
$this->db->order_by('zipcode_id', 'DESC');
}
else if ($action == '14') {
$this->db->order_by('zipcode_status', 'DESC');
}
else if ($action == '41') {
$this->db->order_by('zipcode_status', 'ASC');
}
else if ($action == '19') {
$this->db->order_by('zipcode', 'ASC');
}
else if ($action == '91') {
$this->db->order_by('zipcode', 'DESC');
}
else {
$this->db->order_by('zipcode_id', 'DESC');
}
if(array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit'],$params['start']);
}elseif(!array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit']);
}
$query = $this->db->get();
return ($query->num_rows() > 0)?$query->result_array():FALSE;
}
function isZipcodeExist($zipcode_id, $zipcode) {
$this->db->select('*');
$this->db->from('rt_zipcode');
$this->db->where('zipcode_id !=', $zipcode_id);
$this->db->where('zipcode', $zipcode);
$query = $this->db->get();
return ($query->num_rows() > 0)?TRUE:FALSE;
}
}