Example #1
0
    $html = "<p class='lead'>Announcements <small>–Obviously each thing is the most important thing.</small></p>";
    //announcement block
    //Show only announcements less than a month old and unarchived
    $sql = "SELECT * FROM `announcement` WHERE date_add(timePosted, INTERVAL 1 MONTH) > now() and `choir` = '{$CHOIR}' AND `archived`=0 ORDER BY `timePosted` DESC LIMIT 0, 3";
    $result = mysql_query($sql);
    while ($announcement = mysql_fetch_array($result)) {
        $timestamp = strtotime($announcement['timePosted']);
        $dayPosted = date('M j, Y', $timestamp);
        $timePosted = date('g:i a', $timestamp);
        $op = $announcement['memberID'];
        $mid = $announcement['announcementNo'];
        $name = prefNameFromEmail($op);
        if (isOfficer($userEmail)) {
            $html .= "<div class='block' id='announce" . $mid . "'><p><b>{$dayPosted} {$timePosted}</b><i class='icon-remove archiveButton' onclick='archiveAnnouncement(" . $mid . ")' style='float: right'></i><br />" . $announcement['announcement'] . "<br /><small style='color:grey'>&mdash;{$name}</small></p></div>";
        } else {
            $html .= "<div class='block'><p><b>{$dayPosted} {$timePosted}</b><br />" . $announcement['announcement'] . "<br /><small style='color:grey'>&mdash;{$name}</small></p></div>";
        }
    }
    $html .= "<button type='button' id='allAnnounceButton' class='btn' href='#annoucnements'>See All Announcements</button>";
    return $html;
}
echo "<div class='block span5' id='attendanceHistory'>";
echo attendanceHistory($USER);
echo "</div><div class='span6 block' style='float:right'>";
echo gigBlock($USER);
echo info($USER);
echo "</div><div class='span6 block' style='float:right'>";
echo announcements($USER);
echo "</div><div class='span6 block' style='float:right'>";
echo todoBlock($USER, true, true);
echo "</div>";
Example #2
0
}
?>
						</table>
					</div>
					
					<h1>Manage Announcements <a href="announcements.php?create" class="btn btn-sm btn-info">Create Announcement</a></h1>
					<div class="well">
						<table class="table table-striped">
							<tr>
								<th>Title</th>
								<th>Level</th>
								<th>Status</th>
								<th></th>
							</tr>
							<?php 
$announcements = announcements();
foreach ($announcements as $announcement) {
    ?>
							<tr>
								<td><?php 
    echo '<a href="' . $basedir . 'admin/announcements.php?edit=' . $announcement["id"] . '">' . $announcement["header"] . '</a>';
    ?>
</td>
								<td><?php 
    echo $announcement['level'];
    ?>
</td>
								<td><?php 
    echo $announcement['status'];
    ?>
</td>