Ajout fonction load_previous_next_id

This commit is contained in:
Rodolphe Quiedeville 2005-12-12 14:26:05 +00:00
parent 7c9972341f
commit b4fb110b45

View File

@ -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;
}
/*
*
*