Compare commits
No commits in common. "837e666af9bb764945773fa69c241f6252280705" and "9e5b874fe0380cdbee52bf150bc1990398ca97ac" have entirely different histories.
837e666af9
...
9e5b874fe0
@ -7,20 +7,3 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-user {
|
|
||||||
border-radius: 9999px;
|
|
||||||
color: var(--brand-primary);
|
|
||||||
background-color: var(--brand-white);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
justify-items: center;
|
|
||||||
align-items: center;
|
|
||||||
width: fit-content;
|
|
||||||
aspect-ratio: 1/1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-user > span {
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Blog\Controller;
|
|
||||||
|
|
||||||
use Blog\Model\AdminModel;
|
|
||||||
|
|
||||||
class AdminController
|
|
||||||
{
|
|
||||||
protected $view;
|
|
||||||
private $db;
|
|
||||||
private $validData = array();
|
|
||||||
private $errors = array();
|
|
||||||
private $labels = array("name" => "Name*", "preis" => "Preis*", "dauer" => "Dauer*", "rabatt" => "Rabatt", "kategorie" => "Kategorie", "beschreibung" => "Beschreibung");
|
|
||||||
|
|
||||||
|
|
||||||
public function __construct($view)
|
|
||||||
{
|
|
||||||
$this->db = new AdminModel();
|
|
||||||
$this->view = $view;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function showForm()
|
|
||||||
{
|
|
||||||
$this->view->setVars([
|
|
||||||
'labels' => $this->labels,
|
|
||||||
'validData' => $this->validData,
|
|
||||||
'errors' => $this->errors
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function showConfirmation()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validateForm(){
|
|
||||||
foreach ($this->labels as $index => $value) {
|
|
||||||
if (!isset($_POST[$index]) || empty($_POST[$index])) {
|
|
||||||
$this->errors[$index] = "Bitte " . $value . " angeben";
|
|
||||||
} else {
|
|
||||||
$this->validData[$index] = $_POST[$index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($this->errors) > 0) {
|
|
||||||
$this->view->setDoMethodName("showContactForm");
|
|
||||||
$this->showContactForm();
|
|
||||||
} else {
|
|
||||||
if ($this->db->writeContactData($this->validData)) {
|
|
||||||
$this->view->setDoMethodName("showConfirmation");
|
|
||||||
$this->showConfirmation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Blog\Model;
|
|
||||||
|
|
||||||
use PDOException;
|
|
||||||
|
|
||||||
class AdminModel extends Database
|
|
||||||
{
|
|
||||||
public function writeContactData($values)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
include dirname(__DIR__).'/header.phtml';
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Neuer Kurs</h2>
|
|
||||||
<form method="post">
|
|
||||||
|
|
||||||
<?php foreach ($labels as $index => $value) {
|
|
||||||
echo '<label for="' . $index . '">' . $value . '</label>';
|
|
||||||
if ($index == "beschreibung") {
|
|
||||||
echo "<textarea id=\"$index\" name=\"$index\" >";
|
|
||||||
if (isset($validData[$index])) { echo $validData[$index]; }
|
|
||||||
echo "</textarea><br>";
|
|
||||||
} else {
|
|
||||||
echo '<input type="text" name="' . $index . '" value="' . (isset($validData[$index]) ? $validData[$index] : '') . '"><br>';
|
|
||||||
}
|
|
||||||
if (isset($errors[$index])) {
|
|
||||||
echo '<label class="errorMsg">' . $errors[$index] . '</label><br>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<input type="hidden" name="controller" value="contact">
|
|
||||||
<input type="hidden" name="do" value="validateForm">
|
|
||||||
<input type="submit" name="submit" value="Absenden"></form>
|
|
||||||
|
|
||||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
|
@ -8,8 +8,6 @@
|
|||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
|
|
||||||
rel="stylesheet">
|
|
||||||
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
|
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -19,7 +17,6 @@
|
|||||||
<div class="d-flex-between">
|
<div class="d-flex-between">
|
||||||
<h3 class="logo">bib<span>course</span></h3>
|
<h3 class="logo">bib<span>course</span></h3>
|
||||||
<div id="metanavi">
|
<div id="metanavi">
|
||||||
<a class="btn btn-user" href="?controller=Admin&do=showForm"><span class="material-icons">person</span></a>
|
|
||||||
<a class="btn btn-register" href="?controller=User&do=showUserForm">Registration</a>
|
<a class="btn btn-register" href="?controller=User&do=showUserForm">Registration</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -29,6 +26,7 @@
|
|||||||
<li><a href="#">Projekte</a></li>
|
<li><a href="#">Projekte</a></li>
|
||||||
<li><a href="#">Workshops</a></li>
|
<li><a href="#">Workshops</a></li>
|
||||||
<li><a href="?controller=Contact&do=showContactForm">Kontakt</a></li>
|
<li><a href="?controller=Contact&do=showContactForm">Kontakt</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user