From 7d564efbccc4b361d2fa2db2902fb35882304aae Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 20 Dec 2022 03:31:33 +0100 Subject: recherche de clients --- src/main.php | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/main.php') 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 require('view/zenity_setup.php'); // texte dans les fenêtres ET instanciation (un objet = une commande) require('Latex.php'); // générer le code LaTeX -/* SYNTAXE BDD */ -// chaînage de méthodes -//~ $Client->setPrenom_nom('Jean Némar')->setAdresse('10, rue des douves')->setCode_client('464653476')->setCommentaires('un peu chiant'); -//~ $Client->create(); - -// tableau en entrée -//~ $input = ['prenom_nom' => 'Eva Casquer', 'adresse' => "2, place d'Écosse", 'code_client' => '958465875', 'commentaires' => 'bonne vache à lait']; -//~ $Client->hydrate($input); -//~ $Client->create(); - -//~ $input = ['prenom_nom' => 'Eva Paparla', 'commentaires' => 'grosse nunuche']; -//~ $Client->hydrate($input); -//~ $Client->update(2); - -//~ $Client->delete(3); - // boucle principale $boucle = true; @@ -78,15 +62,18 @@ while($boucle) echo "debug: recherche souhaitée\n"; // niveau 3: saisie du nom du client - $client_saisie = exec($RechercheClient->get()); - if($client_saisie !== '') + $nom_client = exec($RechercheClient->get()); + if($nom_client !== '') { echo "debug: recherche effectuée\n"; - - $ResultatsRechercheClient->setEntries(rechercheClient($client_saisie)); // recherche silencieuse + $ResultatsRechercheClient->setListRows(rechercheClient($nom_client, $Client), $Client->getTable()); // recherche silencieuse + //~ var_dump($ResultatsRechercheClient->get()); die(); + unset($nom_client); // niveau 4: sélection parmi les résultats $choix_niv4 = exec($ResultatsRechercheClient->get()); + $ResultatsRechercheClient->cleanCommand(); + if($choix_niv4 !== '') { echo "debug: client sélectionné\n"; @@ -110,7 +97,7 @@ while($boucle) // niveau 2: on n'a pas cherché OU on n'a pas trouvé if(!$id_client_connu) { - $id_client_connu = enregistrementNouveauClient($Client, $NouveauClient); + $id_client_connu = enregistrementNouveauClient(exec($NouveauClient->get()), $Client); // fenêtre + écriture BDD } // niveau 2: type comptable d'enregistrement: devis, facture, cesu ou pas de prestation -- cgit v1.2.3