From 537599eab12656e8d1ec40b085b687714483f4fc Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 27 Nov 2022 16:26:54 +0100 Subject: =?UTF-8?q?r=C3=A9organisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/main.php | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100755 php/main.php (limited to 'php') diff --git a/php/main.php b/php/main.php new file mode 100755 index 0000000..934f718 --- /dev/null +++ b/php/main.php @@ -0,0 +1,193 @@ +#!/bin/php +get()); + + // enregistrement + if($choix_niv1 == 'Nouvelle prestation') + { + // est ce que le client est déjà dans la base? + if(exec($QuestionNouveauClient->get()) == 0) // $? = 0 signifie oui + { + // saisie du nom du client et recherche + $client_saisie = exec($RechercheClient->get()); + + // sélection parmi les résultats + $ResultatsRechercheClient->set_entries(recherche_client($client_saisie)); + $choix_niv2 = exec($ResultatsRechercheClient->get()); + if($choix_niv2 != '') + { + echo "client trouvé\n"; + } + else // chaîne vide + { + echo "client pas trouvé\n"; + exec($NouveauClient->get()); + + // enregistrement dans la BDD + + } + + // récupération des infos dans la BDD + + } + else + { + echo "nouveau client\n"; + exec($NouveauClient->get()); + + // enregistrement dans la BDD + + } + + // infos sur la prestation + $choix_niv2 = exec($MenuEnregistrement->get()); + $continuer = true; + if($choix_niv2 == "Devis") + { + $type = 'DEVIS'; + } + elseif($choix_niv2 == "Facture") + { + $type = 'FACTURE'; + } + elseif($choix_niv2 == "CESU") + { + $type = 'CESU'; + } + elseif($choix_niv2 == "Pas de prestation") + { + $type = ''; + } + else + { + $continuer = false; // retour menu principal + } + + if($continuer) + { + exec($Calendrier->get()); + exec($FormulairePrestation->get()); + // enregistrement date et prestation en BDD + exec($CommentairePrestation->get()); + // enregistrement commentaire en BDD + } + } + + elseif($choix_niv1 == 'Fichier clients') + { + // quel affichage? un grand tableau avec zenity? une page web? un document LaTeX? + } + + // documents à imprimer + elseif($choix_niv1 == 'Créer/imprimer un document') + { + $choix_niv2 = exec($MenuDocuments->get()); + if($choix_niv2 == 'Devis') + { + + } + elseif($choix_niv2 == 'Facture') + { + + } + elseif($choix_niv2 == 'Lettre avec adresse') + { + + } + elseif($choix_niv2 == 'Livre des recettes') + { + + } + elseif($choix_niv2 == "Registre des achats") + { + + } + elseif($choix_niv2 == "Bilan annuel") + { + + } + else + { + // retour menu principal + } + } + + // Supports de communication + elseif($choix_niv1 == 'Communication') + { + $choix_niv2 = exec($MenuCommunication->get()); + if($choix_niv2 == 'Flyer (nécessite gimp)') + { + exec(window_app_command('gimp', $flyer)); + } + elseif($choix_niv2 == 'Carte de visite (nécessite scribus)') + { + exec(window_app_command('scribus', $business_card)); + } + elseif($choix_niv2 == 'Explorateur de fichiers') + { + exec(window_app_command($file_explorer, $pub)); + } + else + { + // retour menu principal + } + } + + // BDD + elseif($choix_niv1 == 'Base de données') + { + if($sqlitebrowser_enable) + { + exec(window_app_command('sqlitebrowser', $db_place)); + } + else + { + exec($x_term_command . ' ' . $sqlite_cli . ' ' . $db_place); // correpond à priori à: xterm -e sqlite3 ~/ORDIPOLO/Appli_PHP/ordipolo.sqlite + } + } + else + { + $boucle = false; // byebye + } +} + +// sauvegarder la base de données -- cgit v1.2.3