shopping-list/cont/recipe.php

35 lines
1.3 KiB
PHP
Raw Normal View History

2018-10-24 15:00:27 +02:00
<link rel="stylesheet" href="/style/recipe.css">
<script src="/bin/recipe.js" charset="utf-8"></script>
<?php
include $_SESSION["docroot"].'/php/classes.recipe.php';
2018-10-24 18:24:05 +02:00
include $_SESSION["docroot"].'/php/classes.parsedown.php';
2018-10-24 15:00:27 +02:00
$book = new cookbook;
$book->getRecipe($_GET["number"]);
$recipe = $book->sites[0];
echo "<h1 data-recipeid='$recipe->ID'>$recipe->Name</h1>";
echo "<h2>Zutaten</h2>";
echo "<button id='addToListButton' class='button'>Zur Einkaufsliste hinzufügen</button>";
echo "<div id='ingredients'>";
$parity="odd";
foreach($recipe->Zutaten as $Zutat){
if($parity=="even"){$parity="odd";}else{$parity="even";}
echo "<span class='ingredients_row $parity'><font class='ingredients_row_amount'>$Zutat->Menge</font><font class='ingredients_row_unit'>$Zutat->Einheit</font><font class='ingredients_row_name'>".$Zutat->Name."</font></span>";
}
echo "</div>";
echo "<h2>Zubereitung</h2>";
2018-10-24 18:24:05 +02:00
$parsedown = new Parsedown;
// var_dump($recipe->Beschreibung);
echo $parsedown->text($recipe->Beschreibung);
// foreach(explode("\r\n", $recipe->Beschreibung) as $paragraph){
// echo "<p>$paragraph</p>";
// }
2018-10-24 15:00:27 +02:00
?>
<div id="editingMenu"></div>
<div id="editingMenuOpen">
<font id="closeMenue"></font>
<font id="edit-recipe"></font>
<font id="delRecipe"></font>
</div>