-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathofficials.php
More file actions
68 lines (60 loc) · 1.96 KB
/
officials.php
File metadata and controls
68 lines (60 loc) · 1.96 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
<?php
session_start();
require_once 'backend/config.php';
?>
<!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 - Officials</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="assets/img/BMS.png">
<link rel="stylesheet" href="css/style.css" />
</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>Officials</h3>
</div>
<img src="assets/img/barangaygusalogo.png" class="right-logo" alt="right logo">
</section>
<section class="py-5 bg-light">
<div class="container">
<h3 class="fw-bold mb-4">Elected <span class="text-success">Officials</span></h3>
<div class="row g-2" id="officialsContainer">
</div>
</div>
</section>
<?php include('includes/footer.php'); ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
fetch('backend/officials_get.php')
.then(res => res.json())
.then(data => {
const container = document.getElementById('officialsContainer');
container.innerHTML = '';
if(data.length === 0){
container.innerHTML = '<p class="text-center">No officials found.</p>';
return;
}
data.forEach(official => {
container.innerHTML += `
<div class="col-md-3 d-flex justify-content-center">
<div class="official-card">
<div class="official-img-box">
<img src="uploads/officials/${official.image}" alt="">
</div>
<h6 class="fw-bold official-page-title mt-3">${official.name}</h6>
<p>${official.position}</p>
</div>
</div>
`;
});
});
</script>
</body>
</html>