0% found this document useful (0 votes)
105 views64 pages

Web Technologies Miniproject

The document outlines a project report for a Hospital Management System designed to enhance interactions between doctors and patients by automating administrative tasks and improving operational efficiency. It addresses challenges in traditional healthcare management, such as patient record handling and appointment scheduling, while promoting a digital and eco-friendly approach. The system aims to provide a centralized platform for secure access to medical records and facilitate better communication, ultimately improving the quality of care delivered to patients.

Uploaded by

anuarg chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views64 pages

Web Technologies Miniproject

The document outlines a project report for a Hospital Management System designed to enhance interactions between doctors and patients by automating administrative tasks and improving operational efficiency. It addresses challenges in traditional healthcare management, such as patient record handling and appointment scheduling, while promoting a digital and eco-friendly approach. The system aims to provide a centralized platform for secure access to medical records and facilitate better communication, ultimately improving the quality of care delivered to patients.

Uploaded by

anuarg chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

“HOSPITAL MANAGEMENT SYSTEM FOR

DOCTOR AND PATIENT”


A Report submitted under Project-Based Learning

In Partial Fulfillment of the Course Requirements for

“Web Technologies (22IT104001)”

Submitted By
Nandimandalam Varneeth varma 22101A010108

Under the Guidance of


[Link]
Department of CSE

Department of Computer Science and Engineering


School of Computing

MOHAN BABU UNIVERSITY


Sree Sainath Nagar, Tirupati – 517 102
2024-2025
MOHAN BABU UNIVERSITY
Vision
To be a globally respected institution with an innovative and entrepreneurial culture that
offers transformative education to advance sustainability and societal good.

Mission
❖ Develop industry-focused professionals with a global perspective.
❖ Offer academic programs that provide transformative learning experience founded on
the spirit of curiosity, innovation, and integrity.
❖ Create confluence of research, innovation, and ideation to bring about sustainable and
socially relevant enterprises.
❖ Uphold high standards of professional ethics leading to harmonious relationship with
environment and society.

SCHOOL OF COMPUTING

Vision
To lead the advancement of computer science research and education that has real-world
impact and to push the frontiers of innovation in the field.

Mission
❖ Instil within our students fundamental computing knowledge, a broad set of skills,
and an inquisitive attitude to create innovative solutions to serve industry and
community.
❖ Provide an experience par excellence with our state-of-the-art research, innovation,
and incubation ecosystem to realise our learners’ fullest potential.
❖ Impart continued education and research support to working professionals in the
computing domain to enhance their expertise in the cutting-edge technologies.
❖ Inculcate among the computing engineers of tomorrow with a spirit to solve societal
challenges.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Vision
To become a Centre of Excellence in Computer Science and its emerging areas by imparting
high quality education through teaching, training and research.

Mission
Imparting quality education in Computer Science and Engineering and emerging areas of
IT industry by disseminating knowledge through contemporary curriculum, competent
faculty and effective teaching-learning methodologies.
Nurture research, innovation and entrepreneurial skills among faculty and students to
contribute to the needs of industry and society.
Inculcate professional attitude, ethical and social responsibilities for prospective and
promising engineering profession.
Encourage students to engage in life-long learning by creating awareness of the
contemporary developments in Computer Science and Engineering and its emerging
areas.
[Link]. Computer Science and Engineering
PROGRAM EDUCATIONAL OBJECTIVES

After few years of graduation, the graduates of [Link]. CSE will be:
PEO1. Pursuing higher studies in core, specialized or allied areas of Computer Science, or
Management.
PEO2. Employed in reputed Computer and I.T organizations or Government to have a globally
competent professional career in Computer Science and Engineering domain or be
successful Entrepreneurs.
PEO3. Able to demonstrate effective communication, engage in teamwork, exhibit leadership
skills and ethical attitude, and achieve professional advancement through continuing
education.

PROGRAM OUTCOMES

On successful completion of the Program, the graduates of [Link]. CSE Program will be able to:
PO1. Engineering Knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering
problems.
PO2. Problem Analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
PO3. Design/Development of Solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
PO4. Conduct Investigations of Complex Problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis
of the information to provide valid conclusions.
PO5. Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations.
PO6. The Engineer and Society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant
to the professional engineering practice.
PO7. Environment and Sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.
PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
PO9. Individual and Team Work: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
PO10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give and
receive clear instructions.
PO11. Project Management and Finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.
PO12. Life-long Learning: Recognize the need for, and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

PROGRAM SPECIFIC OUTCOMES

On successful completion of the Program, the graduates of B. Tech. (CSE) program will be able to:
PSO1. Apply knowledge of computer science engineering, Use modern tools, techniques and
technologies for efficient design and development of computer-based systems for complex
engineering problems.
PSO2. Design and deploy networked systems using standards and principles, evaluate security
measures for complex networks, apply procedures and tools to solve networking issues.
PSO3. Develop intelligent systems by applying adaptive algorithms and methodologies for solving
problems from inter-disciplinary domains.
PSO4. Apply suitable models, tools and techniques to perform data analytics for effective decision
making.
Course Code Course Title L T P S C
22IT104001 WEB TECHNOLOGIES 3 - 2 4 5

COURSE OUTCOMES: After successful completion of this course, the students will be able to:
CO1. Demonstrate knowledge on web page design elements, dynamic content and database connection.
CO2. Analyze user requirements to develop web applications.
CO3. Design client-server applications using web technologies.
CO4. Demonstrate problem solving skills to develop enterprise web applications.
CO5. Apply HTML, CSS, JavaScript, JQuery, Bootstrap and PHP technologies for device independent web
application development.
CO6. Apply web technologies to develop interactive, dynamic and scalable web applications for societal needs.

CO-PO-PSO Mapping Table:


Program Specific
Course Program Outcomes
Outcomes
Outcomes
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3 PSO4
CO1 3 3 2 - - - - - - - - - 3 2 3 -
CO2 3 3 3 2 2 - - - - - - - 3 2 3 -
CO3 3 3 3 2 2 - - - - - - - 3 2 3 -
CO4 3 3 3 2 2 - - - - - - - 2 2 3 -
CO5 3 2 2 2 2 3 - - - - - - 2 2 3 -
CO6 2 3 3
Course
Correlatio 3 3 3 2 2 3 3 3 2 3
n Mapping

Correlation Levels: 3: High; 2: Medium; 1: Low


Department of Computer Science and Engineering

This is to certify that the Project Entitled

“ONLINE EXAMINATION AND RESULT SYSTEM”

Submitted By

Nandimandalam Varneeth Varma 22101A010108

is the work submitted under Project-Based Learning in Partial Fulfillment of the Course Requirements
for “Web Technologies (22IT104001)” during 2024-2025.

Supervisor: Head:
M. Surya Department Dr. G. Sunitha
of CSE School of Professor & Head
Computing Department of CSE
Mohan Babu University School of Computing
Tirupati. Mohan Babu University
Tirupati.
ACKNOWLEDGEMENTS

First and foremost, I extend my sincere thanks to Dr. M. Mohan Babu, Chancellor, for his
unwavering support and vision that fosters academic excellence within the institution.

My gratitude also goes to Mr. Manchu Vishnu, Pro-Chancellor, for creating an environment that
promotes creativity and for his encouragement and commitment to student success.

I am deeply appreciative of Prof. Nagaraj Ramrao, Vice Chancellor, whose leadership has created
an environment conducive to learning and innovation.

I would like to thank Dr. K. Saradhi, Registrar, for his support in creating an environment conducive
to academic success.

My sincere thanks to Dr. B.M. Satish, Dean of the School of Engineering and Computing, for his
valuable support and guidance in all academic matters.

I am also grateful to Dr. G. Sunitha, Head of the Department of Computer Science and Engineering,
for her valuable insights and support.

Finally, I would like to express my deepest appreciation to my project supervisor, [Link],


Department of Computer Science and Engineering for continuous guidance, encouragement, and
expertise throughout this project.

Thank you all for your support and encouragement.


Table of Contents

Chapter Title Page


No. No.

Abstract 1

1 Introduction 2

1.1 Problem Statement 2

1.2 Importance of the Problem 2

1.3 Objectives 2

1.4 Scope of the Project 3

2 System Design 4

2.1 Architecture Diagram 4

2.2 Module Descriptions 4

2.3 Database Design 6

3 Implementation 9

3.1 Tools and Technologies Used 9

3.2 Front-End Development 9

3.3 Back-End Development 11

3.4 Integration 12

4 Testing, Results and Discussion 14

4.1 Test Cases 14

4.2 Testing Methods 14

4.3 Output Screenshots 17

4.4 Analysis of Results 27

5 Conclusion 28

5.1 Summary of Findings 28

5.2 Future Enhancements 28

6 Appendix 29

6.1 Code Snippets 29


ABSTRACT

The Hospital Management System for Doctor and Patient is a comprehensive digital platform designed to
revolutionize traditional healthcare management by streamlining interactions between doctors and patients.
This system addresses key challenges in healthcare administration, such as managing patient records,
scheduling appointments, and ensuring secure communication, while minimizing the reliance on manual
processes. By digitizing hospital workflows, the system improves operational efficiency, reduces paperwork,
and ensures that healthcare providers can deliver quality services more effectively.

The platform caters to the diverse needs of hospitals by providing a centralized database for storing and
accessing patient medical records securely. Patients can conveniently book appointments, access prescriptions,
and communicate with healthcare professionals, thereby enhancing their overall experience. Similarly, doctors
benefit from features like automated scheduling, instant access to patient history, and prescription
management, which help them focus on delivering better care.

A standout feature of the system is its ability to generate and maintain accurate, real-time reports on patient
health metrics and appointment statuses. This ensures a high degree of transparency and reliability in the data
exchanged between patients and doctors. The system also integrates feedback mechanisms to improve service
quality, fostering a patient-centric approach.

By leveraging advanced tools and technologies, this project demonstrates how digital transformation can
modernize healthcare, ensuring both convenience and efficiency for all stakeholders involved. The Hospital
Management System ultimately aims to bridge the gap between patients and healthcare providers, ensuring a
seamless and effective healthcare experience.

Keywords: Hospital Management, Patient Records, Appointment Scheduling, Healthcare


Digitization, Secure Communication, Real-time Reporting, Feedback Mechanism, Efficiency.
1. Introduction

1.1 Problem Statement:

The Hospital Management System for Doctor and Patient is a digital solution to overcome inefficiencies in
traditional hospital administration, where patient and doctor interactions are managed through manual
processes. Hospitals often face challenges such as maintaining large volumes of paper-based patient records,
scheduling appointments effectively, and ensuring timely communication between patients and healthcare
providers. These issues result in delays, errors, and an overall reduction in the quality of care provided.

This system aims to automate hospital workflows by integrating functionalities like patient record
management, appointment scheduling, and real-time access to medical data. The objective is to reduce the
reliance on manual tasks, minimize errors, and provide a seamless experience for both doctors and patients.
By utilizing a centralized, secure, and efficient digital platform, this project intends to transform traditional
hospital operations into a streamlined and modernized system that ensures fast and accurate service delivery.

1.2 Importance of the Problem:

The Hospital Management System for Doctor and Patient is a critical tool in modernizing healthcare
administration and improving the quality of care provided to patients. Traditional methods of hospital
management, which rely heavily on manual processes and paper-based record-keeping, often result in
inefficiencies, delays, and increased chances of errors. These challenges are exacerbated in busy hospital
environments, where the accurate and timely handling of patient data is paramount.

This system is increasingly relevant in today’s healthcare landscape due to the growing need for streamlined
operations and digital solutions. It reduces the workload on administrative staff, minimizes errors in
record-keeping, and ensures faster processing of patient information. Additionally, during situations like the
COVID-19 pandemic, digital platforms became indispensable for maintaining operations while reducing
physical contact and ensuring the safety of patients and staff.

The system also promotes sustainability by significantly reducing the reliance on paper-based documentation.
Automated features such as appointment scheduling, prescription management, and real-time updates enhance
the overall efficiency of hospital operations. This not only saves time and resources but also improves the
patient experience by providing quicker and more reliable services. Furthermore, the ability to store and
retrieve medical records electronically ensures that patients receive accurate and personalized care.

In summary, the Hospital Management System is essential for healthcare institutions looking to adopt
efficient, secure, and sustainable solutions to meet the increasing demands of modern medical services while
ensuring optimal patient care.

1.3 Objectives:

❖ To minimize the manual workload of hospital staff by automating patient record management,
appointment scheduling, and communication between patients and healthcare providers.

❖ To reduce the reliance on paper-based documentation, promoting a more sustainable and


eco-friendly healthcare system.

❖ To provide a secure and centralized system for storing, accessing, and updating patient medical
records.

❖ To enable automated appointment scheduling, ensuring that doctors' schedules are efficiently
managed and patients experience minimal waiting times.

❖ To facilitate automatic generation of prescriptions and real-time access to medical reports for
patients.

❖ To ensure faster and more accurate handling of patient data, reducing errors and enhancing service
quality.

❖ To save time for both patients and healthcare providers by streamlining processes and reducing
redundancies.

