-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannouncement.php
More file actions
103 lines (87 loc) · 3.77 KB
/
announcement.php
File metadata and controls
103 lines (87 loc) · 3.77 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
session_start();
require_once 'backend/config.php';
$announcementFilter = ['status' => 'active'];
$announcements = $announcementCollection->find(
$announcementFilter,
[
'sort' => [
'date' => -1,
'time' => -1
]
]
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>BMS - Announcements</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="icon" type="image/png" href="assets/img/BMS.png">
<link rel="stylesheet" href="css/style.css?v=1" />
</head>
<body>
<?php include 'includes/nav.php'; ?>
<section class="header-banner">
<img src="assets/img/cdologo.png" class="left-logo" alt="left logo">
<div class="header-text">
<h1>Barangay</h1>
<h3>Announcements</h3>
</div>
<img src="assets/img/barangaygusalogo.png" class="right-logo" alt="right logo">
</section>
<section class="py-5 bg-light">
<div class="container">
<div class="row g-4">
<?php foreach ($announcements as $item):
$modalId = "seeMoreAnnouncement" . (string)$item->_id;
?>
<div class="col-md-4 d-flex">
<div class="card announcement-page-card p-3 h-100 w-100 d-flex flex-column">
<!-- Image -->
<?php if (!empty($item->image)): ?>
<img src="uploads/announcements/<?= $item->image ?>" class="mb-3 w-100 announcement-page-img" />
<?php else: ?>
<img src="assets/img/announcement_placeholder.png" class="mb-3 w-100 announcement-page-img" />
<?php endif; ?>
<!-- TEXT CONTENT -->
<div class="d-flex flex-column flex-grow-1 text-start">
<!-- Date + Time -->
<span class="badge bg-success mb-2 announcement-page-date">
<?= date("d M Y", strtotime($item->date)) ?>
<?= !empty($item->time) ? " | " . date("h:i A", strtotime($item->time)) : "" ?>
</span>
<!-- Location -->
<?php if (!empty($item->location)): ?>
<div class="mb-2 text-secondary announcement-page-location">
<i class="bi bi-geo-alt-fill"></i>
<?= htmlspecialchars($item->location) ?>
</div>
<?php endif; ?>
<!-- Title -->
<h6 class="fw-bold announcement-page-title mt-3">
<?= htmlspecialchars($item->title) ?>
</h6>
<!-- Details -->
<p class="announcement-page-details flex-grow-1">
<?= strlen($item->details) > 80 ? substr($item->details, 0, 80) . "..." : htmlspecialchars($item->details) ?>
</p>
<!-- See More Button links to separate page -->
<a href="see-more-announcement.php?id=<?= $item->_id ?>" class="text-success mt-auto">
See More
</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<!-- Footer -->
<?php include('includes/footer.php'); ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>