# gojosaturo00425-sudo/empcert architecture

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

- Interactive diagram: https://gitdiagram.com/gojosaturo00425-sudo/empcert
- Repository: https://github.com/gojosaturo00425-sudo/empcert

## Overview

This PHP application manages employee accounts and employment certificates. The main workflow is account registration and login, role-based routing, administrative review of employee records, certificate upload or replacement, and client viewing/downloading. Admin listings also support searching and deletion. The code excerpts show direct MySQL queries and local file uploads. Several secondary pages are present in the tree but their behavior is not sufficiently shown to map in detail.

Main entry points: [`index.php`](https://github.com/gojosaturo00425-sudo/empcert/blob/main/index.php) (Login), [`adminaccount.php`](https://github.com/gojosaturo00425-sudo/empcert/blob/main/adminaccount.php) (Admin Certificate List), [`uploadpage.php`](https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage.php) (Add Certificate Form), [`uploadpage1.php`](https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage1.php) (Update Certificate Form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and Access"]
  node_login["Login<br/>[index.php]"]
  node_registration["Self Registration<br/>[register.php]"]
  node_admin_registration["Admin Registration<br/>[register1.php]"]
  node_client["Client Account<br/>[clientaccount.php]"]
end

subgraph group_admin["Administration"]
  node_admin_list["Admin Certificate List<br/>[adminaccount.php]"]
  node_admin_missing["Missing Certificates"]
  node_delete["Delete Account<br/>[delete.php]"]
end

subgraph group_certificates["Certificate Handling"]
  node_upload_new["Add Certificate Form<br/>[uploadpage.php]"]
  node_upload_update["Update Certificate Form<br/>[uploadpage1.php]"]
  node_save_update["Save Certificate Update<br/>[display.php]"]
  node_save_new["Save New Certificate<br/>[display1.php]"]
  node_upload_helper["Form Field Helper<br/>[operation.php]"]
end

subgraph group_infrastructure["Persistence"]
  node_db_connection["MySQL Connection<br/>[connect.php]"]
  node_project_db[("Project Database")]
  node_uploaded_files[("Uploaded Files")]
end

node_visitor(("Visitor"))

node_visitor -->|"signs in"| node_login
node_visitor -->|"registers"| node_registration
node_login -->|"checks credentials"| node_project_db
node_login -->|"routes user"| node_client
node_login -->|"routes admin"| node_admin_list
node_registration -->|"creates records"| node_project_db
node_admin_registration -->|"creates record"| node_project_db
node_client -->|"reads certificates"| node_project_db
node_admin_list -->|"searches records"| node_project_db
node_admin_list -->|"opens upload"| node_upload_new
node_admin_list -->|"submits deletion"| node_delete
node_admin_missing -->|"searches records"| node_project_db
node_admin_missing -->|"opens update"| node_upload_update
node_upload_new -->|"renders fields"| node_upload_helper
node_upload_new -->|"submits form"| node_save_update
node_upload_update -->|"renders fields"| node_upload_helper
node_upload_update -->|"submits form"| node_save_new
node_save_update -->|"updates certificate"| node_project_db
node_save_update -->|"stores file"| node_uploaded_files
node_save_new -->|"inserts certificate"| node_project_db
node_save_new -->|"stores file"| node_uploaded_files
node_db_connection -->|"connects to"| node_project_db
node_delete -->|"uses connection"| node_project_db

click node_login "https://github.com/gojosaturo00425-sudo/empcert/blob/main/index.php"
click node_registration "https://github.com/gojosaturo00425-sudo/empcert/blob/main/register.php"
click node_admin_registration "https://github.com/gojosaturo00425-sudo/empcert/blob/main/register1.php"
click node_client "https://github.com/gojosaturo00425-sudo/empcert/blob/main/clientaccount.php"
click node_admin_list "https://github.com/gojosaturo00425-sudo/empcert/blob/main/adminaccount.php"
click node_admin_missing "https://github.com/gojosaturo00425-sudo/empcert/blob/main/adminaccount_withoutcert.php"
click node_delete "https://github.com/gojosaturo00425-sudo/empcert/blob/main/delete.php"
click node_upload_new "https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage.php"
click node_upload_update "https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage1.php"
click node_save_update "https://github.com/gojosaturo00425-sudo/empcert/blob/main/display.php"
click node_save_new "https://github.com/gojosaturo00425-sudo/empcert/blob/main/display1.php"
click node_upload_helper "https://github.com/gojosaturo00425-sudo/empcert/blob/main/operation.php"
click node_db_connection "https://github.com/gojosaturo00425-sudo/empcert/blob/main/connect.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_login,node_registration,node_admin_registration,node_client toneBlue
class node_admin_list,node_admin_missing,node_delete toneAmber
class node_upload_new,node_upload_update,node_save_update,node_save_new,node_upload_helper toneMint
class node_db_connection,node_project_db,node_uploaded_files toneRose
class node_visitor toneIndigo
```

## Components

### Accounts and Access

- [Login](https://github.com/gojosaturo00425-sudo/empcert/blob/main/index.php): `index.php`
- [Self Registration](https://github.com/gojosaturo00425-sudo/empcert/blob/main/register.php): `register.php`
- [Admin Registration](https://github.com/gojosaturo00425-sudo/empcert/blob/main/register1.php): `register1.php`
- [Client Account](https://github.com/gojosaturo00425-sudo/empcert/blob/main/clientaccount.php): `clientaccount.php`

### Administration

- [Admin Certificate List](https://github.com/gojosaturo00425-sudo/empcert/blob/main/adminaccount.php): `adminaccount.php`
- [Missing Certificates](https://github.com/gojosaturo00425-sudo/empcert/blob/main/adminaccount_withoutcert.php): `adminaccount_withoutcert.php`
- [Delete Account](https://github.com/gojosaturo00425-sudo/empcert/blob/main/delete.php): `delete.php`

### Certificate Handling

- [Add Certificate Form](https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage.php): `uploadpage.php`
- [Update Certificate Form](https://github.com/gojosaturo00425-sudo/empcert/blob/main/uploadpage1.php): `uploadpage1.php`
- [Save Certificate Update](https://github.com/gojosaturo00425-sudo/empcert/blob/main/display.php): `display.php`
- [Save New Certificate](https://github.com/gojosaturo00425-sudo/empcert/blob/main/display1.php): `display1.php`
- [Form Field Helper](https://github.com/gojosaturo00425-sudo/empcert/blob/main/operation.php): `operation.php`

### Persistence

- [MySQL Connection](https://github.com/gojosaturo00425-sudo/empcert/blob/main/connect.php): `connect.php`
- **Project Database**
- **Uploaded Files**

### Other components

- **Visitor**

## Connections

- Visitor → Login: signs in (evidence: `index.php`)
- Visitor → Self Registration: registers
- Login → Project Database: checks credentials (evidence: `index.php`)
- Login → Client Account: routes user (evidence: `index.php`)
- Login → Admin Certificate List: routes admin (evidence: `index.php`)
- Self Registration → Project Database: creates records (evidence: `register.php`)
- Admin Registration → Project Database: creates record (evidence: `register1.php`)
- Client Account → Project Database: reads certificates (evidence: `clientaccount.php`)
- Admin Certificate List → Project Database: searches records (evidence: `adminaccount.php`)
- Admin Certificate List → Add Certificate Form: opens upload (evidence: `adminaccount.php`)
- Admin Certificate List → Delete Account: submits deletion (evidence: `adminaccount.php`)
- Missing Certificates → Project Database: searches records (evidence: `adminaccount_withoutcert.php`)
- Missing Certificates → Update Certificate Form: opens update (evidence: `adminaccount_withoutcert.php`)
- Add Certificate Form → Form Field Helper: renders fields (evidence: `uploadpage.php`)
- Add Certificate Form → Save Certificate Update: submits form (evidence: `uploadpage.php`)
- Update Certificate Form → Form Field Helper: renders fields (evidence: `uploadpage1.php`)
- Update Certificate Form → Save New Certificate: submits form (evidence: `uploadpage1.php`)
- Save Certificate Update → Project Database: updates certificate (evidence: `display.php`)
- Save Certificate Update → Uploaded Files: stores file (evidence: `display.php`)
- Save New Certificate → Project Database: inserts certificate (evidence: `display1.php`)
- Save New Certificate → Uploaded Files: stores file (evidence: `display1.php`)
- MySQL Connection → Project Database: connects to (evidence: `connect.php`)
- Delete Account → Project Database: uses connection (evidence: `delete.php`)