❖ To integrate features such as feedback collection for service quality improvement and personalized
care.

❖ To empower healthcare providers with tools for tracking and analyzing patient progress efficiently.
1.4 Scope of the Project:

The Hospital Management System for Doctor and Patient is a comprehensive digital platform that aims to
streamline healthcare management and improve service delivery. Its scope extends to various stakeholders,
including hospital administrators, doctors, and patients, by providing features that enhance operational
efficiency and user convenience.

● For Patients:
○ Enable secure registration and profile management.
○ Facilitate easy appointment booking with doctors based on availability.
○ Provide access to medical records, prescriptions, and test reports in real-time.
○ Ensure seamless communication with healthcare providers through integrated messaging
features.
● For Doctors:
○ Offer tools for managing patient records, medical histories, and prescriptions efficiently.
○ Provide automated appointment scheduling and reminders to optimize time management.
○ Enable secure access to patient information for better diagnosis and treatment.
● For Hospital Administrators:
○ Centralize hospital operations, including staff management and resource allocation.
○ Generate detailed reports and analytics on hospital performance and patient data.
○ Automate billing and payment processes for improved accuracy and efficiency.

Features

User Side

❖ New User Registration:


Users can create an account to access the Hospital Management System platform.

❖ Login and Authentication:


Users can log in securely using their email ID and password.

❖ Profile Management:
Users can view and update their profile details.

❖ Password Management:
Users can change their password for enhanced security.
❖ Appointment Booking:
Users can view a list of available doctors and book appointments as per their convenience.

❖ Access to Medical Records:


Users can view their medical history, prescriptions, and test reports.

❖ Prescription Management:
Patients can access prescribed medication details online.

❖ Feedback Submission:
Users can provide feedback about their experience for service improvement.

Admin Side

❖ Manage Doctors and Staff:


Admins can add, update, or remove doctors and staff profiles.

❖ Appointment Management:
Admins can view and modify appointment schedules.

❖ Patient Data Management:


Admins can access and manage patient records securely.

❖ System Configuration:
Admins can update system settings and ensure smooth operations.

❖ Reporting and Analytics:


Admins can generate and view reports on appointments, patient records, and service efficiency.

❖ User Data Access:


Admins can view and manage all user accounts.

❖ Feedback Review:
Admins can monitor user feedback to address issues and improve services.
2. System design

21. Architecture Diagram

Data Flow Diagrams (DFD)

DFD, Data flow diagrams are used to graphically represent the flow of data in a business
information system.
DFD graphically representing the functions, or processes, which capture, manipulate, store,
and distribute data between a system and its environment and between components of a
system. The visual representation makes it a good communication tool between User and
System designer. Structure of DFD allows starting from a broad overview and expands it to a
hierarchy of detailed [Link] Software engineering DFD (data flow diagram) can be
drawn to represent the system of different levels of [Link] and functional
elements. Levels in DFD are numbered 0, 1, 2 or beyond. Here, we will see mainly 3 levels in
data flow diagram, which are: 0-level DFD, 1-level DFD, and 2-level DFD.

2.2 Module Descriptions:

Levels in Data Flow Diagrams (DFD)

0- level DFD:

It is also known as context diagram. It’s designed to be an abstraction view, showing the
system as a single process with its relationship to external entities. It represents the entire
system as single bubble with input and output data indicated by incoming/outgoing arrows.
Fig : 0-level DFD
1- level DFD:

In 1-level DFD, context diagram is decomposed into multiple bubbles/processes. in this level
we highlight the main functions of the system and breakdown the high-level process of
0-level DFD into sub processes.

2- level DFD:

2-level DFD goes one step deeper into parts of 1-level DFD. It can be used to plan or record
the specific/necessary detail about the system’s functioning.

Fig : 2-leven DED

DATA FLOW DIAGRAM (DFD) FOR USER DATA


A Data Flow Diagram (DFD) for user data in a hospital management system starts with the
Patient Login process. Once logged in, users proceed to the Appointment Booking section,
where they can select a doctor and schedule an appointment. After the appointment, they can
view their medical history and prescriptions. The system then stores and updates the patient
records for future reference.
ER Diagram
Entity relationship diagram displays the relationships of entity set stored in a database. In
other words, we can say that ER diagrams help you to explain the logical structure of
databases. At first look, an ER diagram looks very similar to the flowchart. However, ER
Diagram includes many specialized symbols, and its meanings make this model unique.

Components of the ER Diagram


This model is based on three basic concepts: Entities, Attributes, Relationships.
Entities: Entities represent real-world objects or concepts, such as people, places, or things,
that are stored in a database. Each entity is depicted as a rectangle in the ER diagram, with its
name written inside.
Attributes: Attributes describe the properties or characteristics of entities. They provide
details about each entity and are represented as ovals connected to their respective entity
rectangles in the ER diagram.
Relationships: Relationships illustrate how entities are connected or associated with each
other within the database. They depict the interactions and dependencies between entities.
Relationships are represented as diamond shapes connecting the related entities, and they
typically have names that describe the nature of the association.

ENTITY RELATIONAL (ER) MODEL


Is a high-level conceptual data model diagram. ER modeling helps us to analyze data
requirements systematically to produce a well-designed database. The Entity-Relation model
represents real-world entities and the relationship between them. It is considered a best
practice to complete ER modeling before implementing one’s database.

It displays the relationships of entity set stored in a database. In other words, we can say that
ER diagrams help us to explain the logical structure of databases. At first look, an ER
diagram looks very similar to the flowchart.

The Entity-Relationship (ER) model, beyond its basic elements, facilitates hierarchical
organization, normalization principles, and representation of complex relationships. It
supports
extended notations for intricate scenarios and semantic modeling for real-world relevance.
ER diagrams are visualized through software tools, aiding in design, documentation, and
communication. Overall, the ER model provides a versatile and intuitive framework for
conceptualizing database structures, essential for effective database design and management.

ER model stands for an Entity-Relationship model. It is a high-level data model. This model
is used to define the data elements and relationship for a specified
system.
3. Implementation

3.1 Tools and Technologies Used


The main objective of the Hospital Management System is to assist healthcare institutions
in efficiently managing patient data, doctor schedules, and medical records in an automated
manner. It reduces the time consumption and workload associated with traditional hospital
management processes. The system streamlines various tasks, including appointment
scheduling, patient record management, and prescription handling.

Software Requirements

❖ Front End Tools

● HTML

● CSS

● JAVA SCRIPT

● PHP

❖ Back End Tools

● MySQL

3.2Front-End Development
The frontend design for the Hospital Management System utilizes a combination of
HTML, CSS, JavaScript, and a PHP integrated development environment to create a
robust, intuitive, and user-friendly interface.

