Ajout fonction CountContrats

This commit is contained in:
Rodolphe Quiedeville 2007-07-12 09:44:07 +00:00
parent 8a3e146d23
commit bfd158b2f4

View File

@ -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