# lordzohar/hospital architecture

> Architecture diagram of the GitHub repository lordzohar/hospital, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lordzohar/hospital
- Repository: https://github.com/lordzohar/hospital

## Overview

This is a legacy PHP hospital portal combining patient appointment booking and notifications with manager/vendor medicine-quotation workflows. A patient submits an appointment, views appointments matched against doctor availability, and can trigger an email notification. Managers have separate registration/login and a quotation-list view; vendor quotation and other account flows are visible in the tree but their runtime links are not established by the sampled source. Evidence is limited: several listed handlers were not excerpted, so uncertain connections are omitted.

Main entry points: [`hospital.sql`](https://github.com/lordzohar/hospital/blob/master/hospital.sql) (Hospital database), [`index.php`](https://github.com/lordzohar/hospital/blob/master/index.php) (Appointment notification), [`myaccount.php`](https://github.com/lordzohar/hospital/blob/master/myaccount.php) (Appointment lookup), [`action.php`](https://github.com/lordzohar/hospital/blob/master/action.php) (Appointment booking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient appointments"]
  node_booking["Appointment booking<br/>[action.php]"]
  node_appointment_view["Appointment lookup<br/>[myaccount.php]"]
  node_confirmation_view["Appointment confirmation<br/>[myaccount1.php]"]
  node_doctor_schedule["Doctor availability<br/>[medical.html]"]
end

subgraph group_accounts["Portal accounts"]
  node_patient_login["Patient login<br/>[login.php]"]
  node_patient_register["Patient registration<br/>[reg.php]"]
  node_account_pages["Account pages<br/>[account.php]"]
  node_manager_register["Manager registration"]
  node_manager_login["Manager login<br/>[managerlogin.php]"]
  node_vendor_register["Vendor registration<br/>[vendorregister.php]"]
  node_vendor_login["Vendor login<br/>[vendorlogin.php]"]
end

subgraph group_procurement["Medicine procurement"]
  node_quotation_submit["Quotation submission<br/>[qoutation.php]"]
  node_quotation_list["Quotation comparison<br/>[data.php]"]
  node_medicine_catalog[("Medicine data<br/>[medicine.sql]")]
  node_vendor_data[("Vendor data<br/>[vendor.sql]")]
end

subgraph group_mail["Email delivery"]
  node_notification["Appointment notification<br/>[index.php]"]
  node_mailer_loader["Mailer autoloader"]
  node_mailer["Message construction"]
  node_smtp["SMTP transport<br/>[class.smtp.php]"]
end

node_patient(("Patient"))
node_hospital_db[("Hospital database<br/>[hospital.sql]")]
node_manager(("Manager"))
node_vendor(("Vendor"))
node_smtp_service["SMTP service"]

node_patient -->|"submits"| node_booking
node_booking -->|"writes appointment"| node_hospital_db
node_booking -->|"queries booking"| node_hospital_db
node_appointment_view -->|"queries appointments"| node_hospital_db
node_appointment_view -->|"matches availability"| node_doctor_schedule
node_appointment_view -->|"opens notification"| node_notification
node_notification -->|"loads"| node_mailer_loader
node_mailer -->|"delegates SMTP"| node_smtp
node_mailer -.->|"sends message"| node_smtp_service
node_notification -->|"configures SMTP"| node_smtp_service
node_notification -->|"redirects on success"| node_confirmation_view
node_manager -.->|"registers"| node_manager_register
node_manager_register -->|"writes manager"| node_hospital_db
node_manager -.->|"signs in"| node_manager_login
node_manager_login -->|"redirects"| node_quotation_list
node_quotation_list -->|"reads quotations"| node_hospital_db
node_vendor -.->|"registers"| node_vendor_register
node_vendor -.->|"signs in"| node_vendor_login
node_vendor -.->|"submits quotation"| node_quotation_submit
node_quotation_submit -.->|"writes quotation"| node_hospital_db

click node_booking "https://github.com/lordzohar/hospital/blob/master/action.php"
click node_appointment_view "https://github.com/lordzohar/hospital/blob/master/myaccount.php"
click node_confirmation_view "https://github.com/lordzohar/hospital/blob/master/myaccount1.php"
click node_hospital_db "https://github.com/lordzohar/hospital/blob/master/hospital.sql"
click node_doctor_schedule "https://github.com/lordzohar/hospital/blob/master/medical.html"
click node_patient_login "https://github.com/lordzohar/hospital/blob/master/login.php"
click node_patient_register "https://github.com/lordzohar/hospital/blob/master/reg.php"
click node_account_pages "https://github.com/lordzohar/hospital/blob/master/account.php"
click node_manager_register "https://github.com/lordzohar/hospital/blob/master/managerregister.php"
click node_manager_login "https://github.com/lordzohar/hospital/blob/master/managerlogin.php"
click node_vendor_register "https://github.com/lordzohar/hospital/blob/master/vendorregister.php"
click node_vendor_login "https://github.com/lordzohar/hospital/blob/master/vendorlogin.php"
click node_quotation_submit "https://github.com/lordzohar/hospital/blob/master/qoutation.php"
click node_quotation_list "https://github.com/lordzohar/hospital/blob/master/data.php"
click node_medicine_catalog "https://github.com/lordzohar/hospital/blob/master/medicine.sql"
click node_vendor_data "https://github.com/lordzohar/hospital/blob/master/vendor.sql"
click node_notification "https://github.com/lordzohar/hospital/blob/master/index.php"
click node_mailer_loader "https://github.com/lordzohar/hospital/blob/master/PHPMailer/PHPMailerAutoload.php"
click node_mailer "https://github.com/lordzohar/hospital/blob/master/PHPMailer/class.phpmailer.php"
click node_smtp "https://github.com/lordzohar/hospital/blob/master/PHPMailer/class.smtp.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_booking,node_appointment_view,node_confirmation_view,node_doctor_schedule toneBlue
class node_patient_login,node_patient_register,node_account_pages,node_manager_register,node_manager_login,node_vendor_register,node_vendor_login,node_hospital_db toneAmber
class node_quotation_submit,node_quotation_list,node_medicine_catalog,node_vendor_data toneMint
class node_notification,node_mailer_loader,node_mailer,node_smtp toneRose
class node_patient,node_manager,node_vendor,node_smtp_service toneIndigo
```

## Components

### Patient appointments

- [Appointment booking](https://github.com/lordzohar/hospital/blob/master/action.php): `action.php`
- [Appointment lookup](https://github.com/lordzohar/hospital/blob/master/myaccount.php): `myaccount.php`
- [Appointment confirmation](https://github.com/lordzohar/hospital/blob/master/myaccount1.php): `myaccount1.php`
- [Doctor availability](https://github.com/lordzohar/hospital/blob/master/medical.html): `medical.html`

### Portal accounts

- [Patient login](https://github.com/lordzohar/hospital/blob/master/login.php): `login.php`
- [Patient registration](https://github.com/lordzohar/hospital/blob/master/reg.php): `reg.php`
- [Account pages](https://github.com/lordzohar/hospital/blob/master/account.php): `account.php`
- [Manager registration](https://github.com/lordzohar/hospital/blob/master/managerregister.php): `managerregister.php`
- [Manager login](https://github.com/lordzohar/hospital/blob/master/managerlogin.php): `managerlogin.php`
- [Vendor registration](https://github.com/lordzohar/hospital/blob/master/vendorregister.php): `vendorregister.php`
- [Vendor login](https://github.com/lordzohar/hospital/blob/master/vendorlogin.php): `vendorlogin.php`

### Medicine procurement

- [Quotation submission](https://github.com/lordzohar/hospital/blob/master/qoutation.php): `qoutation.php`
- [Quotation comparison](https://github.com/lordzohar/hospital/blob/master/data.php): `data.php`
- [Medicine data](https://github.com/lordzohar/hospital/blob/master/medicine.sql): `medicine.sql`
- [Vendor data](https://github.com/lordzohar/hospital/blob/master/vendor.sql): `vendor.sql`

### Email delivery

- [Appointment notification](https://github.com/lordzohar/hospital/blob/master/index.php): `index.php`
- [Mailer autoloader](https://github.com/lordzohar/hospital/blob/master/PHPMailer/PHPMailerAutoload.php): `PHPMailer/PHPMailerAutoload.php`
- [Message construction](https://github.com/lordzohar/hospital/blob/master/PHPMailer/class.phpmailer.php): `PHPMailer/class.phpmailer.php`
- [SMTP transport](https://github.com/lordzohar/hospital/blob/master/PHPMailer/class.smtp.php): `PHPMailer/class.smtp.php`

### Other components

- **Patient**
- [Hospital database](https://github.com/lordzohar/hospital/blob/master/hospital.sql): `hospital.sql`
- **Manager**
- **Vendor**
- **SMTP service**

## Connections

- Patient → Appointment booking: submits
- Appointment booking → Hospital database: writes appointment (evidence: `action.php`)
- Appointment booking → Hospital database: queries booking (evidence: `action.php`)
- Appointment lookup → Hospital database: queries appointments (evidence: `myaccount.php`)
- Appointment lookup → Doctor availability: matches availability (evidence: `myaccount.php`)
- Appointment lookup → Appointment notification: opens notification (evidence: `myaccount.php`)
- Appointment notification → Mailer autoloader: loads (evidence: `index.php`)
- Message construction → SMTP transport: delegates SMTP (evidence: `PHPMailer/class.phpmailer.php`)
- Message construction → SMTP service: sends message
- Appointment notification → SMTP service: configures SMTP (evidence: `index.php`)
- Appointment notification → Appointment confirmation: redirects on success (evidence: `index.php`)
- Manager → Manager registration: registers
- Manager registration → Hospital database: writes manager (evidence: `managerregister.php`)
- Manager → Manager login: signs in
- Manager login → Quotation comparison: redirects (evidence: `managerlogin.php`)
- Quotation comparison → Hospital database: reads quotations (evidence: `data.php`)
- Vendor → Vendor registration: registers
- Vendor → Vendor login: signs in
- Vendor → Quotation submission: submits quotation
- Quotation submission → Hospital database: writes quotation