HTML (Hypertext Markup Language):


HTML serves as the standard markup language for creating the structure and content of web
pages and applications within the Hospital Management System. It defines elements such as
headings, paragraphs, lists, links, images, forms, and other essential components necessary
for presenting exam questions, results, and navigation.

CSS (Cascading Style Sheets):


CSS plays a crucial role in styling HTML elements and defining the layout of web pages within the
Hospital Management System. It allows developers to control the appearance of various user
interfaces such as appointment scheduling, patient profiles, and medical records by specifying
properties like colors, fonts, margins, padding, and positioning. CSS ensures consistency across all
pages, providing a unified and professional design.

JavaScript:

JavaScript enables interactive and dynamic behavior on pages within the Hospital
Management System, enhancing user engagement and functionality. It facilitates features
such as form validation, real-time updates, interactive elements, and dynamic content loading.
For instance, JavaScript can be used to validate patient registration forms, handle
appointment booking in real time, and update doctor availability dynamically.

PHP (Hypertext Preprocessor):

PHP serves as the server-side scripting language used for backend processing, database
interactions, and dynamic content generation within the Hospital Management System. It
enables functionalities such as user authentication, appointment management, patient record
handling, and database management. PHP handles tasks like verifying user credentials during
login, retrieving patient data from the database, and generating dynamic content such as
medical records and prescription details.

Integration:

The integration of HTML, CSS, JavaScript, and PHP within the Hospital Management
System provides a comprehensive toolkit for frontend and backend development. HTML
defines the structure and content of the user interfaces, such as patient profiles, appointment
booking, and medical records. CSS styles the presentation and layout, ensuring a visually
appealing, consistent, and responsive design across various devices. JavaScript adds
interactivity and dynamic behavior, enabling real-time updates for appointment scheduling,
feedback submission, and interactive elements like patient data retrieval.

Benefits:
By leveraging a combination of HTML, CSS, JavaScript, and PHP, the Hospital
Management System offers a robust and versatile frontend and backend design. HTML
provides the foundational structure and content for patient registration forms, appointment
scheduling, and medical records. CSS enhances the visual presentation and layout, ensuring a
consistent and professional appearance across all pages.

3.3Back-End Development:

The back-end of the Hospital Management System will be developed and managed using
MySQL, a powerful open-source relational database management system. Here's a detailed
breakdown of MySQL's features and its role within the system:

MySQL (Relational Database Management System):

​ MySQL is utilized for the permanent storage of records within the system, ensuring data

integrity, reliability, and scalability.

​ It is the most popular open-source SQL database management system, developed,

distributed, and supported by Oracle Corporation.

​ MySQL databases are relational, storing data in separate tables organized into physical

files optimized for speed.

​ The logical model includes objects such as databases, tables, views, rows, and columns,

offering a flexible programming environment for managing relationships between


different data fields.

​ SQL (Structured Query Language) is used to interact with MySQL databases, providing a

common standardized language for accessing and manipulating data.

​ MySQL software is open-source, allowing anyone to download, use, and modify the

software without any cost.


​ MySQL Server works in client/server or embedded systems, providing a multithreaded

SQL server that supports various client programs, libraries, administrative tools, and
application programming interfaces (APIs).
Integration in the Hospital Management System
Database Integration:

1. hospital_patient_data:
This database stores patient details, including personal information, medical history,
appointments, and prescriptions.
○ Tables: Patient Information, Medical Records, Appointment History, Prescription
Data.
2. hospital_staff_data:
This database stores information about hospital staff, including doctors, nurses, and
administrative personnel.
○ Tables: Staff Profiles, Schedules, Roles, Specializations.
3. hospital_appointments:
This database manages patient appointments with doctors, allowing for easy tracking and
updates.
○ Tables: Appointment Records, Appointment Times, Doctor Availability.
4. hospital_medical_records:
This database stores the detailed medical records for patients, including diagnostic reports,
lab test results, and prescribed treatments.
○ Tables: Test Results, Diagnostic Information, Treatment History.
PHP Integration:

PHP scripts serve as the intermediary between the frontend and MySQL databases, ensuring
smooth communication between the user interface and the backend systems. Here's how PHP
integrates into the system:

1. Authentication and User Login:


PHP handles user authentication by validating credentials stored in the
hospital_patient_data or hospital_staff_data databases. Once logged in, users are
granted access to their personalized dashboards.
2. Appointment Booking and Management:
PHP scripts query the hospital_appointments database to retrieve available time slots and
schedule appointments with doctors. It also allows users to view, modify, or cancel
appointments by interacting with the backend data.
3. Medical Record Access:
PHP scripts fetch data from the hospital_medical_records database, displaying patient
medical history, test results, and prescriptions on the user interface. PHP processes this
information, generating real-time content for the user.
4. Form Handling and Data Storage:
PHP scripts process form submissions, such as patient registration or appointment requests,
by storing data into the relevant tables within the hospital_patient_data or
hospital_appointments databases. The form inputs are validated, sanitized, and securely
stored.
5. Dynamic Content Generation:
PHP dynamically generates content based on the data stored in MySQL databases. For
example, after a patient’s appointment, PHP fetches and displays the doctor’s schedule,
medical notes, and prescribed medication from the database.

JavaScript Integration:

​ JavaScript enhances the user experience by providing interactive features and dynamic

content manipulation.

​ JavaScript can make asynchronous HTTP requests (AJAX) to PHP scripts, which then
interact with MySQL databases to fetch data without reloading the entire webpage.

​ This allows for real-time updates, dynamic content loading, and seamless user

interactions, enhancing the responsiveness and usability of the system.

HTML Forms for User Input:

HTML forms are used to collect user input in various sections of the Hospital

Management System, such as patient registration, appointment booking, and

login. These forms allow users (patients, doctors, and administrative staff) to enter

details like:

● Patient name, age, medical history (for registration).

● Login credentials (email ID and password).

● Appointment preferences (doctor, time, date).

● Prescription details (for doctors).

Form Submission and PHP Handling:

When a user submits a form, the data is sent via HTTP to the PHP backend for

processing. For example:

● In the patient registration form, once the user submits the details, PHP receives the data

and processes it.

● In the appointment booking form, PHP takes the input data (doctor’s name, time, and date)

and stores it in the relevant database.


● Login forms are used to authenticate users by validating their credentials against the

hospital_patient_data or hospital_staff_data databases.

PHP Handling of Submitted Data:

PHP scripts handle the incoming form data by:

● Validating: Checking the data for correctness and security.

● Sanitizing: Ensuring that malicious code is not injected.

● Executing SQL Queries: PHP uses SQL to insert, update, or delete records in the MySQL

databases.

○ For instance, when a user registers, the script will insert their details into the

hospital_patient_data database.

○ When an appointment is booked, the data is inserted into the hospital_appointments

database.

● Once the data is processed, PHP either redirects the user to the relevant page or provides a

response (e.g., confirmation of successful registration or booking).


4. Testing, Results and Discussion

4.1 Test cases


Unit testing is a level of software testing where individual units/ components of software are
tested. The purpose is to validate that each unit of the software performs as designed. A unit
is the smallest testable part of any software. It usually has one or a few inputs and usually a
single output.

In procedural programming, a unit may be an individual program, function, procedure, etc. in


object-oriented programming, the smallest unit is a method, which may belong to a base/
super class, abstract class or derived/ child class. (Some treat a module of an application as a
unit. It is concerned with functional correctness of the standalone modules. The main aim is
to isolate each unit of the system to identify, analyze and fix the defects. A unit test is a way
of testing a unit – the smallest piece of code that can be logically isolated in a system. In most
programming languages, that is a function, a subroutine, a method or property. The isolated
part of the definition is important.

4.2 Testing Methods:

❖ Black Box Testing - Using which the user interface, input and output are tested.

❖ White Box Testing - used to test each one of those functions behaviors is tested.

❖ Gray Box Testing - Used to execute tests, risks and assessment methods.

Integration Testing

Integration Testing is a level of software testing where individual units are combined and
tested as a group. The purpose of this level of testing is to expose faults in the interaction
between integrated units. Test drivers and test stubs are used to assist in Integration Testing. It
is defined as a type of testing where software modules are integrated logically and tested as a
group. A typical software project consists of multiple software modules, coded by different
programmers. The purpose of this level of testing is to expose defects in the interaction
between
these software modules when they are Integrated Integration Testing focuses on checking
data communication amongst these modules.

Approaches, Strategies, Methodologies of Integration Testing

Software Engineering defines variety of strategies to execute Integration testing, viz.

❖ Big Bang Approach

❖ Incremental Approach: which is further divided into the following

▪ Top-Down Approach

▪ Bottom-Up Approach

▪ Sandwich Approach - Combination of Top Down and Bottom Up

System Testing
System Testing is a level of testing that validates the complete and fully integrated software
product. The purpose of a system test is to evaluate the end-to-end system specifications.
Usually, the software is only one element of a larger computer-based system. Ultimately, the
software is interfaced with other software/hardware systems. System Testing is actually a
series of different tests whose sole purpose is to exercise the full computerbased system.

System Testing is carried out on the whole system in the context of either system
requirement specifications or functional requirement specifications or in the context of both.
System testing tests the design and behavior of the system and also the expectations of the
customer. It is performed to test the system beyond the bounds mentioned in the software
requirements specification (SRS).

In system testing, integration testing passed components are taken as input. The goal of
integration testing is to detect any irregularity between the units that are integrated together.
System testing detects defects within both the integrated units and the whole system. The
result of system testing is the observed behavior of a component or a system when it is tested.
System Testing is basically performed by a testing team that is independent of the
development team that helps to test the quality of the system impartial. It has both functional
and nonfunctional
testing. System Testing is a black-box testing. It is performed after the integration testing and
before the acceptance testing.

Types of System Testing


Performance Testing: Performance Testing is a type of software testing that is carried out to test the
speed, scalability, stability and reliability of the software product or application.
Load Testing: Load Testing is a type of software Testing which is carried out to determine the
behavior of a system or software product under extreme load.
Stress Testing: Stress Testing is a type of software testing performed to check the robustness of the
system under the varying loads.
Scalability Testing: Scalability Testing is a type of software testing which is carried out to check the
performance of a software application or system in terms of its capability to scale up or scale down the
number of user request load.

Secure Authentication and Access Control System for Student and Admin
Accounts
Registration:
When a new user (patient) wants to register, the system will check the username entered against the
records stored in the hospital_patient_data database. If the username matches an authorized student
(patient) already in the database, they can proceed with the registration. If the username is not
recognized, they will be redirected back to the main page to re-enter their credentials.
Login Verification:
Upon login, the system verifies the username and password entered by the user against the data
stored in the hospital_patient_data or hospital_staff_data database.

5 If the user is authorized, they gain access to their dashboard or the appropriate section of the system, such as
viewing medical records or making appointments.
6 If the login credentials do not match, the user will be denied access and redirected to the login page again.

Admin Authentication:
The admin login functionality is handled separately. Only authorized administrators can log in using their
credentials. Admin credentials are stored in a dedicated table within the hospital_staff_data or a separate
admin_credentials database.

Admins are required to log in with a valid username and password. If the entered credentials match those in
the database, the admin will be granted access to the admin panel where they can manage various aspects of the
system, such as patient records, doctor schedules, and appointments.
Admin Privileges:
An admin can change their username and password via the admin page. This functionality is restricted to
admins only, and no one can register themselves as an admin. Any unauthorized attempts to access the admin
panel or modify admin credentials will be blocked.
6.1 Output Screens:

Fig : Patient_Signup

Fig : Doctor_Signup
Fig : login_page_admin

Fig : Patient_Login
Fig : Contact_Us

Fig : Patient_Home
Fig : Admin_home_page

Fig : Admin_DataBase
DATA BASES

Fig : html

Fig : ADMIN LOGIN


Fig : USER LOGIN

Fig : results
6.2 analysis of results:

The Hospital Management System offers real-time insights into patient care and
administrative operations. After a patient appointment or medical test, healthcare
professionals and administrators can quickly access relevant patient data, treatment plans, and
outcomes. This instant feedback allows doctors to assess the progress of treatment and adjust
care plans promptly, improving patient outcomes. For administrators, the system compiles
detailed reports on patient interactions, medical history, and treatment results, enabling them
to track trends, monitor hospital performance, and make informed decisions regarding
staffing, resource allocation, and healthcare services. This data-driven approach promotes
better management of hospital operations, enhances patient care, and facilitates strategic
planning for hospital improvements.
5. Conclusion

5.1 summary of findings:

The Hospital Management System effectively modernizes patient care and administrative operations by
transitioning from paper-based methods to automated, digital processes. Key findings indicate that the system
enhances operational efficiency, reduces administrative errors, and ensures accurate patient data management.
Healthcare professionals benefit from easy access to patient records, treatment histories, and real-time
updates, which improve decision-making and patient outcomes. Additionally, the secure database structure
guarantees the integrity of sensitive medical information and simplifies record retrieval. Overall, this system
not only enhances the user experience for both healthcare providers and patients but also offers a scalable and
reliable solution that meets the evolving needs of modern healthcare institutions.

5.2 future enhancements:


Future enhancements for the Hospital Management System could focus on expanding features to improve
patient care, security, and system adaptability. First, incorporating telemedicine capabilities could allow
doctors to conduct virtual consultations, offering greater convenience for patients and increasing access to
healthcare services. Additionally, integrating AI-powered diagnostic tools could assist healthcare
professionals in analyzing medical data, providing more accurate diagnoses and personalized treatment plans.

To enhance security, implementing biometric authentication (such as fingerprint or facial recognition) for
accessing patient records could provide an extra layer of protection. AI-based anomaly detection could also
be employed to monitor for any unauthorized access or unusual activities, further strengthening patient data
security.

For greater adaptability, the system could support real-time data sharing with other healthcare institutions,
enabling seamless collaboration and patient referrals across hospitals or clinics. Mobile app integration
would allow patients to book appointments, view their medical records, and receive test results on the go,
improving patient engagement.

To improve the user experience, advanced analytics could be integrated to provide insights into patient
outcomes, hospital performance, and treatment effectiveness, helping administrators make data-driven
decisions. Additionally, multi-language support would help accommodate a wider range of patients,
ensuring the system can cater to diverse populations in global healthcare settings.
By incorporating these advancements, the Hospital Management System could provide more comprehensive,
secure, and user-friendly solutions for modern healthcare needs.
6. Appendix

6.1 Code Snippets:

Snippets of codes include are:

1. Admin Dashboard
2. Admin and User Login
3. Home Page
4. User Sign Up

5. Reset Password
6. Appointment booking
7. Patient profile
8. Doctor Home page

1. Database Setup (MySQL)


Create your database and tables using the following schema:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

START TRANSACTION;

SET time_zone = "+00:00";

Database: myhmsdb

CREATE USER 'hmsuser'@'localhost' IDENTIFIED BY


'varneeth';

GRANT ALL PRIVILEGES ON myhmsdb.* TO


'hmsuser'@'localhost';

FLUSH PRIVILEGES;
CREATE TABLE `admintb` (

`username` varchar(50) NOT NULL,

`password` varchar(30) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `admintb` (`username`, `password`)


VALUES

('admin', 'admin123');

CREATE TABLE `appointmenttb` (

`pid` int(11) NOT NULL,

`ID` int(11) NOT NULL,

`fname` varchar(20) NOT NULL,

`lname` varchar(20) NOT NULL,

`gender` varchar(10) NOT NULL,

`email` varchar(30) NOT NULL,

`contact` varchar(10) NOT NULL,

`doctor` varchar(30) NOT NULL,

`docFees` int(5) NOT NULL,

`appdate` date NOT NULL,


`apptime` time NOT NULL,

`userStatus` int(5) NOT NULL,

`doctorStatus` int(5) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `appointmenttb` (`pid`, `ID`, `fname`,


`lname`, `gender`, `email`, `contact`, `doctor`, `docFees`,
`appdate`, `apptime`, `userStatus`, `doctorStatus`) VALUES

(4, 1, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Ganesh', 550, '2020-02-14', '[Link]', 1, 0),

(4, 2, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Dinesh', 700, '2020-02-28', '[Link]', 0, 1),

(4, 3, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Amit', 1000, '2020-02-19', '[Link]', 0, 1),

(11, 4, 'Shraddha', 'Kapoor', 'Female',


'shraddha@[Link]', '9768946252', 'ashok', 500,
'2020-02-29', '[Link]', 1, 1),

(4, 5, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Dinesh', 700, '2020-02-28', '[Link]', 1, 1),

(4, 6, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Ganesh', 550, '2020-02-26', '[Link]', 0, 1),

(2, 8, 'Alia', 'Bhatt', 'Female', 'alia@[Link]',


'8976897689', 'Ganesh', 550, '2020-03-21', '[Link]', 1, 1),

(5, 9, 'Gautam', 'Shankararam', 'Male', 'gautam@[Link]',


'9070897653', 'Ganesh', 550, '2020-03-19', '[Link]', 1, 0),

(4, 10, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Ganesh', 550, '0000-00-00', '[Link]', 1, 0),

(4, 11, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'Dinesh', 700, '2020-03-27', '[Link]', 1, 1),

(9, 12, 'William', 'Blake', 'Male', 'william@[Link]',


'8683619153', 'Kumar', 800, '2020-03-26', '[Link]', 1, 1),

(9, 13, 'William', 'Blake', 'Male', 'william@[Link]',


'8683619153', 'Tiwary', 450, '2020-03-26', '[Link]', 1, 1);

CREATE TABLE `contact` (

`name` varchar(30) NOT NULL,

`email` text NOT NULL,

`contact` varchar(10) NOT NULL,

`message` varchar(200) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `contact` (`name`, `email`, `contact`,


`message`) VALUES

('Anu', 'anu@[Link]', '7896677554', 'Hey Admin'),

(' Viki', 'viki@[Link]', '9899778865', 'Good Job, Pal'),

('Ananya', 'ananya@[Link]', '9997888879', 'How can I


reach you?'),

('Aakash', 'aakash@[Link]', '8788979967', 'Love your


site'),
('Mani', 'mani@[Link]', '8977768978', 'Want some
coffee?'),

('Karthick', 'karthi@[Link]', '9898989898', 'Good


service'),

('Abbis', 'abbis@[Link]', '8979776868', 'Love your


service'),

('Asiq', 'asiq@[Link]', '9087897564', 'Love your service.


Thank you!'),

('Jane', 'jane@[Link]', '7869869757', 'I love your


service!');

CREATE TABLE `doctb` (

`username` varchar(50) NOT NULL,

`gender` varchar(10) NOT NULL,

`password` varchar(50) NOT NULL,

`email` varchar(50) NOT NULL,

`spec` varchar(50) NOT NULL,

`docFees` bigint(10) NOT NULL,

`lat` float NOT NULL,

`lng` float NOT NULL,

`docContact` bigint(20) NOT NULL,


`docAddress` varchar(100) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `doctb` (`username`, `gender`, `password`,


`email`, `spec`, `docFees`, `lat`, `lng`, `docContact`,
`docAddress`) VALUES

('ashok', 'Male', 'ashok123', 'ashok@[Link]', 'General',


500, 15.5645, 120.423, 9123456789, 'Manila'),

('arun', 'Male', 'arun123', 'arun@[Link]', 'Cardiologist',


600, 13.9833, 120.857, 8123456789, 'Tondo'),

('Dinesh', 'Male', 'dinesh123', 'dinesh@[Link]',


'General', 700, 14.6012, 121.011, 2882223223, 'Zambales'),

('Ganesh', 'Male', 'ganesh123', 'ganesh@[Link]',


'Pediatrician', 550, 14.3601, 120.961, 7123456789, 'Clark'),

('Kumar', 'Male', 'kumar123', 'kumar@[Link]',


'Pediatrician', 800, 14.9323, 120.107, 19123456789,
'Pampanga'),

('Amit', 'Female', 'amit123', 'amit@[Link]',


'Cardiologist', 1000, 14.0516, 121.514, 39123456789, 'Clark
City'),

('Abbis', 'Female', 'abbis123', 'abbis@[Link]',


'Neurologist', 1500, 14.6249, 120.541, 19123456789, 'Clark
Avenue'),

('Tiwary', 'Female', 'tiwary123', 'tiwary@[Link]',


'Pediatrician', 450, 13.135, 123.668, 33123456789, 'Clark
New York');

CREATE TABLE `patreg` (

`pid` int(11) NOT NULL,

`fname` varchar(20) NOT NULL,

`lname` varchar(20) NOT NULL,

`gender` varchar(10) NOT NULL,

`email` varchar(30) NOT NULL,

`contact` varchar(30) NOT NULL,

`password` varchar(30) NOT NULL,

`cpassword` varchar(30) NOT NULL,

`lat` float NOT NULL,

`lng` float NOT NULL,

`patAddress` varchar(100) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `patreg` (`pid`, `fname`, `lname`, `gender`,


`email`, `contact`, `password`, `cpassword`, `lat`, `lng`,
`patAddress`) VALUES

(1, 'Ram', 'Kumar', 'Male', 'ram@[Link]', '9876543210',


'ram123', 'ram123', 14.0008, 120.857, 'Germany'),
(2, 'Alia', 'Bhatt', 'Female', 'alia@[Link]', '8976897689',
'alia123', 'alia123', 14.0886, 121.148, 'Germany'),

(3, 'Shahrukh', 'khan', 'Male', 'shahrukh@[Link]',


'8976898463', 'shahrukh123', 'shahrukh123', 14.232,
120.769, 'Germany'),

(4, 'Kishan', 'Lal', 'Male', 'kishansmart0@[Link]',


'8838489464', 'kishan123', 'kishan123', 14.2872, 120.978,
'Germany'),

(5, 'Gautam', 'Shankararam', 'Male', 'gautam@[Link]',


'9070897653', 'gautam123', 'gautam123', 14.0831, 121.651,
'Germany'),

(6, 'Sushant', 'Singh', 'Male', 'sushant@[Link]',


'9059986865', 'sushant123', 'sushant123', 14.4668, 120.543,
'Germany'),

(7, 'Nancy', 'Deborah', 'Female', 'nancy@[Link]',


'9128972454', 'nancy123', 'nancy123', 14.7659, 121.013,
'Germany'),

(8, 'Kenny', 'Sebastian', 'Male', 'kenny@[Link]',


'9809879868', 'kenny123', 'kenny123', 14.5173, 121.252,
'Germany'),

(9, 'William', 'Blake', 'Male', 'william@[Link]',


'8683619153', 'william123', 'william123', 14.8513, 120.361,
'Germany'),

(10, 'Peter', 'Norvig', 'Male', 'peter@[Link]',


'9609362815', 'peter123', 'peter123', 14.0333, 120.889,
'Germany'),
(11, 'Shraddha', 'Kapoor', 'Female', 'shraddha@[Link]',
'9768946252', 'shraddha123', 'shraddha123', 15.4185,
120.579, 'Germany');

CREATE TABLE `prestb` (

`doctor` varchar(50) NOT NULL,

`pid` int(11) NOT NULL,

`ID` int(11) NOT NULL,

`fname` varchar(50) NOT NULL,

`lname` varchar(50) NOT NULL,

`appdate` date NOT NULL,

`apptime` time NOT NULL,

`disease` varchar(250) NOT NULL,

`allergy` varchar(250) NOT NULL,

`prescription` varchar(1000) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `prestb` (`doctor`, `pid`, `ID`, `fname`,


`lname`, `appdate`, `apptime`, `disease`, `allergy`,
`prescription`) VALUES

('Dinesh', 4, 11, 'Kishan', 'Lal', '2020-03-27', '[Link]',


'Cough', 'Nothing', 'Just take a teaspoon of Benadryl every
night'),

('Ganesh', 2, 8, 'Alia', 'Bhatt', '2020-03-21', '[Link]',


'Severe Fever', 'Nothing', 'Take bed rest'),

('Kumar', 9, 12, 'William', 'Blake', '2020-03-26', '[Link]',


'Sever fever', 'nothing', 'Paracetamol -> 1 every morning and
night'),

('Tiwary', 9, 13, 'William', 'Blake', '2020-03-26', '[Link]',


'Cough', 'Skin dryness', 'Intake fruits with more water
content');

ALTER TABLE `appointmenttb`

ADD PRIMARY KEY (`ID`);

ALTER TABLE `patreg`

ADD PRIMARY KEY (`pid`);

ALTER TABLE `appointmenttb`

MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=14;

ALTER TABLE `patreg`

MODIFY `pid` int(11) NOT NULL


AUTO_INCREMENT, AUTO_INCREMENT=12;
ALTER TABLE doctb MODIFY pid INT NOT NULL
AUTO_INCREMENT PRIMARY KEY;

COMMIT;
2. Database Connection (db_connect.php)
<?php
$servername = "localhost";
$username = "root";

$password = "";
$dbname = "online_exam_system";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);


}
?>

3. User Sign Up (sign_up.php)


HTML Form
html
Copy code
<form method="POST" action="sign_up.php">
<label>Username:</label>
<input type="text" name="username" required>
<label>Email:</label>
<input type="email" name="email" required>
<label>Password:</label>
<input type="password" name="password" required>
<button type="submit">Sign Up</button>
</form>

PHP Backend
<?php
include 'db_connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'];
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_BCRYPT);

$query = "INSERT INTO users (username, email, password, role) VALUES ('$username',
'$email', '$password', 'user')";
if ($conn->query($query)) {
echo "Registration successful!";
} else {
echo "Error: " . $conn->error;
}
}
?>

4. Login Page ([Link])


HTML Form
<form method="POST" action="[Link]">
<label>Email:</label>
<input type="email" name="email" required>
<label>Password:</label>
<input type="password" name="password" required>
<button type="submit">Login</button>
</form>

PHP Backend
<?php
session_start();

include 'db_connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['email'];
$password = $_POST['password'];

$result = $conn->query("SELECT * FROM users WHERE email='$email'");


$user = $result->fetch_assoc();

if ($user && password_verify($password, $user['password'])) {

$_SESSION['user_id'] = $user['id'];
$_SESSION['role'] = $user['role'];
header("Location: " . ($user['role'] == 'admin' ? 'admin_dashboard.php'
: 'user_home.php'));
} else {
echo "Invalid credentials!";
}
}

?>
5. Admin Dashboard (admin_dashboard.php)
<?php
session_start();
if ($_SESSION['role'] !== 'admin') {
header("Location: [Link]");

}
?>

<h2>Admin Dashboard</h2>
<a href="create_exam.php">Create New Exam</a> |
<a href="modify_exam.php">Modify Exam</a> |

<a href="view_results.php">View Results</a> |


<a href="[Link]">Logout</a>

6. Doctor panel ([Link])


<!DOCTYPE html>
<?php
include('[Link]');

$con=mysqli_connect("localhost","root","","myhmsdb");
$doctor = $_SESSION['dname'];
echo $doctor;
if(isset($_GET['cancel']))
{
$query=mysqli_query($con,"update appointmenttb set doctorStatus='0' where ID = '".$_GET['ID']."'");
if($query)
{
echo "<script>alert('Your appointment successfully cancelled');</script>";
}
<?php
$pid = array();
$appdate = array();

$query = "select pid, userStatus, doctorStatus from appointmenttb where doctor= '$doctor'; ";
$result = mysqli_query($con,$query);

if ($result->num_rows > 0) {
$num = ($result->num_rows);
$row = $result->fetch_assoc();
for ($i = 0; $i < $num; $i++){
$pid[] = $row["pid"];
$userStatus[] = $row["userStatus"];
$doctorStatus[] = $row["doctorStatus"];
if(($row['userStatus']==1) && ($row['doctorStatus']==1))
{
$status[] = 1;
} else {
$status[] = 0;
}

$row = $result->fetch_assoc();
}
for ($i = 0; $i < $num; $i++){
}
}
else {
echo " ";

}
$con->close();

?>
<script>

var pid_js_count = <?php echo json_encode($pid); ?>;

var pid_js = <?php echo json_encode($pid); ?>;


var pid1_js64 = new Float64Array(pid_js);

var status_js = <?php echo json_encode($status); ?>;

</script>

<script>
var i = 0 ;
var j = pid_js_count.length;
</script>

<script>
var i = 0 ;
var j = pid_js_count.length;
[Link]("SortBystatus").onclick = Oyelami_sort(status_js,pid1_js64 );

</script>
<script>
function Display13() {

[Link]("<br>");
[Link](pid1_js64);
[Link]("<br>");

[Link](status_js );
[Link]("<br>");
[Link]("FNameFNameDoes it changed and altered the contents?: FName " + "<br>");
[Link](status_js );
[Link](" <----------- Yes, ready for cocktail");
}
</script>
<script>
var pid_js_count = <?php echo json_encode($pid); ?>;

var pid_js = <?php echo json_encode($pid); ?>;


var pid1_js64 = new Float64Array(pid_js);

var status_js = <?php echo json_encode($status); ?>;

</script>

7. Add Questions to Exam (add_questions.php)


<form method="POST" action="add_questions.php">
<label>Question:</label>
<textarea name="question_text" required></textarea>
<label>Option A:</label><input type="text" name="option_a" required>
<label>Option B:</label><input type="text" name="option_b" required>
<label>Option C:</label><input type="text" name="option_c" required>

<label>Option D:</label><input type="text" name="option_d" required>


<label>Correct Answer:</label><input type="text" name="correct_answer" required>
<button type="submit">Add Question</button>
</form>

8. Admin panel ([Link])


<!DOCTYPE html>

<?php

error_reporting(E_ALL);

ini_set('display_errors', 1);

$host = 'localhost';

$username = 'root';

$password = 'varneeth';

$database = 'myhmsdb';

$socket = '/run/mysqld/[Link]';

$con = mysqli_connect($host, $username, $password, $database, null, $socket);

if (!$con) {

die("Connection failed: " . mysqli_connect_error());

include('[Link]');

if (isset($_POST['docsub'])) {

$doctor = $_POST['doctor'];

$dpassword = $_POST['dpassword'];
$demail = $_POST['demail'];

$spec = $_POST['special'];

$docFees = $_POST['docFees'];

$dgender = $_POST['dgender'];

$docAddress = $_POST['docAddress'];

$docContact = $_POST['docContact'];

$lat = isset($_POST['lat']) && !empty($_POST['lat']) ? $_POST['lat'] : 0;

$lng = isset($_POST['lng']) && !empty($_POST['lng']) ? $_POST['lng'] : 0;

$stmt = $con->prepare("INSERT INTO doctb(username, password, email, spec, docFees, gender,


docContact, docAddress, lat, lng)

VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");

$stmt->bind_param("ssssdsdsdd", $doctor, $dpassword, $demail, $spec, $docFees, $dgender,


$docContact, $docAddress, $lat, $lng);

if (!$stmt->execute()) {

die('Query Failed: ' . $stmt->error);

} else {

echo "<script>alert('Doctor added successfully!');</script>";

echo '<script>[Link] = "/[Link]";</script>';

$stmt->close();

mysqli_close($con);

?>

9. Appointment ([Link])
<?php
session_start();
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$host = "[Link]";
$username = "hmsuser";
$password = "varneeth";
$database = "myhmsdb";

$con = mysqli_connect($host, $username, $password, $database);


if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
function validateInput($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['entry_submit'])) {
$fname = !empty($_POST['fname']) ? validateInput($_POST['fname']) : null;
$lname = !empty($_POST['lname']) ? validateInput($_POST['lname']) : null;
$email = !empty($_POST['email']) ? validateInput($_POST['email']) : null;
$contact = !empty($_POST['contact']) ? validateInput($_POST['contact']) : null;
$doctor = !empty($_POST['doctor']) ? validateInput($_POST['doctor']) : null;
if (!$fname || !$lname || !$email || !$contact || !$doctor) {
echo "<script>alert('Please fill all fields.');</script>";
echo "<script>[Link] = '[Link]';</script>";
exit;
}
$stmt = $con->prepare("INSERT INTO appointmenttb (fname, lname, email, contact, doctor)
VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("sssss", $fname, $lname, $email, $contact, $doctor);
if ($stmt->execute()) {
echo "<script>alert('Appointment created successfully!');</script>";
echo "<script>[Link] = '[Link]';</script>";
} else {
echo "<script>alert('Error creating appointment. Please try again.');</script>";
echo "<script>[Link] = '[Link]';</script>";
}
$stmt->close();
}
}
?>

10. Logout ([Link])


<?php
session_start();
session_destroy();

header("Location: [Link]");
?>

You might also like