From 6b021ba72bde969442faa6b9b376a8bd14651394 Mon Sep 17 00:00:00 2001 From: betty Date: Thu, 29 Jan 2026 15:47:06 +0100 Subject: [PATCH] check if values set in form --- static/php/message.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/static/php/message.php b/static/php/message.php index f104112..0a9648e 100644 --- a/static/php/message.php +++ b/static/php/message.php @@ -134,29 +134,40 @@ function constructMessage() if ( ! isset($organisation) && $lang == "DE" ) { $arrServiceTyps = [ "SOM", "PSY", "AÜP" ]; - $message .= "

"; - $message .= "Leistungen, die Sie anbieten"; - $message .= "
"; + $strServiceTyps = ""; foreach ( $arrServiceTyps as $abbreviation ) { if (isset( $_POST[$abbreviation]) ) { - $message .= $_POST[$abbreviation] . "
"; + $strServiceTyps .= $_POST[$abbreviation] . "
"; } } - $message .= "

"; + if ( $strServiceTyps != "" ) + { + $message .= "

"; + $message .= "Leistungen, die Sie anbieten"; + $message .= $strServiceTyps; + $message .= "
"; + $message .= "

"; + } + $arrAllCantons = [ "AG", "AI", "AR", "BE", "BL", "BS", "FR", "GE", "GL", "GR", "JU", "LU", "NE", "NW", "OW", "SG", "SH", "SO", "SZ", "TG", "UR", "VD", "VS", "ZG", "ZH" ]; - $message .= "

"; - $message .= "Kantone, in denen Sie eine Bewilligung (beantragt) haben"; - $message .= "
"; + $strCantons = ""; foreach ( $arrAllCantons as $abbreviation ) { if (isset( $_POST[$abbreviation]) ) { - $message .= $_POST[$abbreviation] . "
"; + $strCantons .= $_POST[$abbreviation] . "
"; } } - $message .= "

"; + if ( $strCantons != "" ) + { + $message .= "

"; + $message .= "Kantone, in denen Sie eine Bewilligung (beantragt) haben"; + $message .= "
"; + $message .= $strCantons; + $message .= "

"; + } } $modulpop2 = filter_input(INPUT_POST, 'modulpop2');