-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_user.php
More file actions
28 lines (23 loc) · 769 Bytes
/
Copy pathdebug_user.php
File metadata and controls
28 lines (23 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once __DIR__ . '/config.php';
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
$user_id = $_SESSION['user_id'] ?? 0;
$query = "SELECT id, fullname, department, role, staff_id
FROM users
WHERE id = ?";
$stmt = $conn->prepare($query);
$stmt->bind_param('i', $user_id);
$stmt->execute();
$result = $stmt->get_result();
if ($result && $row = $result->fetch_assoc()) {
echo "Staff User Info:\n";
echo "ID: " . $row['id'] . "\n";
echo "Name: " . $row['fullname'] . "\n";
echo "Department: " . ($row['department'] ?? 'NULL') . "\n";
echo "Role: " . $row['role'] . "\n";
echo "Staff ID: " . ($row['staff_id'] ?? 'NULL') . "\n";
} else {
echo "User not found or error occurred";
}