How kishan0725/hospital-management-system works
Purpose and runtime
A server-rendered Hospital Management System for patient, doctor, and administrator workflows. It runs as a PHP application under Apache/XAMPP, persists operational data in MySQL, and is initialized from myhmsdb.sql. TCPDF is vendored for PDF generation. Core entry points are index.php (public/auth landing), index1.php (patient area), doctor-panel.php, and admin-panel.php.
Shared application boundary
Database connectivity and common page composition are centralized in include/config.php and the shared layout files include/header.php, include/sidebar.php, and include/footer.php. These form the boundary between individual PHP page/controllers and the MySQL-backed application state. include/checklogin.php is the reusable session/authentication gate for protected screens.
Authentication and role routing
The landing flow accepts separate patient, doctor, and admin credentials and dispatches users into role-specific dashboards. index.php is the primary login/registration endpoint; func.php, func1.php, func2.php, and func3.php likely contain action handlers used by these form-driven flows. Separate logout endpoints (logout.php, logout1.php) reflect distinct role/session paths rather than a unified routing layer.
Patient workflow
Patients register/login, book appointments, inspect appointment history, and cancel appointments. The patient dashboard is index1.php; appointment/prescription-related interactions are represented by prescribe.php and likely submitted through the shared function handlers. Appointment state is a cross-role record: a patient cancellation must remain visible to the corresponding doctor and admin views.
Doctor workflow
Doctors are admin-provisioned users who authenticate and view or search their assigned appointments/patients. doctor-panel.php is the role dashboard and doctorsearch.php provides doctor-facing lookup. The doctor may cancel an appointment, changing the same persisted appointment record consumed by patient and administrative views.
Administrative workflow
Admin is the operational control plane: view patients, doctors, appointments, and contact submissions; add/remove doctors; and search records. Its main dashboard is admin-panel.php, with related alternate/admin listing handling in admin-panel1.php and search endpoints such as patientsearch.php, appsearch.php, messearch.php, and search.php. Admin mutations to doctors affect who can authenticate and be selected for appointments.
Contact, presentation, and PDF output
Public informational/contact pages are contact.html, contact.php, and services.html; contact submissions become records reviewed by admin. The UI is PHP/HTML with Bootstrap-oriented static assets under assets/, css/, and js/, plus Font Awesome. PDF generation is provided by the embedded TCPDF library, centered on TCPDF/tcpdf.php, with application-level dependency declaration in composer.json; it is an in-process PHP library, not an external service.
Main entry points: doctor-panel.php Doctor dashboard · admin-panel.php Admin dashboard · prescribe.php Appointments & prescriptions · index.php Login & registration
Components 18
Public & patient
- Login & registration · Role-specific authentication landing.
index.php - Patient dashboard
index1.php - Contact flow · Collects public contact submissions.
contact.php
Clinical operations
- Doctor dashboard
doctor-panel.php - Doctor search
doctorsearch.php
Administration
- Admin dashboard · Operational control plane for records and doctors.
admin-panel.php - Admin listings & search
admin-panel1.php
Shared application
- Form action handlers · Processes form-driven authentication and workflow actions.
func.php - Appointments & prescriptions · Creates, views, cancels, and prepares appointment-related records.
prescribe.php - Session auth gate
include/checklogin.php - Database configuration · Central MySQL connectivity boundary.
include/config.php - Shared page layout
include/header.php - UI assets · Bootstrap-oriented presentation assets.
- Hospital operational data · Patients, doctors, appointments, and contact records.
- Database initialization
myhmsdb.sql - TCPDF · In-process PDF generation library.
TCPDF/tcpdf.php - PHP dependencies
composer.json - Role logout endpoints · Separate session termination paths.
logout.php
Connections 25
- Login & registration → Form action handlers: submits credentials
- Form action handlers → Hospital operational data: authenticates and registers
- Login & registration → Patient dashboard: routes patient
- Login & registration → Doctor dashboard: routes doctor
- Login & registration → Admin dashboard: routes admin
- Patient dashboard → Session auth gate: protects access
- Doctor dashboard → Session auth gate: protects access
- Admin dashboard → Session auth gate: protects access
- Patient dashboard → Appointments & prescriptions: books and cancels
- Doctor dashboard → Appointments & prescriptions: views and cancels assigned
- Admin dashboard → Appointments & prescriptions: oversees appointments
- Doctor dashboard → Doctor search: searches patients
- Admin dashboard → Admin listings & search: lists and searches records
- Admin dashboard → Hospital operational data: manages doctors and records
- Appointments & prescriptions → Hospital operational data: persists shared appointment state
- Doctor search → Hospital operational data: queries assigned records
- Admin listings & search → Hospital operational data: queries operational records
- Contact flow → Hospital operational data: stores submissions
- Database configuration → Hospital operational data: connects
- Database initialization → Hospital operational data: initializes
- Shared page layout → UI assets: renders with
- Appointments & prescriptions → TCPDF: generates PDFs
- PHP dependencies → TCPDF: declares dependency
- Patient dashboard → Role logout endpoints: ends session
- Doctor dashboard → Role logout endpoints: ends session