1438 |
} |
} |
1439 |
} |
} |
1440 |
|
|
1441 |
|
/* |
1442 |
|
* \brief Charge les informations d'ordre info dans l'objet societe |
1443 |
|
* \param id id de la societe a charger |
1444 |
|
*/ |
1445 |
|
function info($id) |
1446 |
|
{ |
1447 |
|
$sql = "SELECT s.idp, s.nom, ".$this->db->pdate("datec")." as datec, ".$this->db->pdate("datea")." as datea,"; |
1448 |
|
$sql.= " fk_user_creat, fk_user_modif"; |
1449 |
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; |
1450 |
|
$sql.= " WHERE s.idp = ".$id; |
1451 |
|
|
1452 |
|
$result=$this->db->query($sql); |
1453 |
|
if ($result) |
1454 |
|
{ |
1455 |
|
if ($this->db->num_rows($result)) |
1456 |
|
{ |
1457 |
|
$obj = $this->db->fetch_object($result); |
1458 |
|
|
1459 |
|
$this->id = $obj->idp; |
1460 |
|
|
1461 |
|
if ($obj->fk_user_creat) { |
1462 |
|
$cuser = new User($this->db, $obj->fk_user_creat); |
1463 |
|
$cuser->fetch(); |
1464 |
|
$this->user_creation = $cuser; |
1465 |
|
} |
1466 |
|
|
1467 |
|
if ($obj->fk_user_modif) { |
1468 |
|
$muser = new User($this->db, $obj->fk_user_modif); |
1469 |
|
$muser->fetch(); |
1470 |
|
$this->user_modification = $muser; |
1471 |
|
} |
1472 |
|
$this->ref = $obj->nom; |
1473 |
|
$this->date_creation = $obj->datec; |
1474 |
|
$this->date_modification = $obj->datea; |
1475 |
|
} |
1476 |
|
|
1477 |
|
$this->db->free($result); |
1478 |
|
|
1479 |
|
} |
1480 |
|
else |
1481 |
|
{ |
1482 |
|
dolibarr_print_error($this->db); |
1483 |
|
} |
1484 |
|
} |
1485 |
|
|
1486 |
} |
} |
1487 |
|
|
1488 |
?> |
?> |