Skip to content
Snippets Groups Projects
Commit 33a13c65 authored by Omar Ibrahim Arfa's avatar Omar Ibrahim Arfa
Browse files

last fixes

parent 97976367
No related branches found
No related tags found
No related merge requests found
......@@ -95,9 +95,10 @@ class Bestellung extends Page
echo "<img src='./img/Header.png' alt='Header Image'>\n";
echo "</header>\n";
echo <<< HTML
<main class="bestellungMain">
<main class="bestellungMain" >
<h1 id="bestellungTitle">Bestellung</h1>
<hr class="not-flex-item">
<div id="sectionContainer" class="flex-container flex-direction-row justify-content-center align-items-center wrap">
<section id="speisekarteSection">
<h2 class="speisekarteTitle">Speisekarte</h2>
<div class="pizzaContainer flex-container flex-direction-row justify-content-center align-items-center wrap">
......@@ -108,13 +109,13 @@ HTML;
<label class="pizzaLabel flex-item flex-container flex-direction-column justify-content-center align-items-center wrap">
<img class="pizzaImage flex-item" alt="Image of Pizza {$pizza->getName()}" src="{$pizza->getPicture()}" data-articleID="{$pizza->getArticleId()}" data-name="{$pizza->getName()}" data-price="{$pizza->getPrice()}" onclick="addItem(this);">
<br>
<span class="pizzaInfo flex-item flex-container flex-direction-column align-items-center">
<span class="flex-item">{$pizza->getName()}</span>
<span class="flex-item">{$pizza->getPrice()}</span>
</span>
</label>
<br>
HTML;
}
......@@ -133,12 +134,13 @@ HTML;
<p id="sum"></p>
<label for="address"></label>
<input class="flex-item" id="address" name="Adresse" placeholder="Ihre Adresse" type="text" required><br>
<input class="flex-item" id="address" name="Adresse" placeholder="Ihre Adresse" type="text" required>
<input type="button" value="Auswahl Löschen" onclick="removeItem();">
<input type="button" value="Alles Löschen" onclick="removeAll();">
<input id="submitButton" type="submit" name="save" value="Bestellen" onclick="selectOrder();">
</form>
</section>
</div>
</main>
HTML;
......
......@@ -19,6 +19,7 @@
require_once './Page.php';
require_once './DB_Classes/Ordering.php';
require_once './DB_Classes/OrderedArticle.php';
require_once './navbar.php';
/**
* This is a template for top level classes, which represent
* a complete web page and which are called directly by the user.
......@@ -104,13 +105,18 @@ class Fahrer extends Page
protected function generateView():void
{
$data = $this->getViewData();
$this->generatePageHeader('Fahrer', "", true);
$this->generatePageHeader('Fahrer', "", true, "./CSS/Fahrer.css");
echo "\n<header class='flex-container flex-direction-column justify-content-center'>\n";
buildNavbar(null, true);
echo "<img src='./img/Header.png' alt='Header Image'>\n";
echo "</header>\n";
echo <<< HTML
<main>
<section id="Fahrer">
<h2>Lieferliste</h2>
<form id="formFahrer" accept-charset="UTF-8" action="#" method="post">
<form class="flex-container flex-direction-row justify-content-center wrap" id="formFahrer" accept-charset="UTF-8" action="#" method="post">
HTML;
$noDeliveries = true;
......@@ -165,6 +171,7 @@ HTML;
echo <<< HTML
</form>
</section>
</main>
HTML;
$this->generatePageFooter();
}
......
......@@ -33,12 +33,7 @@ function loadData() {
request.send();
}
/*
const newScript = document.createElement("script");
newScript.src = "./JS/OrderData.js";
newScript.type = "module";
document.getElementsByTagName("body")[0].prepend(newScript);
*/ //TODO: Remove this
function process(data) {
......@@ -58,7 +53,6 @@ function process(data) {
pizzaList: []
};
//orderForm.append(testBuildOrder(orderingID));
let orderList = order["OrderList"]
for (let [orderedArticleID, pizza] of Object.entries(orderList)) {
......@@ -136,21 +130,19 @@ function buildInputs(pizzaNode, orderedArticleID, status) {
"Bestellt", "Im Ofen", "Fertig",
"Unterwegs", "Geliefert"
];
for (let value = 0; value < 5; value++) {
let inputLabel = document.createElement("label");
let inputRadio = document.createElement("input");
inputLabel.innerText = statusArray[value];
inputLabel.className = "pizzaRadioLabel";
inputRadio.type = "radio";
inputRadio.className = "pizzaRadio";
inputRadio.name = orderedArticleID;
inputRadio.value = value.toString();
inputRadio.disabled = true;
if (value === status) {
inputRadio.checked = true;
}
inputLabel.prepend(inputRadio);
pizzaNode.append(inputLabel);
}
let inputLabel = document.createElement("label");
let inputRadio = document.createElement("input");
inputLabel.innerText = statusArray[status];
inputLabel.className = "pizzaRadioLabel";
inputRadio.type = "radio";
inputRadio.className = "pizzaRadio";
inputRadio.name = orderedArticleID;
inputRadio.value = status.toString();
inputRadio.disabled = true;
inputRadio.checked = true;
inputLabel.prepend(inputRadio);
pizzaNode.append(inputLabel);
}
......@@ -112,7 +112,7 @@ class Kunde extends Page
$this->generatePageHeader('Kunde','./JS/Kunde.js', false, "./CSS/Kunde.css"); //to do: set optional parameters
echo "\n<header class='flex-container flex-direction-column justify-content-center'>\n";
buildNavbar(null, true);
buildNavbar(null, false);
echo "<img src='./img/Header.png' alt='Header Image'>\n";
echo "</header>\n";
......@@ -130,36 +130,7 @@ HTML;
<section id="Kunde">
<h2>Kunde</h2>
<form id="orderForm" accept-charset="UTF-8" action="#" method="post">\n
<fieldset id="bestellung"> <!--TODO: DELETE FROM HERE-->
<legend id="bestellung.legend">Bestellung X</legend>
<fieldset id="pizza" disabled>
<legend id="pizza.legend">Pizza Y</legend>
<label>
Bestellt
<input type="radio" name="ordArtID" value="0">
</label> <br>
<label>
Im Ofen
<input type="radio" name="ordArtID" value="1">
</label> <br>
<label>
Fertig
<input type="radio" name="ordArtID" value="2">
</label> <br>
<label>
Unterwegs
<input type="radio" name="ordArtID" value="3">
</label> <br>
<label>
Geliefert
<input type="radio" name="ordArtID" value="4">
</label>
</fieldset>\n
</fieldset>\n <!--TODO: TO HERE-->
</form>\n
</section>\n
HTML;
......
......@@ -101,6 +101,7 @@ abstract class Page
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{$title}</title>
<link rel="icon" type="image/png" href="./img/favicon.png">
HTML;
$globalCSS = "./CSS/global.css";
if (is_file($globalCSS)) {
......
......@@ -79,16 +79,16 @@ class Index extends Page
protected function generateView():void
{
$data = $this->getViewData(); //NOSONAR ignore unused $data
$this->generatePageHeader('Übersicht'); //to do: set optional parameters
$this->generatePageHeader('Übersicht', "", false, "./CSS/index.css");
// to do: output view of this page
echo <<< HTML
<header>
<h1>Übersicht</h1>
HTML;
buildNavbar($data);
buildNavbar($data, true);
echo"</header>";
echo "\n <footer>© 2024 by Omar Arfa & Simon Pototzki</footer>";
$this->generatePageFooter();
......@@ -124,7 +124,6 @@ HTML;
$page->processReceivedData();
$page->generateView();
} catch (Exception $e) {
//header("Content-type: text/plain; charset=UTF-8");
header("Content-type: text/html; charset=UTF-8");
echo $e->getMessage();
}
......
......@@ -5,8 +5,9 @@
function buildNavbar (array $urlArray = null, bool $target_blank = false) : void {
if (empty($urlArray)) {
$urlArray = array("Bestellung" => "./Bestellung.php", "Bäcker" => "./Baecker.php",
"Kunde" => "./Kunde.php", "Fahrer" => "./Fahrer.php", "Kundenstatus" => "./Kundenstatus.php");
$urlArray = array("Bestellung" => "./Bestellung.php", "Kunde" => "./Kunde.php", "Bäcker" => "./Baecker.php",
"Fahrer" => "./Fahrer.php",
"Kundenstatus" => "./Kundenstatus.php");
}
echo "\n<nav>\n";
$target = $target_blank ? 'target="_blank"' : "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment