Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
30 changes: 29 additions & 1 deletion app/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"denied" : {
"Register" : ["login", "register"]
},
"NewPatient":["*"],
"Register" : ["logout"],
"Tools" : ["AddNewPatient","Update","existingPatient"]
"Tools" : ["AddNewPatient","Update","existingPatient","dischargedPatient"]
},

"Admin" :{
Expand All @@ -37,6 +38,33 @@
"denied" : {},
"Tools" : ["first", "inbox"]

},
"ecg_lab" :{
"denied" : {},
"Tools" : ["first", "inbox"]

},
"microbio_lab" :{
"denied" : {},
"Tools" : ["first", "inbox"]

},
"biochemical_lab" :{
"denied" : {},
"Tools" : ["first", "inbox"]

},
"specimen_exam_lab" :{
"denied" : {},
"Tools" : ["first", "inbox"]

},
"xray_lab" :{
"denied" : {},
"Tools" : ["first", "inbox"]

}



}
8 changes: 5 additions & 3 deletions app/controllers/Filter Control/Filtering.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

<?php
include '../../views/layouts/docmenu.php';
include '../../models/DatabaseConnection/Database.php';
include '../../models/Validation.php';
include '../../classes/Patient.php';
include '../../views/HeaderAndFooter/header.php';

if (!(isset($_SESSION))){
session_start();
Expand All @@ -16,8 +16,10 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel = "stylesheet" href = "../../bootstrap/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../css/styles.css">
<link rel = "stylesheet" href = "../../../bootstrap/css/bootstrap.min.css" integrity="" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../../style.css">
<link rel = "stylesheet" href = "../../../css/styles.css">

</head>
<body class="mainbody">
<div class = "container">
Expand Down
31 changes: 28 additions & 3 deletions app/controllers/Home.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php


/**
*
*/
class Home extends Controller
{
public function __construct($controller , $action)
{

parent::__construct($controller , $action);
}

Expand All @@ -18,11 +20,34 @@ public function indexAction()

if(currentUser()->acl == 'Doctor'){

if($_POST){
dnd($_POST);
}

$this->view->render('home/contents');

}else if(currentUser()->acl == 'ecg_lab'){

$this->view->post = currentUser()->acl;
$this->view->render('home/TestRequestViewer.viewer');

}else if(currentUser()->acl == 'xray_lab'){

$this->view->post = currentUser()->acl;
$this->view->render('home/TestRequestViewer.viewer');

}else if(currentUser()->acl == 'specimen_exam_lab'){

$this->view->post = currentUser()->acl;
$this->view->render('home/TestRequestViewer.viewer');

}else if(currentUser()->acl == 'biochemical_lab'){

$this->view->post = currentUser()->acl;
$this->view->render('home/TestRequestViewer.viewer');

}else if(currentUser()->acl == 'microbio_lab'){

$this->view->post = currentUser()->acl;
$this->view->render('home/TestRequestViewer.viewer');

}
else {
$this->view->render('home/index');
Expand Down
23 changes: 16 additions & 7 deletions app/controllers/PatientForms/ExistingPatient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
include '../../views/HeaderAndFooter/header.php';
include '../../views/layouts/docmenu.php';
// include '../../views/HeaderAndFooter/header.php';
include '../../models/DatabaseConnection/Database.php';
//include '../../models/Users.php';
include '../../classes/Patient.php';
include '../../classes/Test.php';
include '../../views/home/cache.php';
Expand All @@ -14,11 +16,11 @@
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel = "stylesheet" href = "../../../bootstrap/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../../css/styles.css">
<link rel = "stylesheet" href = "../../../bootstrap/css/bootstrap.min.css" integrity="" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../../style.css">
<link rel = "stylesheet" href = "../../../css/styles.css">

<title> </title>
</head>
<body class = 'mainbody'>
Expand Down Expand Up @@ -52,7 +54,14 @@
}

$columns = array('RegNo', 'FullName', 'Age', 'Gender', 'FullAddress', 'DateOfBirth', 'Diagnosis', 'BedNo','ContactNo');
$results = $medical->retrieveData("patients", $columns, $_SESSION["regNo"]);
if(isset($_POST['regNo'])){
$regNo = $_POST["regNo"];
$_SESSION["regNo"] = $_POST['regNo'];
}
else if(isset($_SESSION['regNo'])){
$regNo = $_SESSION["regNo"];
}
$results = $medical->retrieveData("patients", $columns, $regNo);
if (mysqli_num_rows($results)!=0) {
while($row = mysqli_fetch_array($results)){
$regNo = $row['RegNo'];
Expand All @@ -70,13 +79,13 @@
else{
$admission = "Admitted";
}

$patient = new Patient($regNo, $name, $age, $address,$diagnosis,$dob,$gender,$admission, $bedNo, $contact,"Existing");
$_SESSION["Patient"] = $patient;
$patient->displayUI();
//include '../../views/ExistingPatient/ExistingPatientForm.php';
}
}

else{
echo "Registration number not found.";
}
Expand Down
20 changes: 8 additions & 12 deletions app/controllers/PatientForms/ExistingTreatments.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
include '../../views/HeaderAndFooter/header.php';
include '../../views/layouts/docmenu.php';
// include '../../views/HeaderAndFooter/header.php';
include '../../models/DatabaseConnection/Database.php';
include '../../cache.php';
include '../../views/home/cache.php';

if (!(isset($_SESSION))){
session_start();
Expand All @@ -11,16 +12,10 @@
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel = "stylesheet" href = "../../css/styles.css">
<link rel = "stylesheet" href = "../../../bootstrap/css/bootstrap.min.css" integrity="" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../../style.css">
<link rel = "stylesheet" href = "../../../css/styles.css">
<link rel = "stylesheet" href = "../../../img/test.css">
<title> </title>
</head>
<body class ='mainbody'>
Expand All @@ -46,6 +41,7 @@
}
else{
if (isset($_POST["regNo"])){

$regNo = $_POST["regNo"];
}
}
Expand Down
8 changes: 5 additions & 3 deletions app/controllers/PatientForms/ExistingTreatmentsFiltered.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include '../../views/HeaderAndFooter/header.php';
include '../../views/layouts/docmenu.php';
include '../../models/DatabaseConnection/Database.php';
include '../../cache.php';
include '../../views/home/cache.php';

if (!(isset($_SESSION))){
session_start();
Expand All @@ -20,7 +20,9 @@
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel = "stylesheet" href = "../../css/styles.css">
<link rel = "stylesheet" href = "../../../css/styles.css">
<link rel = "stylesheet" href = "../../../img/test.css">
<link rel = "stylesheet" href = "../../../style.css">
<title> </title>
</head>
<body class = "mainbody">
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/PatientForms/NewPatient.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
//$medical->enterData($test, array('patient_id','sdate'), array($regNo, date('Y-m-d')));
}
}
header("Location: ../../contents.php");
header("Location: ../../../");

}

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function confirmAction($username)
</div>';

