23 lines
464 B
PHP
23 lines
464 B
PHP
<?php
|
|
session_start();
|
|
|
|
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'Super Admin') {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
|
|
require_once 'db/config.php';
|
|
|
|
if (isset($_GET['id'])) {
|
|
$user_id = $_GET['id'];
|
|
$db = db();
|
|
$stmt = $db->prepare('DELETE FROM users WHERE id = ?');
|
|
$stmt->execute([$user_id]);
|
|
|
|
header('Location: admin_dashboard.php');
|
|
exit;
|
|
} else {
|
|
header('Location: admin_dashboard.php');
|
|
exit;
|
|
}
|
|
?>
|