From 1cd8abc9c2236fc4038e678f4eb3a86c83bc26db Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 29 Mar 2007 14:35:01 +0000 Subject: [PATCH] Ajout fonction de configuration par l'interface --- htdocs/telephonie/telephonie.tarif.class.php | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/htdocs/telephonie/telephonie.tarif.class.php b/htdocs/telephonie/telephonie.tarif.class.php index 9355f5a04d4..dfdcba782d0 100644 --- a/htdocs/telephonie/telephonie.tarif.class.php +++ b/htdocs/telephonie/telephonie.tarif.class.php @@ -69,6 +69,58 @@ class TelephonieTarif { } + function CreateTarif($name, $type) + { + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_tarif"; + $sql .= "(libelle, type)"; + $sql .= " VALUES ('".$name."','".$type."');"; + + if ( $this->db->query($sql) ) + { + + } + else + { + dolibarr_syslog($this->db->error()); + } + + return $result; + } + + /* + * + * + */ + function Fetch($id) + { + $this->id = 0; + + $sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."telephonie_tarif"; + $sql .= " WHERE rowid = '".$id."';"; + + $resql = $this->db->query($sql); + + if ( $resql ) + { + if ($row = $this->db->fetch_row($resql) ) + { + $this->id = $row[0]; + $this->libelle = stripslashes($row[1]); + } + $this->db->free($resql); + + return 0; + } + else + { + return -1; + } + } + /* + * + * + */ function _load_tarif($fournisseur_id, $type) {