Skip to content
Snippets Groups Projects
Commit 620a1caa authored by Burhan Akbar's avatar Burhan Akbar
Browse files

approve pending hospitals

parents 0f03bc16 b92c807d
No related branches found
No related tags found
No related merge requests found
/*
Navicat Premium Dump SQL
Source Server : Root
Source Server Type : MariaDB
Source Server Version : 101107 (10.11.7-MariaDB)
Source Host : localhost:3306
Source Schema : healthcare
Target Server Type : MariaDB
Target Server Version : 101107 (10.11.7-MariaDB)
File Encoding : 65001
Date: 11/12/2024 22:08:40
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for care_homes
-- ----------------------------
DROP TABLE IF EXISTS `care_homes`;
CREATE TABLE `care_homes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`status` enum('approved','rejected','pending') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT 'pending',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of care_homes
-- ----------------------------
INSERT INTO `care_homes` VALUES (1, 'Hospital1', 'Cardiff', 'pending');
INSERT INTO `care_homes` VALUES (2, 'Hospital2', 'Cardiff', 'pending');
INSERT INTO `care_homes` VALUES (3, 'Hospital3', 'London', 'pending');
INSERT INTO `care_homes` VALUES (4, 'Hospital4', 'London', 'pending');
INSERT INTO `care_homes` VALUES (5, 'Hospital5', 'Manchester', 'pending');
INSERT INTO `care_homes` VALUES (6, 'Hospital6', 'Manchester', 'pending');
INSERT INTO `care_homes` VALUES (7, 'Hospital7', 'Cardiff', 'pending');
INSERT INTO `care_homes` VALUES (8, 'Hospital8', 'Cardiff', 'pending');
INSERT INTO `care_homes` VALUES (9, 'Hospital9', 'Cardiff', 'pending');
INSERT INTO `care_homes` VALUES (10, 'Hospital10', 'Cardiff', 'pending');
-- ----------------------------
-- Table structure for common_admin
-- ----------------------------
DROP TABLE IF EXISTS `common_admin`;
CREATE TABLE `common_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`roleId` int(11) NULL DEFAULT NULL,
`phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`status` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of common_admin
-- ----------------------------
INSERT INTO `common_admin` VALUES (1, '26497@qq.com', '$2a$10$5UzuKUxgR8H0RzLYrP.BUu8.76yKwMD4XkvJIu/xxB7AAHWfphFQm', 'commonAdmin', 1, '111', 'justnoww', 1);
INSERT INTO `common_admin` VALUES (2, '1234@qq.com', '$2a$10$iW/zeL9TLq55SHFaOfyfr.xFMvB4aD3CL2layeAlGC7CqZ9kcscA.', 'commonAdmin', 1, '123', 'BAa', 1);
INSERT INTO `common_admin` VALUES (3, '123cmy@qq.com', '$2a$10$u2KxNBaHuTVwX7KudUgyNelp8j2lymarXKkkUXfWBMRAgbPNryTuW', 'commonAdmin', 1, '123', 'cmy', 1);
-- ----------------------------
-- Table structure for device
-- ----------------------------
DROP TABLE IF EXISTS `device`;
CREATE TABLE `device` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hospitalId` int(11) NULL DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`freeTime` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of device
-- ----------------------------
INSERT INTO `device` VALUES (1, 0, 'bed1', 'bed', '2024-12-02 09:51:12');
INSERT INTO `device` VALUES (2, 2, 'bed2', 'bed', '2024-12-03 09:30:00');
INSERT INTO `device` VALUES (3, 2, 'bed3', 'bed', '2025-12-05 10:30:35');
INSERT INTO `device` VALUES (4, 2, 'instrument1', 'instrument', '2024-12-05 07:15:59');
INSERT INTO `device` VALUES (5, 2, 'instrument5', 'instrument', '2024-12-05 10:30:00');
-- ----------------------------
-- Table structure for hospital
-- ----------------------------
DROP TABLE IF EXISTS `hospital`;
CREATE TABLE `hospital` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`amountPatient` int(11) NULL DEFAULT NULL,
`maxAmount` int(11) NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`status` int(11) NULL DEFAULT NULL,
`roleId` int(11) NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`patientId` int(11) NULL DEFAULT NULL,
`deviceId` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of hospital
-- ----------------------------
INSERT INTO `hospital` VALUES (1, 'hospital1', 5, 200, 'hospital', 'beijing', '6371', 1, 3, 'hospital1@qq.com', '$2a$10$wvAZoj4V51MH/MLhVIrnG.NrY07/.Gn9Ar6JsyzRAubWtqbWzgKie', 0, 0);
INSERT INTO `hospital` VALUES (2, 'hospital2', 10, 50, 'hospital', 'cardiff', '123', 1, 3, 'hospital2@qq.com', '$2a$10$wvAZoj4V51MH/MLhVIrnG.NrY07/.Gn9Ar6JsyzRAubWtqbWzgKie', 0, 0);
-- ----------------------------
-- Table structure for hospital_device
-- ----------------------------
DROP TABLE IF EXISTS `hospital_device`;
CREATE TABLE `hospital_device` (
`hospitalId` int(11) NULL DEFAULT NULL,
`deviceId` int(11) NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of hospital_device
-- ----------------------------
-- ----------------------------
-- Table structure for nurse
-- ----------------------------
DROP TABLE IF EXISTS `nurse`;
CREATE TABLE `nurse` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`status` int(11) NULL DEFAULT NULL,
`hospitalId` int(11) NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`age` int(11) NULL DEFAULT NULL,
`phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of nurse
-- ----------------------------
INSERT INTO `nurse` VALUES (1, 'nn', 0, 2, 'nurse', 23, '111', '23453', 'Cardiff');
INSERT INTO `nurse` VALUES (2, 'Li Xiaoming', 1, 2, 'nurse', 25, '222', '4399', 'Cardiff');
INSERT INTO `nurse` VALUES (3, 'Sun Hao', 1, 2, 'nurse', 24, '123', '23576', 'Bute');
INSERT INTO `nurse` VALUES (4, 'Wang Xiaoming', 0, 2, 'nurse', 26, '333', '34578', 'Cardiff');
INSERT INTO `nurse` VALUES (5, 'Tian Hao', 0, 2, 'nurse', 30, '321', '24353', 'Cardiff');
-- ----------------------------
-- Table structure for patient
-- ----------------------------
DROP TABLE IF EXISTS `patient`;
CREATE TABLE `patient` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`roleId` int(11) NULL DEFAULT NULL,
`status` int(11) NULL DEFAULT NULL,
`hospitalId` int(11) NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`age` int(11) NULL DEFAULT NULL,
`phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of patient
-- ----------------------------
INSERT INTO `patient` VALUES (1, 'Li Ming', '$2a$10$obgmyiqAuhIkBjuw3bROr.LkCh.Nb70e4dL8lwKjSsPxS8gSpQxSC', 2, 1, 0, 'patient', 20, '135', 'wwgwg@outlook.com');
INSERT INTO `patient` VALUES (2, 'Li Hua', '$2a$10$obgmyiqAuhIkBjuw3bROr.LkCh.Nb70e4dL8lwKjSsPxS8gSpQxSC', 2, 0, 0, 'patient', 21, '166', 'ss@qq.com');
INSERT INTO `patient` VALUES (3, 'Huang Li', '$2a$10$obgmyiqAuhIkBjuw3bROr.LkCh.Nb70e4dL8lwKjSsPxS8gSpQxSC', 2, 0, 0, 'patient', 13, '111', '22@qq.com');
INSERT INTO `patient` VALUES (4, 'Xia Ming', '$2a$10$obgmyiqAuhIkBjuw3bROr.LkCh.Nb70e4dL8lwKjSsPxS8gSpQxSC', 2, 1, 2, 'patient', 61, '15', '131@qq.com');
INSERT INTO `patient` VALUES (5, 'Xia Yu', '$2a$10$obgmyiqAuhIkBjuw3bROr.LkCh.Nb70e4dL8lwKjSsPxS8gSpQxSC', 2, 1, 2, 'patient', 33, '14315', 'xx@qq.com');
-- ----------------------------
-- Table structure for patient_hospital
-- ----------------------------
DROP TABLE IF EXISTS `patient_hospital`;
CREATE TABLE `patient_hospital` (
`hosptialId` int(11) NULL DEFAULT NULL,
`patientId` int(11) NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of patient_hospital
-- ----------------------------
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`roleId` int(11) NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES (0, 'SUPER');
INSERT INTO `role` VALUES (1, 'ADMIN');
INSERT INTO `role` VALUES (2, 'PATIENT');
INSERT INTO `role` VALUES (3, 'HOSPITAL');
-- ----------------------------
-- Table structure for super_admin
-- ----------------------------
DROP TABLE IF EXISTS `super_admin`;
CREATE TABLE `super_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`roleId` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of super_admin
-- ----------------------------
INSERT INTO `super_admin` VALUES (1, '2649783657@qq.com', '$2a$10$5UzuKUxgR8H0RzLYrP.BUu8.76yKwMD4XkvJIu/xxB7AAHWfphFQm', 0);
SET FOREIGN_KEY_CHECKS = 1;
...@@ -4,39 +4,111 @@ body { ...@@ -4,39 +4,111 @@ body {
padding: 0; padding: 0;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
/* Sidebar Styling */
.sidebar { .sidebar {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 250px;
height: 100vh; height: 100vh;
background-color: #1f2937; width: 250px;
background: #1f2937;
padding: 1.5rem 1rem;
color: white; color: white;
padding: 1rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; /* 为按钮之间增加间距 */ box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
} }
.sidebar .text-lg {
/* Logo/Brand section */
.sidebar-brand {
color: white;
font-size: 1.25rem; font-size: 1.25rem;
font-weight: bold; font-weight: 600;
margin-bottom: 1rem; padding: 1rem;
margin-bottom: 2rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
} }
.sidebar a {
padding: 0.75rem 1rem;
margin-bottom: 0.5rem; .sidebar .nav-item {
color: white; display: flex;
align-items: center;
padding: 0.875rem 1rem;
color: rgba(255, 255, 255, 0.8);
text-decoration: none; text-decoration: none;
border-radius: 0.5rem; border-radius: 0.5rem;
transition: background-color 0.3s ease; margin: 0.25rem 0;
transition: all 0.3s ease;
cursor: pointer;
} }
.sidebar a:hover {
background-color: #4b5563; .sidebar .nav-item:before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
margin-right: 0.75rem;
}
.sidebar a[data-content="hospital"]:before {
content: "\f0f8"; /* hospital icon */
}
.sidebar a[data-content="nursing"]:before {
content: "\f0f0"; /* user-nurse icon */
}
.sidebar .sign-out:before {
content: "\f2f5"; /* sign-out icon */
} }
.sidebar .nav-item:hover {
background: rgba(255, 255, 255, 0.1);
color: white;
transform: translateX(5px);
}
.sidebar .sign-out {
margin-top: auto;
color: #ef4444;
}
.sidebar .sign-out:hover {
background: #ef4444;
color: white;
}
.content { .content {
margin-left: 250px; margin-left: 250px;
padding: 2rem; padding: 2rem;
min-height: 100vh;
}
/* Active state for sidebar items */
.sidebar .nav-item.active {
background: #3b82f6;
color: white;
}
.sidebar div[onclick="chooseOut()"] {
margin-top: auto;
color: #ef4444;
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 1rem;
}
.sidebar div[onclick="chooseOut()"]:hover {
background-color: #ef4444;
color: white;
}
/* Content area adjustment */
.content {
margin-left: 250px;
padding: 2rem;
min-height: 100vh;
background-color: #f9fafb;
} }
.table-container { .table-container {
margin-top: 2rem; margin-top: 2rem;
padding: 1rem; padding: 1rem;
......
.top-nav {
background: #1f2937;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
}
.nav-brand {
color: white;
font-size: 1.5rem;
font-weight: 600;
text-decoration: none;
}
.nav-items {
display: flex;
gap: 1.5rem;
align-items: center;
}
.nav-link {
color: white;
text-decoration: none;
padding: 0.75rem 1.25rem;
border-radius: 6px;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 0.5rem;
}
.nav-link:hover, .nav-link.active {
background: rgba(255,255,255,0.1);
transform: translateY(-1px);
}
.user-info {
display: flex;
flex-direction: column;
align-items: flex-end;
color: white;
gap: 0.25rem;
}
.content-wrapper {
margin-top: 80px;
padding: 2rem;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
.sign-out {
background: #ef4444;
border: none;
cursor: pointer;
padding: 0.75rem 1.25rem;
border-radius: 6px;
color: white;
transition: all 0.3s ease;
}
.sign-out:hover {
background: #dc2626;
transform: translateY(-1px);
}
\ No newline at end of file
/* basic */
.nav-item {
background-color: #93a5e7;
color: white;
padding: 15px;
text-align: center;
margin-bottom: 10px;
border-radius: 5px;
font-size: 18px;
font-weight: bold;
transition: background-color 0.3s ease, transform 0.2s ease;
}
/* hover */
.nav-item:hover {
background-color: #555;
transform: scale(1.05); /* Magnification effect */
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<link rel="stylesheet" href="/css/common.css"> <link rel="stylesheet" href="/css/common.css">
<link rel="stylesheet" href="/css/beds.css"> <link rel="stylesheet" href="/css/beds.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="../css/shared-nav.css">
<style> <style>
.approval-dashboard { .approval-dashboard {
background-color: #ffffff; background-color: #ffffff;
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
} }
</style> </style>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="../js/shared-nav.js"></script>
</head> </head>
<body> <body>
...@@ -101,6 +103,11 @@ ...@@ -101,6 +103,11 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/approvalSystem.js"></script> <script src="/js/approvalSystem.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
setupNavigation('currentPage'); // Replace currentPage with: dashboard, beds, or approvals
});
</script>
</body> </body>
</html> </html>
...@@ -4,14 +4,28 @@ ...@@ -4,14 +4,28 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hospital Management</title> <title>Hospital Management</title>
<link rel="stylesheet" type="text/css" href="../css/admin.css"> <link rel="stylesheet" href="../css/beds.css">
<link rel="stylesheet" href="../css/admin.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/shared-nav.css">
<script src="../js/shared-nav.js"></script>
</head> </head>
<body> <body>
<!-- Update sidebar HTML structure -->
<nav class="sidebar"> <nav class="sidebar">
<div class="text-lg font-semibold">System</div> <div class="text-lg">System</div>
<a href="#" data-content="hospital">Hospital</a> <a href="#" data-content="hospital" class="nav-item">
<a href="#" data-content="nursing">Nursing Staff</a> Hospital
<a><div onclick="chooseOut()">Sign Out</div></a> </a>
<a href="#" data-content="nursing" class="nav-item">
Nursing Staff
</a>
<div onclick="chooseOut()" class="nav-item sign-out">
Sign Out
</div>
</nav>
</nav> </nav>
<div class="content"> <div class="content">
<div id="user-info" style="text-align: right; padding: 10px; font-weight: bold;"></div> <div id="user-info" style="text-align: right; padding: 10px; font-weight: bold;"></div>
...@@ -377,6 +391,10 @@ ...@@ -377,6 +391,10 @@
} }
}); });
}); });
document.addEventListener('DOMContentLoaded', function() {
setupNavigation('currentPage'); // Replace currentPage with: dashboard, beds, or approvals
});
</script> </script>
</body> </body>
</html> </html>
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/shared-nav.css">
<script src="../js/shared-nav.js"></script>
</head> </head>
<body> <body>
<div class="main-container"> <div class="main-container">
...@@ -87,5 +89,10 @@ ...@@ -87,5 +89,10 @@
</div> </div>
<script src="../js/beds.js"></script> <script src="../js/beds.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
setupNavigation('currentPage'); // Replace currentPage with: dashboard, beds, or approvals
});
</script>
</body> </body>
</html> </html>
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="../css/shared-nav.css">
<script src="../js/shared-nav.js"></script>
<style> <style>
body{ body{
background-image:url("/img/backpicture.jpg"); background-image:url("/img/backpicture.jpg");
...@@ -107,5 +109,9 @@ ...@@ -107,5 +109,9 @@
} }
}) })
document.addEventListener('DOMContentLoaded', function() {
setupNavigation('currentPage'); // Replace currentPage with: dashboard, beds, or approvals
});
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="../css/admin.css">
<link rel="stylesheet" href="../css/shared-nav.css">
<script src="../js/shared-nav.js"></script>
<style> <style>
body{ body{
background-image:url("/img/backpicture.jpg"); background-image:url("/img/backpicture.jpg");
...@@ -76,5 +79,9 @@ ...@@ -76,5 +79,9 @@
} }
}) })
document.addEventListener('DOMContentLoaded', function() {
setupNavigation('currentPage'); // Replace currentPage with: dashboard, beds, or approvals
});
</script> </script>
</html> </html>
\ No newline at end of file
function setupNavigation(currentPage) {
const nav = `
<nav class="top-nav">
<a href="/superAdminView.html" class="nav-brand">Digital Insight for Health</a>
<div class="nav-items">
<a href="/superAdminView.html" class="nav-link ${currentPage === 'dashboard' ? 'active' : ''}">
<i class="fas fa-home"></i> Dashboard
</a>
<a href="/beds.html" class="nav-link ${currentPage === 'beds' ? 'active' : ''}">
<i class="fas fa-bed"></i> Beds
</a>
<a href="/CHApprovalSystem.html" class="nav-link ${currentPage === 'approvals' ? 'active' : ''}">
<i class="fas fa-check-circle"></i> Approvals
</a>
<div class="user-info">
<span class="user-name">${localStorage.getItem('name') || 'User'}</span>
<span class="user-role">${localStorage.getItem('type') || 'Guest'}</span>
</div>
<button class="sign-out" onclick="handleSignOut()">
<i class="fas fa-sign-out-alt"></i> Sign Out
</button>
</div>
</nav>
<div class="content-wrapper">
<!-- Page content will go here -->
</div>
`;
document.body.insertAdjacentHTML('afterbegin', nav);
}
function handleSignOut() {
localStorage.clear();
window.location.href = '/login.html';
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment