summaryrefslogtreecommitdiff
path: root/src/main.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-12-20 03:31:33 +0100
committerpolo <ordipolo@gmx.fr>2022-12-20 03:31:33 +0100
commit7d564efbccc4b361d2fa2db2902fb35882304aae (patch)
treeefc28d94a1387f918c84201318880d74a52adf84 /src/main.php
parentdedbe2f5cee33431c1299c7f0dbef4e247dc2447 (diff)
downloadAppliGestionPHP-7d564efbccc4b361d2fa2db2902fb35882304aae.zip
recherche de clients
Diffstat (limited to 'src/main.php')
-rwxr-xr-xsrc/main.php29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/main.php b/src/main.php
index eacd3b3..3c9c4aa 100755
--- a/src/main.php
+++ b/src/main.php
@@ -42,22 +42,6 @@ require('view/Zenity.php'); // commande système zenity
42require('view/zenity_setup.php'); // texte dans les fenêtres ET instanciation (un objet = une commande) 42require('view/zenity_setup.php'); // texte dans les fenêtres ET instanciation (un objet = une commande)
43require('Latex.php'); // générer le code LaTeX 43require('Latex.php'); // générer le code LaTeX
44 44
45/* SYNTAXE BDD */
46// chaînage de méthodes
47//~ $Client->setPrenom_nom('Jean Némar')->setAdresse('10, rue des douves')->setCode_client('464653476')->setCommentaires('un peu chiant');
48//~ $Client->create();
49
50// tableau en entrée
51//~ $input = ['prenom_nom' => 'Eva Casquer', 'adresse' => "2, place d'Écosse", 'code_client' => '958465875', 'commentaires' => 'bonne vache à lait'];
52//~ $Client->hydrate($input);
53//~ $Client->create();
54
55//~ $input = ['prenom_nom' => 'Eva Paparla', 'commentaires' => 'grosse nunuche'];
56//~ $Client->hydrate($input);
57//~ $Client->update(2);
58
59//~ $Client->delete(3);
60
61 45
62// boucle principale 46// boucle principale
63$boucle = true; 47$boucle = true;
@@ -78,15 +62,18 @@ while($boucle)
78 echo "debug: recherche souhaitée\n"; 62 echo "debug: recherche souhaitée\n";
79 63
80 // niveau 3: saisie du nom du client 64 // niveau 3: saisie du nom du client
81 $client_saisie = exec($RechercheClient->get()); 65 $nom_client = exec($RechercheClient->get());
82 if($client_saisie !== '') 66 if($nom_client !== '')
83 { 67 {
84 echo "debug: recherche effectuée\n"; 68 echo "debug: recherche effectuée\n";
85 69 $ResultatsRechercheClient->setListRows(rechercheClient($nom_client, $Client), $Client->getTable()); // recherche silencieuse
86 $ResultatsRechercheClient->setEntries(rechercheClient($client_saisie)); // recherche silencieuse 70 //~ var_dump($ResultatsRechercheClient->get()); die();
71 unset($nom_client);
87 72
88 // niveau 4: sélection parmi les résultats 73 // niveau 4: sélection parmi les résultats
89 $choix_niv4 = exec($ResultatsRechercheClient->get()); 74 $choix_niv4 = exec($ResultatsRechercheClient->get());
75 $ResultatsRechercheClient->cleanCommand();
76
90 if($choix_niv4 !== '') 77 if($choix_niv4 !== '')
91 { 78 {
92 echo "debug: client sélectionné\n"; 79 echo "debug: client sélectionné\n";
@@ -110,7 +97,7 @@ while($boucle)
110 // niveau 2: on n'a pas cherché OU on n'a pas trouvé 97 // niveau 2: on n'a pas cherché OU on n'a pas trouvé
111 if(!$id_client_connu) 98 if(!$id_client_connu)
112 { 99 {
113 $id_client_connu = enregistrementNouveauClient($Client, $NouveauClient); 100 $id_client_connu = enregistrementNouveauClient(exec($NouveauClient->get()), $Client); // fenêtre + écriture BDD
114 } 101 }
115 102
116 // niveau 2: type comptable d'enregistrement: devis, facture, cesu ou pas de prestation 103 // niveau 2: type comptable d'enregistrement: devis, facture, cesu ou pas de prestation