public function vehicle_advertisement_detail_view($id)
 {
     $vehicle_advertisments_service = new Vehicle_advertisments_service();
     $vehicle_images_service = new Vehicle_images_service();
     $searched_vehicles_model = new Searched_vehicles_model();
     $searched_vehicles_service = new Searched_vehicles_service();
     $vehicle_reviews_service = new Vehicle_reviews_service();
     $vehicle_equipment_service = new Vehicle_equipment_service();
     $equipment_service = new Equipment_service();
     $user_service = new User_service();
     $website_advertisement_service = new Website_advertisements_service();
     $vehicle_id = $this->uri->segment(3);
     $data['equipments'] = $equipment_service->get_all_active_equipment();
     $data['vehicle_detail'] = $vehicle_advertisments_service->get_advertisement_by_id($id);
     $data['seller_add'] = $user_service->get_user($data['vehicle_detail']->added_by);
     $data['images'] = $vehicle_images_service->get_images_for_advertisement($id);
     $data['vehicle_reviews'] = $vehicle_reviews_service->get_all_vehicle_reviews($vehicle_id);
     $data['review_looks_count'] = count($searched_vehicles_service->get_view_count_for_advertisement($id));
     $data['suggestions'] = $vehicle_advertisments_service->similar_suggestions($data['vehicle_detail']->manufacture_id, $data['vehicle_detail']->model_id);
     //Ashani
     $vehicle_equipments = $vehicle_equipment_service->get_equipments_by_vehicle_id($id);
     $equipment_array = array();
     foreach ($vehicle_equipments as $value) {
         $equipment_array[] = $value->equipment_id;
     }
     $data['vehicle_equipments'] = $equipment_array;
     $data['latest_vehicles'] = $vehicle_advertisments_service->get_new_arrival(2);
     $data['commercial_images'] = $website_advertisement_service->get_advertisement_image();
     $parials = array('content' => 'vehicle_adds/vehicle_detail_view', 'new_arrivals' => 'vehicle_adds/new_arrivals');
     $this->template->load('template/main_template', $parials, $data);
 }
示例#2
0
 /**
  * this is the controller function to load compare vehicles section on dashboard directly for unregistered user
  * compare button click event
  */
 function load_compare_vehicles_dashboard_unreg_user($key_array)
 {
     $saved_vehicle_list = array();
     $saved_vehicle_id_list = array();
     //split and extract vehicle list from jStorage key list (key list comes as one string)
     $saved_vehicle_list = explode(',', $key_array);
     //extract vehicle id from vehicle list
     for ($i = 0; $i < count($saved_vehicle_list); $i++) {
         $vehicle_id = explode('_', $saved_vehicle_list[$i]);
         $saved_vehicle_id_list[$i] = $vehicle_id[1];
     }
     $vehicle_compare_service = new Vehicle_compare_service();
     $equipment_service = new Equipment_service();
     $data['vehicle_list'] = $vehicle_compare_service->get_vehicle_to_compare_for_unregistered_user($saved_vehicle_id_list);
     $data['equipments'] = $equipment_service->get_all_active_equipment();
     $data['vehicle_equipments'] = array();
     foreach ($data['vehicle_list'] as $vehicle) {
         $data['equipment_arr'] = $equipment_service->get_equiments_in_vehicle($vehicle->id);
         array_push($data['vehicle_equipments'], $data['equipment_arr']);
     }
     $data['my_advertisements'] = 0;
     $vehicle_advertisments_service = new Vehicle_advertisments_service();
     $data['latest_vehicles'] = $vehicle_advertisments_service->get_new_arrival(2);
     //author-Ishani
     $parials = array('content' => 'my_dashboard/my_dashboard', 'new_arrivals' => 'vehicle_adds/new_arrivals');
     $this->template->load('template/main_template', $parials, $data);
 }