survey_seahorse

Software Engineering Project - Fall 2018
Log | Files | Refs | README

commit f7853cdc52a8fe796c720736f288a08b621ae742
parent 18874a21b516100e26a733e84809ade8d6bd9979
Author: John Kubach <johnkubach@gmail.com>
Date:   Wed, 19 Dec 2018 20:18:45 -0500

profile page updates

registration date is formatted nicer. all blocked statuses are represented.

Diffstat:
Mwebsite/profile.php | 25++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/website/profile.php b/website/profile.php @@ -8,17 +8,20 @@ if($_SESSION['username'] == null) $user = $_SESSION['username']; $email = $_SESSION['email']; $uid = $_SESSION['uid']; -$date = $_SESSION['date']; +$date = date("M j, Y",strtotime($_SESSION['date'])); $block = $_SESSION['blocked']; $blockStatus = ""; -if($block == 48) +if($block == 48) { $blockStatus = "full access"; -if($block == 49) - $blockStatus = "reduced access"; -if($block == 50) - $blockStatus = "you shouldn't even be here"; +} elseif($block == 49) { + $blockStatus = "cannot create surveys"; +} elseif($block == 50) { + $blockStatus = "cannot take or create surveys"; +} elseif($block == 51) { + $blockStatus = "r.i.p."; +} include 'res/navbar.php'; @@ -26,11 +29,11 @@ echo '<link rel="stylesheet" href="res/style.css">'; echo '<div class="profile">'; -echo "<h2> Username: '$user' </h2>"; -echo "<h2> Email: '$email' </h2>"; -echo "<h2> UserID: '$uid' </h2>"; -echo "<h2> User Registration Date: '$date' </h2>"; -echo "<h2> Blocked Status: ' $blockStatus' </h2>"; +echo "<h2> Username: $user </h2>"; +echo "<h2> Email: $email </h2>"; +echo "<h2> UserID: $uid </h2>"; +echo "<h2> User Registration Date: $date </h2>"; +echo "<h2> Blocked Status: $blockStatus </h2>"; $sql = "SELECT title FROM survey WHERE survey_id IN (SELECT survey_id FROM answer_numeric WHERE user_id=$uid) ORDER BY RAND() LIMIT 3;"; $result = mysqli_query($connect, $sql);