Update
This commit is contained in:
38
cgi-bin/uebung09/questions-show.php
Normal file
38
cgi-bin/uebung09/questions-show.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require_once(__DIR__ . 'Database.php');
|
||||
|
||||
echo <<<END
|
||||
<h1>Fragen anzeigen</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Frage</td>
|
||||
<td>Antwort0</td>
|
||||
<td>Antwort1</td>
|
||||
<td>Antwort2</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
END;
|
||||
|
||||
$db = new Database();
|
||||
|
||||
$questions = $db->getQuestions();
|
||||
|
||||
foreach($questions as $question) {
|
||||
echo("<tr>");
|
||||
echo("<td>$question->question</td>");
|
||||
echo("<td>$question->answer0</td>");
|
||||
echo("<td>$question->answer1</td>");
|
||||
echo("<td>$question->answer2</td>");
|
||||
echo("<td>$question->solution</td>");
|
||||
echo("</tr>");
|
||||
}
|
||||
|
||||
echo <<<END
|
||||
</table>
|
||||
<br><br>
|
||||
<a href="questions-create.php">Frage hinzufügen</a>
|
||||
END;
|
||||
|
||||
?>
|
Reference in New Issue
Block a user