54 lines
1.4 KiB
PHP
54 lines
1.4 KiB
PHP
<?php
|
|
require_once 'header.php';
|
|
require_once 'db/config.php';
|
|
|
|
// Check if user is logged in and is an admin
|
|
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'admin') {
|
|
header("Location: profile.php");
|
|
exit;
|
|
}
|
|
|
|
$page_title = 'Edit User';
|
|
|
|
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
|
|
header("Location: admin_users.php");
|
|
exit;
|
|
}
|
|
|
|
$user_id = $_GET['id'];
|
|
|
|
$pdo = db();
|
|
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
|
|
$stmt->execute([$user_id]);
|
|
$user = $stmt->fetch();
|
|
|
|
if (!$user) {
|
|
header("Location: admin_users.php");
|
|
exit;
|
|
}
|
|
|
|
// For now, this is just a placeholder page.
|
|
// Full edit functionality will be added later.
|
|
?>
|
|
|
|
<header class="hero text-center">
|
|
<div class="container">
|
|
<h1 class="display-4"><?php echo $page_title; ?></h1>
|
|
<p class="lead">Editing user: <?php echo htmlspecialchars($user['username']); ?></p>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container my-5">
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-8">
|
|
<div class="card">
|
|
<div class="card-body p-5">
|
|
<p>Full user editing functionality will be implemented here soon.</p>
|
|
<a href="admin_users.php" class="btn btn-primary">Back to Users List</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<?php require_once 'footer.php'; ?>
|