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