The next major module after ESS is **Performance Management / Appraisal System**.

I would build it as:

```text
performance/
│
├── appraisal_dashboard.php
├── appraisal_periods.php
├── kpi_setup.php
├── employee_appraisal.php
├── manager_review.php
├── hr_review.php
├── appraisal_reports.php
├── my_appraisals.php
```

Before I generate all the copy-paste-ready files, we need the database tables because this module is much more data-driven than ESS.

Run these SQL statements first:

```sql
CREATE TABLE appraisal_periods (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255),
    start_date DATE,
    end_date DATE,
    status ENUM('Open','Closed') DEFAULT 'Open',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE performance_kpis (
    id INT AUTO_INCREMENT PRIMARY KEY,
    department_id INT,
    kpi_name VARCHAR(255),
    max_score INT DEFAULT 5,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE employee_appraisals (
    id INT AUTO_INCREMENT PRIMARY KEY,
    period_id INT,
    employee_id INT,

    self_score DECIMAL(5,2) DEFAULT 0,
    manager_score DECIMAL(5,2) DEFAULT 0,
    hr_score DECIMAL(5,2) DEFAULT 0,

    self_comment TEXT,
    manager_comment TEXT,
    hr_comment TEXT,

    status ENUM(
        'Pending Self Review',
        'Pending Manager Review',
        'Pending HR Review',
        'Completed'
    ) DEFAULT 'Pending Self Review',

    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE appraisal_scores (
    id INT AUTO_INCREMENT PRIMARY KEY,
    appraisal_id INT,
    kpi_id INT,
    self_score INT DEFAULT 0,
    manager_score INT DEFAULT 0,
    hr_score INT DEFAULT 0
);
```

After creating these tables, I can generate:

* `appraisal_dashboard.php`
* `appraisal_periods.php`
* `kpi_setup.php`
* `employee_appraisal.php`
* `manager_review.php`
* `hr_review.php`
* `appraisal_reports.php`
* `my_appraisals.php`

with the complete Tailwind UI, approval workflow, KPI scoring, performance reports, promotion recommendations, and salary increment recommendations.

Since that is about 1,500–2,000 lines of code, it's best to generate the files one by one after the tables exist so the code exactly matches your schema.


---------------------------------------------------------------
<?php

require '../config.php';
session_start();

if(!isset($_SESSION['user_id'])){
    header("Location: ../login.php");
    exit;
}

$totalPeriods = $conn->query("
SELECT COUNT(*) total
FROM appraisal_periods
")->fetch_assoc()['total'];

$totalOpen = $conn->query("
SELECT COUNT(*) total
FROM appraisal_periods
WHERE status='Open'
")->fetch_assoc()['total'];

$totalAppraisals = $conn->query("
SELECT COUNT(*) total
FROM employee_appraisals
")->fetch_assoc()['total'];

$totalCompleted = $conn->query("
SELECT COUNT(*) total
FROM employee_appraisals
WHERE status='Completed'
")->fetch_assoc()['total'];
?>

<!DOCTYPE html>
<html>
<head>

<title>Performance Dashboard</title>

<script src="https://cdn.tailwindcss.com"></script>

</head>

<body class="flex bg-gray-100 min-h-screen">

<?php include '../sidebar.php'; ?>

<div class="flex-1 p-8">

<h1 class="text-3xl font-bold mb-8">

Performance Management

</h1>

<div class="grid md:grid-cols-4 gap-6 mb-8">

<div class="bg-white p-6 rounded-xl shadow">

<div class="text-gray-500">
Appraisal Periods
</div>

<div class="text-3xl font-bold mt-2 text-blue-600">

<?= $totalPeriods ?>

</div>

</div>

<div class="bg-white p-6 rounded-xl shadow">

<div class="text-gray-500">
Open Periods
</div>

<div class="text-3xl font-bold mt-2 text-green-600">

<?= $totalOpen ?>

</div>

</div>

<div class="bg-white p-6 rounded-xl shadow">

<div class="text-gray-500">
Appraisals
</div>

<div class="text-3xl font-bold mt-2 text-purple-600">

<?= $totalAppraisals ?>

</div>

</div>

<div class="bg-white p-6 rounded-xl shadow">

<div class="text-gray-500">
Completed
</div>

<div class="text-3xl font-bold mt-2 text-orange-600">

<?= $totalCompleted ?>

</div>

</div>

</div>

<div class="grid md:grid-cols-2 gap-6">

<a href="appraisal_periods.php"
class="bg-white p-6 rounded-xl shadow hover:shadow-lg">

<h2 class="font-bold text-xl mb-2">
Appraisal Periods
</h2>

<p class="text-gray-500">
Manage yearly and quarterly appraisal cycles
</p>

</a>

<a href="kpi_setup.php"
class="bg-white p-6 rounded-xl shadow hover:shadow-lg">

<h2 class="font-bold text-xl mb-2">
KPI Setup
</h2>

<p class="text-gray-500">
Create departmental performance indicators
</p>

</a>

<a href="manager_review.php"
class="bg-white p-6 rounded-xl shadow hover:shadow-lg">

<h2 class="font-bold text-xl mb-2">
Manager Reviews
</h2>

<p class="text-gray-500">
Review employee performance submissions
</p>

</a>

<a href="appraisal_reports.php"
class="bg-white p-6 rounded-xl shadow hover:shadow-lg">

<h2 class="font-bold text-xl mb-2">
Performance Reports
</h2>

<p class="text-gray-500">
View completed appraisal statistics
</p>

</a>

</div>

</div>

</body>
</html>