diff --git a/admin/attendance.php b/admin/attendance.php
new file mode 100644
index 0000000..c03adc8
--- /dev/null
+++ b/admin/attendance.php
@@ -0,0 +1,125 @@
+prepare($query);
+$stmt->execute($params);
+$logs = $stmt->fetchAll(PDO::FETCH_ASSOC);
+
+$users = $pdo->query("SELECT id, full_name, username FROM users ORDER BY full_name")->fetchAll();
+
+include 'includes/header.php';
+?>
+
+
+
Attendance Sheet
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Timestamp |
+ User |
+ Employee ID |
+ Type |
+ Device |
+ IP Address |
+
+
+
+
+
+ | No attendance logs found for the selected period. |
+
+
+
+
+ |
+ = date('d M Y', strtotime($log['log_timestamp'])) ?>
+ = date('H:i:s', strtotime($log['log_timestamp'])) ?>
+ |
+
+
+ = htmlspecialchars($log['full_name'] ?: $log['username']) ?>
+
+ Unmapped Device ID: = htmlspecialchars($log['employee_id']) ?>
+
+ |
+ = htmlspecialchars($log['employee_id']) ?> |
+
+
+ CHECK-IN
+
+ CHECK-OUT
+
+ = $log['log_type'] ?>
+
+ |
+ = htmlspecialchars($log['device_id']) ?> |
+ = htmlspecialchars($log['ip_address']) ?> |
+
+
+
+
+
+
+
+
+
+
diff --git a/admin/includes/header.php b/admin/includes/header.php
index 3c58cc9..23bf47f 100644
--- a/admin/includes/header.php
+++ b/admin/includes/header.php
@@ -450,7 +450,7 @@ function can_view($module) {
@@ -472,6 +472,11 @@ function can_view($module) {
+
+
+ Attendance
+
+
Roles / Groups
diff --git a/admin/profile.php b/admin/profile.php
index 12aaebc..c464fee 100644
--- a/admin/profile.php
+++ b/admin/profile.php
@@ -118,6 +118,8 @@ include 'includes/header.php';
+
+
diff --git a/admin/user_edit.php b/admin/user_edit.php
index d072253..86a9cd9 100644
--- a/admin/user_edit.php
+++ b/admin/user_edit.php
@@ -26,6 +26,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = $_POST['username'];
$email = $_POST['email'];
$group_id = $_POST['group_id'];
+ $employee_id = $_POST['employee_id'] ?? null;
$is_active = isset($_POST['is_active']) ? 1 : 0;
$assigned_outlets = $_POST['outlets'] ?? [];
@@ -41,8 +42,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!$message) {
$pdo->beginTransaction();
try {
- $sql = "UPDATE users SET full_name = ?, username = ?, email = ?, group_id = ?, is_active = ? WHERE id = ?";
- $params = [$full_name, $username, $email, $group_id, $is_active, $id];
+ $sql = "UPDATE users SET full_name = ?, username = ?, email = ?, group_id = ?, is_active = ?, employee_id = ? WHERE id = ?";
+ $params = [$full_name, $username, $email, $group_id, $is_active, $employee_id, $id];
$stmt = $pdo->prepare($sql);
$stmt->execute($params);
@@ -144,6 +145,8 @@ include 'includes/header.php';
+
+