# saravanan2575/bug_fix_task architecture

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

- Interactive diagram: https://gitdiagram.com/saravanan2575/bug_fix_task
- Repository: https://github.com/saravanan2575/bug_fix_task

## Overview

This is a junior PHP bug-fix exercise presented as a browser-based menu of five database tasks. Users open registration, payment, or KYC forms, submit intentionally broken handlers, and inspect admin/output pages; the dashboard demonstrates searchable, paginated customer data. The shared PDO connection supports the database-backed pages. The README documents the task structure, while several form and output modules were not excerpted, so their internal links are shown only where the README or visible code supports them.

Main entry points: [`db.php`](https://github.com/saravanan2575/bug_fix_task/blob/main/db.php) (PDO connection), [`index.php`](https://github.com/saravanan2575/bug_fix_task/blob/main/index.php) (Task menu), [`task3_payment.php`](https://github.com/saravanan2575/bug_fix_task/blob/main/task3_payment.php) (Payment form), [`task4_kyc.php`](https://github.com/saravanan2575/bug_fix_task/blob/main/task4_kyc.php) (KYC form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Task navigation"]
  node_menu["Task menu<br/>[index.php]"]
  node_pdo["PDO connection<br/>[db.php]"]
end

subgraph group_registration["Registration tasks"]
  node_task1form["Task 1 form<br/>[task1_register.php]"]
  node_task1handler["Task 1 broken save"]
  node_task2form["Task 2 form<br/>[task2_register.php]"]
  node_task2handler["Task 2 broken save"]
  node_task2admin["Registration admin<br/>[task2_admin.php]"]
end

subgraph group_payments["Payment task"]
  node_paymentform["Payment form<br/>[task3_payment.php]"]
  node_paymenthandler["Payment update"]
  node_paymentoutput["Payment output<br/>[task3_output.php]"]
end

subgraph group_kyc["KYC task"]
  node_kycform["KYC form<br/>[task4_kyc.php]"]
  node_kychandler["KYC upload"]
  node_kycoutput["KYC output<br/>[task4_output.php]"]
end

subgraph group_dashboard["Admin dashboard"]
  node_dashboard["Customer dashboard"]
end

node_user(("Browser user"))
node_mysql[("MySQL database")]

node_user -->|"opens"| node_menu
node_menu -->|"links to"| node_task1form
node_menu -->|"offers task"| node_task2form
node_menu -->|"links to"| node_paymentform
node_menu -->|"links to"| node_kycform
node_menu -->|"links to"| node_dashboard
node_task1form -.->|"submits to"| node_task1handler
node_task2form -.->|"submits to"| node_task2handler
node_task2handler -->|"redirects to"| node_task2admin
node_task2admin -->|"links back"| node_task2form
node_paymentform -->|"submits to"| node_paymenthandler
node_paymentform -->|"links to"| node_paymentoutput
node_paymenthandler -->|"redirects to"| node_paymentform
node_paymentoutput -->|"links back"| node_paymentform
node_kycform -->|"submits to"| node_kychandler
node_kycform -->|"links to"| node_kycoutput
node_kychandler -->|"redirects to"| node_kycoutput
node_kycoutput -->|"links back"| node_kycform
node_task1handler -->|"uses"| node_pdo
node_task2handler -->|"uses"| node_pdo
node_task2admin -->|"queries"| node_pdo
node_paymentform -->|"loads"| node_pdo
node_paymenthandler -->|"updates through"| node_pdo
node_paymentoutput -->|"queries"| node_pdo
node_kychandler -->|"stores through"| node_pdo
node_kycoutput -->|"queries"| node_pdo
node_dashboard -->|"queries through"| node_pdo
node_pdo -->|"connects to"| node_mysql

click node_menu "https://github.com/saravanan2575/bug_fix_task/blob/main/index.php"
click node_pdo "https://github.com/saravanan2575/bug_fix_task/blob/main/db.php"
click node_task1form "https://github.com/saravanan2575/bug_fix_task/blob/main/task1_register.php"
click node_task1handler "https://github.com/saravanan2575/bug_fix_task/blob/main/task1_broken_save.php"
click node_task2form "https://github.com/saravanan2575/bug_fix_task/blob/main/task2_register.php"
click node_task2handler "https://github.com/saravanan2575/bug_fix_task/blob/main/task2_broken_save.php"
click node_task2admin "https://github.com/saravanan2575/bug_fix_task/blob/main/task2_admin.php"
click node_paymentform "https://github.com/saravanan2575/bug_fix_task/blob/main/task3_payment.php"
click node_paymenthandler "https://github.com/saravanan2575/bug_fix_task/blob/main/task3_broken_update.php"
click node_paymentoutput "https://github.com/saravanan2575/bug_fix_task/blob/main/task3_output.php"
click node_kycform "https://github.com/saravanan2575/bug_fix_task/blob/main/task4_kyc.php"
click node_kychandler "https://github.com/saravanan2575/bug_fix_task/blob/main/task4_broken_upload.php"
click node_kycoutput "https://github.com/saravanan2575/bug_fix_task/blob/main/task4_output.php"
click node_dashboard "https://github.com/saravanan2575/bug_fix_task/blob/main/task5_dashboard.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_menu,node_pdo,node_user toneBlue
class node_task1form,node_task1handler,node_task2form,node_task2handler,node_task2admin,node_mysql toneAmber
class node_paymentform,node_paymenthandler,node_paymentoutput toneMint
class node_kycform,node_kychandler,node_kycoutput toneRose
class node_dashboard toneIndigo
```

## Components

### Task navigation

- [Task menu](https://github.com/saravanan2575/bug_fix_task/blob/main/index.php): `index.php`
- [PDO connection](https://github.com/saravanan2575/bug_fix_task/blob/main/db.php): `db.php`

### Registration tasks

- [Task 1 form](https://github.com/saravanan2575/bug_fix_task/blob/main/task1_register.php): `task1_register.php`
- [Task 1 broken save](https://github.com/saravanan2575/bug_fix_task/blob/main/task1_broken_save.php): `task1_broken_save.php`
- [Task 2 form](https://github.com/saravanan2575/bug_fix_task/blob/main/task2_register.php): `task2_register.php`
- [Task 2 broken save](https://github.com/saravanan2575/bug_fix_task/blob/main/task2_broken_save.php): `task2_broken_save.php`
- [Registration admin](https://github.com/saravanan2575/bug_fix_task/blob/main/task2_admin.php): `task2_admin.php`

### Payment task

- [Payment form](https://github.com/saravanan2575/bug_fix_task/blob/main/task3_payment.php): `task3_payment.php`
- [Payment update](https://github.com/saravanan2575/bug_fix_task/blob/main/task3_broken_update.php): `task3_broken_update.php`
- [Payment output](https://github.com/saravanan2575/bug_fix_task/blob/main/task3_output.php): `task3_output.php`

### KYC task

- [KYC form](https://github.com/saravanan2575/bug_fix_task/blob/main/task4_kyc.php): `task4_kyc.php`
- [KYC upload](https://github.com/saravanan2575/bug_fix_task/blob/main/task4_broken_upload.php): `task4_broken_upload.php`
- [KYC output](https://github.com/saravanan2575/bug_fix_task/blob/main/task4_output.php): `task4_output.php`

### Admin dashboard

- [Customer dashboard](https://github.com/saravanan2575/bug_fix_task/blob/main/task5_dashboard.php): `task5_dashboard.php`

### Other components

- **Browser user**
- **MySQL database**

## Connections

- Browser user → Task menu: opens (evidence: `README.txt`)
- Task menu → Task 1 form: links to (evidence: `index.php`)
- Task menu → Task 2 form: offers task (evidence: `README.txt`)
- Task menu → Payment form: links to (evidence: `index.php`)
- Task menu → KYC form: links to (evidence: `index.php`)
- Task menu → Customer dashboard: links to (evidence: `index.php`)
- Task 1 form → Task 1 broken save: submits to (evidence: `README.txt`)
- Task 2 form → Task 2 broken save: submits to (evidence: `README.txt`)
- Task 2 broken save → Registration admin: redirects to (evidence: `task2_broken_save.php`)
- Registration admin → Task 2 form: links back (evidence: `task2_admin.php`)
- Payment form → Payment update: submits to (evidence: `task3_payment.php`)
- Payment form → Payment output: links to (evidence: `task3_payment.php`)
- Payment update → Payment form: redirects to (evidence: `task3_broken_update.php`)
- Payment output → Payment form: links back (evidence: `task3_output.php`)
- KYC form → KYC upload: submits to (evidence: `task4_kyc.php`)
- KYC form → KYC output: links to (evidence: `task4_kyc.php`)
- KYC upload → KYC output: redirects to (evidence: `task4_broken_upload.php`)
- KYC output → KYC form: links back (evidence: `task4_output.php`)
- Task 1 broken save → PDO connection: uses (evidence: `task1_broken_save.php`)
- Task 2 broken save → PDO connection: uses (evidence: `task2_broken_save.php`)
- Registration admin → PDO connection: queries (evidence: `task2_admin.php`)
- Payment form → PDO connection: loads (evidence: `task3_payment.php`)
- Payment update → PDO connection: updates through (evidence: `task3_broken_update.php`)
- Payment output → PDO connection: queries (evidence: `task3_output.php`)
- KYC upload → PDO connection: stores through (evidence: `task4_broken_upload.php`)
- KYC output → PDO connection: queries (evidence: `task4_output.php`)
- Customer dashboard → PDO connection: queries through (evidence: `task5_dashboard.php`)
- PDO connection → MySQL database: connects to (evidence: `db.php`)
