4.4
This commit is contained in:
parent
59d1fd0157
commit
a30c5e71e8
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
require_once '../db/config.php';
|
||||
|
||||
// Admin role check
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include_once '../includes/header.php';
|
||||
include_once '../db/config.php';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include_once '../db/config.php';
|
||||
|
||||
// Ensure the user is an admin
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include_once '../includes/header.php';
|
||||
include_once '../db/config.php';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include_once '../db/config.php';
|
||||
|
||||
// Ensure the user is an admin
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
header("Location: /auth/login.php");
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?php session_start(); ?>
|
||||
<?php if (session_status() === PHP_SESSION_NONE) { session_start(); } ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
@ -8,7 +8,7 @@ if (!isset($_SESSION['id']) || $_SESSION['role'] !== 'Student') {
|
||||
}
|
||||
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT r.room_number, r.details FROM Allocations a JOIN Rooms r ON a.room_id = r.id WHERE a.student_id = ?");
|
||||
$stmt = $pdo->prepare("SELECT r.room_no, r.type, r.block FROM Allocations a JOIN Rooms r ON a.room_id = r.id WHERE a.student_id = ?");
|
||||
$stmt->execute([$_SESSION['id']]);
|
||||
$allocation = $stmt->fetch();
|
||||
?>
|
||||
@ -23,8 +23,9 @@ $allocation = $stmt->fetch();
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($allocation): ?>
|
||||
<h5 class="card-title">You are allocated to Room: <?php echo htmlspecialchars($allocation['room_number']); ?></h5>
|
||||
<p class="card-text"><strong>Details:</strong> <?php echo htmlspecialchars($allocation['details']); ?></p>
|
||||
<h5 class="card-title">You are allocated to Room: <?php echo htmlspecialchars($allocation['room_no']); ?></h5>
|
||||
<p class="card-text"><strong>Type:</strong> <?php echo htmlspecialchars($allocation['type']); ?></p>
|
||||
<p class="card-text"><strong>Block:</strong> <?php echo htmlspecialchars($allocation['block']); ?></p>
|
||||
<?php else: ?>
|
||||
<p class="card-text">You have not been allocated a room yet.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user