Skip to content

Stucom-Pelai/MP0487_RA5_MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Employee Management Web App (PHP MVC)

🌐 Introduction

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.


🚀 Features

  • 🔍 View the list of registered employees
  • ➕ Add new employees
  • ✏️ Update existing employee details (to be implemented)
  • ❌ Delete an employee (to be implemented)

⚙️ How It Works

  • Employee.php is a simple class that defines the structure of an employee object.
  • EmployeeController.php handles incoming requests and logic for creating, reading, updating, and deleting employees.
  • The index.php file acts as a front controller and main entry point.
  • The view (index.php in views/employees/) renders a form and the employee list, retrieving data directly from $_SESSION.

Class diagram

classDiagram
    class Employee {
        -name : string
        -position : string
        +__construct(name, position)
    }

    class EmployeeController {
        +create()  void
        +read()  void
        +update()  void
        +delete()  void
    }

    EmployeeController --> Employee : use
Loading

Sequence diagram for Create

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)
Loading

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors