Use remote var

This commit is contained in:
Michael RICOIS 2016-11-29 15:28:39 +01:00
parent eae820245e
commit 525d25eccc

View File

@ -1,5 +1,4 @@
<?php
define('ARTISANAT_DISPO_WEB', 1);
require_once 'framework/common/curl.php';
class Metier_Partenaires_MArtisanat
@ -29,14 +28,18 @@ class Metier_Partenaires_MArtisanat
public function getIdentite($siren)
{
$data = array();
$siren = $siren * 1;
$res = $this->iDb->select('jo.artisanat', 'id, siren, actif, numRM, denomination, sigle, nomCommercial, enseigne, fj, effectif, aprm, debutActivite, activite, adresse, cp, ville, cessation, radiation, nbInscriptions, nom, prenom, nomUsage, dateNaiss, lieuNaiss, natio, qualite, qualif, dateQualif, dateFctDeb, dateFctFin, IF(dateInsert>dateUpdate,dateInsert,dateUpdate) AS dateUpdate', "siren=$siren", false, MYSQL_ASSOC);
if (count($res)>0 && !$this->remote) {
$tabInsert = $res[0];
} elseif (ARTISANAT_DISPO_WEB) {
$tabInsert = $this->getRemoteIdentite();
if ($this->remote) {
$data = $this->getRemoteIdentite();
} else {
if (count($res) > 0) {
$data = $res[0];
}
}
return $tabInsert;
return $data;
}
public function getRemoteIdentite()