From d103984d1392a3ada8b84bf14e45ea60b5c9d5eb Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Mon, 26 Sep 2022 16:13:09 +0200 Subject: [PATCH] Added fields to preorder form --- Layout/default/Preorder/Form.php | 42 +++++++++++++++++++-- application/Preorder/PreorderController.php | 28 ++++++++++++++ application/Preorder/PreorderModel.php | 4 +- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Layout/default/Preorder/Form.php b/Layout/default/Preorder/Form.php index bd426ceee..0e0feef92 100644 --- a/Layout/default/Preorder/Form.php +++ b/Layout/default/Preorder/Form.php @@ -94,6 +94,26 @@ +
+ +
+ +
+
+ +
+ +
+ +
+
+ product_type != "no_setup" && is_array($campaign->setup_products) && count($campaign->setup_products)): ?> @@ -155,7 +175,7 @@ product_type != "setup_only"): ?>
- +
@@ -163,13 +183,13 @@ isAdmin()): ?>
- +
- +
@@ -177,12 +197,26 @@
- +
+ +

Zustimmungen

+
+
+
+
+
+
+ +
+
+ + +

Kundendaten

diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 254701210..3dd15f32f 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -152,6 +152,7 @@ class PreorderController extends mfBaseController { $data['adb_wohneinheit_id'] = ($r->adb_wohneinheit_id) ? $r->adb_wohneinheit_id : null; $data['termination_id'] = ($r->termination_id) ? $r->termination_id : null; + if($campaign->product_type != "setup_only") { $data['product_id'] = $r->product_id; } @@ -178,6 +179,33 @@ class PreorderController extends mfBaseController { break; } + switch($r->connection_type) { + case "single-dwelling": + $data['connection_type'] = "single-dwelling"; + break; + case "multi-dwelling": + $data['connection_type'] = "multi-dwelling"; + break; + case "apartment-building": + $data['connection_type'] = "apartment-building"; + break; + case "apartment": + $data['connection_type'] = "apartment"; + break; + case "business": + $data['connection_type'] = "business"; + break; + } + + $data['accept_agb'] = 1; + $data['accept_dsgvo'] = 1; + $data['accept_withdrawal'] = 1; + + $data['accept_marketing'] = 0; + if($r->accept_marketing == 1) { + $data['accept_marketing'] = 1; + } + $data['price'] = ($r->price) ? $r->price : 0; $data['price_setup'] = ($r->price_setup) ? $r->price_setup : 0; $data['price_nne'] = ($r->price_nne) ? $r->price_nne : 0; diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index 0924f23a4..03b9a4dcd 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -93,7 +93,7 @@ class PreorderModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $res = $db->select("Preorder", "*", "$where ORDER BY zip, city, company, lastname, firstname"); + $res = $db->select("Preorder", "*", "$where ORDER BY lastname, firstname"); if($db->num_rows($res)) { $data = $db->fetch_object($res); $item = new Preorder($data); @@ -111,7 +111,7 @@ class PreorderModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $res = $db->select("Preorder", "*", "$where ORDER BY zip, city, company, lastname, firstname"); + $res = $db->select("Preorder", "*", "$where ORDER BY lastname, firstname"); if($db->num_rows($res)) { while($data = $db->fetch_object($res)) { $items[] = new Preorder($data);