From a4d88fd1913758cc95b395eefcf5e9d730450382 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 23 Dec 2023 10:00:24 +0100 Subject: =?UTF-8?q?devis=20payant,=20cr=C3=A9er=20devis=20depuis=20facture?= =?UTF-8?q?,=20changement=20dans=20getIDsByIdClient(),=20suppression=20d?= =?UTF-8?q?=C3=A9pendance=20paquet=20latex=20"ulem",=20(string)=20dans=20s?= =?UTF-8?q?etTelephone()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/Prestations.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/model/Prestations.php') diff --git a/src/model/Prestations.php b/src/model/Prestations.php index 54ad4b7..8591e83 100644 --- a/src/model/Prestations.php +++ b/src/model/Prestations.php @@ -28,13 +28,19 @@ class Prestations extends Model { return $this->ID_client; } - public function getIDsByIdClient() // obtenir une entrée avec son ID_client + public function getIDsByIdClient() // obtenir une entrée avec son ID_client, comportement différent si le type est connu { - $IDs = $this->execQuery('SELECT id FROM ' . $this->table . ' WHERE id_client = ' . $this->ID_client)->fetchAll(); - // changer le tableau de tableaux en tableau simple - for($i = 0; $i < count($IDs); $i++) + $sql = 'SELECT id FROM ' . $this->table . ' WHERE id_client = ' . $this->ID_client; + if($this->type_presta != '') { - $IDs[$i] = $IDs[$i]['ID']; + $sql .= " AND type_presta = '" . $this->type_presta . "'"; + } + $data = $this->execQuery($sql)->fetchAll(); // tableau de tableaux + + $IDs = []; // si $IDs reste vide, ne pas être de type NULL + for($i = 0; $i < count($data); $i++) + { + $IDs[$i] = $data[$i]['ID']; // tableau simple } return($IDs); } @@ -152,7 +158,7 @@ class Prestations extends Model } } -class CodePresta extends Prestations -{ - protected $numero_presta; -} +//~ class CodePresta extends Prestations +//~ { + //~ protected $numero_presta; +//~ } -- cgit v1.2.3