fix
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
MERM Providers Login
|
||||
*/
|
||||
class Login extends Web_Controller {
|
||||
|
||||
public function index() {
|
||||
// echo rand(1000, 9999);
|
||||
// print_r($this->input->get());
|
||||
|
||||
$data = array();
|
||||
$data['username'] = $data['pass'] = $data['error_message']='';
|
||||
|
||||
@@ -14,9 +15,7 @@ class Login extends Web_Controller {
|
||||
|
||||
$data['username'] = trim($this->input->post('username'));
|
||||
$data['pass'] = htmlspecialchars($this->input->post('pass'));
|
||||
//$this->load->view('provider/dash');
|
||||
$outData = array();
|
||||
//print_r($data);
|
||||
$loginResult = $this->verifyLoginInput($data); // initial test
|
||||
if ($loginResult == true) {
|
||||
|
||||
@@ -24,25 +23,21 @@ class Login extends Web_Controller {
|
||||
$loginResult = $this->loginUser($data, $outData);
|
||||
if (true == $loginResult) {
|
||||
$out = array();
|
||||
$this->load->model('patient_model');
|
||||
$out = $this->patient_model->getPatientList();
|
||||
$data["patient_list"] = $out["patient_list"];
|
||||
$this->renderProviderSecurePage('dash', $data);
|
||||
redirect('provider'); // provider controller extend Provider_Controller- this check session valid
|
||||
}
|
||||
}// if valid input was supplied
|
||||
else
|
||||
{
|
||||
$data['error_message']="Invalid Username or Password";
|
||||
}
|
||||
|
||||
if (false == $loginResult) {
|
||||
$this->renderExternalPage('welcome_message', $data); // get here if login galis
|
||||
}
|
||||
} else {
|
||||
//$this->load->view('welcome_message');
|
||||
// $this->load->view('provider/dash');
|
||||
$this->renderExternalPage('welcome_message', $data);
|
||||
}
|
||||
|
||||
//$this->load->view('provider/dash');
|
||||
//$this->load->view('welcome_message');
|
||||
}
|
||||
} // end of index Login
|
||||
|
||||
private function verifyLoginInput(&$data) {
|
||||
|
||||
@@ -51,7 +46,6 @@ class Login extends Web_Controller {
|
||||
$data['error_message']="Username and password required";
|
||||
}
|
||||
|
||||
|
||||
if (trim($data['username']) != '' or trim($data['pass']) != '') {
|
||||
$ret = true;
|
||||
}
|
||||
@@ -59,14 +53,4 @@ class Login extends Web_Controller {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$data = array();
|
||||
$this->destroySession();
|
||||
$this->renderExternalPage('welcome_message', $data);
|
||||
}
|
||||
|
||||
private function destroySession() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
MERMS Providers log out
|
||||
*/
|
||||
class Logout extends Web_Controller {
|
||||
|
||||
public function index() {
|
||||
// echo rand(1000, 9999);
|
||||
// print_r($this->input->get());
|
||||
$data = array();
|
||||
|
||||
$this->logUserOut();
|
||||
}
|
||||
|
||||
public function logUserOut() {
|
||||
private function logUserOut() {
|
||||
$data = array();
|
||||
$this->destroySession();
|
||||
$this->renderExternalPage('welcome_message', $data);
|
||||
}
|
||||
|
||||
private function destroySession() {
|
||||
|
||||
private function destroySession() {
|
||||
$_SESSION['session_id'] =$_SESSION['username'] =$_SESSION['practice_name'] =$_SESSION['sessionpractice_code_id'] =$_SESSION['user_id'] =""; // "";
|
||||
$_SESSION['user_firstname'] =$_SESSION['user_lastname'] =$_SESSION['user_email'] =$_SESSION['practice_id'] =$_SESSION['user_provider'] =""; // "";
|
||||
$_SESSION['user_admin'] = "";
|
||||
unset($_SESSION);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,14 @@ class Provider extends Provider_Controller {
|
||||
$out = $this->patient_model->getPatientList();
|
||||
$data["patient_list"] = $out["patient_list"];
|
||||
$_SESSION['patient_count']=5;
|
||||
|
||||
|
||||
|
||||
$this->load->model('encounter_model');
|
||||
$out = $this->encounter_model->getEncounterList();
|
||||
$data["encounter_list"] = $out["encounter_list"];
|
||||
|
||||
|
||||
$this->renderProviderSecurePage('dash', $data);
|
||||
}
|
||||
|
||||
@@ -56,6 +64,11 @@ class Provider extends Provider_Controller {
|
||||
$this->load->model('patient_model');
|
||||
$out = $this->patient_model->getPatientList();
|
||||
$data["patient_list"] = $out["patient_list"];
|
||||
|
||||
$this->load->model('encounter_model');
|
||||
$out = $this->encounter_model->getEncounterList();
|
||||
$data["encounter_list"] = $out["encounter_list"];
|
||||
|
||||
$this->renderProviderSecurePage('dash', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ class Register extends Web_Controller {
|
||||
//#define MERMS_PROVIDERS_STARTPRACTICE 150005
|
||||
|
||||
// echo "xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ";
|
||||
$data["practice_name"] = $this->input->post('practice_name');
|
||||
$data["practice_name"] = $this->input->post('practice_name').rand(100,999);
|
||||
$data["firstname"] = $this->input->post('firstname');
|
||||
$data["lastname"] = $this->input->post('lastname');
|
||||
$data["email"] = $this->input->post('email');
|
||||
$data["password"] = $this->input->post('password');
|
||||
$data["username"] = $this->input->post('username');
|
||||
$data["username"] = $this->input->post('username').rand(100,999);
|
||||
|
||||
|
||||
$data['action'] = MERMS_PROVIDERS_STARTPRACTICE;
|
||||
@@ -28,9 +28,9 @@ class Register extends Web_Controller {
|
||||
$res = $this->backend_model->mermsemr_api($data, $out);
|
||||
|
||||
$loginReturn = false;
|
||||
|
||||
if ( $res==PHP_LOGIN_OK && isset($out["practice_id"]) && $out["practice_id"] > 0 ){
|
||||
|
||||
// echo $res;
|
||||
if ( $res==PHP_API_OK && isset($out["practice_pending_id"]) && $out["practice_pending_id"] > 0 ){
|
||||
$data["loginReturn"] = true;
|
||||
}
|
||||
|
||||
$this->renderExternalPage('register', $data);
|
||||
|
||||
Reference in New Issue
Block a user