Dbms Project
Dbms Project
3. Abstract
The COVID Bed Management System is a comprehensive project designed to enhance the
efficiency of hospital bed allocation and management during the COVID-19 pandemic. This
system aims to address the critical need for real-time tracking and management of hospital
bed occupancy, ensuring that patients receive timely and appropriate care, and optimizing the
utilization of healthcare resources. The primary functionalities include patient booking,
hospital data management, user authentication, and real-time updates on bed occupancy and
availability.
The project encompasses a robust backend database designed to handle large volumes of data
efficiently, incorporating normalization techniques to ensure data integrity, minimize
redundancy, and optimize query performance. The system's frontend, developed using
HTML, provides a user-friendly interface for hospital staff and administrators to interact with
the data seamlessly. Integration between the backend and frontend is achieved using a Python
script, which handles data processing, user inputs, and security measures.
Key outcomes of the project include streamlined bed management processes, improved
accuracy and reliability of hospital data, and enhanced decision-making capabilities for
hospital administrators. The system also features automated triggers and stored procedures to
maintain data consistency and provide real-time updates. This project successfully
demonstrates the potential for technology to significantly improve healthcare logistics,
particularly during a crisis, and offers a scalable solution adaptable to various healthcare
settings. Additionally, the system's architecture and design principles can serve as a model for
similar healthcare management applications in the future.
4. Introduction
Background
The COVID-19 pandemic has placed unprecedented strain on global healthcare systems,
highlighting the critical need for effective management of hospital resources, particularly bed
allocation. During surges of COVID-19 cases, hospitals faced overwhelming demand for
beds, leading to challenges in providing timely care to patients. Effective bed management
became a pivotal aspect of healthcare response, directly impacting patient outcomes and the
ability to control the spread of the virus. The lack of real-time data on bed availability,
coupled with inefficient manual processes, exacerbated these challenges, making it
imperative to develop systems that could streamline bed management and enhance
operational efficiency.
Hospital bed management during the pandemic involves not only keeping track of the
number of available beds but also categorizing them based on the type of care they can
provide, such as normal beds, ICU beds, and ventilator beds. The ability to quickly identify
and allocate the appropriate type of bed to patients in need is crucial for managing the flow of
patients and ensuring that critical resources are used effectively. Furthermore, effective bed
management helps in maintaining proper infection control protocols, as it ensures that
COVID-19 patients are isolated in designated areas, thereby reducing the risk of cross-
contamination with non-COVID-19 patients.
Purpose
2
The COVID Bed Management System was developed to address these critical issues by
providing a digital solution that automates and optimizes the process of hospital bed
allocation. The primary purpose of this system is to ensure that patients in need of care are
assigned appropriate beds swiftly and accurately, thereby improving patient care and
maximizing the utilization of hospital resources. By leveraging technology, this system aims
to eliminate the inefficiencies associated with manual bed management, reduce the burden on
healthcare workers, and provide real-time data that supports informed decision-making.
Scope
The COVID Bed Management System encompasses several core functionalities aimed at
addressing the critical aspects of hospital bed management. These functionalities include:
Patient Booking: Allows for the reservation and allocation of hospital beds to
patients based on their medical needs and bed availability. This feature ensures that
patients are assigned to the most appropriate type of bed (e.g., ICU bed, ventilator
bed) based on their condition.
Hospital Data Management: Maintains comprehensive data on hospital capacities,
including the number and types of beds available in different hospitals. This includes
real-time updates on bed occupancy, admissions, and discharges.
User Authentication: Implements secure login and authentication mechanisms to
ensure that only authorized personnel can access and manage the system. This feature
is crucial for maintaining the security and integrity of sensitive patient data.
Real-Time Updates: Continuously monitors and updates the status of bed occupancy,
providing real-time data to hospital staff and administrators. This ensures that
decisions regarding patient transfers and admissions are based on the most current
information available.
Reporting and Analytics: Generates reports and analytics on bed usage, patient
admissions, and other key metrics. These reports help hospital administrators
understand trends, identify bottlenecks, and make informed decisions about resource
allocation.
3
Integration with Other Systems: The system can be integrated with other hospital
management systems, such as electronic health records (EHR) and patient
management systems, to provide a seamless flow of information across different
platforms.
Despite its comprehensive design, the system has certain limitations. It relies on accurate data
entry and regular updates by hospital staff to maintain its effectiveness. Inaccuracies or
delays in data entry can lead to discrepancies in bed availability information. Additionally,
while the system is designed to be scalable, its performance may be impacted by the volume
of data and the number of concurrent users, necessitating appropriate infrastructure support.
There is also a need for training healthcare staff to use the system effectively, which may
require time and resources.
Structure
This report is structured to provide a detailed overview of the COVID Bed Management
System, its design, implementation, and outcomes. The structure of the report is as follows:
1. Title Page: Provides essential information about the project, including the title,
course, authors, and date.
2. Table of Contents: Lists the sections and subsections of the report for easy
navigation.
3. Abstract: Summarizes the project's purpose, functionalities, and key outcomes.
4. Introduction: Discusses the background, purpose, scope, and structure of the report.
5. Objectives: Outlines the primary and secondary goals of the project.
6. System Design: Details the design of the database, ER diagram, schema, and
normalization process.
o 6.1 Database Design: Description of the database structure and rationale
behind its design.
o 6.2 ER Diagram: Visual representation of the relationships between tables in
the database.
o 6.3 Schema: Detailed schema of the database, including tables, columns, data
types, and constraints.
o 6.4 Normalization: Explanation of the normalization process applied to the
database and its benefits.
7. Implementation: Describes the steps taken to implement the database, frontend, and
backend integration.
o 7.1 Database Implementation: SQL script used to create and populate the
database, and discussion of special SQL features used.
o 7.2 Frontend Development: Overview of the HTML structure, key pages,
features, and code snippets.
o 7.3 Backend Integration: Description of how the Python script interacts with
the database, key functionalities, user inputs, and security measures.
8. Data Insertion and Querying: Provides examples of data insertion and querying
operations.
o 8.1 Data Insertion: Examples of data insertion for each table and discussion
of challenges.
o 8.2 Sample Queries: Sample queries used to interact with the database,
including complex queries.
4
9. Triggers and Stored Procedures: Discusses the triggers and stored procedures used
in the database, with examples of their usage.
10. Results and Discussion: Presents the results obtained from the system, discussing
performance, challenges, and user feedback.
11. Conclusion: Summarizes the key points, reflects on the project's success, and
suggests possible future enhancements.
12. References: Lists the sources and references used in the report.
13. Appendix: Includes additional materials such as code listings, diagrams, and
documentation.
o Glossary: Provides a glossary of terms used in the report.
o Documentation: Includes any user manuals or documentation created for the
system.
This structured approach ensures a comprehensive and clear presentation of the COVID Bed
Management System, covering all aspects from design to implementation and results.
5. Objectives
Primary Objectives:
Secondary Objectives:
6. System Design
Description: The database design aims to support efficient hospital bed management by
structuring data in a way that facilitates real-time updates, ensures data integrity, and allows
for comprehensive reporting and analytics. The design includes tables for booking patients,
hospital data, users, and triggers, each serving a specific purpose in the system's operation.
Tables:
bookingpatient:
o Purpose: Stores information about patients who have booked hospital beds.
o Columns:
id: Unique identifier for each booking.
srfid: Unique identifier for the patient.
bedtype: Type of bed booked (e.g., normal, ICU, ventilator).
hcode: Hospital code where the bed is booked.
spo2: Patient's blood oxygen level.
pname: Patient's name.
pphone: Patient's phone number.
paddress: Patient's address.
hospitaldata:
o Purpose: Contains data about each hospital and its available beds.
o Columns:
id: Unique identifier for the hospital record.
hcode: Unique code for the hospital.
hname: Name of the hospital.
normalbed: Number of normal beds available.
hicubed: Number of high ICU beds available.
icubed: Number of ICU beds available.
vbed: Number of ventilator beds available.
hospitaluser:
6
Relationships:
6.2 ER Diagram
Relationships:
bookingpatient.hcode → hospitaldata.hcode
hospitaluser.hcode → hospitaldata.hcode
trig.hcode → hospitaldata.hcode
user.srfid → bookingpatient.srfid
patienthospital.patientid → bookingpatient.id
patienthospital.hospitalid → hospitaldata.id
6.3 Schema
-- Database: `covid`
(6, 'ARK123 ', 12, 55, 22, 22, ' INSERTED', '2022-01-12'),
(7, 'ARK123', 12, 50, 22, 22, ' UPDATED', '2022-01-12'),
(8, 'ABCD123 ', 11, 15, 4, 20, ' INSERTED', '2022-01-12'),
(9, 'ABCD123', 11, 11, 4, 20, ' UPDATED', '2022-01-12'),
(10, 'ARK123', 12, 50, 21, 22, ' UPDATED', '2022-01-12'),
(11, 'MAT123', 40, 4, 4, 1, ' DELETED', '2022-01-30'),
(12, 'AA1100', 15, 10, 7, 2, ' DELETED', '2022-01-30'),
(13, 'ARK123', 12, 50, 21, 22, ' DELETED', '2022-01-30'),
(14, 'ABCD123', 11, 11, 4, 20, ' DELETED', '2022-01-30');
COMMIT;
This schema ensures that all necessary data for managing hospital beds, patients, and hospital
staff is effectively organized, supporting the system's primary and secondary objectives.
6.4 Normalization
Definition:
Process:
Normalization typically proceeds through three progressive normal forms (1NF, 2NF, 3NF)
to ensure data is organized optimally.
Example Application: Ensures that in tables like trig, hospitaluser, and others,
attributes are not dependent on each other, avoiding transitive dependencies. For
instance, in trig, attributes like normalbed, hicubed, icubed, and vbed are directly
dependent on hcode and not on each other, promoting data integrity and flexibility.
Benefits:
Reduced Redundancy: By breaking down tables into smaller ones and linking them
with relationships, redundancy is minimized. For example, hospital data
(hospitaldata) and user information (user) are stored separately, linked by
common keys (hcode), preventing data duplication.
Improved Data Integrity: Ensures data consistency and accuracy. For instance,
changes made in hospitaldata reflect uniformly across related tables (trig,
hospitaluser) due to well-defined relationships.
Optimized Storage: Efficient use of storage space by avoiding duplication of data,
thereby optimizing database performance.
Simplified Updates: Updates and modifications are easier and less error-prone. For
example, when updating hospital information (hospitaldata), related triggers (trig)
and user credentials (hospitaluser) are automatically adjusted through established
relationships.
bookingpatient Table:
hospitaldata Table:
hospitaluser Table:
test Table:
trig Table:
user Table:
First Normal Form (1NF): Each table has a primary key (id) and all columns
contain atomic values. For instance, bookingpatient, hospitaldata,
hospitaluser, test, trig, and user tables all conform to 1NF by having atomic
values in their columns and a primary key defined for each table.
Second Normal Form (2NF): Ensures that all non-key attributes are fully
functionally dependent on the primary key. This is achieved by ensuring that each
non-key column depends on the entire primary key, and there are no partial
dependencies.
Third Normal Form (3NF): In addition to 2NF requirements, 3NF ensures that all
non-key attributes are not dependent on each other. This is achieved by eliminating
transitive dependencies where one non-key column depends on another non-key
column.
Triggers: The triggers defined on the hospitaldata table (Insert, Update, Delete)
in the trig table help in maintaining audit information about changes made to
hospitaldata. This is a common use case for triggers in maintaining data integrity
and auditing changes.
Stored Procedures: The stored procedures getPatientDetails and getUsers
simplify data retrieval operations without modifying data, ensuring separation of
concerns and enhancing security.
Conclusion
The provided SQL script adheres to Third Normal Form (3NF) principles primarily through
its table structures, ensuring minimal redundancy, and maintaining data integrity by
eliminating dependencies among non-key attributes. This normalization process helps in
14
efficient data management and querying, contributing to the overall reliability and
performance of the database system.
7. Implementation
SQL Script: Below is the SQL script used to create and populate the database for the
COVID-19 Hospital Management System:
--
-- Database: `covid`
--
DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `getPatientDetails` (IN `inp`
VARCHAR(50)) NO SQL
SELECT pname,pphone,srfid,bedtype,paddress FROM bookingpatient WHERE
hcode=inp$$
DELIMITER ;
15
-- --------------------------------------------------------
--
-- Table structure for table `bookingpatient`
--
-- --------------------------------------------------------
--
-- Table structure for table `hospitaldata`
--
--
-- Triggers `hospitaldata`
--
DELIMITER $$
CREATE TRIGGER `Insert` AFTER INSERT ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,NEW.hcode,NEW.normalbed,NEW.hicubed,NEW.icubed,NEW.vbed,'
INSERTED',NOW())
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `Update` AFTER UPDATE ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,NEW.hcode,NEW.normalbed,NEW.hicubed,NEW.icubed,NEW.vbed,'
UPDATED',NOW())
16
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `delet` BEFORE DELETE ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,OLD.hcode,OLD.normalbed,OLD.hicubed,OLD.icubed,OLD.vbed,'
DELETED',NOW())
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `hospitaluser`
--
-- --------------------------------------------------------
--
-- Table structure for table `test`
--
--
-- Dumping data for table `test`
--
-- --------------------------------------------------------
--
-- Table structure for table `trig`
--
17
--
-- Dumping data for table `trig`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
--
-- Indexes for dumped tables
--
18
--
-- Indexes for table `bookingpatient`
--
ALTER TABLE `bookingpatient`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `srfid` (`srfid`(20));
--
-- Indexes for table `hospitaldata`
--
ALTER TABLE `hospitaldata`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `hcode` (`hcode`);
--
-- Indexes for table `hospitaluser`
--
ALTER TABLE `hospitaluser`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test`
--
ALTER TABLE `test`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `trig`
--
ALTER TABLE `trig`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `srfid` (`srfid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bookingpatient`
--
ALTER TABLE `bookingpatient`
19
--
-- AUTO_INCREMENT for table `hospitaldata`
--
ALTER TABLE `hospitaldata`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `hospitaluser`
--
ALTER TABLE `hospitaluser`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `test`
--
ALTER TABLE `test`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `trig`
--
ALTER TABLE `trig`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
COMMIT;
Triggers: Triggers are used in the hospitaldata table to capture events like
insertions, updates, and deletions into a separate trig table. This helps in maintaining
an audit trail of changes made to hospital data.
Stored Procedures: Stored procedures (getPatientDetails and getUsers) are
implemented in the database to fetch specific information efficiently. These
procedures help streamline data retrieval operations.
HTML Structure: The HTML pages are structured using standard elements like <html>,
<head>, <body>, and include forms, tables, and div elements as necessary to present and
collect information from users.
Key Pages:
Features:
Forms: Used for data entry and submission (e.g., patient booking form).
Tables: Displaying structured information such as hospital data and patient records.
Code Snippets:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="static/assets/vendor/bootstrap-icons/bootstrap-icons.css"
rel="stylesheet">
<link href="static/assets/vendor/boxicons/css/boxicons.min.css"
rel="stylesheet">
<link href="static/assets/vendor/glightbox/css/glightbox.min.css"
rel="stylesheet">
<link href="static/assets/vendor/swiper/swiper-bundle.min.css"
rel="stylesheet">
</head>
<body>
</ul>
</li>
{% elif current_user.is_authenticated and current_user.srfid %}
<li class="dropdown"><a href="/login"><span>Welcome
{{current_user.email}}</span> <i class="bi bi-chevron-down"></i></a>
<ul>
</ul>
</li>
{% else %}
<li class="dropdown"><a href="/login"><span>Sign In</span> <i
class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="/login">User Login</a></li>
<li><a href="/hospitallogin">Hospital Login</a></li>
<li><a href="/admin">Admin Login</a></li>
</ul>
</li>
{% endif %}
<li><a class="nav-link scrollto" href="#contact">Contact</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
</div>
</header><!-- End Header -->
</div>
</div>
</section><!-- End Hero -->
<main id="main">
24
{% block body %}
{% endblock body %}
<footer>
<div class="container">
<div class="copyright">
© Copyright <strong><span>Arkprocoder</span></strong>. All Rights
Reserved
</div>
<div class="credits">
<div id="preloader"></div>
<a href="#" class="back-to-top d-flex align-items-center justify-content-
center"><i class="bi bi-arrow-up-short"></i></a>
</body>
</html>
CSS: Used for styling elements to enhance the user interface and make it more
intuitive.
Source code :
/**
* Template Name: Medicio - v4.7.0
25
/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
body {
font-family: "Open Sans", sans-serif;
color: #444444;
}
a {
color: #3fbbc0;
text-decoration: none;
}
a:hover {
color: #65c9cd;
text-decoration: none;
}
/*--------------------------------------------------------------
# Preloader
--------------------------------------------------------------*/
#preloader {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
overflow: hidden;
background: #fff;
}
#preloader:before {
content: "";
position: fixed;
top: calc(50% - 30px);
left: calc(50% - 30px);
border: 6px solid #3fbbc0;
border-top-color: #ecf8f9;
26
border-radius: 50%;
width: 60px;
height: 60px;
-webkit-animation: animate-preloader 1s linear infinite;
animation: animate-preloader 1s linear infinite;
}
@-webkit-keyframes animate-preloader {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes animate-preloader {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/*--------------------------------------------------------------
# Back to top button
--------------------------------------------------------------*/
.back-to-top {
position: fixed;
visibility: hidden;
opacity: 0;
right: 15px;
bottom: 15px;
z-index: 996;
background: #3fbbc0;
width: 40px;
height: 40px;
border-radius: 4px;
transition: all 0.4s;
}
.back-to-top i {
font-size: 28px;
color: #fff;
line-height: 0;
}
.back-to-top:hover {
background: #5ec6ca;
color: #fff;
27
}
.back-to-top.active {
visibility: visible;
opacity: 1;
}
/*--------------------------------------------------------------
# Disable aos animation delay on mobile devices
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
[data-aos-delay] {
transition-delay: 0 !important;
}
}
/*--------------------------------------------------------------
# Top Bar
--------------------------------------------------------------*/
#topbar {
background: #3fbbc0;
color: #fff;
height: 40px;
font-size: 16px;
font-weight: 600;
z-index: 996;
transition: all 0.5s;
}
#topbar.topbar-scrolled {
top: -40px;
}
#topbar i {
padding-right: 6px;
line-height: 0;
}
/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
#header {
background: #fff;
transition: all 0.5s;
z-index: 997;
padding: 20px 0;
top: 40px;
box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
}
@media (max-width: 992px) {
#header {
padding: 15px 0;
28
}
}
#header.header-scrolled {
top: 0;
}
#header .logo {
font-size: 28px;
margin: 0;
padding: 0;
line-height: 1;
font-weight: 600;
letter-spacing: 0.5px;
text-transform: uppercase;
}
#header .logo a {
color: #555555;
}
#header .logo img {
max-height: 40px;
}
/**
* Appointment Button
*/
.appointment-btn {
margin-left: 25px;
background: #3fbbc0;
color: #fff;
border-radius: 4px;
padding: 8px 25px;
white-space: nowrap;
transition: 0.3s;
font-size: 14px;
display: inline-block;
}
.appointment-btn:hover {
background: #65c9cd;
color: #fff;
}
@media (max-width: 768px) {
.appointment-btn {
margin: 0 15px 0 0;
padding: 6px 15px;
}
}
/*--------------------------------------------------------------
# Navigation Menu
29
--------------------------------------------------------------*/
/**
* Desktop Navigation
*/
.navbar {
padding: 0;
}
.navbar ul {
margin: 0;
padding: 0;
display: flex;
list-style: none;
align-items: center;
}
.navbar li {
position: relative;
}
.navbar a, .navbar a:focus {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 0 10px 30px;
font-family: "Roboto", sans-serif;
font-size: 13px;
color: #626262;
white-space: nowrap;
transition: 0.3s;
text-transform: uppercase;
font-weight: 500;
}
.navbar a i, .navbar a:focus i {
font-size: 12px;
line-height: 0;
margin-left: 5px;
}
.navbar a:hover, .navbar .active, .navbar .active:focus, .navbar li:hover > a
{
color: #3fbbc0;
}
.navbar .dropdown ul {
display: block;
position: absolute;
left: 14px;
top: calc(100% + 30px);
margin: 0;
padding: 10px 0;
z-index: 99;
opacity: 0;
30
visibility: hidden;
background: #fff;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
transition: 0.3s;
border-radius: 4px;
}
.navbar .dropdown ul li {
min-width: 200px;
}
.navbar .dropdown ul a {
padding: 10px 20px;
text-transform: none;
}
.navbar .dropdown ul a i {
font-size: 12px;
}
.navbar .dropdown ul a:hover, .navbar .dropdown ul .active:hover, .navbar
.dropdown ul li:hover > a {
color: #3fbbc0;
}
.navbar .dropdown:hover > ul {
opacity: 1;
top: 100%;
visibility: visible;
}
.navbar .dropdown .dropdown ul {
top: 0;
left: calc(100% - 30px);
visibility: hidden;
}
.navbar .dropdown .dropdown:hover > ul {
opacity: 1;
top: 0;
left: 100%;
visibility: visible;
}
@media (max-width: 1366px) {
.navbar .dropdown .dropdown ul {
left: -90%;
}
.navbar .dropdown .dropdown:hover > ul {
left: -100%;
}
}
/**
* Mobile Navigation
*/
31
.mobile-nav-toggle {
color: #555555;
font-size: 28px;
cursor: pointer;
display: none;
line-height: 0;
transition: 0.5s;
}
.mobile-nav-toggle.bi-x {
color: #fff;
}
.navbar ul {
display: none;
}
}
.navbar-mobile {
position: fixed;
overflow: hidden;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(60, 60, 60, 0.9);
transition: 0.3s;
z-index: 999;
}
.navbar-mobile .mobile-nav-toggle {
position: absolute;
top: 15px;
right: 15px;
}
.navbar-mobile ul {
display: block;
position: absolute;
top: 55px;
right: 15px;
bottom: 15px;
left: 15px;
padding: 10px 0;
border-radius: 8px;
background-color: #fff;
overflow-y: auto;
32
transition: 0.3s;
}
.navbar-mobile a, .navbar-mobile a:focus {
padding: 10px 20px;
font-size: 15px;
color: #555555;
}
.navbar-mobile a:hover, .navbar-mobile .active, .navbar-mobile li:hover > a {
color: #3fbbc0;
}
.navbar-mobile .dropdown ul {
position: static;
display: none;
margin: 10px 20px;
padding: 10px 0;
z-index: 99;
opacity: 1;
visibility: visible;
background: #fff;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
}
.navbar-mobile .dropdown ul li {
min-width: 200px;
}
.navbar-mobile .dropdown ul a {
padding: 10px 20px;
}
.navbar-mobile .dropdown ul a i {
font-size: 12px;
}
.navbar-mobile .dropdown ul a:hover, .navbar-mobile .dropdown ul
.active:hover, .navbar-mobile .dropdown ul li:hover > a {
color: #3fbbc0;
}
.navbar-mobile .dropdown > .dropdown-active {
display: block;
}
/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
#hero {
width: 100%;
height: 100vh;
background-color: rgba(60, 60, 60, 0.8);
overflow: hidden;
position: relative;
}
33
}
#hero .carousel-inner .active,
#hero .carousel-inner .carousel-item-next.carousel-item-start,
#hero .carousel-inner .carousel-item-prev.carousel-item-end {
opacity: 1;
transition: 0.5s;
}
#hero .carousel-inner .carousel-item-next,
#hero .carousel-inner .carousel-item-prev,
#hero .carousel-inner .active.carousel-item-start,
#hero .carousel-inner .active.carousel-item-end {
left: 0;
transform: translate3d(0, 0, 0);
}
#hero .carousel-control-next-icon, #hero .carousel-control-prev-icon {
background: none;
font-size: 30px;
line-height: 0;
width: auto;
height: auto;
background: rgba(63, 187, 192, 0.8);
border-radius: 50px;
transition: 0.3s;
color: rgba(255, 255, 255, 0.5);
width: 54px;
height: 54px;
display: flex;
align-items: center;
justify-content: center;
}
#hero .carousel-control-next-icon:hover, #hero .carousel-control-prev-
icon:hover {
background: #3fbbc0;
color: rgba(255, 255, 255, 0.8);
}
#hero .carousel-indicators li {
cursor: pointer;
background: #fff;
overflow: hidden;
border: 0;
width: 12px;
height: 12px;
border-radius: 50px;
opacity: 0.6;
transition: 0.3s;
}
#hero .carousel-indicators li.active {
opacity: 1;
35
background: #3fbbc0;
}
#hero .btn-get-started {
font-family: "Roboto", sans-serif;
font-weight: 500;
font-size: 14px;
letter-spacing: 1px;
display: inline-block;
padding: 14px 32px;
border-radius: 4px;
transition: 0.5s;
line-height: 1;
color: #fff;
background: #3fbbc0;
}
#hero .btn-get-started:hover {
background: #65c9cd;
}
@media (max-width: 992px) {
#hero {
height: 100vh;
}
#hero .container {
margin-top: 100px;
}
}
@media (max-width: 768px) {
#hero h2 {
font-size: 28px;
}
}
@media (min-width: 1024px) {
#hero .carousel-control-prev, #hero .carousel-control-next {
width: 5%;
}
}
@media (max-height: 500px) {
#hero {
height: 160vh;
}
}
/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
padding: 60px 0;
overflow: hidden;
36
.section-bg {
background-color: #f7fcfc;
}
.section-title {
text-align: center;
padding-bottom: 30px;
}
.section-title h2 {
font-size: 32px;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 20px;
padding-bottom: 20px;
position: relative;
}
.section-title h2::after {
content: "";
position: absolute;
display: block;
width: 50px;
height: 3px;
background: #3fbbc0;
bottom: 0;
left: calc(50% - 25px);
}
.section-title p {
margin-bottom: 0;
}
/*--------------------------------------------------------------
# Breadcrumbs
--------------------------------------------------------------*/
.breadcrumbs {
padding: 20px 0;
background-color: #ecf8f9;
min-height: 40px;
margin-top: 120px;
}
@media (max-width: 992px) {
.breadcrumbs {
margin-top: 70px;
}
}
.breadcrumbs h2 {
font-size: 24px;
37
font-weight: 300;
margin: 0;
}
@media (max-width: 992px) {
.breadcrumbs h2 {
margin: 0 0 10px 0;
}
}
.breadcrumbs ol {
display: flex;
flex-wrap: wrap;
list-style: none;
padding: 0;
margin: 0;
font-size: 14px;
}
.breadcrumbs ol li + li {
padding-left: 10px;
}
.breadcrumbs ol li + li::before {
display: inline-block;
padding-right: 10px;
color: #6c757d;
content: "/";
}
@media (max-width: 768px) {
.breadcrumbs .d-flex {
display: block !important;
}
.breadcrumbs ol {
display: block;
}
.breadcrumbs ol li {
display: inline-block;
}
}
/*--------------------------------------------------------------
# Featured Services
--------------------------------------------------------------*/
.featured-services .icon-box {
padding: 30px;
position: relative;
overflow: hidden;
background: #fff;
box-shadow: 0 0 29px 0 rgba(68, 88, 144, 0.12);
transition: all 0.3s ease-in-out;
border-radius: 8px;
38
z-index: 1;
}
.featured-services .icon-box::before {
content: "";
position: absolute;
background: #d9f1f2;
right: 0;
left: 0;
bottom: 0;
top: 100%;
transition: all 0.3s;
z-index: -1;
}
.featured-services .icon-box:hover::before {
background: #3fbbc0;
top: 0;
border-radius: 0px;
}
.featured-services .icon {
margin-bottom: 15px;
}
.featured-services .icon i {
font-size: 48px;
line-height: 1;
color: #3fbbc0;
transition: all 0.3s ease-in-out;
}
.featured-services .title {
font-weight: 700;
margin-bottom: 15px;
font-size: 18px;
}
.featured-services .title a {
color: #111;
}
.featured-services .description {
font-size: 15px;
line-height: 28px;
margin-bottom: 0;
}
.featured-services .icon-box:hover .title a, .featured-services .icon-
box:hover .description {
color: #fff;
}
.featured-services .icon-box:hover .icon i {
color: #fff;
}
39
/*--------------------------------------------------------------
# Cta
--------------------------------------------------------------*/
.cta {
background: #3fbbc0;
color: #fff;
background-size: cover;
padding: 60px 0;
}
.cta h3 {
font-size: 28px;
font-weight: 700;
}
.cta .cta-btn {
font-family: "Roboto", sans-serif;
font-weight: 500;
font-size: 16px;
letter-spacing: 1px;
display: inline-block;
padding: 10px 35px;
border-radius: 25px;
transition: 0.5s;
margin-top: 10px;
border: 2px solid #fff;
color: #fff;
}
.cta .cta-btn:hover {
background: #fff;
color: #3fbbc0;
}
/*--------------------------------------------------------------
# About Us
--------------------------------------------------------------*/
.about .content h3 {
font-weight: 600;
font-size: 26px;
}
.about .content ul {
list-style: none;
padding: 0;
}
.about .content ul li {
padding-bottom: 10px;
}
.about .content ul i {
font-size: 20px;
padding-right: 4px;
40
color: #3fbbc0;
}
.about .content p:last-child {
margin-bottom: 0;
}
/*--------------------------------------------------------------
# Counts
--------------------------------------------------------------*/
.counts {
padding-bottom: 30px;
}
.counts .count-box {
box-shadow: -10px -5px 40px 0 rgba(0, 0, 0, 0.1);
padding: 30px;
width: 100%;
}
.counts .count-box i {
display: block;
font-size: 30px;
color: #3fbbc0;
float: left;
}
.counts .count-box span {
font-size: 42px;
line-height: 24px;
display: block;
font-weight: 700;
color: #555555;
margin-left: 50px;
}
.counts .count-box p {
padding: 30px 0 0 0;
margin: 0;
font-family: "Roboto", sans-serif;
font-size: 14px;
}
.counts .count-box a {
font-weight: 600;
display: block;
margin-top: 20px;
color: #7b7b7b;
font-size: 15px;
font-family: "Poppins", sans-serif;
transition: ease-in-out 0.3s;
}
.counts .count-box a:hover {
color: #3fbbc0;
41
/*--------------------------------------------------------------
# Features
--------------------------------------------------------------*/
.features .icon-box h4 {
font-size: 20px;
font-weight: 700;
margin: 5px 0 10px 60px;
}
.features .icon-box i {
font-size: 48px;
float: left;
color: #3fbbc0;
}
.features .icon-box p {
font-size: 15px;
color: #848484;
margin-left: 60px;
}
.features .image {
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
min-height: 400px;
}
/*--------------------------------------------------------------
# Services
--------------------------------------------------------------*/
.services .icon-box {
margin-bottom: 20px;
text-align: center;
}
.services .icon {
display: inline-flex;
justify-content: center;
align-items: center;
width: 80px;
height: 80px;
margin-bottom: 20px;
background: #fff;
border-radius: 50%;
transition: 0.5s;
color: #3fbbc0;
overflow: hidden;
box-shadow: 0px 0 25px rgba(0, 0, 0, 0.15);
}
42
.services .icon i {
font-size: 36px;
line-height: 0;
}
.services .icon-box:hover .icon {
box-shadow: 0px 0 25px rgba(63, 187, 192, 0.3);
}
.services .title {
font-weight: 600;
margin-bottom: 15px;
font-size: 18px;
position: relative;
padding-bottom: 15px;
}
.services .title a {
color: #444444;
transition: 0.3s;
}
.services .title a:hover {
color: #3fbbc0;
}
.services .title::after {
content: "";
position: absolute;
display: block;
width: 50px;
height: 2px;
background: #3fbbc0;
bottom: 0;
left: calc(50% - 25px);
}
.services .description {
line-height: 24px;
font-size: 14px;
}
/*--------------------------------------------------------------
# Appointments
--------------------------------------------------------------*/
.appointment .php-email-form {
width: 100%;
}
.appointment .php-email-form .form-group {
padding-bottom: 8px;
}
.appointment .php-email-form .validate {
display: none;
color: red;
43
margin: 0 0 15px 0;
font-weight: 400;
font-size: 13px;
}
.appointment .php-email-form .error-message {
display: none;
color: #fff;
background: #ed3c0d;
text-align: left;
padding: 15px;
font-weight: 600;
}
.appointment .php-email-form .error-message br + br {
margin-top: 25px;
}
.appointment .php-email-form .sent-message {
display: none;
color: #fff;
background: #18d26e;
text-align: center;
padding: 15px;
font-weight: 600;
}
.appointment .php-email-form .loading {
display: none;
background: #fff;
text-align: center;
padding: 15px;
}
.appointment .php-email-form .loading:before {
content: "";
display: inline-block;
border-radius: 50%;
width: 24px;
height: 24px;
margin: 0 10px -6px 0;
border: 3px solid #18d26e;
border-top-color: #eee;
-webkit-animation: animate-loading 1s linear infinite;
animation: animate-loading 1s linear infinite;
}
.appointment .php-email-form input, .appointment .php-email-form textarea,
.appointment .php-email-form select {
border-radius: 0;
box-shadow: none;
font-size: 14px;
padding: 10px !important;
}
44
/*--------------------------------------------------------------
# Departments
--------------------------------------------------------------*/
.departments .nav-tabs {
border: 0;
}
.departments .nav-link {
border: 0;
padding: 20px;
color: #555555;
border-radius: 0;
border-left: 5px solid #fff;
cursor: pointer;
}
.departments .nav-link h4 {
font-size: 18px;
font-weight: 600;
transition: 0.3s;
}
.departments .nav-link p {
font-size: 14px;
margin-bottom: 0;
}
.departments .nav-link:hover h4 {
color: #3fbbc0;
}
45
.departments .nav-link.active {
background: #f7fcfc;
border-color: #3fbbc0;
}
.departments .nav-link.active h4 {
color: #3fbbc0;
}
.departments .tab-pane.active {
-webkit-animation: slide-down 0.5s ease-out;
animation: slide-down 0.5s ease-out;
}
.departments .tab-pane img {
float: left;
max-width: 300px;
padding: 0 15px 15px 0;
}
@media (max-width: 768px) {
.departments .tab-pane img {
float: none;
padding: 0 0 15px 0;
max-width: 100%;
}
}
.departments .tab-pane h3 {
font-size: 26px;
font-weight: 600;
margin-bottom: 20px;
color: #3fbbc0;
}
.departments .tab-pane p {
color: #777777;
}
.departments .tab-pane p:last-child {
margin-bottom: 0;
}
@-webkit-keyframes slide-down {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes slide-down {
0% {
opacity: 0;
}
100% {
46
opacity: 1;
}
}
/*--------------------------------------------------------------
# Testimonials
--------------------------------------------------------------*/
.testimonials .testimonials-carousel, .testimonials .testimonials-slider {
overflow: hidden;
}
.testimonials .testimonial-item {
box-sizing: content-box;
min-height: 320px;
}
.testimonials .testimonial-item .testimonial-img {
width: 90px;
border-radius: 50%;
margin: -40px 0 0 40px;
position: relative;
z-index: 2;
border: 6px solid #fff;
}
.testimonials .testimonial-item h3 {
font-size: 18px;
font-weight: bold;
margin: 10px 0 5px 45px;
color: #111;
}
.testimonials .testimonial-item h4 {
font-size: 14px;
color: #999;
margin: 0 0 0 45px;
}
.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-
item .quote-icon-right {
color: #b2e4e6;
font-size: 26px;
}
.testimonials .testimonial-item .quote-icon-left {
display: inline-block;
left: -5px;
position: relative;
}
.testimonials .testimonial-item .quote-icon-right {
display: inline-block;
right: -5px;
position: relative;
top: 10px;
47
}
.testimonials .testimonial-item p {
font-style: italic;
margin: 0 15px 0 15px;
padding: 20px 20px 60px 20px;
background: #f0fafa;
position: relative;
border-radius: 6px;
position: relative;
z-index: 1;
}
.testimonials .swiper-pagination {
margin-top: 20px;
position: relative;
}
.testimonials .swiper-pagination .swiper-pagination-bullet {
width: 12px;
height: 12px;
background-color: #fff;
opacity: 1;
border: 1px solid #3fbbc0;
}
.testimonials .swiper-pagination .swiper-pagination-bullet-active {
background-color: #3fbbc0;
}
/*--------------------------------------------------------------
# Doctors
--------------------------------------------------------------*/
.doctors .member {
margin-bottom: 20px;
overflow: hidden;
text-align: center;
border-radius: 4px;
background: #fff;
box-shadow: 0px 2px 15px rgba(63, 187, 192, 0.1);
}
.doctors .member .member-img {
position: relative;
overflow: hidden;
}
.doctors .member .social {
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 40px;
opacity: 0;
48
/*--------------------------------------------------------------
# Gallery
--------------------------------------------------------------*/
.gallery {
overflow: hidden;
}
.gallery .swiper-pagination {
margin-top: 20px;
position: relative;
}
.gallery .swiper-pagination .swiper-pagination-bullet {
width: 12px;
height: 12px;
background-color: #fff;
opacity: 1;
border: 1px solid #3fbbc0;
}
.gallery .swiper-pagination .swiper-pagination-bullet-active {
background-color: #3fbbc0;
}
.gallery .swiper-slide-active {
text-align: center;
}
@media (min-width: 992px) {
.gallery .swiper-wrapper {
padding: 40px 0;
}
.gallery .swiper-slide-active {
border: 6px solid #3fbbc0;
padding: 4px;
background: #fff;
z-index: 1;
transform: scale(1.2);
margin-top: 10px;
}
}
/*--------------------------------------------------------------
# Pricing
--------------------------------------------------------------*/
.pricing .box {
padding: 20px;
background: #fff;
text-align: center;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.12);
border-radius: 4px;
position: relative;
50
overflow: hidden;
}
.pricing h3 {
font-weight: 400;
margin: -20px -20px 20px -20px;
padding: 20px 15px;
font-size: 16px;
font-weight: 600;
color: #777777;
background: #f8f8f8;
}
.pricing h4 {
font-size: 36px;
color: #3fbbc0;
font-weight: 600;
font-family: "Poppins", sans-serif;
margin-bottom: 20px;
}
.pricing h4 sup {
font-size: 20px;
top: -15px;
left: -3px;
}
.pricing h4 span {
color: #bababa;
font-size: 16px;
font-weight: 300;
}
.pricing ul {
padding: 0;
list-style: none;
color: #444444;
text-align: center;
line-height: 20px;
font-size: 14px;
}
.pricing ul li {
padding-bottom: 16px;
}
.pricing ul i {
color: #3fbbc0;
font-size: 18px;
padding-right: 4px;
}
.pricing ul .na {
color: #ccc;
text-decoration: line-through;
}
51
.pricing .btn-wrap {
margin: 20px -20px -20px -20px;
padding: 20px 15px;
background: #f8f8f8;
text-align: center;
}
.pricing .btn-buy {
background: #3fbbc0;
display: inline-block;
padding: 8px 35px 10px 35px;
border-radius: 4px;
color: #fff;
transition: none;
font-size: 14px;
font-weight: 400;
font-family: "Roboto", sans-serif;
font-weight: 600;
transition: 0.3s;
}
.pricing .btn-buy:hover {
background: #65c9cd;
}
.pricing .featured h3 {
color: #fff;
background: #3fbbc0;
}
.pricing .advanced {
width: 200px;
position: absolute;
top: 18px;
right: -68px;
transform: rotate(45deg);
z-index: 1;
font-size: 14px;
padding: 1px 0 3px 0;
background: #3fbbc0;
color: #fff;
}
/*--------------------------------------------------------------
# Frequently Asked Questioins
--------------------------------------------------------------*/
.faq {
padding: 60px 0;
}
.faq .faq-list {
padding: 0;
list-style: none;
52
}
.faq .faq-list li {
border-bottom: 1px solid #d9f1f2;
margin-bottom: 20px;
padding-bottom: 20px;
}
.faq .faq-list .question {
display: block;
position: relative;
font-family: #3fbbc0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
padding-left: 25px;
cursor: pointer;
color: #32969a;
transition: 0.3s;
}
.faq .faq-list i {
font-size: 16px;
position: absolute;
left: 0;
top: -2px;
}
.faq .faq-list p {
margin-bottom: 0;
padding: 10px 0 0 25px;
}
.faq .faq-list .icon-show {
display: none;
}
.faq .faq-list .collapsed {
color: black;
}
.faq .faq-list .collapsed:hover {
color: #3fbbc0;
}
.faq .faq-list .collapsed .icon-show {
display: inline-block;
transition: 0.6s;
}
.faq .faq-list .collapsed .icon-close {
display: none;
transition: 0.6s;
}
/*--------------------------------------------------------------
# Contact
53
--------------------------------------------------------------*/
.contact .info-box {
color: #444444;
text-align: center;
box-shadow: 0 0 20px rgba(214, 215, 216, 0.5);
padding: 20px 0 30px 0;
}
.contact .info-box i {
font-size: 32px;
color: #3fbbc0;
border-radius: 50%;
padding: 8px;
border: 2px dotted #c5ebec;
}
.contact .info-box h3 {
font-size: 20px;
color: #777777;
font-weight: 700;
margin: 10px 0;
}
.contact .info-box p {
padding: 0;
line-height: 24px;
font-size: 14px;
margin-bottom: 0;
}
.contact .php-email-form {
box-shadow: 0 0 20px rgba(214, 215, 216, 0.5);
padding: 30px;
}
.contact .php-email-form .error-message {
display: none;
color: #fff;
background: #ed3c0d;
text-align: left;
padding: 15px;
font-weight: 600;
}
.contact .php-email-form .error-message br + br {
margin-top: 25px;
}
.contact .php-email-form .sent-message {
display: none;
color: #fff;
background: #18d26e;
text-align: center;
padding: 15px;
font-weight: 600;
54
}
.contact .php-email-form .loading {
display: none;
background: #fff;
text-align: center;
padding: 15px;
}
.contact .php-email-form .loading:before {
content: "";
display: inline-block;
border-radius: 50%;
width: 24px;
height: 24px;
margin: 0 10px -6px 0;
border: 3px solid #18d26e;
border-top-color: #eee;
-webkit-animation: animate-loading 1s linear infinite;
animation: animate-loading 1s linear infinite;
}
.contact .php-email-form input, .contact .php-email-form textarea {
border-radius: 4px;
box-shadow: none;
font-size: 14px;
}
.contact .php-email-form input:focus, .contact .php-email-form textarea:focus
{
border-color: #3fbbc0;
}
.contact .php-email-form input {
padding: 10px 15px;
}
.contact .php-email-form textarea {
padding: 12px 15px;
}
.contact .php-email-form button[type=submit] {
background: #3fbbc0;
border: 0;
padding: 10px 30px;
color: #fff;
transition: 0.4s;
border-radius: 4px;
}
.contact .php-email-form button[type=submit]:hover {
background: #65c9cd;
}
@-webkit-keyframes animate-loading {
0% {
transform: rotate(0deg);
55
}
100% {
transform: rotate(360deg);
}
}
@keyframes animate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
#footer {
background: #eeeeee;
padding: 0 0 30px 0;
color: #555555;
font-size: 14px;
}
#footer .footer-top {
background: #f6f6f6;
padding: 60px 0 30px 0;
}
#footer .footer-top .footer-info {
margin-bottom: 30px;
}
#footer .footer-top .footer-info h3 {
font-size: 24px;
margin: 0 0 20px 0;
padding: 2px 0 2px 0;
line-height: 1;
font-weight: 700;
}
#footer .footer-top .footer-info p {
font-size: 14px;
line-height: 24px;
margin-bottom: 0;
font-family: "Roboto", sans-serif;
}
#footer .footer-top .social-links a {
font-size: 18px;
display: inline-block;
background: #3fbbc0;
color: #fff;
56
line-height: 1;
padding: 8px 0;
margin-right: 4px;
border-radius: 4px;
text-align: center;
width: 36px;
height: 36px;
transition: 0.3s;
}
#footer .footer-top .social-links a:hover {
background: #65c9cd;
text-decoration: none;
}
#footer .footer-top h4 {
font-size: 16px;
font-weight: 600;
position: relative;
padding-bottom: 12px;
}
#footer .footer-top .footer-links {
margin-bottom: 30px;
}
#footer .footer-top .footer-links ul {
list-style: none;
padding: 0;
margin: 0;
}
#footer .footer-top .footer-links ul i {
padding-right: 2px;
color: #3fbbc0;
font-size: 18px;
line-height: 1;
}
#footer .footer-top .footer-links ul li {
padding: 10px 0;
display: flex;
align-items: center;
}
#footer .footer-top .footer-links ul li:first-child {
padding-top: 0;
}
#footer .footer-top .footer-links ul a {
color: #555555;
transition: 0.3s;
display: inline-block;
line-height: 1;
}
#footer .footer-top .footer-links ul a:hover {
57
color: #3fbbc0;
}
#footer .footer-top .footer-newsletter form {
margin-top: 30px;
background: #fff;
padding: 6px 10px;
position: relative;
border: 1px solid #d5d5d5;
border-radius: 4px;
}
#footer .footer-top .footer-newsletter form input[type=email] {
border: 0;
padding: 4px;
width: calc(100% - 110px);
}
#footer .footer-top .footer-newsletter form input[type=submit] {
position: absolute;
top: -1px;
right: -1px;
bottom: -1px;
border: 0;
background: none;
font-size: 16px;
padding: 0 20px;
background: #3fbbc0;
color: #fff;
transition: 0.3s;
border-radius: 0 4px 4px 0;
}
#footer .footer-top .footer-newsletter form input[type=submit]:hover {
background: #65c9cd;
}
#footer .copyright {
text-align: center;
padding-top: 30px;
}
#footer .credits {
padding-top: 10px;
text-align: center;
font-size: 13px;
}
Overview: Python scripts are used to interact with the MySQL database, handling data
retrieval, insertion, updating, and deletion based on user actions from the frontend.
Key Functionalities:
Data Retrieval: Fetching patient details, hospital data, and user information from the
database.
Data Insertion: Adding new patient bookings and updating hospital information.
Data Validation: Ensuring input data meets specified criteria (e.g., valid email
format, required fields).
User Inputs:
Backend processes user inputs received from HTML forms using HTTP requests
(POST/GET).
Validates and sanitizes user inputs to prevent SQL injection and ensure data integrity.
Security Measures:
Data Validation: Input fields are validated on the frontend using JavaScript and re-
validated on the backend to prevent malicious data entry.
Sanitization: User inputs are sanitized to prevent SQL injection attacks, ensuring
database security.
This integrated approach ensures a secure, responsive, and efficient COVID-19 Hospital
Management System, capable of managing patient data and hospital resources effectively.
sql
Copy code
INSERT INTO bookingpatient (srfid, bedtype, hcode, spo2, pname,
pphone, paddress)
VALUES ('SRF001', 'normal', 'HOS001', 95, 'John Doe', '1234567890',
'123 Main St, City');
This query inserts a new patient record into the bookingpatient table with specified
details such as SRFID, bed type, hospital code, SpO2 level, patient name, phone
number, and address.
sql
59
Copy code
INSERT INTO hospitaldata (hcode, hname, normalbed, hicubed, icubed,
vbed)
VALUES ('HOS001', 'City Hospital', 100, 20, 10, 5);
This query inserts hospital data into the hospitaldata table, including hospital code,
name, and bed counts for different types of beds.
sql
Copy code
INSERT INTO hospitaluser (hcode, email, password)
VALUES ('HOS001', '[email protected]', 'hashed_password');
This example inserts a new hospital user record with email and hashed password.
Data Validation: Ensuring that all required fields are provided and validating data
formats (e.g., phone number format) before insertion.
Concurrency Control: Handling concurrent inserts to avoid race conditions and
maintain data consistency.
Security Considerations: Properly hashing passwords and sanitizing inputs to
prevent SQL injection attacks.
Sample Queries:
sql
Copy code
SELECT pname, pphone, srfid, bedtype, paddress
FROM bookingpatient
WHERE hcode = 'HOS001';
Purpose: Retrieve details of patients admitted to hospital with code 'HOS001'. Output
includes patient name, phone number, SRFID, bed type, and address.
sql
Copy code
SELECT hname, normalbed, hicubed, icubed, vbed
FROM hospitaldata;
Purpose: Retrieve overall hospital data including name and bed counts for different
types (normal, high-intensity, intensive, and ventilator).
sql
Copy code
SELECT b.pname, b.pphone, h.hname
FROM bookingpatient b
INNER JOIN hospitaldata h ON b.hcode = h.hcode
WHERE b.bedtype = 'icu';
Explanation of Queries:
Query 1: Retrieves patient details based on hospital code, useful for managing patient
admissions and tracking.
Query 2: Provides an overview of hospital resources, aiding in resource allocation
and planning.
Query 3: Demonstrates a join operation to link patient records with hospital details,
facilitating comprehensive reporting and management.
Complex Queries:
sql
Copy code
SELECT h.hname, h.normalbed - COUNT(b.id) AS available_normal_beds
FROM hospitaldata h
LEFT JOIN bookingpatient b ON h.hcode = b.hcode AND b.bedtype =
'normal'
GROUP BY h.hname;
Purpose: Calculates available normal beds by subtracting booked beds from total
normal beds per hospital, helping in real-time bed availability monitoring.
These queries and examples illustrate the versatility and functionality of the database in
managing hospital operations efficiently, from patient admissions to resource management.
Properly crafted queries ensure accurate data retrieval and manipulation, crucial for decision-
making and operational efficiency in healthcare settings.
9.1 Triggers
Triggers are special types of stored procedures that automatically execute or fire when certain
events occur. They are used to enforce data integrity, maintain audit trails, and synchronize
related tables.
update_bed_count_trigger
61
sql
Copy code
-- Trigger to update available beds when a new patient is admitted
CREATE TRIGGER update_bed_count_after_insert
AFTER INSERT ON Patients
FOR EACH ROW
BEGIN
UPDATE Hospitals
SET available_beds = available_beds - 1
WHERE hospital_id = NEW.hospital_id;
END;
Stored procedures are a set of SQL statements that can be executed as a single unit. They help
in reusing code, encapsulating business logic, and improving performance.
admit_patient
discharge_patient
Example of Usage:
1. admit_patient Procedure:
62
sql
Copy code
CREATE PROCEDURE admit_patient(
IN p_name VARCHAR(255),
IN p_age INT,
IN p_gender VARCHAR(10),
IN p_hospital_id INT,
IN p_bed_number INT,
IN p_admission_date DATE
)
BEGIN
INSERT INTO Patients (name, age, gender, hospital_id, bed_number,
admission_date)
VALUES (p_name, p_age, p_gender, p_hospital_id, p_bed_number,
p_admission_date);
UPDATE Hospitals
SET available_beds = available_beds - 1
WHERE hospital_id = p_hospital_id;
END;
This procedure admits a new patient by inserting their details into the Patients table and
updating the available bed count in the corresponding hospital.
2. discharge_patient Procedure:
sql
Copy code
CREATE PROCEDURE discharge_patient(
IN p_patient_id INT,
IN p_discharge_date DATE
)
BEGIN
UPDATE Patients
SET discharge_date = p_discharge_date
WHERE patient_id = p_patient_id;
UPDATE Hospitals
SET available_beds = available_beds + 1
WHERE hospital_id = (SELECT hospital_id FROM Patients WHERE patient_id
= p_patient_id);
END;
This procedure discharges a patient by updating their discharge date in the Patients table
and adjusting the available bed count in the corresponding hospital.
Examples of How Triggers and Stored Procedures are Used in the System:
When a new patient is admitted using the admit_patient procedure, the trigger
update_bed_count_after_insert is fired to decrement the available bed count.
When a patient is discharged using the discharge_patient procedure, the trigger
update_bed_count_after_delete is fired to increment the available bed count.
These triggers and stored procedures ensure that the hospital's bed availability is
always accurately reflected in the database without requiring manual intervention.
Results
The system was successfully implemented and tested, providing the following results:
Performance
Response Time: Database queries, including complex joins and aggregate functions,
performed efficiently, ensuring rapid data retrieval even under load.
Scalability: The system demonstrated scalability by handling increased data volume
and concurrent user requests without significant degradation in performance.
Resource Utilization: Monitoring of system resources indicated optimal utilization of
server resources, including CPU and memory, supporting continuous operation.
Challenges
User Feedback
User-Friendly Interface: Positive feedback was received regarding the intuitive user
interface, facilitating ease of use and navigation.
Enhanced Operational Efficiency: Users reported improved efficiency in managing
hospital resources and patient admissions, attributed to real-time data availability and
comprehensive reporting features.
Suggestions for Enhancement: Stakeholders provided valuable suggestions for
future enhancements, including additional features for analytics and reporting
capabilities, which are planned for future iterations.
64
13. Appendix
Additional Material
--
-- Database: `covid`
--
DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `getPatientDetails` (IN `inp`
VARCHAR(50)) NO SQL
SELECT pname,pphone,srfid,bedtype,paddress FROM bookingpatient WHERE
hcode=inp$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `bookingpatient`
65
--
-- --------------------------------------------------------
--
-- Table structure for table `hospitaldata`
--
--
-- Triggers `hospitaldata`
--
DELIMITER $$
CREATE TRIGGER `Insert` AFTER INSERT ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,NEW.hcode,NEW.normalbed,NEW.hicubed,NEW.icubed,NEW.vbed,'
INSERTED',NOW())
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `Update` AFTER UPDATE ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,NEW.hcode,NEW.normalbed,NEW.hicubed,NEW.icubed,NEW.vbed,'
UPDATED',NOW())
$$
DELIMITER ;
DELIMITER $$
66
CREATE TRIGGER `delet` BEFORE DELETE ON `hospitaldata` FOR EACH ROW INSERT
INTO trig
VALUES(null,OLD.hcode,OLD.normalbed,OLD.hicubed,OLD.icubed,OLD.vbed,'
DELETED',NOW())
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `hospitaluser`
--
-- --------------------------------------------------------
--
-- Table structure for table `test`
--
--
-- Dumping data for table `test`
--
-- --------------------------------------------------------
--
-- Table structure for table `trig`
--
--
-- Dumping data for table `trig`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bookingpatient`
68
--
ALTER TABLE `bookingpatient`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `srfid` (`srfid`(20));
--
-- Indexes for table `hospitaldata`
--
ALTER TABLE `hospitaldata`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `hcode` (`hcode`);
--
-- Indexes for table `hospitaluser`
--
ALTER TABLE `hospitaluser`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test`
--
ALTER TABLE `test`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `trig`
--
ALTER TABLE `trig`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `srfid` (`srfid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bookingpatient`
--
ALTER TABLE `bookingpatient`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
69
--
-- AUTO_INCREMENT for table `hospitaluser`
--
ALTER TABLE `hospitaluser`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `test`
--
ALTER TABLE `test`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `trig`
--
ALTER TABLE `trig`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
COMMIT;
2. PlantUML Diagrams:
o Detailed Entity-Relationship (ER) diagram using PlantUML, illustrating table
relationships and attributes.
3. HTML and CSS Code Snippets:
o Snippets of HTML and CSS code used for critical parts of the frontend, such
as user interface components and styling.
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<body>
</ul>
</li>
{% elif current_user.is_authenticated and current_user.srfid %}
<li class="dropdown"><a href="/login"><span>Welcome
{{current_user.email}}</span> <i class="bi bi-chevron-down"></i></a>
<ul>
</ul>
</li>
{% else %}
<li class="dropdown"><a href="/login"><span>Sign In</span> <i
class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="/login">User Login</a></li>
<li><a href="/hospitallogin">Hospital Login</a></li>
<li><a href="/admin">Admin Login</a></li>
</ul>
</li>
{% endif %}
<li><a class="nav-link scrollto" href="#contact">Contact</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
</div>
</header><!-- End Header -->
<div class="container">
<h2>CHINA</h2>
<p>Yangzhou bed booking system</p>
<a href="#about" class="btn-get-started scrollto">Read More</a>
</div>
</div>
</div>
</div>
</section><!-- End Hero -->
<main id="main">
{% block body %}
{% endblock body %}
<footer>
<div class="container">
<div class="copyright">
© Copyright <strong><span>Arkprocoder</span></strong>. All Rights
Reserved
</div>
<div class="credits">
<div id="preloader"></div>
74
</body>
</html>
Css code:
/**
* Template Name: Medicio - v4.7.0
* Template URL: https://bootstrapmade.com/medicio-free-bootstrap-theme/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
*/
/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
body {
font-family: "Open Sans", sans-serif;
color: #444444;
}
a {
color: #3fbbc0;
text-decoration: none;
}
a:hover {
color: #65c9cd;
text-decoration: none;
}
/*--------------------------------------------------------------
# Preloader
--------------------------------------------------------------*/
#preloader {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
overflow: hidden;
background: #fff;
}
#preloader:before {
content: "";
position: fixed;
top: calc(50% - 30px);
left: calc(50% - 30px);
border: 6px solid #3fbbc0;
border-top-color: #ecf8f9;
border-radius: 50%;
width: 60px;
height: 60px;
-webkit-animation: animate-preloader 1s linear infinite;
animation: animate-preloader 1s linear infinite;
}
@-webkit-keyframes animate-preloader {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes animate-preloader {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/*--------------------------------------------------------------
# Back to top button
76
--------------------------------------------------------------*/
.back-to-top {
position: fixed;
visibility: hidden;
opacity: 0;
right: 15px;
bottom: 15px;
z-index: 996;
background: #3fbbc0;
width: 40px;
height: 40px;
border-radius: 4px;
transition: all 0.4s;
}
.back-to-top i {
font-size: 28px;
color: #fff;
line-height: 0;
}
.back-to-top:hover {
background: #5ec6ca;
color: #fff;
}
.back-to-top.active {
visibility: visible;
opacity: 1;
}
/*--------------------------------------------------------------
# Disable aos animation delay on mobile devices
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
[data-aos-delay] {
transition-delay: 0 !important;
}
}
/*--------------------------------------------------------------
# Top Bar
--------------------------------------------------------------*/
#topbar {
background: #3fbbc0;
color: #fff;
height: 40px;
font-size: 16px;
font-weight: 600;
z-index: 996;
transition: all 0.5s;
}
77
#topbar.topbar-scrolled {
top: -40px;
}
#topbar i {
padding-right: 6px;
line-height: 0;
}
/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
#header {
background: #fff;
transition: all 0.5s;
z-index: 997;
padding: 20px 0;
top: 40px;
box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
}
@media (max-width: 992px) {
#header {
padding: 15px 0;
}
}
#header.header-scrolled {
top: 0;
}
#header .logo {
font-size: 28px;
margin: 0;
padding: 0;
line-height: 1;
font-weight: 600;
letter-spacing: 0.5px;
text-transform: uppercase;
}
#header .logo a {
color: #555555;
}
#header .logo img {
max-height: 40px;
}
/**
* Appointment Button
*/
.appointment-btn {
margin-left: 25px;
78
background: #3fbbc0;
color: #fff;
border-radius: 4px;
padding: 8px 25px;
white-space: nowrap;
transition: 0.3s;
font-size: 14px;
display: inline-block;
}
.appointment-btn:hover {
background: #65c9cd;
color: #fff;
}
@media (max-width: 768px) {
.appointment-btn {
margin: 0 15px 0 0;
padding: 6px 15px;
}
}
/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/**
* Desktop Navigation
*/
.navbar {
padding: 0;
}
.navbar ul {
margin: 0;
padding: 0;
display: flex;
list-style: none;
align-items: center;
}
.navbar li {
position: relative;
}
.navbar a, .navbar a:focus {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 0 10px 30px;
font-family: "Roboto", sans-serif;
font-size: 13px;
color: #626262;
white-space: nowrap;
79
transition: 0.3s;
text-transform: uppercase;
font-weight: 500;
}
.navbar a i, .navbar a:focus i {
font-size: 12px;
line-height: 0;
margin-left: 5px;
}
.navbar a:hover, .navbar .active, .navbar .active:focus, .navbar li:hover > a
{
color: #3fbbc0;
}
.navbar .dropdown ul {
display: block;
position: absolute;
left: 14px;
top: calc(100% + 30px);
margin: 0;
padding: 10px 0;
z-index: 99;
opacity: 0;
visibility: hidden;
background: #fff;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
transition: 0.3s;
border-radius: 4px;
}
.navbar .dropdown ul li {
min-width: 200px;
}
.navbar .dropdown ul a {
padding: 10px 20px;
text-transform: none;
}
.navbar .dropdown ul a i {
font-size: 12px;
}
.navbar .dropdown ul a:hover, .navbar .dropdown ul .active:hover, .navbar
.dropdown ul li:hover > a {
color: #3fbbc0;
}
.navbar .dropdown:hover > ul {
opacity: 1;
top: 100%;
visibility: visible;
}
.navbar .dropdown .dropdown ul {
80
top: 0;
left: calc(100% - 30px);
visibility: hidden;
}
.navbar .dropdown .dropdown:hover > ul {
opacity: 1;
top: 0;
left: 100%;
visibility: visible;
}
@media (max-width: 1366px) {
.navbar .dropdown .dropdown ul {
left: -90%;
}
.navbar .dropdown .dropdown:hover > ul {
left: -100%;
}
}
/**
* Mobile Navigation
*/
.mobile-nav-toggle {
color: #555555;
font-size: 28px;
cursor: pointer;
display: none;
line-height: 0;
transition: 0.5s;
}
.mobile-nav-toggle.bi-x {
color: #fff;
}
.navbar ul {
display: none;
}
}
.navbar-mobile {
position: fixed;
overflow: hidden;
top: 0;
right: 0;
81
left: 0;
bottom: 0;
background: rgba(60, 60, 60, 0.9);
transition: 0.3s;
z-index: 999;
}
.navbar-mobile .mobile-nav-toggle {
position: absolute;
top: 15px;
right: 15px;
}
.navbar-mobile ul {
display: block;
position: absolute;
top: 55px;
right: 15px;
bottom: 15px;
left: 15px;
padding: 10px 0;
border-radius: 8px;
background-color: #fff;
overflow-y: auto;
transition: 0.3s;
}
.navbar-mobile a, .navbar-mobile a:focus {
padding: 10px 20px;
font-size: 15px;
color: #555555;
}
.navbar-mobile a:hover, .navbar-mobile .active, .navbar-mobile li:hover > a {
color: #3fbbc0;
}
.navbar-mobile .dropdown ul {
position: static;
display: none;
margin: 10px 20px;
padding: 10px 0;
z-index: 99;
opacity: 1;
visibility: visible;
background: #fff;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
}
.navbar-mobile .dropdown ul li {
min-width: 200px;
}
.navbar-mobile .dropdown ul a {
padding: 10px 20px;
82
}
.navbar-mobile .dropdown ul a i {
font-size: 12px;
}
.navbar-mobile .dropdown ul a:hover, .navbar-mobile .dropdown ul
.active:hover, .navbar-mobile .dropdown ul li:hover > a {
color: #3fbbc0;
}
.navbar-mobile .dropdown > .dropdown-active {
display: block;
}
/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
#hero {
width: 100%;
height: 100vh;
background-color: rgba(60, 60, 60, 0.8);
overflow: hidden;
position: relative;
}
#hero .carousel, #hero .carousel-inner, #hero .carousel-item, #hero .carousel-
item::before {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
#hero .carousel-item {
background-size: cover;
background-position: center;
background-repeat: no-repeat;
display: flex;
justify-content: center;
align-items: flex-end;
}
#hero .container {
text-align: center;
background: rgba(255, 255, 255, 0.9);
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 50px;
border-top: 4px solid #3fbbc0;
}
@media (max-width: 1200px) {
#hero .container {
83
margin-left: 50px;
margin-right: 50px;
}
}
#hero h2 {
color: #2f2f2f;
margin-bottom: 20px;
font-size: 36px;
font-weight: 700;
}
#hero p {
margin: 0 auto 30px auto;
color: #555555;
}
#hero .carousel-inner .carousel-item {
transition-property: opacity;
background-position: center top;
}
#hero .carousel-inner .carousel-item,
#hero .carousel-inner .active.carousel-item-start,
#hero .carousel-inner .active.carousel-item-end {
opacity: 0;
}
#hero .carousel-inner .active,
#hero .carousel-inner .carousel-item-next.carousel-item-start,
#hero .carousel-inner .carousel-item-prev.carousel-item-end {
opacity: 1;
transition: 0.5s;
}
#hero .carousel-inner .carousel-item-next,
#hero .carousel-inner .carousel-item-prev,
#hero .carousel-inner .active.carousel-item-start,
#hero .carousel-inner .active.carousel-item-end {
left: 0;
transform: translate3d(0, 0, 0);
}
#hero .carousel-control-next-icon, #hero .carousel-control-prev-icon {
background: none;
font-size: 30px;
line-height: 0;
width: auto;
height: auto;
background: rgba(63, 187, 192, 0.8);
border-radius: 50px;
transition: 0.3s;
color: rgba(255, 255, 255, 0.5);
width: 54px;
height: 54px;
84
display: flex;
align-items: center;
justify-content: center;
}
#hero .carousel-control-next-icon:hover, #hero .carousel-control-prev-
icon:hover {
background: #3fbbc0;
color: rgba(255, 255, 255, 0.8);
}
#hero .carousel-indicators li {
cursor: pointer;
background: #fff;
overflow: hidden;
border: 0;
width: 12px;
height: 12px;
border-radius: 50px;
opacity: 0.6;
transition: 0.3s;
}
#hero .carousel-indicators li.active {
opacity: 1;
background: #3fbbc0;
}
#hero .btn-get-started {
font-family: "Roboto", sans-serif;
font-weight: 500;
font-size: 14px;
letter-spacing: 1px;
display: inline-block;
padding: 14px 32px;
border-radius: 4px;
transition: 0.5s;
line-height: 1;
color: #fff;
background: #3fbbc0;
}
#hero .btn-get-started:hover {
background: #65c9cd;
}
@media (max-width: 992px) {
#hero {
height: 100vh;
}
#hero .container {
margin-top: 100px;
}
}
85
/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
padding: 60px 0;
overflow: hidden;
}
.section-bg {
background-color: #f7fcfc;
}
.section-title {
text-align: center;
padding-bottom: 30px;
}
.section-title h2 {
font-size: 32px;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 20px;
padding-bottom: 20px;
position: relative;
}
.section-title h2::after {
content: "";
position: absolute;
display: block;
width: 50px;
height: 3px;
background: #3fbbc0;
bottom: 0;
86
/*--------------------------------------------------------------
# Breadcrumbs
--------------------------------------------------------------*/
.breadcrumbs {
padding: 20px 0;
background-color: #ecf8f9;
min-height: 40px;
margin-top: 120px;
}
@media (max-width: 992px) {
.breadcrumbs {
margin-top: 70px;
}
}
.breadcrumbs h2 {
font-size: 24px;
font-weight: 300;
margin: 0;
}
@media (max-width: 992px) {
.breadcrumbs h2 {
margin: 0 0 10px 0;
}
}
.breadcrumbs ol {
display: flex;
flex-wrap: wrap;
list-style: none;
padding: 0;
margin: 0;
font-size: 14px;
}
.breadcrumbs ol li + li {
padding-left: 10px;
}
.breadcrumbs ol li + li::before {
display: inline-block;
padding-right: 10px;
color: #6c757d;
content: "/";
}
@media (max-width: 768px) {
87
.breadcrumbs .d-flex {
display: block !important;
}
.breadcrumbs ol {
display: block;
}
.breadcrumbs ol li {
display: inline-block;
}
}
/*--------------------------------------------------------------
# Featured Services
--------------------------------------------------------------*/
.featured-services .icon-box {
padding: 30px;
position: relative;
overflow: hidden;
background: #fff;
box-shadow: 0 0 29px 0 rgba(68, 88, 144, 0.12);
transition: all 0.3s ease-in-out;
border-radius: 8px;
z-index: 1;
}
.featured-services .icon-box::before {
content: "";
position: absolute;
background: #d9f1f2;
right: 0;
left: 0;
bottom: 0;
top: 100%;
transition: all 0.3s;
z-index: -1;
}
.featured-services .icon-box:hover::before {
background: #3fbbc0;
top: 0;
border-radius: 0px;
}
.featured-services .icon {
margin-bottom: 15px;
}
.featured-services .icon i {
font-size: 48px;
line-height: 1;
color: #3fbbc0;
transition: all 0.3s ease-in-out;
88
}
.featured-services .title {
font-weight: 700;
margin-bottom: 15px;
font-size: 18px;
}
.featured-services .title a {
color: #111;
}
.featured-services .description {
font-size: 15px;
line-height: 28px;
margin-bottom: 0;
}
.featured-services .icon-box:hover .title a, .featured-services .icon-
box:hover .description {
color: #fff;
}
.featured-services .icon-box:hover .icon i {
color: #fff;
}
/*--------------------------------------------------------------
# Cta
--------------------------------------------------------------*/
.cta {
background: #3fbbc0;
color: #fff;
background-size: cover;
padding: 60px 0;
}
.cta h3 {
font-size: 28px;
font-weight: 700;
}
.cta .cta-btn {
font-family: "Roboto", sans-serif;
font-weight: 500;
font-size: 16px;
letter-spacing: 1px;
display: inline-block;
padding: 10px 35px;
border-radius: 25px;
transition: 0.5s;
margin-top: 10px;
border: 2px solid #fff;
color: #fff;
}
89
.cta .cta-btn:hover {
background: #fff;
color: #3fbbc0;
}
/*--------------------------------------------------------------
# About Us
--------------------------------------------------------------*/
.about .content h3 {
font-weight: 600;
font-size: 26px;
}
.about .content ul {
list-style: none;
padding: 0;
}
.about .content ul li {
padding-bottom: 10px;
}
.about .content ul i {
font-size: 20px;
padding-right: 4px;
color: #3fbbc0;
}
.about .content p:last-child {
margin-bottom: 0;
}
/*--------------------------------------------------------------
# Counts
--------------------------------------------------------------*/
.counts {
padding-bottom: 30px;
}
.counts .count-box {
box-shadow: -10px -5px 40px 0 rgba(0, 0, 0, 0.1);
padding: 30px;
width: 100%;
}
.counts .count-box i {
display: block;
font-size: 30px;
color: #3fbbc0;
float: left;
}
.counts .count-box span {
font-size: 42px;
line-height: 24px;
90
display: block;
font-weight: 700;
color: #555555;
margin-left: 50px;
}
.counts .count-box p {
padding: 30px 0 0 0;
margin: 0;
font-family: "Roboto", sans-serif;
font-size: 14px;
}
.counts .count-box a {
font-weight: 600;
display: block;
margin-top: 20px;
color: #7b7b7b;
font-size: 15px;
font-family: "Poppins", sans-serif;
transition: ease-in-out 0.3s;
}
.counts .count-box a:hover {
color: #3fbbc0;
}
/*--------------------------------------------------------------
# Features
--------------------------------------------------------------*/
.features .icon-box h4 {
font-size: 20px;
font-weight: 700;
margin: 5px 0 10px 60px;
}
.features .icon-box i {
font-size: 48px;
float: left;
color: #3fbbc0;
}
.features .icon-box p {
font-size: 15px;
color: #848484;
margin-left: 60px;
}
.features .image {
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
min-height: 400px;
}
91
/*--------------------------------------------------------------
# Services
--------------------------------------------------------------*/
.services .icon-box {
margin-bottom: 20px;
text-align: center;
}
.services .icon {
display: inline-flex;
justify-content: center;
align-items: center;
width: 80px;
height: 80px;
margin-bottom: 20px;
background: #fff;
border-radius: 50%;
transition: 0.5s;
color: #3fbbc0;
overflow: hidden;
box-shadow: 0px 0 25px rgba(0, 0, 0, 0.15);
}
.services .icon i {
font-size: 36px;
line-height: 0;
}
.services .icon-box:hover .icon {
box-shadow: 0px 0 25px rgba(63, 187, 192, 0.3);
}
.services .title {
font-weight: 600;
margin-bottom: 15px;
font-size: 18px;
position: relative;
padding-bottom: 15px;
}
.services .title a {
color: #444444;
transition: 0.3s;
}
.services .title a:hover {
color: #3fbbc0;
}
.services .title::after {
content: "";
position: absolute;
display: block;
width: 50px;
92
height: 2px;
background: #3fbbc0;
bottom: 0;
left: calc(50% - 25px);
}
.services .description {
line-height: 24px;
font-size: 14px;
}
/*--------------------------------------------------------------
# Appointments
--------------------------------------------------------------*/
.appointment .php-email-form {
width: 100%;
}
.appointment .php-email-form .form-group {
padding-bottom: 8px;
}
.appointment .php-email-form .validate {
display: none;
color: red;
margin: 0 0 15px 0;
font-weight: 400;
font-size: 13px;
}
.appointment .php-email-form .error-message {
display: none;
color: #fff;
background: #ed3c0d;
text-align: left;
padding: 15px;
font-weight: 600;
}
.appointment .php-email-form .error-message br + br {
margin-top: 25px;
}
.appointment .php-email-form .sent-message {
display: none;
color: #fff;
background: #18d26e;
text-align: center;
padding: 15px;
font-weight: 600;
}
.appointment .php-email-form .loading {
display: none;
background: #fff;
93
text-align: center;
padding: 15px;
}
.appointment .php-email-form .loading:before {
content: "";
display: inline-block;
border-radius: 50%;
width: 24px;
height: 24px;
margin: 0 10px -6px 0;
border: 3px solid #18d26e;
border-top-color: #eee;
-webkit-animation: animate-loading 1s linear infinite;
animation: animate-loading 1s linear infinite;
}
.appointment .php-email-form input, .appointment .php-email-form textarea,
.appointment .php-email-form select {
border-radius: 0;
box-shadow: none;
font-size: 14px;
padding: 10px !important;
}
.appointment .php-email-form input:focus, .appointment .php-email-form
textarea:focus, .appointment .php-email-form select:focus {
border-color: #3fbbc0;
}
.appointment .php-email-form input, .appointment .php-email-form select {
height: 44px;
}
.appointment .php-email-form textarea {
padding: 10px 12px;
}
.appointment .php-email-form button[type=submit] {
background: #3fbbc0;
border: 0;
padding: 10px 35px;
color: #fff;
transition: 0.4s;
border-radius: 50px;
}
.appointment .php-email-form button[type=submit]:hover {
background: #52c2c6;
}
/*--------------------------------------------------------------
# Departments
--------------------------------------------------------------*/
.departments .nav-tabs {
94
border: 0;
}
.departments .nav-link {
border: 0;
padding: 20px;
color: #555555;
border-radius: 0;
border-left: 5px solid #fff;
cursor: pointer;
}
.departments .nav-link h4 {
font-size: 18px;
font-weight: 600;
transition: 0.3s;
}
.departments .nav-link p {
font-size: 14px;
margin-bottom: 0;
}
.departments .nav-link:hover h4 {
color: #3fbbc0;
}
.departments .nav-link.active {
background: #f7fcfc;
border-color: #3fbbc0;
}
.departments .nav-link.active h4 {
color: #3fbbc0;
}
.departments .tab-pane.active {
-webkit-animation: slide-down 0.5s ease-out;
animation: slide-down 0.5s ease-out;
}
.departments .tab-pane img {
float: left;
max-width: 300px;
padding: 0 15px 15px 0;
}
@media (max-width: 768px) {
.departments .tab-pane img {
float: none;
padding: 0 0 15px 0;
max-width: 100%;
}
}
.departments .tab-pane h3 {
font-size: 26px;
font-weight: 600;
95
margin-bottom: 20px;
color: #3fbbc0;
}
.departments .tab-pane p {
color: #777777;
}
.departments .tab-pane p:last-child {
margin-bottom: 0;
}
@-webkit-keyframes slide-down {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes slide-down {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/*--------------------------------------------------------------
# Testimonials
--------------------------------------------------------------*/
.testimonials .testimonials-carousel, .testimonials .testimonials-slider {
overflow: hidden;
}
.testimonials .testimonial-item {
box-sizing: content-box;
min-height: 320px;
}
.testimonials .testimonial-item .testimonial-img {
width: 90px;
border-radius: 50%;
margin: -40px 0 0 40px;
position: relative;
z-index: 2;
border: 6px solid #fff;
}
.testimonials .testimonial-item h3 {
font-size: 18px;
font-weight: bold;
margin: 10px 0 5px 45px;
96
color: #111;
}
.testimonials .testimonial-item h4 {
font-size: 14px;
color: #999;
margin: 0 0 0 45px;
}
.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-
item .quote-icon-right {
color: #b2e4e6;
font-size: 26px;
}
.testimonials .testimonial-item .quote-icon-left {
display: inline-block;
left: -5px;
position: relative;
}
.testimonials .testimonial-item .quote-icon-right {
display: inline-block;
right: -5px;
position: relative;
top: 10px;
}
.testimonials .testimonial-item p {
font-style: italic;
margin: 0 15px 0 15px;
padding: 20px 20px 60px 20px;
background: #f0fafa;
position: relative;
border-radius: 6px;
position: relative;
z-index: 1;
}
.testimonials .swiper-pagination {
margin-top: 20px;
position: relative;
}
.testimonials .swiper-pagination .swiper-pagination-bullet {
width: 12px;
height: 12px;
background-color: #fff;
opacity: 1;
border: 1px solid #3fbbc0;
}
.testimonials .swiper-pagination .swiper-pagination-bullet-active {
background-color: #3fbbc0;
}
97
/*--------------------------------------------------------------
# Doctors
--------------------------------------------------------------*/
.doctors .member {
margin-bottom: 20px;
overflow: hidden;
text-align: center;
border-radius: 4px;
background: #fff;
box-shadow: 0px 2px 15px rgba(63, 187, 192, 0.1);
}
.doctors .member .member-img {
position: relative;
overflow: hidden;
}
.doctors .member .social {
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 40px;
opacity: 0;
transition: ease-in-out 0.3s;
background: rgba(255, 255, 255, 0.85);
display: flex;
align-items: center;
justify-content: center;
}
.doctors .member .social a {
transition: color 0.3s;
color: #555555;
margin: 0 10px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.doctors .member .social a i {
line-height: 0;
}
.doctors .member .social a:hover {
color: #3fbbc0;
}
.doctors .member .social i {
font-size: 18px;
margin: 0 2px;
}
.doctors .member .member-info {
padding: 25px 15px;
98
}
.doctors .member .member-info h4 {
font-weight: 700;
margin-bottom: 5px;
font-size: 18px;
color: #555555;
}
.doctors .member .member-info span {
display: block;
font-size: 13px;
font-weight: 400;
color: #aaaaaa;
}
.doctors .member .member-info p {
font-style: italic;
font-size: 14px;
line-height: 26px;
color: #777777;
}
.doctors .member:hover .social {
opacity: 1;
}
/*--------------------------------------------------------------
# Gallery
--------------------------------------------------------------*/
.gallery {
overflow: hidden;
}
.gallery .swiper-pagination {
margin-top: 20px;
position: relative;
}
.gallery .swiper-pagination .swiper-pagination-bullet {
width: 12px;
height: 12px;
background-color: #fff;
opacity: 1;
border: 1px solid #3fbbc0;
}
.gallery .swiper-pagination .swiper-pagination-bullet-active {
background-color: #3fbbc0;
}
.gallery .swiper-slide-active {
text-align: center;
}
@media (min-width: 992px) {
.gallery .swiper-wrapper {
99
padding: 40px 0;
}
.gallery .swiper-slide-active {
border: 6px solid #3fbbc0;
padding: 4px;
background: #fff;
z-index: 1;
transform: scale(1.2);
margin-top: 10px;
}
}
/*--------------------------------------------------------------
# Pricing
--------------------------------------------------------------*/
.pricing .box {
padding: 20px;
background: #fff;
text-align: center;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.12);
border-radius: 4px;
position: relative;
overflow: hidden;
}
.pricing h3 {
font-weight: 400;
margin: -20px -20px 20px -20px;
padding: 20px 15px;
font-size: 16px;
font-weight: 600;
color: #777777;
background: #f8f8f8;
}
.pricing h4 {
font-size: 36px;
color: #3fbbc0;
font-weight: 600;
font-family: "Poppins", sans-serif;
margin-bottom: 20px;
}
.pricing h4 sup {
font-size: 20px;
top: -15px;
left: -3px;
}
.pricing h4 span {
color: #bababa;
font-size: 16px;
100
font-weight: 300;
}
.pricing ul {
padding: 0;
list-style: none;
color: #444444;
text-align: center;
line-height: 20px;
font-size: 14px;
}
.pricing ul li {
padding-bottom: 16px;
}
.pricing ul i {
color: #3fbbc0;
font-size: 18px;
padding-right: 4px;
}
.pricing ul .na {
color: #ccc;
text-decoration: line-through;
}
.pricing .btn-wrap {
margin: 20px -20px -20px -20px;
padding: 20px 15px;
background: #f8f8f8;
text-align: center;
}
.pricing .btn-buy {
background: #3fbbc0;
display: inline-block;
padding: 8px 35px 10px 35px;
border-radius: 4px;
color: #fff;
transition: none;
font-size: 14px;
font-weight: 400;
font-family: "Roboto", sans-serif;
font-weight: 600;
transition: 0.3s;
}
.pricing .btn-buy:hover {
background: #65c9cd;
}
.pricing .featured h3 {
color: #fff;
background: #3fbbc0;
}
101
.pricing .advanced {
width: 200px;
position: absolute;
top: 18px;
right: -68px;
transform: rotate(45deg);
z-index: 1;
font-size: 14px;
padding: 1px 0 3px 0;
background: #3fbbc0;
color: #fff;
}
/*--------------------------------------------------------------
# Frequently Asked Questioins
--------------------------------------------------------------*/
.faq {
padding: 60px 0;
}
.faq .faq-list {
padding: 0;
list-style: none;
}
.faq .faq-list li {
border-bottom: 1px solid #d9f1f2;
margin-bottom: 20px;
padding-bottom: 20px;
}
.faq .faq-list .question {
display: block;
position: relative;
font-family: #3fbbc0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
padding-left: 25px;
cursor: pointer;
color: #32969a;
transition: 0.3s;
}
.faq .faq-list i {
font-size: 16px;
position: absolute;
left: 0;
top: -2px;
}
.faq .faq-list p {
margin-bottom: 0;
102
/*--------------------------------------------------------------
# Contact
--------------------------------------------------------------*/
.contact .info-box {
color: #444444;
text-align: center;
box-shadow: 0 0 20px rgba(214, 215, 216, 0.5);
padding: 20px 0 30px 0;
}
.contact .info-box i {
font-size: 32px;
color: #3fbbc0;
border-radius: 50%;
padding: 8px;
border: 2px dotted #c5ebec;
}
.contact .info-box h3 {
font-size: 20px;
color: #777777;
font-weight: 700;
margin: 10px 0;
}
.contact .info-box p {
padding: 0;
line-height: 24px;
font-size: 14px;
margin-bottom: 0;
}
103
.contact .php-email-form {
box-shadow: 0 0 20px rgba(214, 215, 216, 0.5);
padding: 30px;
}
.contact .php-email-form .error-message {
display: none;
color: #fff;
background: #ed3c0d;
text-align: left;
padding: 15px;
font-weight: 600;
}
.contact .php-email-form .error-message br + br {
margin-top: 25px;
}
.contact .php-email-form .sent-message {
display: none;
color: #fff;
background: #18d26e;
text-align: center;
padding: 15px;
font-weight: 600;
}
.contact .php-email-form .loading {
display: none;
background: #fff;
text-align: center;
padding: 15px;
}
.contact .php-email-form .loading:before {
content: "";
display: inline-block;
border-radius: 50%;
width: 24px;
height: 24px;
margin: 0 10px -6px 0;
border: 3px solid #18d26e;
border-top-color: #eee;
-webkit-animation: animate-loading 1s linear infinite;
animation: animate-loading 1s linear infinite;
}
.contact .php-email-form input, .contact .php-email-form textarea {
border-radius: 4px;
box-shadow: none;
font-size: 14px;
}
.contact .php-email-form input:focus, .contact .php-email-form textarea:focus
{
104
border-color: #3fbbc0;
}
.contact .php-email-form input {
padding: 10px 15px;
}
.contact .php-email-form textarea {
padding: 12px 15px;
}
.contact .php-email-form button[type=submit] {
background: #3fbbc0;
border: 0;
padding: 10px 30px;
color: #fff;
transition: 0.4s;
border-radius: 4px;
}
.contact .php-email-form button[type=submit]:hover {
background: #65c9cd;
}
@-webkit-keyframes animate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes animate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
#footer {
background: #eeeeee;
padding: 0 0 30px 0;
color: #555555;
font-size: 14px;
}
#footer .footer-top {
background: #f6f6f6;
padding: 60px 0 30px 0;
105
}
#footer .footer-top .footer-info {
margin-bottom: 30px;
}
#footer .footer-top .footer-info h3 {
font-size: 24px;
margin: 0 0 20px 0;
padding: 2px 0 2px 0;
line-height: 1;
font-weight: 700;
}
#footer .footer-top .footer-info p {
font-size: 14px;
line-height: 24px;
margin-bottom: 0;
font-family: "Roboto", sans-serif;
}
#footer .footer-top .social-links a {
font-size: 18px;
display: inline-block;
background: #3fbbc0;
color: #fff;
line-height: 1;
padding: 8px 0;
margin-right: 4px;
border-radius: 4px;
text-align: center;
width: 36px;
height: 36px;
transition: 0.3s;
}
#footer .footer-top .social-links a:hover {
background: #65c9cd;
text-decoration: none;
}
#footer .footer-top h4 {
font-size: 16px;
font-weight: 600;
position: relative;
padding-bottom: 12px;
}
#footer .footer-top .footer-links {
margin-bottom: 30px;
}
#footer .footer-top .footer-links ul {
list-style: none;
padding: 0;
margin: 0;
106
}
#footer .footer-top .footer-links ul i {
padding-right: 2px;
color: #3fbbc0;
font-size: 18px;
line-height: 1;
}
#footer .footer-top .footer-links ul li {
padding: 10px 0;
display: flex;
align-items: center;
}
#footer .footer-top .footer-links ul li:first-child {
padding-top: 0;
}
#footer .footer-top .footer-links ul a {
color: #555555;
transition: 0.3s;
display: inline-block;
line-height: 1;
}
#footer .footer-top .footer-links ul a:hover {
color: #3fbbc0;
}
#footer .footer-top .footer-newsletter form {
margin-top: 30px;
background: #fff;
padding: 6px 10px;
position: relative;
border: 1px solid #d5d5d5;
border-radius: 4px;
}
#footer .footer-top .footer-newsletter form input[type=email] {
border: 0;
padding: 4px;
width: calc(100% - 110px);
}
#footer .footer-top .footer-newsletter form input[type=submit] {
position: absolute;
top: -1px;
right: -1px;
bottom: -1px;
border: 0;
background: none;
font-size: 16px;
padding: 0 20px;
background: #3fbbc0;
color: #fff;
107
transition: 0.3s;
border-radius: 0 4px 4px 0;
}
#footer .footer-top .footer-newsletter form input[type=submit]:hover {
background: #65c9cd;
}
#footer .copyright {
text-align: center;
padding-top: 30px;
}
#footer .credits {
padding-top: 10px;
text-align: center;
font-size: 13px;
}
# mydatabase connection
local_server=True
app=Flask(__name__)
app.secret_key="aneesrehmankhan"
with open('config.json','r') as c:
params=json.load(c)["params"]
app.config.update(
108
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT='465',
MAIL_USE_SSL=True,
MAIL_USERNAME='gmail account',
MAIL_PASSWORD='gmail account password'
)
mail = Mail(app)
#
app.config['SQLALCHEMY_DATABASE_URI']='mysql://username:password@localhost/
databsename'
app.config['SQLALCHEMY_DATABASE_URI']='mysql://root:@localhost/covid'
db=SQLAlchemy(app)
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id)) or
Hospitaluser.query.get(int(user_id))
class Test(db.Model):
id=db.Column(db.Integer,primary_key=True)
name=db.Column(db.String(50))
class User(UserMixin,db.Model):
id=db.Column(db.Integer,primary_key=True)
srfid=db.Column(db.String(20),unique=True)
email=db.Column(db.String(50))
dob=db.Column(db.String(1000))
class Hospitaluser(UserMixin,db.Model):
id=db.Column(db.Integer,primary_key=True)
hcode=db.Column(db.String(20))
email=db.Column(db.String(50))
password=db.Column(db.String(1000))
class Hospitaldata(db.Model):
id=db.Column(db.Integer,primary_key=True)
109
hcode=db.Column(db.String(20),unique=True)
hname=db.Column(db.String(100))
normalbed=db.Column(db.Integer)
hicubed=db.Column(db.Integer)
icubed=db.Column(db.Integer)
vbed=db.Column(db.Integer)
class Trig(db.Model):
id=db.Column(db.Integer,primary_key=True)
hcode=db.Column(db.String(20))
normalbed=db.Column(db.Integer)
hicubed=db.Column(db.Integer)
icubed=db.Column(db.Integer)
vbed=db.Column(db.Integer)
querys=db.Column(db.String(50))
date=db.Column(db.String(50))
class Bookingpatient(db.Model):
id=db.Column(db.Integer,primary_key=True)
srfid=db.Column(db.String(20),unique=True)
bedtype=db.Column(db.String(100))
hcode=db.Column(db.String(20))
spo2=db.Column(db.Integer)
pname=db.Column(db.String(100))
pphone=db.Column(db.String(100))
paddress=db.Column(db.String(100))
@app.route("/")
def home():
return render_template("index.html")
@app.route("/trigers")
def trigers():
query=Trig.query.all()
return render_template("trigers.html",query=query)
@app.route('/signup',methods=['POST','GET'])
def signup():
if request.method=="POST":
srfid=request.form.get('srf')
email=request.form.get('email')
dob=request.form.get('dob')
# print(srfid,email,dob)
#encpassword=generate_password_hash(dob)
user=User.query.filter_by(srfid=srfid).first()
emailUser=User.query.filter_by(email=email).first()
110
if user or emailUser:
flash("Email or srif is already taken","warning")
return render_template("usersignup.html")
# new_user=db.engine.execute(f"INSERT INTO `user`
(`srfid`,`email`,`dob`) VALUES ('{srfid}','{email}','{dob}') ")
new_user=User(srfid=srfid,email=email,dob=dob)
db.session.add(new_user)
db.session.commit()
return render_template("usersignup.html")
@app.route('/login',methods=['POST','GET'])
def login():
if request.method=="POST":
srfid=request.form.get('srf')
dob=request.form.get('dob')
user=User.query.filter_by(srfid=srfid).first()
if user and user.dob==dob:
login_user(user)
flash("Login Success","info")
return render_template("index.html")
else:
flash("Invalid Credentials","danger")
return render_template("userlogin.html")
return render_template("userlogin.html")
@app.route('/hospitallogin',methods=['POST','GET'])
def hospitallogin():
if request.method=="POST":
email=request.form.get('email')
password=request.form.get('password')
user=Hospitaluser.query.filter_by(email=email).first()
#if user and check_password_hash(user.password,password):
if user and user.password==password:
login_user(user)
flash("Login Success","info")
return render_template("index.html")
else:
flash("Invalid Credentials","danger")
return render_template("hospitallogin.html")
return render_template("hospitallogin.html")
111
@app.route('/admin',methods=['POST','GET'])
def admin():
if request.method=="POST":
username=request.form.get('username')
password=request.form.get('password')
if(username=="admin" and password=="admin"):
session['user']=username
flash("login success","info")
return render_template("addHosUser.html")
else:
flash("Invalid Credentials","danger")
return render_template("admin.html")
@app.route('/logout')
@login_required
def logout():
logout_user()
flash("Logout SuccessFul","warning")
return redirect(url_for('login'))
@app.route('/addHospitalUser',methods=['POST','GET'])
def hospitalUser():
if request.method=="POST":
hcode=request.form.get('hcode')
email=request.form.get('email')
password=request.form.get('password')
#encpassword=generate_password_hash(password)
hcode=hcode.upper()
emailUser=Hospitaluser.query.filter_by(email=email).first()
if emailUser:
flash("Email or srif is already taken","warning")
else:
flash("Login and try Again","warning")
return render_template("addHosUser.html")
@app.route("/logoutadmin")
def logoutadmin():
session.pop('user')
flash("You are logout admin", "primary")
return redirect('/admin')
def updatess(code):
postsdata=Hospitaldata.query.filter_by(hcode=code).first()
return render_template("hospitaldata.html",postsdata=postsdata)
@app.route("/addhospitalinfo",methods=['POST','GET'])
def addhospitalinfo():
email=current_user.email
posts=Hospitaluser.query.filter_by(email=email).first()
code=posts.hcode
postsdata=Hospitaldata.query.filter_by(hcode=code).first()
if request.method=="POST":
hcode=request.form.get('hcode')
hname=request.form.get('hname')
nbed=request.form.get('normalbed')
113
hbed=request.form.get('hicubeds')
ibed=request.form.get('icubeds')
vbed=request.form.get('ventbeds')
hcode=hcode.upper()
huser=Hospitaluser.query.filter_by(hcode=hcode).first()
hduser=Hospitaldata.query.filter_by(hcode=hcode).first()
if hduser:
flash("Data is already Present you can update it..","primary")
return render_template("hospitaldata.html")
if huser:
# db.engine.execute(f"INSERT INTO `hospitaldata`
(`hcode`,`hname`,`normalbed`,`hicubed`,`icubed`,`vbed`) VALUES
('{hcode}','{hname}','{nbed}','{hbed}','{ibed}','{vbed}')")
query=Hospitaldata(hcode=hcode,hname=hname,normalbed=nbed,hicubed=hbed,icu
bed=ibed,vbed=vbed)
db.session.add(query)
db.session.commit()
flash("Data Is Added","primary")
return redirect('/addhospitalinfo')
else:
flash("Hospital Code not Exist","warning")
return redirect('/addhospitalinfo')
return render_template("hospitaldata.html",postsdata=postsdata)
@app.route("/hedit/<string:id>",methods=['POST','GET'])
@login_required
def hedit(id):
posts=Hospitaldata.query.filter_by(id=id).first()
if request.method=="POST":
hcode=request.form.get('hcode')
hname=request.form.get('hname')
nbed=request.form.get('normalbed')
hbed=request.form.get('hicubeds')
ibed=request.form.get('icubeds')
vbed=request.form.get('ventbeds')
hcode=hcode.upper()
# db.engine.execute(f"UPDATE `hospitaldata` SET `hcode`
='{hcode}',`hname`='{hname}',`normalbed`='{nbed}',`hicubed`='{hbed}',`icube
d`='{ibed}',`vbed`='{vbed}' WHERE `hospitaldata`.`id`={id}")
post=Hospitaldata.query.filter_by(id=id).first()
114
post.hcode=hcode
post.hname=hname
post.normalbed=nbed
post.hicubed=hbed
post.icubed=ibed
post.vbed=vbed
db.session.commit()
flash("Slot Updated","info")
return redirect("/addhospitalinfo")
# posts=Hospitaldata.query.filter_by(id=id).first()
return render_template("hedit.html",posts=posts)
@app.route("/hdelete/<string:id>",methods=['POST','GET'])
@login_required
def hdelete(id):
# db.engine.execute(f"DELETE FROM `hospitaldata` WHERE
`hospitaldata`.`id`={id}")
post=Hospitaldata.query.filter_by(id=id).first()
db.session.delete(post)
db.session.commit()
flash("Date Deleted","danger")
return redirect("/addhospitalinfo")
@app.route("/pdetails",methods=['GET'])
@login_required
def pdetails():
code=current_user.srfid
print(code)
data=Bookingpatient.query.filter_by(srfid=code).first()
return render_template("detials.html",data=data)
@app.route("/slotbooking",methods=['POST','GET'])
@login_required
def slotbooking():
# query1=db.engine.execute(f"SELECT * FROM `hospitaldata` ")
# query=db.engine.execute(f"SELECT * FROM `hospitaldata` ")
query1=Hospitaldata.query.all()
query=Hospitaldata.query.all()
if request.method=="POST":
srfid=request.form.get('srfid')
bedtype=request.form.get('bedtype')
hcode=request.form.get('hcode')
spo2=request.form.get('spo2')
pname=request.form.get('pname')
115
pphone=request.form.get('pphone')
paddress=request.form.get('paddress')
check2=Hospitaldata.query.filter_by(hcode=hcode).first()
checkpatient=Bookingpatient.query.filter_by(srfid=srfid).first()
if checkpatient:
flash("already srd id is registered ","warning")
return
render_template("booking.html",query=query,query1=query1)
if not check2:
flash("Hospital Code not exist","warning")
return
render_template("booking.html",query=query,query1=query1)
code=hcode
# dbb=db.engine.execute(f"SELECT * FROM `hospitaldata` WHERE
`hospitaldata`.`hcode`='{code}' ")
dbb=Hospitaldata.query.filter_by(hcode=hcode).first()
bedtype=bedtype
if bedtype=="NormalBed":
for d in dbb:
seat=d.normalbed
print(seat)
ar=Hospitaldata.query.filter_by(hcode=code).first()
ar.normalbed=seat-1
db.session.commit()
elif bedtype=="HICUBed":
for d in dbb:
seat=d.hicubed
print(seat)
ar=Hospitaldata.query.filter_by(hcode=code).first()
ar.hicubed=seat-1
db.session.commit()
elif bedtype=="ICUBed":
for d in dbb:
seat=d.icubed
print(seat)
ar=Hospitaldata.query.filter_by(hcode=code).first()
ar.icubed=seat-1
db.session.commit()
elif bedtype=="VENTILATORBed":
for d in dbb:
seat=d.vbed
ar=Hospitaldata.query.filter_by(hcode=code).first()
116
ar.vbed=seat-1
db.session.commit()
else:
pass
check=Hospitaldata.query.filter_by(hcode=hcode).first()
if check!=None:
if(seat>0 and check):
res=Bookingpatient(srfid=srfid,bedtype=bedtype,hcode=hcode,spo2=spo2,pname
=pname,pphone=pphone,paddress=paddress)
db.session.add(res)
db.session.commit()
flash("Slot is Booked kindly Visit Hospital for Further
Procedure","success")
return
render_template("booking.html",query=query,query1=query1)
else:
flash("Something Went Wrong","danger")
return
render_template("booking.html",query=query,query1=query1)
else:
flash("Give the proper hospital Code","info")
return
render_template("booking.html",query=query,query1=query1)
return render_template("booking.html",query=query,query1=query1)
app.run(debug=True)