File: //var/www/html/pmw24/OLD_Root_BAK/application/controllers/admin/Wheelreplacementreport.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Wheelreplacementreport extends MY_Controller {
public function __construct() {
parent::__construct();
$this->redirect_guest();
$this->admin=$this->session->userdata('admin');
$this->load->model('admin/mwheelreplacementreport');
}
public function index() {
$this->_load_list_view();
}
private function _load_list_view() {
$condition = array();
$data['content'] = 'admin/wheelreplacementreport/list';
$this->load->view('admin/layouts/index', $data);
}
public function all_content_list(){
$list = $this->mwheelreplacementreport->get_datatables();
$data = array();
$no = $_POST['start'];
$i=1;
foreach ($list as $person) {
$no++;
$row = array();
$row[] =$no;
$row[] = '<a class="cstm_view" id="view" style="padding-left:5px" href="javascript:void(0)" title="'.$person->car_id.'">'.$person->car_no.'</a>';
$data[] = $row;
$i++;
}
$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->mwheelreplacementreport->count_all(),
"recordsFiltered" => $this->mwheelreplacementreport->count_filtered(),
"data" => $data,
);
echo json_encode($output);
}
public function all_details(){
$car_id = $this->input->post('car_id');
$service_dates = $this->mwheelreplacementreport->getServicedates($car_id);
$result['service_dates'] = $service_dates;
echo json_encode($result);
}
}