load->model('pagination/HealthCareSheets_model', 'model'); } function getLists() { $data = $row = array(); // Fetch member's records $witData = $this->model->getRows($_POST); $i = $_POST['start']; $current_url = $_POST['currentURL']; foreach ($witData as $row) { $data[] = array($row->health_care_sheet_id , $row->type , $row->insured_id , $row->patient_lastname.' '.$row->patient_firstname, $this->lang->line($row->patient_situation), $row->institution_name, $row->practitioner_lastname.' '.$row->practitioner_firstname, $this->lang->line($row->care_condition), $this->lang->line($row->state), $row->created_at, ' '.$this->lang->line('Voir plus...').''); } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->model->countAll($_POST), "recordsFiltered" => $this->model->countFiltered($_POST), "data" => $data, ); // Output to JSON format echo json_encode($output); } }