diff --git a/src/model/HotelModel.php b/src/model/HotelModel.php index 3e27249..d07b512 100644 --- a/src/model/HotelModel.php +++ b/src/model/HotelModel.php @@ -8,7 +8,6 @@ class HotelModel { private PDO $db; private AnschriftModel $mdlAnschr; - private $allowedFields = [ 'hotelname', 'hotelnummer', 'provsatz', 'rg_hotelname', 'rg_interval', 'rg_vondatum', 'rg_bisdatum', 'rg_laufdatum', 'rg_ustid', 'rg_ustfrei', @@ -42,6 +41,16 @@ class HotelModel { public function updateHotel($data) { + $status = $data['status'] ?? 'inaktiv'; + $data['status'] = $status; + + $intern = $data['intern'] ?? 0; + $data['intern'] = $intern; + + $nichtanzeigen = $data['nichtanzeigen'] ?? 0; + $data['nichtanzeigen'] = $nichtanzeigen; + + $fieldsToUpdate = array_intersect_key($data, array_flip($this->allowedFields)); if (empty($fieldsToUpdate)) { return false; @@ -95,14 +104,14 @@ class HotelModel { $this->db->beginTransaction(); try { // 1. Anschrift aktualisieren - + $subid = $this->mdlAnschr->update($data['anschriftid'], $data, false); - if(empty($subid) == false) { + if (empty($subid) == false) { $data['anschriftid'] = $subid; } // 1.1 Rechungsanschrift aktualisieren $subidRg = $this->mdlAnschr->update($data['rg_anschriftid'], $data, true); - if(empty($subidRg) == false) { + if (empty($subidRg) == false) { $data['rg_anschriftid'] = $subidRg; } @@ -110,13 +119,11 @@ class HotelModel { BankverbindungModel::update($data['bankid'], $data); // 3. Hotel aktualisieren - $fieldsToUpdate = array_intersect_key($data, array_flip($this->allowedFields)); - if (empty($fieldsToUpdate)) { + if ($this->updateHotel($data) == false) { + $this->db->rollBack(); return false; } - $this->updateHotel($data); - $this->db->commit(); return true; } catch (Exception $e) { @@ -124,8 +131,4 @@ class HotelModel { return false; } } - - - - } diff --git a/src/view/hotel_edit_adresse.php b/src/view/hotel_edit_adresse.php index 6950e0f..b32f3b9 100644 --- a/src/view/hotel_edit_adresse.php +++ b/src/view/hotel_edit_adresse.php @@ -1,6 +1,6 @@
-
+
@@ -10,23 +10,31 @@
-
+
- > - + > +
-
+
- >
+ +
+ > + +
+
+
@@ -28,15 +28,15 @@
- +
- +
- +
Umsatzsteuer
@@ -84,26 +84,35 @@
Rechnungslauf
+
+ +
+ +
+ > + - + + +
+
diff --git a/src/view/templates/header.php b/src/view/templates/header.php index 2220191..32b1cf1 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php @@ -30,9 +30,11 @@ $username = $_SESSION['user'] ?? 'Gast'; - <?= $pageTitle ?? "Seite" ?> | Meine Anwendung + <?= $pageTitle ?? "Seite" ?> | VWL Support-Tool + + @@ -40,7 +42,7 @@ $username = $_SESSION['user'] ?? 'Gast';
-
Meine Anwendung
+
VWL Support-Tool
Angemeldet als:
@@ -61,13 +63,31 @@ $username = $_SESSION['user'] ?? 'Gast'; 'einstellungen' => 'Einstellungen', 'direct:/logout.php' => 'Logout' ]; + $icons = [ + 'home' => 'bi-house', + 'gutscheinsuche' => 'bi-search', + 'hotels' => 'bi-building', + 'rechnungen' => 'bi-file-earmark-text', + 'partner' => 'bi-people', + 'auswertungen' => 'bi-graph-up', + 'postversand' => 'bi-envelope', + 'einzahlungen' => 'bi-cash-coin', + 'einstellungen' => 'bi-gear', + 'direct:/logout.php' => 'bi-box-arrow-right' + ]; foreach ($menu as $key => $value) { if (str_starts_with($key, 'direct:')) { $link = substr($key, 7); + $iconKey = $key; } else { $link = "?page=$key"; + $iconKey = $key; } - echo ""; + + $iconClass = $icons[$iconKey] ?? 'bi-circle'; // fallback icon + echo ""; } ?>