1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
class Contact
{
public $id_contact = null;
public $nom = null;
public $prenom = null;
public $societe = null;
public $adresse = null;
public $complement = null;
public $cp = null;
public $ville = null;
public $tel_bureau = null;
public $portable = null;
public $tel_domicile = null;
public $tel_autre = null;
public $fax_domicile = null;
public $fax_bureau = null;
public $email = null;
public $note = null;
public $nomaffiche = null;
public $_explicitType = 'ContactVO';
}
public function getContacts()
{
$sql= "SELECT
".$this->table.".id_contact,
".$this->table.".nom,
".$this->table.".prenom,
".$this->table.".societe,
".$this->table.".adresse,
".$this->table.".complement,
".$this->table.".cp,
".$this->table.".ville,
".$this->table.".tel_bureau,
".$this->table.".portable,
".$this->table.".tel_domicile,
".$this->table.".tel_autre,
".$this->table.".fax_domicile,
".$this->table.".fax_bureau,
".$this->table.".email,
".$this->table.".note,
".$this->table.".categorie,
".$this->table.".nomaffiche
FROM ".$this->table;
//echo $sql;
$stmt = mysqli_prepare($this->connection, $sql);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
mysqli_stmt_bind_result($stmt,
$row->id_contact, $row->nom,
$row->prenom, $row->societe, $row->adresse,
$row->complement, $row->cp, $row->ville,
$row->tel_bureau, $row->portable, $row->tel_domicile, $row->tel_autre,
$row->fax_domicile, $row->fax_bureau, $row->email,
$row->note, $row->categorie, $row->nomaffiche
);
while (mysqli_stmt_fetch($stmt))
{
$rows[] = $row;
$row = new Contact();
mysqli_stmt_bind_result($stmt,
$row->id_contact, $row->nom,
$row->prenom, $row->societe, $row->adresse,
$row->complement, $row->cp, $row->ville,
$row->tel_bureau, $row->portable, $row->tel_domicile, $row->tel_autre,
$row->fax_domicile, $row->fax_bureau, $row->email,
$row->note, $row->categorie, $row->nomaffiche
);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $rows;
} |
Partager