diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-09 17:45:25 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-09 17:45:25 +0200 |
| commit | 084264d336fa9156e1b26196d3936eb3cf2c9782 (patch) | |
| tree | 11f177504172de9e75184fa4f61c01d4cf85be1c /src/sections/1_customer.php | |
| parent | f2f5560339203baad7951006c5a63d10f237ee6a (diff) | |
| download | AppliGestionPHP-084264d336fa9156e1b26196d3936eb3cf2c9782.tar.gz AppliGestionPHP-084264d336fa9156e1b26196d3936eb3cf2c9782.tar.bz2 AppliGestionPHP-084264d336fa9156e1b26196d3936eb3cf2c9782.zip | |
Client::controlForm() filtre un client sans nom ou code client, écrire "gratuit" pour un devis gratuit
Diffstat (limited to 'src/sections/1_customer.php')
| -rw-r--r-- | src/sections/1_customer.php | 55 |
1 files changed, 31 insertions, 24 deletions
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 @@ | |||
| 3 | // | 3 | // |
| 4 | // -- SECTION 1: Fichier clients et propects -- | 4 | // -- SECTION 1: Fichier clients et propects -- |
| 5 | 5 | ||
| 6 | use Doctrine\ORM\EntityManager; | ||
| 7 | |||
| 8 | function newCustomer(): array | 6 | function newCustomer(): array |
| 9 | { | 7 | { |
| 10 | // fenêtres | 8 | // fenêtres |
| @@ -13,29 +11,38 @@ function newCustomer(): array | |||
| 13 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); | 11 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); |
| 14 | 12 | ||
| 15 | $Customer = new Client; | 13 | $Customer = new Client; |
| 14 | |||
| 16 | 15 | ||
| 17 | // -- partie 2: saisie des infos -- | 16 | // -- partie 2: saisie des infos -- |
| 18 | if($Customer->enterCustomer($NouveauClient)) | 17 | $input = exec($NouveauClient->get()); |
| 19 | { | 18 | |
| 20 | // -- partie 3: on fait quoi maintenant -- | 19 | // annulation |
| 21 | $choix_niv3 = exec($FinSection1->get()); | 20 | if($input == ''){ |
| 22 | if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]) | 21 | echo "debug: annulation lors de l'enregistrement d'un nouveau client\n"; |
| 23 | { | 22 | return [0, null]; // menu principal |
| 24 | return [2, $Customer]; // section 2: newService() | 23 | } |
| 25 | } | 24 | |
| 26 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]) | 25 | $input = Client::controlForm($input); |
| 27 | { | 26 | |
| 28 | return [3, $Customer]; // section 3: modifyData() | 27 | // vide |
| 29 | } | 28 | if(!$input){ |
| 30 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]) | 29 | return [1, null]; // relancer section 1: newCustomer() |
| 31 | { | 30 | } |
| 32 | return [1, null]; // relancer section 1: newCustomer() | 31 | $Customer->enterCustomer($input); |
| 33 | } | 32 | |
| 34 | else | 33 | |
| 35 | { | 34 | // -- partie 3: on fait quoi maintenant -- |
| 36 | return [0, null]; // menu principal | 35 | $choix_niv3 = exec($FinSection1->get()); |
| 37 | } | 36 | if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]){ |
| 37 | return [2, $Customer]; // section 2: newService() | ||
| 38 | } | ||
| 39 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]){ | ||
| 40 | return [3, $Customer]; // section 3: modifyData() | ||
| 41 | } | ||
| 42 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]){ | ||
| 43 | return [1, null]; // relancer section 1: newCustomer() | ||
| 44 | } | ||
| 45 | else{ | ||
| 46 | return [0, null]; // menu principal | ||
| 38 | } | 47 | } |
| 39 | |||
| 40 | return [0, null]; // menu principal | ||
| 41 | } | 48 | } |
