function change_publish_status() { $comments_model = new Comments_model(); $comments_service = new Comments_service(); $comments_model->set_id(trim($this->input->post('id', TRUE))); $comments_model->set_is_published(trim($this->input->post('value', TRUE))); echo $comments_service->publish_comment($comments_model); }
function index() { $reg_user_service = new Reg_User_Service(); $vehicle_advertisements_service = new Vehicle_advertisments_service(); $comments_service = new Comments_service(); $data['heading'] = 'Dashboard'; $data['reg_user_count'] = count($reg_user_service->get_reg_user_details()); $data['approved_count'] = count($vehicle_advertisements_service->get_approved_advertisements()); $data['pending_count'] = count($vehicle_advertisements_service->get_pending_advertisements()); $data['reviews_count'] = count($comments_service->get_all_comments()); $partials = array('content' => 'dashboard/dashboard_view'); $this->template->load('template/main_template', $partials, $data); }
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); }
function add_website_comments() { $comments_service = new Comments_service(); $comments_model = new Comments_model(); $comments_model->set_description($this->input->post('description', TRUE)); $comments_model->set_title($this->input->post('title', TRUE)); $comments_model->set_added_date(date("Y-m-d H:i:s")); $comments_model->set_added_by($this->session->userdata('USER_ID')); $comments_model->set_is_published('1'); $comments_model->set_is_deleted('0'); $comments_service->add_website_comments($comments_model); $website_comments = $comments_service->get_all_comments_list(); foreach ($website_comments as $value) { ?> <li class="comment"><br> <figure><br><br> <div class="image"> <?php if ($value->profile_pic == '') { ?> <img class="img-responsive img-circle" style="width:100px; height:50px;" src="<?php echo base_url() . 'uploads/user_avatars/avatar.png'; ?> "/> <?php } else { ?> <img class="img-responsive img-circle" style="width:100px; height:50px;" src="<?php echo base_url() . 'uploads/user_avatars/' . $value->profile_pic; ?> "/> <?php } ?> </div> </figure> <div class="comment-wrapper"> <?php if ($value->added_by_user != '') { ?> <div class="name pull-left"><?php echo ucfirst($value->added_by_user); ?> </div> <?php } ?> <span class="date pull-right"><br><br><br><br> <span class="fa fa-calendar"></span> <?php echo date('Y.m.d', strtotime($value->added_date)); ?> </span> <p><header><a href="blog-detail.html"><h2><?php echo $value->title; ?> </h2></a></header> <?php echo $value->description; ?> </p> </div> </li> <?php } }