diff --git a/htdocs/telephonie/telephonie.contrat.class.php b/htdocs/telephonie/telephonie.contrat.class.php index 248c78636d0..6727af3e55a 100644 --- a/htdocs/telephonie/telephonie.contrat.class.php +++ b/htdocs/telephonie/telephonie.contrat.class.php @@ -281,6 +281,46 @@ class TelephonieContrat { $this->db->query($sql); } + /* + * + * + * + */ + function load_previous_next_id($filtre='') + { + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."telephonie_contrat"; + $sql.= " WHERE rowid > ".$this->id.""; + $sql .= " ORDER BY rowid ASC LIMIT 1"; + + $resql = $this->db->query($sql) ; + if ($resql) + { + while ($row = $this->db->fetch_row($resql)) + { + $this->ref_next = $row[0]; + } + } + + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."telephonie_contrat"; + $sql.= " WHERE rowid < ".$this->id.""; + $sql .= " ORDER BY rowid DESC LIMIT 1"; + + $resql = $this->db->query($sql) ; + if ($resql) + { + while ($row = $this->db->fetch_row($resql)) + { + $this->ref_previous = $row[0]; + } + } + + + + + return 1; + } /* * *