From 9b86524638c6fa0c0fb101c01a1443ad5f5a0e8b Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 3 Aug 2003 17:00:34 +0000 Subject: [PATCH] Ajout contact_array() --- htdocs/societe.class.php3 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index ab8e7b977f9..d6939db59d9 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -287,6 +287,39 @@ class Societe { * * */ + Function contact_array() + { + $contacts = array(); + + $sql = "SELECT idp, name, firstname FROM llx_socpeople WHERE fk_soc = $this->id"; + + if ($this->db->query($sql) ) + { + $nump = $this->db->num_rows(); + + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($i); + + $contacts[$obj->idp] = "$obj->firstname $obj->name"; + $i++; + } + } + return $contacts; + } + else + { + print $this->db->error(); + } + + } + /* + * + * + */ Function contact_get_email($rowid) {