-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimetable.php
More file actions
47 lines (43 loc) · 1.65 KB
/
Copy pathtimetable.php
File metadata and controls
47 lines (43 loc) · 1.65 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
include 'includes/db.php';
include 'includes/header.php';
?>
<style>
/* Slightly larger cap on very wide screens */
@media (min-width: 1400px) {
.timetable-img { max-width: 700px; }
}
</style>
<div class="main-content">
<?php include 'includes/sidebar.php'; ?>
<div class="content-sections">
<!-- Time table Section -->
<section id="timetable-section" class="content-section">
<h2 style="margin-bottom:1rem; text-align:center; color:#5a4e8c; letter-spacing:0.03em;">Time Table</h2>
<div class="timetable-container">
<?php
$dir = 'assets/uploads/timetable/';
$displayImage = null;
// Prefer timetable_current.* uploaded by admin
$files = glob($dir . 'timetable_current.*');
if (!empty($files)) {
$displayImage = $files[0];
} else {
// fallback to the original image file name you've been using
$fallback = $dir . 'Time_table.jpeg';
if (file_exists($fallback)) {
$displayImage = $fallback;
}
}
if ($displayImage):
?>
<!-- use class-based styling (no inline huge size) -->
<img src="<?php echo htmlspecialchars($displayImage); ?>" alt="Time Table" class="timetable-img">
<?php else: ?>
<p>No timetable image available.</p>
<?php endif; ?>
</div>
</section>
</div>
</div>
<?php include 'includes/footer.php'; ?>