-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanouncements.php
98 lines (87 loc) · 3.88 KB
/
anouncements.php
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
<?php
include_once 'functions/functions.php';
$page = 3; //Announcements
$getAnnouncements = new Staff();
$announcements = $getAnnouncements->getAnnouncements();
?>
<?php include_once"header.php"; ?>
<main id="main">
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Announcements <i class="fas fa-bullhorn"></i></h2>
<ol>
<li><a href="index.php">Home</a></li>
<li>Announcements</li>
</ol>
</div>
</div>
</section><!-- End Breadcrumbs -->
<!-- ======= Services Section ======= -->
<section style="padding-top: 18px;" id="services" class="services">
<div class="container">
<div class="section-title">
<h2>all announcements <button class="btn btn-outline-success"><a href="download-announcements.php"><i class="fas fa-download"></i> Download PDF</button></a></h2>
</div>
<div class="row">
<?php
$i = 0;
if(isset($announcements) && count($announcements)>0){
foreach($announcements as $announcement){
$i ++;
?>
<div class="col-md-6 mt-4 mt-md-0">
<div class="icon-box">
<i class="icofont-megaphone-alt"></i>
<h4><a href="" data-toggle="modal" data-target="#edit<?php echo $i; ?>modal"><?php echo substr($announcement['title'],0, 70);?></a></h4>
<p><?php echo substr($announcement['description'],0, 160);?>.... <button class="btn btn-success btn-xs" data-toggle="modal" data-target="#edit<?php echo $i; ?>modal">Read More</button></p>
<i style="font-size: 20px; padding-right: 5px;" class="fas fa-calendar-week"></i> <?php $date = date_create($announcement['date_added']); echo date_format($date,"d, M Y"); ?>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="edit<?php echo $i; ?>modal" tabindex="-1" role="dialog" aria-labelledby="exampleModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModal">Read More <i class="fas fa-book-reader"></i></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<h5><?php echo $announcement['title']; ?></h5>
<div class="card border-dark mb-3">
<div class="card-body text-dark">
<p class="card-text"><?php echo $announcement['description']; ?></p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php } ?>
<?php
}else { ?>
<div align="center" class="col-md-12 col-xs-12">
<p>No Announcements Available, Check back later <i style="font-size: 20px;" class="far fa-frown"></i></p>
<i style="font-size: 100px;" class="fas fa-bullhorn"></i>
</div>
<?php }
?>
</div>
</div>
</section><!-- End Services Section -->
<style>
.btn-group-xs > .btn, .btn-xs {
padding: .30rem .4rem;
font-size: .875rem;
line-height: .5;
border-radius: .3rem;
}
</style>
</main><!-- End #main -->
<?php include_once 'footer.php'; ?>