summaryrefslogtreecommitdiff
path: root/dash/notif.php
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2017-03-11 01:29:13 -0800
committerCarson Fleming <cflems@cflems.net>2017-03-11 01:29:13 -0800
commit3d0d3a86106ece4ea298ab2f262b3af5ff8a7728 (patch)
treeb75b297d980f5b061595cea8b29fe42503907684 /dash/notif.php
parenta44a0e047a7582fe7e31743e1b03a17cf2987f73 (diff)
downloadbulletin-3d0d3a86106ece4ea298ab2f262b3af5ff8a7728.tar.gz
Almost there...
Diffstat (limited to 'dash/notif.php')
-rw-r--r--dash/notif.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/dash/notif.php b/dash/notif.php
new file mode 100644
index 0000000..68f0282
--- /dev/null
+++ b/dash/notif.php
@@ -0,0 +1,35 @@
+<?php
+define('HEIRARCHY', 1);
+require('dash_common.php');
+
+$title = 'News / Bulletin';
+$extra_head = ' <link rel="stylesheet" type="text/css" href="css/notif.css" />';
+require('header.php');
+$result = $db->query('SELECT notif.* FROM notif WHERE notif.uid = '.$b_user['id'].' ORDER BY id DESC') or dash_fatal($db->error);
+$db->query('UPDATE notif SET notif.seen = 1 WHERE notif.uid = '.$b_user['id']) or dash_fatal($db->error);
+?>
+ <div class="box cbox">
+ <div id="newshead">
+ <h3><a href="notif.php">News</a></h3>
+ <p>Updates for <?=htmlentities($b_user['name']);?></p>
+ </div>
+ <div class="hr"></div>
+ <div id="newsbody">
+<?php
+if ($result->num_rows < 1) echo ' <p><em>No updates are available at this time.</em></p>'.PHP_EOL;
+else {
+ while ($row = $result->fetch_assoc()) {
+ echo ' <p class="';
+ if ($row['seen']) echo 'seen';
+ else echo 'unseen';
+ if (!is_null($row['icon'])) echo ' icon icon'.strtolower($row['icon']);
+ echo '"><a href="'.$row['link'].'">'.htmlentities($row['text']).'</a></p>'.PHP_EOL;
+ }
+}
+$result->free();
+?>
+ </div>
+ </div>
+<?php
+require('footer.php');
+?>