Normalisation du code
This commit is contained in:
parent
2ff6410b24
commit
3dd458c519
@ -351,11 +351,12 @@ class Contact
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||||
$sql .= " WHERE c.idp = ". $id;
|
$sql .= " WHERE c.idp = ". $id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows())
|
if ($this->db->num_rows($resql))
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object();
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->id = $obj->idp;
|
$this->id = $obj->idp;
|
||||||
$this->civilite_id = $obj->civilite_id;
|
$this->civilite_id = $obj->civilite_id;
|
||||||
@ -389,22 +390,23 @@ class Contact
|
|||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT u.rowid ";
|
$sql = "SELECT u.rowid ";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.fk_socpeople = ". $id;
|
$sql .= " WHERE u.fk_socpeople = ". $id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows())
|
if ($this->db->num_rows($resql))
|
||||||
{
|
{
|
||||||
$uobj = $this->db->fetch_object();
|
$uobj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->user_id = $uobj->rowid;
|
$this->user_id = $uobj->rowid;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -418,9 +420,10 @@ class Contact
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."contact_facture";
|
$sql .= " FROM ".MAIN_DB_PREFIX."contact_facture";
|
||||||
$sql .= " WHERE fk_contact = ". $id;
|
$sql .= " WHERE fk_contact = ". $id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows())
|
if ($this->db->num_rows($resql))
|
||||||
{
|
{
|
||||||
$this->facturation = 1;
|
$this->facturation = 1;
|
||||||
}
|
}
|
||||||
@ -428,7 +431,7 @@ class Contact
|
|||||||
{
|
{
|
||||||
$this->facturation = 0;
|
$this->facturation = 0;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -443,15 +446,16 @@ class Contact
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_alert";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user_alert";
|
||||||
$sql .= " WHERE fk_user = $user->id AND fk_contact = ".$id;
|
$sql .= " WHERE fk_user = $user->id AND fk_contact = ".$id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows())
|
if ($this->db->num_rows($resql))
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object();
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->birthday_alert = 1;
|
$this->birthday_alert = 1;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user