summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2023-12-23 15:34:55 +0100
committerpolo <ordipolo@gmx.fr>2023-12-23 15:34:55 +0100
commitecb77199a60c8d924e02da7d9afab1c9f026a525 (patch)
tree23ea5f65b03a3a7d6c326a62848545b4892d6ef3
parenta4d88fd1913758cc95b395eefcf5e9d730450382 (diff)
downloadAppliGestionPHP-ecb77199a60c8d924e02da7d9afab1c9f026a525.zip
modification de prestation moins dangereuse grâce à shell_exec()
-rw-r--r--data/dev.sqlitebin36864 -> 36864 bytes
-rw-r--r--src/functions.php2
-rw-r--r--src/sections/1_customer.php1
-rw-r--r--src/sections/3-1_windows.php20
-rw-r--r--src/sections/3_modify_data.php3
-rw-r--r--src/view/ZenitySetup.php10
-rw-r--r--structure base de données.odsbin26353 -> 0 bytes
7 files changed, 19 insertions, 17 deletions
diff --git a/data/dev.sqlite b/data/dev.sqlite
index b4f0774..1be9645 100644
--- a/data/dev.sqlite
+++ b/data/dev.sqlite
Binary files differ
diff --git a/src/functions.php b/src/functions.php
index 9bb59d6..e7c2e5b 100644
--- a/src/functions.php
+++ b/src/functions.php
@@ -24,7 +24,7 @@ function windowAppCommand(string $app, string $path = ''): string
24function enterCustomer($Client): bool 24function enterCustomer($Client): bool
25{ 25{
26 // fenêtre 26 // fenêtre
27 $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client_text, ZenitySetup::$nouveau_client_entrees); 27 $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client['text'], ZenitySetup::$nouveau_client['entrees']);
28 28
29 $input = exec($NouveauClient->get()); 29 $input = exec($NouveauClient->get());
30 if($input == '') 30 if($input == '')
diff --git a/src/sections/1_customer.php b/src/sections/1_customer.php
index ae8067f..b0e3283 100644
--- a/src/sections/1_customer.php
+++ b/src/sections/1_customer.php
@@ -7,7 +7,6 @@ function newCustomer(): array
7{ 7{
8 // fenêtres 8 // fenêtres
9 $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); 9 $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']);
10 //~ $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client_text, ZenitySetup::$nouveau_client_entrees);
11 $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); 10 $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']);
12 11
13 // -- partie 1: client ou prospect? -- 12 // -- partie 1: client ou prospect? --
diff --git a/src/sections/3-1_windows.php b/src/sections/3-1_windows.php
index 7e7367b..31c6cee 100644
--- a/src/sections/3-1_windows.php
+++ b/src/sections/3-1_windows.php
@@ -5,7 +5,9 @@
5 5
6function makeModifyCustomerWindow(Clients $Customer): ZenityList 6function makeModifyCustomerWindow(Clients $Customer): ZenityList
7{ 7{
8 // fenêtre
8 $ModifyCustomer = new ZenityList(ZenitySetup::$modification_client['text'], []); 9 $ModifyCustomer = new ZenityList(ZenitySetup::$modification_client['text'], []);
10
9 $entries = []; 11 $entries = [];
10 $i = 0; 12 $i = 0;
11 $client_data = $Customer->getAllWithWindowFields(); 13 $client_data = $Customer->getAllWithWindowFields();
@@ -18,7 +20,6 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList
18 } 20 }
19 $entries[$i][] = ZenitySetup::$modification_client['service']; 21 $entries[$i][] = ZenitySetup::$modification_client['service'];
20 $entries[$i][] = ''; 22 $entries[$i][] = '';
21 //~ $i++;
22 //~ $entries[$i][] = ZenitySetup::$modification_client['return']; 23 //~ $entries[$i][] = ZenitySetup::$modification_client['return'];
23 //~ $entries[$i][] = ''; 24 //~ $entries[$i][] = '';
24 $ModifyCustomer->setListRows($entries, 2, 2.5); 25 $ModifyCustomer->setListRows($entries, 2, 2.5);
@@ -28,10 +29,11 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList
28 29
29function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): ZenityList 30function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): ZenityList
30{ 31{
32 // fenêtre
31 $ModifyService = new ZenityList(ZenitySetup::$modification_presta['text'], []); 33 $ModifyService = new ZenityList(ZenitySetup::$modification_presta['text'], []);
34
32 $entrees = []; 35 $entrees = [];
33 $i = 0; 36 $i = 0;
34
35 $presta_data = $Service->getAllWithWindowFields(); 37 $presta_data = $Service->getAllWithWindowFields();
36 //var_dump($presta_data); 38 //var_dump($presta_data);
37 foreach($presta_data as $key => $value) 39 foreach($presta_data as $key => $value)
@@ -53,18 +55,18 @@ function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null):
53 } 55 }
54 } 56 }
55 57
56 if($Service->getTypePresta() === 'devis') 58 //~ if($Service->getTypePresta() === 'devis')
57 { 59 //~ {
58 $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis 60 //~ $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis
59 $entrees[$i][] = ''; 61 //~ $entrees[$i][] = '';
60 //~ $i++; 62 //~ }
61 } 63
62 //~ $entrees[$i][] = ZenitySetup::$modification_presta['service']; 64 //~ $entrees[$i][] = ZenitySetup::$modification_presta['service'];
63 //~ $entrees[$i][] = ''; 65 //~ $entrees[$i][] = '';
64 //~ $i++; 66 //~ $i++;
65 //~ $entrees[$i][] = ZenitySetup::$modification_presta['return']; 67 //~ $entrees[$i][] = ZenitySetup::$modification_presta['return'];
66 //~ $entrees[$i][] = ''; 68 //~ $entrees[$i][] = '';
67 $ModifyService->setListRows($entrees, 2, 2.5);
68 69
70 $ModifyService->setListRows($entrees, 2, 2.5);
69 return $ModifyService; 71 return $ModifyService;
70} 72}
diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php
index 0a67cea..279310b 100644
--- a/src/sections/3_modify_data.php
+++ b/src/sections/3_modify_data.php
@@ -164,8 +164,7 @@ function modifyData($Client): array
164 { 164 {
165 echo "choix: modifier" . $choix_niv3 . "\n"; 165 echo "choix: modifier" . $choix_niv3 . "\n";
166 $ModificationPrestaForm = new ZenityEntry($choix_niv3); 166 $ModificationPrestaForm = new ZenityEntry($choix_niv3);
167 $input = exec($ModificationPrestaForm->get()); 167 $input = shell_exec($ModificationPrestaForm->get()); // shell_exec() retourne null si la commande échoue, exec() retourne la dernière ligne de texte en sortie ou null si aucune commande ne réussit
168 //if(is_string($input) && $input != '')
169 if(is_string($input)) // chaine vide autorisée 168 if(is_string($input)) // chaine vide autorisée
170 { 169 {
171 // mettre à jour la base de données 170 // mettre à jour la base de données
diff --git a/src/view/ZenitySetup.php b/src/view/ZenitySetup.php
index a876c04..88621bf 100644
--- a/src/view/ZenitySetup.php
+++ b/src/view/ZenitySetup.php
@@ -25,8 +25,10 @@ class ZenitySetup
25 static public $recherche_client_text = "Recherche d'un client avec son nom ou son code client"; 25 static public $recherche_client_text = "Recherche d'un client avec son nom ou son code client";
26 static public $resultats_recherche_client_text = "Résultats de la recherche, sélectionner un client"; 26 static public $resultats_recherche_client_text = "Résultats de la recherche, sélectionner un client";
27 static public $resultats_recherche_presta_text = "Sélectionner une prestation"; 27 static public $resultats_recherche_presta_text = "Sélectionner une prestation";
28 static public $nouveau_client_text = "Nouveau client"; 28 static public $nouveau_client = ['text' => "Nouveau client",
29 static public $nouveau_client_entrees = ["Prénom Nom:", "Code client (J.C.Dusse):", "Adresse:", "Code postal:", "Ville:", "Telephone:", "Courriel:", "À propos:"]; 29 'entrees' => ["Prénom Nom:", "Code client (J.C.Dusse):", "Adresse:", "Code postal:", "Ville:", "Telephone:", "Courriel:", "À propos:"]];
30 //~ static public $nouveau_client_text = "Nouveau client";
31 //~ static public $nouveau_client_entrees = ["Prénom Nom:", "Code client (J.C.Dusse):", "Adresse:", "Code postal:", "Ville:", "Telephone:", "Courriel:", "À propos:"];
30 static public $calendar = ['section2' => 'Nouvelle prestation étape 1/3 - Choisir une date', 32 static public $calendar = ['section2' => 'Nouvelle prestation étape 1/3 - Choisir une date',
31 'section3' => 'Choisir une nouvelle date']; 33 'section3' => 'Choisir une nouvelle date'];
32 static public $formulaire = ['text' => 'Nouvelle prestation 2/3 - Détail des travaux', 34 static public $formulaire = ['text' => 'Nouvelle prestation 2/3 - Détail des travaux',
@@ -39,8 +41,8 @@ class ZenitySetup
39 static public $modification_client = ['text' => 'Modifier une information concernant un client', 41 static public $modification_client = ['text' => 'Modifier une information concernant un client',
40 'service' => "Modifier une prestation"]; 42 'service' => "Modifier une prestation"];
41 //'return' => "Retour menu principal"]; 43 //'return' => "Retour menu principal"];
42 static public $modification_presta = ['text' => 'Modifier une prestation', 44 static public $modification_presta = ['text' => 'Modifier une prestation'];
43 'devis_facture' => "Créer une facture à partir d'un devis"]; 45 //'devis_facture' => "Créer une facture à partir d'un devis"];
44 //'service' => "Modifier une autre prestation", 46 //'service' => "Modifier une autre prestation",
45 //'return' => "Retour menu précédent"]; 47 //'return' => "Retour menu précédent"];
46 48
diff --git a/structure base de données.ods b/structure base de données.ods
deleted file mode 100644
index c050af8..0000000
--- a/structure base de données.ods
+++ /dev/null
Binary files differ