public function displayAttendingSessions() { $query = "select sessionID from {$GLOBALS["database"]}.willAttend where userID = '{$this->username}'"; $sessions = $this->connection->query($query); while ($row = $sessions->fetch_assoc()) { $session = new Session($row['sessionID']); $session->display(); } }
/** * Retrieve and display info about all sessions at which this tutor is scheduled to tutor. */ public function displaySessions() { $query = "select sessionID from {$GLOBALS["database"]}.willTutor where tutorID = '{$this->username}'"; $sessions = $this->connection->query($query); if ($sessions->num_rows == 0) { echo "Not tutoring at any sessions yet"; } else { while ($row = $sessions->fetch_assoc()) { $session = new Session($row['sessionID']); $session->display(); // $session->displaySessionAttenders(); } } }
public function displayAllSessions() { $sessionQuery = "select sessionID from {$GLOBALS["database"]}.session;"; $this->sessions = $this->connection->query($sessionQuery); /* Setup for pagination: */ $i = 0; echo "<div class=\"page\" id=page1>"; while (($row = $this->sessions->fetch_assoc()) != null) { /* If a page worth of results has been displayed, start a new "page" div: */ if ($i > 0 && $i % $this->resultsPerPage == 0) { echo "</div><div class=\"page\" id=page" . ($i / $this->resultsPerPage + 1) . ">"; } $session = new Session($row['sessionID']); $session->display(); $i++; // Keeps track of how many results have been displayed, for pagination. } echo "</div>"; // End of div containing the very last page worth of results. $this->genPageSelector(); }
/** * Retrieve and display info about all sessions taking place at this site leader's site. */ public function displaySiteSessions() { $query = "select sessionID from {$GLOBALS["database"]}.session where site = '{$this->site}'"; $sessions = $this->connection->query($query); while ($row = $sessions->fetch_assoc()) { $session = new Session($row['sessionID']); $session->display(); } }