![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 85 Pomógł: 0 Dołączył: 17.04.2013 Ostrzeżenie: (0%) ![]() ![]() |
Cześć,
postaram się jak najlepiej opisać co chcę osiągnąć. Poniżej jak to jest teraz:
A potem wywołuję to tak i w ten sposób tworze formularz html:
No i jest ok i to działa. Teraz wywołując $this->getRecomendationWOL otrzymuję
A to co chciałbym uzyskać to możliwość wywołania osobno danych dla Grupy 1 / Grupy 2 / Grupy 3
Dziękuję za informacje jak to osiągnąć i za wyrozumiałość. Domyślam się że muszę zmodyfikować: return $recomend; na coś w stylu: public function getValues() { return array ( 'group1' => $this->recomend[1][], 'group2' => $this->recomend[2][], 'group3' => $this->recomend[3][] ); } No ale nie potrafię sobie sam z tym poradzić... Dziękuję jak zawsze za wyrozumiałość. Temat do zamknięcia wystarczyło dane w tablicy zapisać jako
a potem wywołać funkcje poprzez
Ten post edytował pela222 26.03.2021, 13:42:49 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 324 Pomógł: 52 Dołączył: 18.02.2008 Ostrzeżenie: (0%) ![]() ![]() |
Po mojemu to tak:
Kod private $groups = array(); public function __construct(DocumentData $documentData = null) { if (!$documentData) { $documentData = new DocumentData(); } $this->groups= array ( 'common1' => array ( 'name' => '? Wprowadzenie', 'elements'=> array ( 'multiText' => array( 'type' => 'textMulti', 'label' => 'Wprowadzenie', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getIntroData($documentData) ), ), ), 'textMultiList' => array ( 'name' => '? Potrzeby i cele', 'elements'=> array ( 'needs' => array( 'type' => 'textMultiList', 'label' => 'Poszukujecie/Poszukujesz ubezpieczenia, które', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getNeedsData($documentData) ), ), ), 'common2' => array ( 'name' => '? Sytuacja Osobista', 'elements'=> array ( 'multiText' => array( 'type' => 'textMulti', 'label' => 'Osobista', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getPersonData($documentData) ), ), ), 'common3' => array ( 'name' => '? Sytuacja Finansowa', 'elements'=> array ( 'multiText' => array( 'type' => 'textMulti', 'label' => 'Finansowa', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getFinancialData($documentData, $additionalData) ), ), ), ); foreach ($documentData['policies'] as $type => $policieType) { foreach ($policieType as $policy) { // dla typu TerLifeIns if ($type == 'TerLifIns' || $type == 'MorIns') { $termlife = array ( 'common4' => array ( 'name' => '? Rekomendacja Life Term + Mortgage' .$count, 'elements'=> array ( 'multiText' => array( 'type' => 'textMultiList', 'label' => 'Na podstawie otrzymanych informacji, zalecam Wam / Tobie ubezpieczenie', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationTerLifInsData($documentData)[1] ), 'multiText1' => array( 'type' => 'textMultiList', 'label' => 'Dodatkowo omówiono i zaproponowano następujące cechy i elementy:', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationTerLifInsData($documentData)[2] ), 'multiText2' => array( 'type' => 'textMultiList', 'label' => 'Opis Ubezpieczyciela', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationTerLifInsData($documentData)[3] ), ), ), ); $this->groups = array_merge($this->groups, $termlife); } // dla Hive if ($type == 'PerAcc' || $type =='AccSicAndHos' || $type == 'MedCas') { $hive = array ( 'common6' => array ( 'name' => '? Rekomendacja Hive', 'elements'=> array ( 'multiText' => array( 'type' => 'textMultiList', 'label' => 'Na podstawie otrzymanych informacji, zalecam Wam / Tobie ubezpieczenie', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationHiveData($documentData)[1] ), 'multiText2' => array( 'type' => 'textMultiList', 'label' => 'Opis ubezpieczyciela', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationHiveData($documentData)[3] ), ), ), ); $this->groups = array_merge($this->groups, $hive); } // dla Whole of Life if ($type == 'WOL') { $wol = array ( 'common7' => array ( 'name' => '? Rekomendacja Whole of Life', 'elements'=> array ( 'multiText' => array( 'type' => 'textMultiList', 'label' => 'Na podstawie otrzymanych informacji, zalecam Wam / Tobie ubezpieczenie', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationWOL($documentData)[1] ), 'multiText1' => array( 'type' => 'textMultiList', 'label' => 'Dodatkowo omówiono i zaproponowano następujące cechy i elementy:', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationWOL($documentData)[2] ), 'multiText2' => array( 'type' => 'textMultiList', 'label' => 'Opis Ubezpieczyciela', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationWOL($documentData)[3] ), ), ), ); $this->groups = array_merge($this->groups, $wol); } // // dla MCPC if ($type == 'MulClaProCov') { $mcpc = array ( 'common8' => array ( 'name' => '? Rekomendacja Multi-claim', 'elements'=> array ( 'multiText' => array( 'type' => 'textMultiList', 'label' => 'Na podstawie otrzymanych informacji, zalecam Wam / Tobie ubezpieczenie', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationMCPC($documentData)[1] ), 'multiText1' => array( 'type' => 'textMultiList', 'label' => 'Dodatkowo omówiono i zaproponowano następujące cechy i elementy', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationMCPC($documentData)[2] ), 'multiText2' => array( 'type' => 'textMultiList', 'label' => 'Opis Ubezpieczyciela', 'optional' => true, // false -> bez checkbox 'partitions' => $this->getRecomendationMCPC($documentData)[3] ), ), ), ); $this->groups = array_merge($this->groups, $mpc); } } } } public function getGroups() { return $this->groups; } edit poprawka literówek :0 Ten post edytował gino 8.04.2021, 13:45:25 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 21:20 |