';print_r($segments);echo ""; // exit; //$controller = $segments[0]; //echo $controller; global $DB_ROUTES; $routes['products'] = 'products/all_products'; $con = mysqli_connect($params[0], $params[1], $params[2]); mysqli_select_db($con , $params[3]); $routes = array(); $i=0; foreach($segments as $s) { } if(!empty($segments[0])) { $s = $segments[0]; if($s =='search-detail') { echo ""; } $controler = "user/search/"; $loc_status = true; $s = $segments[0]; $sql = "SELECT vendor_id FROM vendor where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $routes["$s"] = "user/search_detail/$route[vendor_id]"; $loc_status = false; } } if($loc_status) { $sql = "SELECT state_id FROM state where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $controler .= $route['state_id']; } } else{ $controler .= '0'; } $controler .= '/'; $sql = "SELECT city_id FROM city where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $controler .= $route['city_id']; } } else{ $controler .= '0'; } $controler .= '/'; $sql = "SELECT location_id FROM location where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $controler .= $route['location_id']; } } else{ $controler .= '0'; } $controler .= '/'; $sql = "SELECT main_category_id FROM main_category where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $controler .= $route['main_category_id']; } } else{ $controler .= '0'; } $sql = "SELECT city_id , main_category_id , from_to_city_id FROM from_to_city where status=1 and slug_url like('$s') limit 1"; $query = mysqli_query($con , $sql); if(mysqli_num_rows($query)>0){ while ($route = mysqli_fetch_assoc($query)) { $controler = "user/search/0/$route[city_id]/0/$route[main_category_id]/$route[from_to_city_id]"; } } if($controler!='user/search/0/0/0/0') $routes["$s"] = $controler; } } // print_r($routes); mysqli_free_result($query); mysqli_close($con); $DB_ROUTES = $routes; // echo "
";print_r($DB_ROUTES);echo "
";exit; } } ?>load->model('user_model'); $this->load->library('session'); $this->load->helper('url'); $this->load->library('upload'); $this->load->helper('recaptchalib'); $this->data['temp_id'] = $this->session->userdata('plp_sess_temp_id'); $this->data['temp_name'] = $this->session->userdata('plp_sess_temp_name'); $this->data['company_name'] = $this->session->userdata('plp_sess_temp_company_name'); $this->output->set_header('HTTP/1.0 200 OK'); $this->output->set_header('HTTP/1.1 200 OK'); //$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate'); $this->output->set_header('Cache-Control: post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); } function getHeader($page , $data='') { //print_r($data); if(!empty($data)) $this->data = $data; $this->data['nav_state'] = $this->user_model->getState(array()); $this->data['servicesLeftNav'] = $this->user_model->getMainCategory(); $this->load->view("inc/$page",$this->data); } function getFooter($page , $data='') { if(!empty($data)) $this->data = $data; $params = array( 'table' => "city", 'is_popular' => "1"); $this->data['footer_popular_locations']=$this->user_model->getPopularLocations($params);unset($params); $this->data['footer_from_to_city'] = $this->user_model->getFromToCity(array('is_popular'=>1)); $this->data['footer_services']=$this->user_model->getMainCategoryFooter(array()); $this->data['servicesLeftNav'] = $this->user_model->getMainCategory(); $this->data['city']=$this->user_model->getCity(array()); $this->load->view("inc/$page", $this->data); } function getLeft($page) { //$data['ctg_list']=$this->admin_model->getList('home_ctg_list',0,"",""); //$data['subctg_list']=$this->admin_model->getList('home_subctg_list',0,"",""); //$this->load->view('inc/leftNav',$data); } } ?>