<!--<table class="hoverable centered white responsive-table z-depth-2 sortable">--> <table class="hoverable centered white responsive-table z-depth-2 sortable"> <thead> <tr> <th data-field="Lname">Last Name</th> <th data-field="Fname">First Name</th> <th data-field="Major">Major</th> <th data-field="Minor">Minor</th> <th data-field="Year">Year</th> <th data-field="Employer">Employer</th> </tr> </thead> <tbody> <?php require_once "Common.php"; require_once "Sanitize.php"; $conn = connectToDB(); $result = $conn->query("SELECT UserID, " . "case when LENGTH(FirstName)>30 then CONCAT(LEFT(FirstName, 27), '...') else FirstName end FirstName, " . "case when LENGTH(LastName)>30 then CONCAT(LEFT(LastName, 27), '...') else LastName end LastName, " . "GradYear FROM `Users` " . "WHERE NOT EXISTS (SELECT * FROM `Permissions` WHERE `Permissions`.UserID = `Users`.UserID)"); //$result = $conn->query('SELECT UserID, FirstName, LastName, GradYear FROM `Users` ' . // 'WHERE NOT EXISTS (SELECT * FROM `Permissions` WHERE `Permissions`.UserID = `Users`.UserID)'); if (!$result) { die('Invalid query: ' . $conn->error); } while ($row = $result->fetch_assoc()) { echo '<tr><td style="word-wrap: break-word">' . SanitizeOut($row['LastName']) . '</td><td style="word-wrap: break-word">' . SanitizeOut($row['FirstName']) . '</td><td>' . getDegreeFor($row['UserID'], $conn, 1) . '</td><td>' . getDegreeFor($row['UserID'], $conn, 0) . '</td><td>' . SanitizeOut($row['GradYear']) . '</td><td>' . getEmployerFor($row['UserID'], $conn) . '</td></tr>'; } $conn->close(); ?> </tbody> </table>
<a class="waves-effect waves-light btn" href="MyEmployment.php">My Employment</a>'; } else { if ($user->hasPermission('ViewFB')) { echo '<a class="waves-effect waves-light btn" href="MySubscriptions.php">Tag Subscriptions</a>'; } } echo '</div> </div>'; ?> <?php ///then (finally) try to log in, and print success or failure to the screen if ($user->isLoggedIn()) { $data = $user->getData(); $conn = connectToDB(); $majors = getDegreeFor($data['UserID'], $conn, 1); $minors = getDegreeFor($data['UserID'], $conn, 0); $conn->close(); //echo "<h6><center>Hello, " . sanitizeOut($data['FirstName']) . " " . sanitizeOut($data['LastName']) . "!</center></h6>"; ///*Bryan: Experimenting, feel free to trash this //TODO: only show relevant data if a Faculty echo '<div style="width: 55%;" class="container white z-depth-2 col s8"> </br> <center><b><h5>' . sanitizeOut($data['FirstName']) . " " . sanitizeOut($data['LastName']) . '</h5>'; if ($isStudent) { echo '<h6> <br><br> <div class="row"> <form class="col s12"> <div class="row"> <div class="col s1 offset-s2"> LU ID: </b>