This is a simple web-based employee management system built using PHP following the MVC (Model-View-Controller) architecture. It uses $_SESSION to temporarily store employee data during a user's session, making it ideal for small-scale testing, learning MVC structure, or classroom demonstrations.
No database or external storage is required — the app persists data only while the session is active.
- 🔍 View the list of registered employees
- ➕ Add new employees
- ✏️ Update existing employee details (to be implemented)
- ❌ Delete an employee (to be implemented)
Employee.phpis a simple class that defines the structure of an employee object.EmployeeController.phphandles incoming requests and logic for creating, reading, updating, and deleting employees.- The
index.phpfile acts as a front controller and main entry point. - The view (
index.phpinviews/employees/) renders a form and the employee list, retrieving data directly from$_SESSION.
classDiagram
class Employee {
-name : string
-position : string
+__construct(name, position)
}
class EmployeeController {
+create() void
+read() void
+update() void
+delete() void
}
EmployeeController --> Employee : use
sequenceDiagram
actor U as User
participant HTML as index.html (form)
participant EC as EmployeeController.php
participant E as Employee.php
participant SESSION as $_SESSION
U->>HTML: Fill form (POST)
HTML->>EC: POST name, position
EC->>E: Create a new object Employee
EC->>SESSION: Save Employee in $_SESSION['employees']
EC->>HTML: Redirect to view (index.html)
HTML->>U: Redirect to User (index.html)