Example #1
0
 function advanced_search_view()
 {
     $manufacture_service = new Manufacture_service();
     $vehicle_model_service = new Vehicle_model_service();
     $body_type_service = new Body_type_service();
     $fuel_type_service = new Fuel_Type_service();
     $transmission_service = new Transmission_service();
     $district_service = new District_service();
     $vehicle_advertisments_service = new Vehicle_advertisments_service();
     $advanced_search_content_service = new Advanced_search_content_service();
     $data['manufactures'] = $manufacture_service->get_all_active_manufactures_for_home();
     $data['models'] = $vehicle_model_service->get_all_active_vehicle_models();
     $data['body_types'] = $body_type_service->get_all_active_body_types();
     $data['fuel_types'] = $fuel_type_service->get_all_active_fuel_types();
     $data['transmissions'] = $transmission_service->get_all_active_transmissions();
     $data['locations'] = $district_service->get_all_districts();
     $data['latest_vehicles'] = $vehicle_advertisments_service->get_new_arrival(2);
     $fields = $advanced_search_content_service->get_user_advanced_search_field($this->session->userdata('USER_ID'));
     $data['fields'] = $fields;
     $fields_arr = array();
     $i = 0;
     foreach ($fields as $field) {
         $fields_arr[$i] = $field->field_name;
         $i++;
     }
     $data['fields_arr'] = $fields_arr;
     $parials = array('content' => 'vehicle_adds/advanced_search', 'new_arrivals' => 'vehicle_adds/new_arrivals');
     $this->template->load('template/main_template', $parials, $data);
 }
Example #2
0
 function edit_transmission()
 {
     $transmission_model = new Transmission_model();
     $transmission_service = new Transmission_service();
     $transmission_model->set_id($this->input->post('transmission_id', TRUE));
     $transmission_model->set_name($this->input->post('name', TRUE));
     $transmission_model->set_updated_by($this->session->userdata('USER_ID'));
     $transmission_model->set_updated_date(date("Y-m-d H:i:s"));
     echo $transmission_service->update_transmission($transmission_model);
 }
 function edit_new_advertisement($advertisement_id)
 {
     $_POST['last_vehicle_id'] = $advertisement_id;
     $manufacture_service = new Manufacture_service();
     $vehicle_model_service = new Vehicle_model_service();
     $body_type_service = new Body_type_service();
     $fuel_type_service = new Fuel_Type_service();
     $transmission_service = new Transmission_service();
     $equipment_service = new Equipment_service();
     $vehicle_advertisement_service = new Vehicle_advertisments_service();
     $vehicle_equipment_service = new Vehicle_equipment_service();
     $district_service = new District_service();
     $vehicle_images_service = new Vehicle_images_service();
     $data['heading'] = "Sell your vehicle";
     $data['manufactures'] = $manufacture_service->get_all_active_manufactures();
     $data['models'] = $vehicle_model_service->get_all_active_vehicle_models();
     $data['body_types'] = $body_type_service->get_all_active_body_types();
     $data['fuel_types'] = $fuel_type_service->get_all_active_fuel_types();
     $data['transmissions'] = $transmission_service->get_all_active_transmissions();
     $data['equipments'] = $equipment_service->get_all_active_equipment();
     $data['locations'] = $district_service->get_all_districts();
     $data['vehicle_advertisement'] = $vehicle_advertisement_service->get_advertisement_by_id($advertisement_id);
     $vehicle_equipments = $vehicle_equipment_service->get_equipments_by_vehicle_id($advertisement_id);
     $equipment_array = array();
     $data['vehicle_images'] = $vehicle_images_service->get_images_for_advertisement($advertisement_id);
     foreach ($vehicle_equipments as $value) {
         $equipment_array[] = $value->equipment_id;
     }
     $data['vehicle_equipments'] = $equipment_array;
     $data['latest_vehicles'] = $vehicle_advertisement_service->get_new_arrival(2);
     $parials = array('content' => 'vehicle_adds/edit_advertisement', 'new_arrivals' => 'vehicle_adds/new_arrivals');
     $this->template->load('template/main_template', $parials, $data);
 }
Example #4
0
 function load_data()
 {
     $manufacture_service = new Manufacture_service();
     $vehicle_model_service = new Vehicle_model_service();
     $body_type_service = new Body_type_service();
     $fuel_type_service = new Fuel_Type_service();
     $transmission_service = new Transmission_service();
     $district_service = new District_service();
     $content_service = new Content_service();
     $data['manufactures'] = $manufacture_service->get_all_active_manufactures();
     $data['models'] = $vehicle_model_service->get_all_active_vehicle_models();
     $data['body_types'] = $body_type_service->get_all_active_body_types();
     $data['fuel_types'] = $fuel_type_service->get_all_active_fuel_types();
     $data['transmissions'] = $transmission_service->get_all_active_transmissions();
     $data['locations'] = $district_service->get_all_districts();
     return $data;
 }
Example #5
0
 function index()
 {
     $manufacture_service = new Manufacture_service();
     $vehicle_model_service = new Vehicle_model_service();
     $body_type_service = new Body_type_service();
     $fuel_type_service = new Fuel_Type_service();
     $transmission_service = new Transmission_service();
     $district_service = new District_service();
     $content_service = new Content_service();
     $vehicle_advertisments_service = new Vehicle_advertisments_service();
     $vehicle_news_service = new Vehicle_news_service();
     $comment_service = new Comments_service();
     $data['website_comments'] = $comment_service->get_all_comments();
     $data['manufactures'] = $manufacture_service->get_all_active_manufactures_for_home();
     //$data['models']        = $vehicle_model_service->get_all_active_vehicle_models();
     $data['body_types'] = $body_type_service->get_all_active_body_types();
     $data['fuel_types'] = $fuel_type_service->get_all_active_fuel_types();
     $data['transmissions'] = $transmission_service->get_all_active_transmissions();
     $data['locations'] = $district_service->get_all_districts();
     $data['why_us'] = $content_service->get_content_by_hcodes('WHYUS');
     if (isset($this->session)) {
         $vehicle_results = $vehicle_advertisments_service->get_recently_viewed_vehicles($this->session->userdata('USER_ID'));
     }
     $data['vehicle_results'] = $vehicle_results;
     $data['names'] = $manufacture_service->get_manufacture_name();
     //        $data['logos'] = $manufacture_service->get_manufacture_logo();
     $data['price_drop_vehicles'] = $vehicle_advertisments_service->get_price_drop_vehicles(4);
     //Ashani
     $data['latest_vehicles'] = $vehicle_advertisments_service->get_new_arrival(2);
     //author-Ishani
     $data['vehicle_news_results'] = $vehicle_news_service->get_vehicle_news();
     //author-Ishani
     $data['featured_vehicles'] = $vehicle_advertisments_service->get_featured_advertisements(4);
     $data['popular_vehicles'] = $vehicle_advertisments_service->get_popular_advertisements();
     //Ashani
     $parials = array('content' => 'content_pages/home_content', 'new_arrivals' => 'vehicle_adds/new_arrivals');
     $this->template->load('template/main_template', $parials, $data);
 }