51 lines
1.5 KiB
PHP
Executable File
51 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class Patient_discharge extends MX_Controller {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->load->library('session');
|
|
$this->load->library('form_validation');
|
|
$this->load->model('Patient_discharge_model');
|
|
if (!$this->ion_auth->in_group('admin')) {
|
|
if(!$this->ion_auth->coordinator_permission('caregivers')){
|
|
redirect('home/permission');
|
|
}
|
|
|
|
}
|
|
}
|
|
function index(){
|
|
//die('xyz');
|
|
}
|
|
|
|
function addDischarge($id) {
|
|
// die($id);
|
|
$data = array();
|
|
$data['patient']=$this->Patient_discharge_model->getPatientDetails($id);
|
|
$data['assessment']=$this->Patient_discharge_model->getPatientAssessmentDetails($id);
|
|
$data['discharge']=$this->Patient_discharge_model->getDischargeDetails($id);
|
|
$data['services'] = $this->Patient_discharge_model->get_care()->result();
|
|
//echo '<pre>'; print_r($data); echo '</pre>';die;
|
|
$this->load->view('home/dashboard'); // just the header file
|
|
$this->load->view('add_new', $data);
|
|
$this->load->view('home/footer'); // just the footer file
|
|
}
|
|
|
|
public function addNew() {
|
|
|
|
$id = $this->input->post('id');
|
|
$this->Patient_discharge_model->upsertPatient($_POST);
|
|
$this->session->set_flashdata('feedback', 'Inserted');
|
|
|
|
// Loading View
|
|
redirect('patient');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|