HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /var/www/html/pmw24/app/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);
	}
}