iforgor
This commit is contained in:
parent
58f73367b3
commit
7f8b539e04
2 changed files with 3 additions and 0 deletions
|
@ -17,6 +17,7 @@ include $_SERVER["DOCUMENT_ROOT"] . "/php/pages.php";
|
||||||
<h1>Ranking</h1>
|
<h1>Ranking</h1>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<main>
|
<main>
|
||||||
|
<h3><a href="../">Powrót</a></h3>
|
||||||
<?php
|
<?php
|
||||||
$conn = connectDB();
|
$conn = connectDB();
|
||||||
$stmt = $conn->prepare("SELECT correctAnswers, UID, testTime FROM tests WHERE rank = 1 ORDER BY correctAnswers DESC, testTime ASC");
|
$stmt = $conn->prepare("SELECT correctAnswers, UID, testTime FROM tests WHERE rank = 1 ORDER BY correctAnswers DESC, testTime ASC");
|
||||||
|
|
|
@ -33,6 +33,7 @@ redirectLogged();
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->store_result();
|
$stmt->store_result();
|
||||||
$stmt->bind_result($QID, $answeredChar, $correct);
|
$stmt->bind_result($QID, $answeredChar, $correct);
|
||||||
|
echo "</table><h3><a href='../tests/'>Powrót</a></h3>";
|
||||||
echo "<table><tr><th>Nr</th><th>Pytanie</th><th>Odpowiedzi</th><th>Twoja odpowiedź</th><th>Prawidłowa?</th><th>Prawidłowa odpowiedź</th></tr>";
|
echo "<table><tr><th>Nr</th><th>Pytanie</th><th>Odpowiedzi</th><th>Twoja odpowiedź</th><th>Prawidłowa?</th><th>Prawidłowa odpowiedź</th></tr>";
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($stmt->fetch()) {
|
while ($stmt->fetch()) {
|
||||||
|
@ -54,6 +55,7 @@ redirectLogged();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
echo "</table><h3><a href='../tests/'>Powrót</a></h3>";
|
echo "</table><h3><a href='../tests/'>Powrót</a></h3>";
|
||||||
} else {
|
} else {
|
||||||
|
echo "</table><h3><a href='../'>Powrót</a></h3>";
|
||||||
$stmt = $conn->prepare("SELECT TID, rank, correctAnswers, testLength, testTime FROM tests WHERE UID = ?");
|
$stmt = $conn->prepare("SELECT TID, rank, correctAnswers, testLength, testTime FROM tests WHERE UID = ?");
|
||||||
$stmt->bind_param("i", $_SESSION["UID"]);
|
$stmt->bind_param("i", $_SESSION["UID"]);
|
||||||
$stmt->bind_result($TID, $rank, $correctAnswers, $testLength, $testTime);
|
$stmt->bind_result($TID, $rank, $correctAnswers, $testLength, $testTime);
|
||||||
|
|
Loading…
Add table
Reference in a new issue