load->library('session'); $this->load->model('Bills_model'); $this->load->model('generate_bill/Generate_bill_model'); if (!$this->ion_auth->in_group(array('admin'))) { if(!$this->ion_auth->coordinator_permission('bills')){ redirect('home/permission'); } } } public function index() { //die; $data = array(); $this->load->model('Bills_model'); $data['data'] = $this->Bills_model->name_list(); //echo '
'; print_r($data); echo '
'; exit; $this->load->view('home/dashboard',$data); // just the header file $this->load->view('namelist',$data); $this->load->view('home/footer'); // just the header file } public function getList() { $this->load->model('Bills_model'); $requestData = $_REQUEST; $start = $requestData['start']; $limit = $requestData['length']; $orderColumn=$requestData['order'][0]['column']; $orderType=$requestData['order'][0]['dir']; $search = $this->input->post('search')['value']; if(!empty($search)) { $data['patient_name'] = $this->Bills_model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType); }else{ $data['patient_name'] = $this->Bills_model->getNameByLimit($limit, $start, $orderColumn, $orderType); } $listCount = sizeof($data['patient_name']); $slno = 1; foreach ($data['patient_name'] as $data) { // $options1 = '' . lang('edit') .' '; $options1 = '' . lang('edit') .' '; $options2 = '' . lang('Print') .' '; $bill_amount=$data->rate * $data->bill_units; $info[] = array( $slno, $data->invoice_id, $data->patient_name, $bill_amount, $options1." ".$options2 ); $slno++; } $csrf_name = $this->security->get_csrf_token_name(); $csrf_hash = $this->security->get_csrf_hash(); if ($listCount > 0) { $output = array( "draw" => intval($requestData['draw']), "recordsTotal" => count($this->Bills_model->name_list()), "recordsFiltered" => count($this->Bills_model->name_list()), "data" => $info ); } else { $output = array( // "draw" => 1, "recordsTotal" => 0, "recordsFiltered" => 0, "data" => [] ); $output[$csrf_name] = $csrf_hash; } echo json_encode($output); } public function getBillDetails($id) { //echo '
'; print_r($id); echo '
'; exit; $data = array(); $this->load->model('Bills_model'); $data['data'] = $this->Bills_model->bill_details($id); $data['patient'] = $this->Generate_bill_model->getPatient($data['data']->patient_id); //echo '
'; print_r($data); echo '
'; exit; $this->load->view('billDetails',$data); } }