Merge branch 'main' of https://git.bib.de/PBBFA23AHR/kurs-app
This commit is contained in:
@@ -10,7 +10,7 @@ class AdminController
|
||||
private $db;
|
||||
private $validData = array();
|
||||
private $errors = array();
|
||||
private $labels = array("name" => "Name*", "preis" => "Preis*", "dauer" => "Dauer*", "rabatt" => "Rabatt", "kategorie" => "Kategorie", "beschreibung" => "Beschreibung");
|
||||
private $labels = array("name" => "Name*", "preis" => "€ Preis*", "dauer" => "Dauer* (Stunden)", "rabatt" => "Rabatt", "kategorie" => "Kategorie", "beschreibung" => "Beschreibung");
|
||||
|
||||
|
||||
public function __construct($view)
|
||||
@@ -30,7 +30,7 @@ class AdminController
|
||||
|
||||
public function showConfirmation()
|
||||
{
|
||||
|
||||
echo "<p>Erfolgreich erstellt!</p>";
|
||||
}
|
||||
|
||||
public function validateForm(){
|
||||
@@ -41,10 +41,9 @@ class AdminController
|
||||
$this->validData[$index] = $_POST[$index];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors) > 0) {
|
||||
$this->view->setDoMethodName("showContactForm");
|
||||
$this->showContactForm();
|
||||
$this->view->setDoMethodName("showForm");
|
||||
$this->showForm();
|
||||
} else {
|
||||
if ($this->db->writeContactData($this->validData)) {
|
||||
$this->view->setDoMethodName("showConfirmation");
|
||||
|
||||
Reference in New Issue
Block a user