ajout code retour dans fetch
This commit is contained in:
parent
ab1d0aefe6
commit
65daba6e03
@ -129,43 +129,48 @@ class Societe {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function fetch($socid) {
|
Function fetch($socid)
|
||||||
$this->id = $socid;
|
{
|
||||||
|
$this->id = $socid;
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,";
|
$sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,";
|
||||||
|
$sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren, client, fournisseur";
|
||||||
|
$sql .= " FROM llx_societe as s";
|
||||||
|
$sql .= " WHERE s.idp = ".$this->id;
|
||||||
|
|
||||||
$sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren, client, fournisseur";
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
$sql .= " FROM llx_societe as s";
|
if ($result)
|
||||||
$sql .= " WHERE s.idp = ".$this->id;
|
{
|
||||||
|
if ($this->db->num_rows())
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object(0);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$this->nom = stripslashes($obj->nom);
|
||||||
|
$this->adresse = stripslashes($obj->address);
|
||||||
|
$this->cp = $obj->cp;
|
||||||
|
$this->ville = stripslashes($obj->ville);
|
||||||
|
|
||||||
if ($result) {
|
$this->url = $obj->url;
|
||||||
if ($this->db->num_rows()) {
|
$this->tel = $obj->tel;
|
||||||
$obj = $this->db->fetch_object(0);
|
$this->fax = $obj->fax;
|
||||||
|
|
||||||
$this->nom = stripslashes($obj->nom);
|
$this->siren = $obj->siren;
|
||||||
$this->adresse = stripslashes($obj->address);
|
|
||||||
$this->cp = $obj->cp;
|
|
||||||
$this->ville = stripslashes($obj->ville);
|
|
||||||
|
|
||||||
$this->url = $obj->url;
|
$this->client = $obj->client;
|
||||||
$this->tel = $obj->tel;
|
$this->fournisseur = $obj->fournisseur;
|
||||||
$this->fax = $obj->fax;
|
|
||||||
|
|
||||||
$this->siren = $obj->siren;
|
$this->note = $obj->note;
|
||||||
|
|
||||||
$this->client = $obj->client;
|
return 1;
|
||||||
$this->fournisseur = $obj->fournisseur;
|
|
||||||
|
|
||||||
$this->note = $obj->note;
|
}
|
||||||
|
$this->db->free();
|
||||||
}
|
}
|
||||||
$this->db->free();
|
else
|
||||||
} else {
|
{
|
||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user