EventController, TicketController + Model + essenzielle Funktionen

This commit is contained in:
2025-06-16 15:12:03 +02:00
parent 5bde268b89
commit 6e3e3708b2
8 changed files with 251 additions and 7 deletions

View File

@@ -13,14 +13,12 @@ class ContactController
private $labels = array("name" => "Name", "email" => "E-Mail-Adresse", "content" => "Nachricht");
public function __construct($view)
{
public function __construct($view) {
$this->db = new ContactModel();
$this->view = $view;
}
public function showContactForm()
{
public function showContactForm() {
$this->view->setVars([
'labels' => $this->labels,
'validData' => $this->validData,
@@ -28,12 +26,11 @@ class ContactController
]);
}
public function showConfirmation()
{
public function showConfirmation() {
}
public function validateForm(){
public function validateForm() {
foreach ($this->labels as $index => $value) {
if (!isset($_POST[$index]) || empty($_POST[$index])) {
$this->errors[$index] = "Bitte " . $value . " angeben";