<?php
require 'overtime_approval_script.php';
?>

<!DOCTYPE html>
<html>
<head>

<title>Overtime Approval</title>

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

</head>

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

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

<div class="flex-1 p-8" id="main-content">

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

Overtime Approval

</h1>

<div class="bg-white rounded-xl shadow overflow-hidden">

<table class="w-full">

<thead class="bg-gray-100">

<tr>

<th class="p-4 text-left">
Employee
</th>

<th class="p-4">
Department
</th>

<th class="p-4">
Date
</th>

<th class="p-4">
Hours
</th>

<th class="p-4">
Manager
</th>

<th class="p-4">
HR
</th>

<th class="p-4">
Action
</th>

</tr>

</thead>

<tbody>

<?php foreach($requests as $row): ?>

<tr class="border-b">

<td class="p-4">

<?= htmlspecialchars(
$row['employee_name']
) ?>

</td>

<td class="p-4">

<?= htmlspecialchars(
$row['department']
) ?>

</td>

<td class="p-4">

<?= $row['overtime_date'] ?>

</td>

<td class="p-4 text-center">

<?= $row['overtime_hours'] ?>

</td>

<td class="p-4 text-center">

<?= $row['manager_status'] ?>

</td>

<td class="p-4 text-center">

<?= $row['hr_status'] ?>

</td>

<td class="p-4 text-center">

<a
href="?approve=<?= $row['id'] ?>"
class="bg-green-600 text-white px-3 py-2 rounded">

Approve

</a>

</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</body>
</html>