Web Technologies Miniproject
Web Technologies Miniproject
”
A Report submitted under Project-Based Learning
Submitted By
Nandimandalam Varneeth varma 22101A010108
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.
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.
Submitted By
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.
Abstract 1
1 Introduction 2
1.3 Objectives 2
2 System Design 4
3 Implementation 9
3.4 Integration 12
5 Conclusion 28
6 Appendix 29
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.
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.
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 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
❖ 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.
❖ Prescription Management:
Patients can access prescribed medication details online.
❖ Feedback Submission:
Users can provide feedback about their experience for service improvement.
Admin Side
❖ Appointment Management:
Admins can view and modify appointment schedules.
❖ System Configuration:
Admins can update system settings and ensure smooth operations.
❖ Feedback Review:
Admins can monitor user feedback to address issues and improve services.
2. System design
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.
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.
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
Software Requirements
● HTML
● CSS
● JAVA SCRIPT
● PHP
● 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.
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 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 is utilized for the permanent storage of records within the system, ensuring data
MySQL databases are relational, storing data in separate tables organized into physical
The logical model includes objects such as databases, tables, views, rows, and columns,
SQL (Structured Query Language) is used to interact with MySQL databases, providing a
MySQL software is open-source, allowing anyone to download, use, and modify the
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:
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
HTML forms are used to collect user input in various sections of the Hospital
login. These forms allow users (patients, doctors, and administrative staff) to enter
details like:
When a user submits a form, the data is sent via HTTP to the PHP backend for
● In the patient registration form, once the user submits the details, PHP receives the data
● In the appointment booking form, PHP takes the input data (doctor’s name, time, and date)
● 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.
database.
● Once the data is processed, PHP either redirects the user to the relevant page or provides a
4. Testing, Results and Discussion
❖ 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.
▪ Top-Down Approach
▪ Bottom-Up Approach
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.
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 : 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
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.
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
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
START TRANSACTION;
Database: myhmsdb
FLUSH PRIVILEGES;
CREATE TABLE `admintb` (
('admin', 'admin123');
COMMIT;
2. Database Connection (db_connect.php)
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "online_exam_system";
if ($conn->connect_error) {
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;
}
}
?>
PHP Backend
<?php
session_start();
include 'db_connect.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['email'];
$password = $_POST['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> |
$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>
</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); ?>;
</script>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$host = 'localhost';
$username = 'root';
$password = 'varneeth';
$database = 'myhmsdb';
$socket = '/run/mysqld/[Link]';
if (!$con) {
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'];
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
if (!$stmt->execute()) {
} else {
$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";
header("Location: [Link]");
?>