$posted_values['button'] = '<div class="input-group-append">
<button name="button" id="button" value="button" class="btn btn-outline-danger" type="submit">Delete Account</button>
<button name="button" id="button" value="button" class="btn btn-outline-danger deletebtn" type="submit">Delete Account</button>
</div>';


Expand Down
2 changes: 1 addition & 1 deletion app/controllers/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function registerAction()
$validation = new Validate();
$posted_values = ['fname' =>'', 'lname'=>'', 'username'=>'', 'email'=>'', 'password'=>'', 'confirm'=>''];
if ($_POST) {
dnd($_POST);

$posted_values = posted_values($_POST);
$validation->check($_POST, [
'fname' => [
Expand Down
17 changes: 12 additions & 5 deletions app/controllers/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function indexAction(){
}

public function updateAction(){
$this->view->render('tools/Update');
header("Location: /Tuto/app/views/Searching.php");
// $this->view->render('tools/Update');
}

public function inboxAction(){
Expand All @@ -29,12 +30,18 @@ public function thirdAction(){
$this->view->render('tools/third');
}

public function dischargedPatientAction(){
header("Location: /Tuto/app/views/DischargedPatient/Intermediate.php");
}

public function AddNewPatientAction(){
$this->view->render('tools/AddNewPatient');
// $this->view->render('tools/AddNewPatient');
header("Location: /Tuto/app/views/NewPatient/NewPatientForm.php");
}

public function existingPatientAction(){
$this->view->render('tools/existingPatient');
//$this->view->render('tools/existingPatient');
header("Location: /Tuto/app/views/Filtering/FilterBar.php");
}

public function deleteAction(){
Expand All @@ -52,7 +59,7 @@ public function deleteAction(){
$posted_values['acl'] = $user->acl;
$posted_values['username'] = $_POST['username'];

$posted_values['smessage']= '<div class="alert alert-success" role="alert">
$posted_values['smessage']= '<div class="alert alert-success w-50" role="alert">
User exists! check user details below before you delete
</div>';

Expand All @@ -62,7 +69,7 @@ public function deleteAction(){
}
else{
$posted_values['message']=
'<div class="alert alert-warning" role="alert">
'<div class="alert alert-warning w-50" role="alert">
Invalid Username or Account type!
</div>';

Expand Down
17 changes: 5 additions & 12 deletions app/menu_acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
"Home" : "home",
"Register" : "register/register",

"Tools" : {
"My Tools" : "tools",
"Inbox" : "tools/inbox",
"New Patient" : "tools/AddNewPatient",

"New Patient" : "tools/AddNewPatient",
"Update Patient" : "tools/Update",
"Filter info":"tools/existingPatient",
"Filter Patients":"tools/existingPatient",
"View Discharged Patients":"tools/dischargedPatient",
"Delete" : "tools/delete",
"separator" : "",

"Tools 3" : "tools/third"

},

"Google" : "https://www.google.com",
"PHP Docs" : "http://php.net/manual/en",

"Login" : "register/login",
"Logout" : "register/logout"
}
2 changes: 1 addition & 1 deletion app/models/DatabaseConnection/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Database{
private $name = "medical"; //Database name
private $host = "localhost"; //Database server
private $user = "root"; //Database username
private $password ="nuwansql" ; //Database password
private $password ="" ; //Database password
private static $instance;
private static $link;

Expand Down
9 changes: 6 additions & 3 deletions app/views/DischargedPatient/AlreadyDischargedPatient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include '../layouts/docmenu.php';
include '../../classes/Patient.php';
include '../HeaderAndFooter/header.php';
include '../HeaderAndFooter/Discharged.php';
include '../../models/DatabaseConnection/Database.php';

Expand All @@ -14,8 +14,11 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel = "stylesheet" href = "../../bootstrap/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../css/styles.css">
<link rel = "stylesheet" href = "../../../bootstrap/css/bootstrap.min.css" integrity="" crossorigin="anonymous">
<link rel = "stylesheet" href = "../../../style.css">
<link rel = "stylesheet" href = "../../../css/styles.css">


<title></title>
</head>
<body >
Expand Down
3 changes: 3 additions & 0 deletions app/views/DischargedPatient/ConfirmDischarge.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
include '../layouts/docmenu.php';
include './HeaderAndFooter/header.php';
include '../models/DatabaseConnection/Database.php';
include '../cache.php';
Expand All @@ -14,6 +15,8 @@
<link rel = "stylesheet" href = "../bootstrap/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<link rel = "stylesheet" href = "../css/header.css">
<link rel = "stylesheet" href = "../../../img/test.css">
<link rel = "stylesheet" href = "../../../style.css">
<title></title>
</head>

Expand Down
Loading