Uploadfunktion Sowie Bemerkungen und Rezepte und CSS hinzugefügt.

This commit is contained in:
2026-05-24 11:59:46 +00:00
parent ae0d150684
commit 54bfcfea4f
14 changed files with 345 additions and 3 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
session_start ();
class RezepteAnzeigen {
function anzeigen_db($bild) {
//String aufbauen, um das Bild auszugeben.
$s="<table class='rezepttab'><tr>".
"<td class='detailbildcontainer'>".
"<img class='detailbild' src='images/$bild'>".
"</td><td id='detailinfo'></td></tr></table>";
$rezeptvorschlaege = "";
@include ("db.inc.php");
if ($stmt = $pdo->prepare (
"SELECT id_frage FROM fragen " .
"WHERE bild='$bild'" )) {
$stmt->execute ();
while ( $row = $stmt->fetch () ) {
$id_frage = $row ['id_frage'];
break;
}
}
if ($stmt = $pdo->prepare (
"SELECT id_antwortgeber,antwort FROM antworten "
. "WHERE id_frage='$id_frage'" )) {
$stmt->execute ();
while ( $row = $stmt->fetch () ) {
$rezeptvorschlaege .=
"<div class='vorschauinfos'>Vorschlag vom Mitglied mit der ID " .
$row ['id_antwortgeber'] . ":<br>" .
$row ['antwort'] . "</div>";
}
}
if ($rezeptvorschlaege != "") {
echo $s. "<h5>Rezeptideen</h5>" .
$rezeptvorschlaege;
} else {
echo $s. "<h5>Rezeptideen</h5>" .
"<div class='vorschauinfos'>" .
"Es gibt noch keine Vorschläge</div>";
}
}
}
if(isset ($_GET ['rezepte'])) {
$obj = new RezepteAnzeigen ();
$obj->anzeigen_db ( $_GET ['rezepte'] );
}
?>