//Variables for the rendering of the tables $activeSessions = array(); $notStartedSessions = array(); $pausedSessions = array(); $doneSessions=array(); $openRegistrationSessions=array(); $testSession = getTestSession(); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if(isset($_POST["maak-sessie"])){ $status = maakSessie($_POST["sessie-naam"], $_POST["pauze-na"]); if ($status != ""){ // Succes, empty the POST echo ' '; } else { echo ' '; } } if(isset($_POST["reset-proef"])){ resetProef(); echo ' '; } if(isset($_POST["login"])){ if(login($_POST["gebruiker"],$_POST["wachtwoord"])){ $_SESSION['loggedIn'] = true; } else { $_SESSION['loggedIn'] = false; $error_msg = "Verkeerde combinatie van gebruiker en wachtwoord."; } } } if(isset($_GET["id_start"])){ startSessie($_GET["id_start"]); echo ' '; } if(isset($_GET["id_stop"])){ stopSessie($_GET["id_stop"]); echo ' '; } if(isset($_GET["id_hervat"])){ hervatSessie($_GET["id_hervat"]); echo ' '; } if(isset($_GET["id_remove"])){ removeUserFromSession($_GET["id_remove"]); echo ' '; } if(isset($_GET["delete_proef"])){ resetProef(); echo ' '; } if(isset($_GET["id_close"])){ closeRegistration($_GET["id_close"]); echo ' '; } if(isset($_GET["proefsessieStop"])){ $result = endTestSessionEarly(); if ($result == 0) { echo ' '; } else { echo ' '; } } if(isset($_GET["id_generate"])){ $sessionInfo = getSessionInfo($_GET["id_generate"]); $rounds = getSessionRounds($_GET["id_generate"]); generatePdf($sessionInfo, $rounds); echo ' '; } // Status sessions: // 0 = not started // 1 = started // 2 = finished // 3 = paused // 4 = open for registration $sql = "SELECT * FROM Sessie WHERE Status=4;"; $result=$conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $row["AmountUsersNotConfirmed"] = getRegisteredUsers($row["Id"]); array_push($openRegistrationSessions, $row); } } $sql = "SELECT * FROM Sessie WHERE Status=0;"; $result=$conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $row["AmountUsersNotConfirmed"] = getRegisteredUsers($row["Id"]); array_push($notStartedSessions, $row); } } $sql = "SELECT * FROM Sessie WHERE Status=1;"; $result=$conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { array_push($activeSessions, $row); } } $sql = "SELECT * FROM Sessie WHERE Status=2;"; $result=$conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { array_push($doneSessions, $row); } } $sql = "SELECT * FROM Sessie WHERE Status=3;"; $result=$conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { array_push($pausedSessions, $row); } } ?> Je moet ingelogd zijn om deze pagina te bekijken. Login Gebruiker Wachtwoord Log in Maak Sessie Naam Pauze Na 1 2 3 4 5 6 7 Maak aan Reset Proefsessie Open voor inschrijving NaamAantal gebruikersActies Geen sessies open voor inschrijving. $v): ?>