From bfd158b2f4772008372eeed29906fc4669d56699 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 12 Jul 2007 09:44:07 +0000 Subject: [PATCH] Ajout fonction CountContrats --- .../telephonie.tarif.grille.class.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/telephonie/telephonie.tarif.grille.class.php b/htdocs/telephonie/telephonie.tarif.grille.class.php index 807d3f2620b..ef03d763080 100644 --- a/htdocs/telephonie/telephonie.tarif.grille.class.php +++ b/htdocs/telephonie/telephonie.tarif.grille.class.php @@ -72,6 +72,26 @@ class TelephonieTarifGrille { $this->db->free($resql); } + } + /** + \brief Lecture de l'objet + + */ + function CountContrats() + { + $sql = "SELECT count(grille_tarif)"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat"; + $sql .=" WHERE grille_tarif='".$this->id."';"; + $resql = $this->db->query($sql); + if ($resql) + { + $row = $this->db->fetch_row($resql); + + $this->nb_contrats = $row[0]; + + $this->db->free($resql); + } + } /* \brief Creation d'une nouvelle grille