From 084264d336fa9156e1b26196d3936eb3cf2c9782 Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 9 Oct 2026 17:45:25 +0200 Subject: =?UTF-8?q?Client::controlForm()=20filtre=20un=20client=20sans=20n?= =?UTF-8?q?om=20ou=20code=20client,=20=C3=A9crire=20"gratuit"=20pour=20un?= =?UTF-8?q?=20devis=20gratuit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sections/1_customer.php | 55 +++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'src/sections') diff --git a/src/sections/1_customer.php b/src/sections/1_customer.php index d282af2..d0d49ff 100644 --- a/src/sections/1_customer.php +++ b/src/sections/1_customer.php @@ -3,8 +3,6 @@ // // -- SECTION 1: Fichier clients et propects -- -use Doctrine\ORM\EntityManager; - function newCustomer(): array { // fenĂȘtres @@ -13,29 +11,38 @@ function newCustomer(): array $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); $Customer = new Client; + // -- partie 2: saisie des infos -- - if($Customer->enterCustomer($NouveauClient)) - { - // -- partie 3: on fait quoi maintenant -- - $choix_niv3 = exec($FinSection1->get()); - if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]) - { - return [2, $Customer]; // section 2: newService() - } - elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]) - { - return [3, $Customer]; // section 3: modifyData() - } - elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]) - { - return [1, null]; // relancer section 1: newCustomer() - } - else - { - return [0, null]; // menu principal - } + $input = exec($NouveauClient->get()); + + // annulation + if($input == ''){ + echo "debug: annulation lors de l'enregistrement d'un nouveau client\n"; + return [0, null]; // menu principal + } + + $input = Client::controlForm($input); + + // vide + if(!$input){ + return [1, null]; // relancer section 1: newCustomer() + } + $Customer->enterCustomer($input); + + + // -- partie 3: on fait quoi maintenant -- + $choix_niv3 = exec($FinSection1->get()); + if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]){ + return [2, $Customer]; // section 2: newService() + } + elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]){ + return [3, $Customer]; // section 3: modifyData() + } + elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]){ + return [1, null]; // relancer section 1: newCustomer() + } + else{ + return [0, null]; // menu principal } - - return [0, null]; // menu principal } -- cgit v1.2.3