shopping-list/cont/recipe.php

32 lines
1.2 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];
2018-10-24 18:31:11 +02:00
echo "<h1 id='recipeHeader' data-recipeid='$recipe->ID'>$recipe->Name</h1>";
2018-10-24 15:00:27 +02:00
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>";
echo "<section class='parsedown-section'>";
2018-10-24 18:24:05 +02:00
$parsedown = new Parsedown;
echo $parsedown->text($recipe->Beschreibung);
echo "</section>";
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>