How dec-olgen/oop works
Ward Stock is a PHP web application for managing ward inventory and staff/admin accounts. The main workflow is: a user logs in, reaches the shared home or inventory view, and authorized staff create or edit stock records; the home and dashboard surface low-stock and expiry warnings. Admins also manage accounts and inspect activity and audit logs. The sampled pages show direct MySQL access, role checks, and transactional audit writes. Other routes are represented from the file tree; their detailed behavior and wiring were not sampled.
Main entry points: auth.php Session and Roles · database.sql Ward Stock Database · admin_and_staff_home.php Home Summary · admin_and_staff_dashboard.php Inventory Dashboard
Components 20
Access and Navigation
- Login
login.php - Session and Roles
includes/auth.php - Role Navigation
shared/admin_and_staff_sidebar.php - Logout
logout.php
Inventory Operations
- Home Summary
shared/admin_and_staff_home.php - Inventory Dashboard
shared/admin_and_staff_dashboard.php - Create Item
shared/admin_and_staff_create.php - Edit Item
shared/admin_and_staff_edit.php - Adjust Stock
shared/adjust_stock.php - Delete Item
shared/admin_and_staff_delete.php - Confirm Item Delete
shared/admin_and_staff_delete_confirm.php
Admin and Reporting
- Create Account
admin_only/admin_register.php - Manage Accounts
admin_only/admin_accounts.php - Account Actions
admin_only - Account Activity
admin_only/admin_activity_log.php - Inventory Audit
admin_only/admin_audit_log.php - Login Log
admin_only/admin_login_log.php
Persistence
- Ward Stock Database
sql/database.sql - DB Connection and Thresholds
includes/config.php
Other components
- Admin or Staff
Connections 31
- Admin or Staff → Login: submits credentials
- Login → DB Connection and Thresholds: connects to
- Login → Ward Stock Database: checks accounts; logs login
- Login → Home Summary: redirects on success
- Home Summary → Session and Roles: checks role
- Inventory Dashboard → Session and Roles: checks role
- Create Item → Session and Roles: checks role
- Edit Item → Session and Roles: checks role
- Home Summary → DB Connection and Thresholds: loads connection and thresholds
- Inventory Dashboard → DB Connection and Thresholds: loads connection and thresholds
- Create Item → DB Connection and Thresholds: loads connection
- Edit Item → DB Connection and Thresholds: loads connection
- Home Summary → Ward Stock Database: reads inventory and activity
- Inventory Dashboard → Ward Stock Database: reads inventory
- Create Item → Ward Stock Database: writes item and audit record
- Edit Item → Ward Stock Database: updates item and audit record
- Create Account → Session and Roles: checks admin role
- Create Account → Ward Stock Database: writes account and activity
- Manage Accounts → Session and Roles: checks admin role
- Manage Accounts → Ward Stock Database: reads accounts
- Account Activity → Session and Roles: checks admin role
- Account Activity → Ward Stock Database: reads activity
- Inventory Audit → Session and Roles: checks admin role
- Inventory Audit → Ward Stock Database: reads item actions
- Login Log → Session and Roles: requires login
- Logout → Session and Roles: ends session
- Home Summary → Role Navigation: includes navigation
- Inventory Dashboard → Role Navigation: includes navigation
- Admin or Staff → Home Summary: opens
- Admin or Staff → Inventory Dashboard: opens
- Admin or Staff → Logout: requests logout