diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /src/sections/1_customer.php | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'src/sections/1_customer.php')
| -rw-r--r-- | src/sections/1_customer.php | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/sections/1_customer.php b/src/sections/1_customer.php index b0e3283..db5c448 100644 --- a/src/sections/1_customer.php +++ b/src/sections/1_customer.php | |||
| @@ -3,42 +3,46 @@ | |||
| 3 | // | 3 | // |
| 4 | // -- SECTION 1: Fichier clients et propects -- | 4 | // -- SECTION 1: Fichier clients et propects -- |
| 5 | 5 | ||
| 6 | use Doctrine\ORM\EntityManager; | ||
| 7 | |||
| 6 | function newCustomer(): array | 8 | function newCustomer(): array |
| 7 | { | 9 | { |
| 8 | // fenêtres | 10 | // fenêtres |
| 9 | $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); | 11 | //$TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); |
| 12 | $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client['text'], ZenitySetup::$nouveau_client['entrees']); | ||
| 10 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); | 13 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); |
| 11 | 14 | ||
| 15 | $Customer = new Client; | ||
| 16 | |||
| 12 | // -- partie 1: client ou prospect? -- | 17 | // -- partie 1: client ou prospect? -- |
| 13 | $Client = new Clients; | 18 | //~ $choix_niv2 = exec($TypeDeClient->get()); |
| 14 | $choix_niv2 = exec($TypeDeClient->get()); | 19 | //~ if($choix_niv2 === ZenitySetup::$type_client['entrees'][0]) |
| 15 | if($choix_niv2 === ZenitySetup::$type_client['entrees'][0]) | 20 | //~ { |
| 16 | { | 21 | //~ echo "choix: " . $choix_niv2 . "\n"; |
| 17 | echo "choix: " . $choix_niv2 . "\n"; | 22 | //~ $Customer->setType('client'); |
| 18 | $Client->setType('client'); | 23 | //~ } |
| 19 | } | 24 | //~ elseif($choix_niv2 === ZenitySetup::$type_client['entrees'][1]) |
| 20 | elseif($choix_niv2 === ZenitySetup::$type_client['entrees'][1]) | 25 | //~ { |
| 21 | { | 26 | //~ echo "choix: " . $choix_niv2 . "\n"; |
| 22 | echo "choix: " . $choix_niv2 . "\n"; | 27 | //~ $Customer->setType('prospect'); |
| 23 | $Client->setType('prospect'); | 28 | //~ } |
| 24 | } | 29 | //~ else |
| 25 | else | 30 | //~ { |
| 26 | { | 31 | //~ return [0, null]; // menu principal |
| 27 | return [0, null]; // menu principal | 32 | //~ } |
| 28 | } | ||
| 29 | 33 | ||
| 30 | // -- partie 2: saisie des infos -- | 34 | // -- partie 2: saisie des infos -- |
| 31 | if(enterCustomer($Client)) | 35 | if($Customer->enterCustomer($NouveauClient)) |
| 32 | { | 36 | { |
| 33 | // -- partie 3: on fait quoi maintenant -- | 37 | // -- partie 3: on fait quoi maintenant -- |
| 34 | $choix_niv3 = exec($FinSection1->get()); | 38 | $choix_niv3 = exec($FinSection1->get()); |
| 35 | if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]) | 39 | if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0]) |
| 36 | { | 40 | { |
| 37 | return [2, $Client]; // section 2: newService() | 41 | return [2, $Customer]; // section 2: newService() |
| 38 | } | 42 | } |
| 39 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]) | 43 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1]) |
| 40 | { | 44 | { |
| 41 | return [3, $Client]; // section 3: modifyData() | 45 | return [3, $Customer]; // section 3: modifyData() |
| 42 | } | 46 | } |
| 43 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]) | 47 | elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2]) |
| 44 | { | 48 | { |
