From 3136cf354a06400f85da2ede5c5a7b0036e47c55 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 27 Jan 2022 11:00:26 +0100 Subject: [PATCH] alle eingetragenen adressen nur beim mitarbeiter anzeigen --- cis/private/profile/index.php | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index 1f1330839..d7a2e76aa 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -293,9 +293,35 @@ if (!$ansicht) $adresse = new adresse(); $adresse->load_pers($user->person_id); - foreach($adresse->result as $a) + if ($type === 'mitarbeiter') { - echo $a->strasse . " (" . $a->bezeichnung_mehrsprachig[$sprache] .") " . "
".$a->plz." ".$a->ort."

"; + foreach ($adresse->result as $a) + { + echo $a->strasse . " (" . $a->bezeichnung_mehrsprachig[$sprache] . ") " . "
" . $a->plz . " " . $a->ort . "

"; + } + } + else + { + function sortAdresse($a , $b) + { + if ($a->typ === $b->typ) + return 0; + + return ($a->typ < $b->typ) ? -1 : 1; + } + usort($adresse->result, "sortAdresse"); + + foreach($adresse->result as $a) + { + if ($a->zustelladresse) + { + if ($a->bezeichnung_mehrsprachig[$sprache] !== NULL) + { + echo "".$a->bezeichnung_mehrsprachig[$sprache].":
"; + echo $a->strasse."
".$a->plz." ".$a->ort."

"; + } + } + } } }