Libraries Update
This commit is contained in:
parent
f447dcaadc
commit
33dc9f0d74
@ -740,4 +740,8 @@ return array(
|
|||||||
'000Z' => "00Z",
|
'000Z' => "00Z",
|
||||||
'526D' => "526D",
|
'526D' => "526D",
|
||||||
'8121' => "8121",
|
'8121' => "8121",
|
||||||
|
'7904' => "7904",
|
||||||
|
'745A' => "745A",
|
||||||
|
'702A' => "702A",
|
||||||
|
'702C' => "702C",
|
||||||
);
|
);
|
||||||
|
@ -1484,4 +1484,8 @@ return array(
|
|||||||
'000Z' => "",
|
'000Z' => "",
|
||||||
'526D' => "",
|
'526D' => "",
|
||||||
'8121' => "",
|
'8121' => "",
|
||||||
|
'7904' => "",
|
||||||
|
'745A' => "",
|
||||||
|
'702A' => "",
|
||||||
|
'702C' => "",
|
||||||
);
|
);
|
||||||
|
@ -4185,7 +4185,7 @@ class MInsee
|
|||||||
|
|
||||||
// --- Type historique
|
// --- Type historique
|
||||||
if ($type == 'histo') {
|
if ($type == 'histo') {
|
||||||
if ($rubrique=='P') {
|
if ($rubrique=='P') {
|
||||||
$where =" AND e.E1GSIR NOT IN(340460104) AND e.CODEVE BETWEEN 50 AND 79 ";
|
$where =" AND e.E1GSIR NOT IN(340460104) AND e.CODEVE BETWEEN 50 AND 79 ";
|
||||||
}
|
}
|
||||||
elseif ($rubrique=='PH') {
|
elseif ($rubrique=='PH') {
|
||||||
@ -4226,6 +4226,9 @@ class MInsee
|
|||||||
$where.=" AND e.ROLE IN('".implode("','",$tabCodRol)."') ";
|
$where.=" AND e.ROLE IN('".implode("','",$tabCodRol)."') ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Type annonce
|
// --- Type annonce
|
||||||
@ -4255,6 +4258,9 @@ class MInsee
|
|||||||
$where.= implode(' OR ',$tabTmp);
|
$where.= implode(' OR ',$tabTmp);
|
||||||
$where.= ')';
|
$where.= ')';
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $where;
|
return $where;
|
||||||
@ -4286,7 +4292,7 @@ class MInsee
|
|||||||
foreach ($tabEven as $even) {
|
foreach ($tabEven as $even) {
|
||||||
if ( intval($even)!=0 ) {
|
if ( intval($even)!=0 ) {
|
||||||
if ( ($this->dureePlan==0 || $this->dureePlan==120) && in_array($even, $evenDetect) ) {
|
if ( ($this->dureePlan==0 || $this->dureePlan==120) && in_array($even, $evenDetect) ) {
|
||||||
file_put_contents('plan.log', "MATCH DUREE PLAN : ", FILE_APPEND);
|
//file_put_contents('plan.log', "MATCH DUREE PLAN : ", FILE_APPEND);
|
||||||
// --- Lecture dureePlan dans annonce
|
// --- Lecture dureePlan dans annonce
|
||||||
$this->debutPlan = str_replace('-','',$annonce['dateJugement']); // SSAAMMJJ
|
$this->debutPlan = str_replace('-','',$annonce['dateJugement']); // SSAAMMJJ
|
||||||
if ( preg_match('/dur.e(?:.*)plan(?:.*)(\d+)\s+ans?/Uisu', $annonce['annonce'], $matches) ) {
|
if ( preg_match('/dur.e(?:.*)plan(?:.*)(\d+)\s+ans?/Uisu', $annonce['annonce'], $matches) ) {
|
||||||
@ -4690,7 +4696,7 @@ class MInsee
|
|||||||
if ($idAnnonce != 0) {
|
if ($idAnnonce != 0) {
|
||||||
// --- Annonce
|
// --- Annonce
|
||||||
if (substr($idAnnonce,0,2) == '0.') {
|
if (substr($idAnnonce,0,2) == '0.') {
|
||||||
$idAnnonce == substr($idAnnonce,2);
|
$idAnnonce = substr($idAnnonce,2);
|
||||||
$sqlAnnonceWhere = "a.id=$idAnnonce";
|
$sqlAnnonceWhere = "a.id=$idAnnonce";
|
||||||
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
||||||
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
||||||
@ -4725,26 +4731,39 @@ class MInsee
|
|||||||
$sqlBodacc = $this->getAnnoncesLegalesBodacc()." WHERE ".$sqlBodaccWhere;
|
$sqlBodacc = $this->getAnnoncesLegalesBodacc()." WHERE ".$sqlBodaccWhere;
|
||||||
|
|
||||||
// --- Where Histo
|
// --- Where Histo
|
||||||
$sqlHistoWhere = "e.E1GSIR=$siren";
|
$sqlHistoRubrique = $this->getAnnoncesLegalesRubrique('histo', $rubrique);
|
||||||
$sqlHistoWhere.= $this->getAnnoncesLegalesRubrique('histo', $rubrique);
|
if ($sqlHistoRubrique !== false) {
|
||||||
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
|
$sqlHistoWhere = "e.E1GSIR=$siren";
|
||||||
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
|
$sqlHistoWhere.= $sqlHistoRubrique;
|
||||||
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
|
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
|
||||||
$sqlHisto = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;
|
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
|
||||||
|
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
|
||||||
|
$sqlHisto = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;
|
||||||
|
}
|
||||||
|
|
||||||
// --- Where Annonce
|
// --- Where Annonce
|
||||||
$sqlAnnonceWhere = "a.siren=$siren";
|
$sqlAnnonceRubrique = $this->getAnnoncesLegalesRubrique('annonce', $rubrique);
|
||||||
$sqlAnnonceWhere.= $this->getAnnoncesLegalesRubrique('annonce', $rubrique);
|
if ($sqlAnnonceRubrique !== false) {
|
||||||
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
$sqlAnnonceWhere = "a.siren=$siren";
|
||||||
if ($visualisation === true) {
|
$sqlAnnonceWhere.= $sqlAnnonceRubrique;
|
||||||
// --- Ne pas afficher les annonces si la procédure à plus de 4 mois
|
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
||||||
$sqlAnnonceWhere.= " AND a.dateJugement > DATE_SUB(NOW(), INTERVAL 24 MONTH)";
|
if ($visualisation === true) {
|
||||||
|
// --- Ne pas afficher les annonces si la procédure à plus de 4 mois
|
||||||
|
$sqlAnnonceWhere.= " AND a.dateJugement > DATE_SUB(NOW(), INTERVAL 24 MONTH)";
|
||||||
|
}
|
||||||
|
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
||||||
|
$sqlAnnonce = $this->getAnnoncesLegalesAnnonce()." WHERE ".$sqlAnnonceWhere;
|
||||||
}
|
}
|
||||||
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
|
||||||
$sqlAnnonce = $this->getAnnoncesLegalesAnnonce()." WHERE ".$sqlAnnonceWhere;
|
|
||||||
|
|
||||||
// --- SQL Union
|
// --- SQL Union
|
||||||
$sql = "SELECT * FROM ( (".$sqlBodacc.") UNION ALL (".$sqlHisto.") UNION ALL (".$sqlAnnonce.") ) results ORDER BY unionDate DESC";
|
$sql = "SELECT * FROM ( (".$sqlBodacc.") ";
|
||||||
|
if (!empty($sqlHisto)) {
|
||||||
|
$sql.= "UNION ALL (".$sqlHisto.") ";
|
||||||
|
}
|
||||||
|
if (!empty($sqlAnnonce)) {
|
||||||
|
$sql.= "UNION ALL (".$sqlAnnonce.") ";
|
||||||
|
}
|
||||||
|
$sql.= ") results ORDER BY unionDate DESC";
|
||||||
}
|
}
|
||||||
$annonceResult = $this->iDb->query($sql);
|
$annonceResult = $this->iDb->query($sql);
|
||||||
|
|
||||||
@ -5327,33 +5346,42 @@ class MInsee
|
|||||||
//$idAnnonce
|
//$idAnnonce
|
||||||
}
|
}
|
||||||
|
|
||||||
$mBalo=new MBalo();
|
$mBalo = new MBalo();
|
||||||
|
|
||||||
|
$bodacc = $this->iDb->select('jo.balo',
|
||||||
|
"Societe_Rcs, Categorie, Num_Affaire, Date_Parution, Num_Parution, Url_Annonce_Html, Url_Annonce_Pdf, Annonce_Html, dateInsert", "Societe_Rcs='$siren' AND Date_Parution>='2004-01-01' $strIdAnn ORDER BY Date_Parution DESC, Num_Affaire LIMIT $offset, $lignes",
|
||||||
|
false, MYSQL_ASSOC);
|
||||||
|
|
||||||
$bodacc=$this->iDb->select('jo.balo', "Societe_Rcs, Categorie, Num_Affaire, Date_Parution, Num_Parution, Url_Annonce_Html, Url_Annonce_Pdf, Annonce_Html, dateInsert", "Societe_Rcs='$siren' AND Date_Parution>='2004-01-01' $strIdAnn ORDER BY Date_Parution DESC, Num_Affaire LIMIT $offset, $lignes", false, MYSQL_ASSOC);
|
|
||||||
// $RP=mysql_select('balo', " ", "Societe_Rcs='$rcs' ");
|
|
||||||
$k=0;
|
$k=0;
|
||||||
if (count($bodacc)>0) {
|
if (count($bodacc) > 0) {
|
||||||
foreach ($bodacc as $k=>$ann) {
|
foreach ($bodacc as $k => $ann) {
|
||||||
$tabRetEven=array();
|
$tabRetEven = array();
|
||||||
$tabRetEven[]=array('CodeEven'=>$mBalo->getLibEven($ann['Categorie']),
|
$tabRetEven[] = array(
|
||||||
'LibEven'=> $ann['Categorie']);
|
'CodeEven' => $mBalo->getLibEven($ann['Categorie']),
|
||||||
|
'LibEven' => $ann['Categorie']
|
||||||
|
);
|
||||||
|
|
||||||
$tabRet[$k]=array( 'id'=>$ann['Num_Affaire'].'.'.$ann['Num_Parution'],
|
$tabRet[$k]=array(
|
||||||
'BodaccCode'=>'BALO',
|
'id'=>$ann['Num_Affaire'].'.'.$ann['Num_Parution'],
|
||||||
'BodaccNum'=>$ann['Num_Parution'],
|
'BodaccCode'=>'BALO',
|
||||||
'NumAnnonce'=>$ann['Num_Affaire'],
|
'BodaccNum'=>$ann['Num_Parution'],
|
||||||
'DateParution'=>$ann['Date_Parution'],
|
'NumAnnonce'=>$ann['Num_Affaire'],
|
||||||
//'Departement'=>'',$ann['Tribunal_Dept'],
|
'DateParution'=>$ann['Date_Parution'],
|
||||||
//'Tribunal'=>$ann['triNom'],
|
//'Departement'=>'',$ann['Tribunal_Dept'],
|
||||||
//'TribunalSiret'=>$ann['triSiret'],
|
//'Tribunal'=>$ann['triNom'],
|
||||||
//'Rubrique'=>$ann['Rubrique'],
|
//'TribunalSiret'=>$ann['triSiret'],
|
||||||
'typeAnnonce'=>'Insertion',
|
//'Rubrique'=>$ann['Rubrique'],
|
||||||
'dateInsertionSD'=>$ann['dateInsert'],
|
'typeAnnonce'=>'Insertion',
|
||||||
'evenements'=>$tabRetEven,
|
'dateInsertionSD'=>$ann['dateInsert'],
|
||||||
'Lien_Annonce_Pdf'=>basename($ann['Url_Annonce_Pdf']),
|
'evenements'=>$tabRetEven,
|
||||||
);
|
'Lien_Annonce_Pdf'=>basename($ann['Url_Annonce_Pdf']),
|
||||||
if ($idAnnonce<>0) $tabRet[$k]['texteAnnonce']=strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
);
|
||||||
preg_replace('/( class=".*")/ie', ' ', $ann['Annonce_Html'])), array(' '=>' ', '</html>'=>'', '</body>'=>''));
|
if ($idAnnonce<>0)
|
||||||
|
$tabRet[$k]['texteAnnonce'] = strtr(
|
||||||
|
preg_replace('/<html.*<body.*>/Uis', '',
|
||||||
|
preg_replace('/( class=".*")/ie', ' ', $ann['Annonce_Html'])),
|
||||||
|
array(' '=>' ', '</html>'=>'', '</body>'=>'')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $tabRet;
|
return $tabRet;
|
||||||
@ -5364,9 +5392,10 @@ class MInsee
|
|||||||
* @param string $siren
|
* @param string $siren
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getAnnoncesBaloCount($siren)
|
public function getAnnoncesBaloCount($siren)
|
||||||
{
|
{
|
||||||
$bodacc = $this->iDb->select('jo.balo', "count(*) AS nb", "Societe_Rcs='$siren' AND Date_Parution>='2004-01-01' ORDER BY Date_Parution DESC, Num_Affaire", false, MYSQL_ASSOC);
|
$bodacc = $this->iDb->select('jo.balo', "count(*) AS nb",
|
||||||
|
"Societe_Rcs='$siren' AND Date_Parution>='2004-01-01' ORDER BY Date_Parution DESC, Num_Affaire", false, MYSQL_ASSOC);
|
||||||
$nb = 0;
|
$nb = 0;
|
||||||
if (count($bodacc)>0) {
|
if (count($bodacc)>0) {
|
||||||
$nb = $bodacc[0]['nb'];
|
$nb = $bodacc[0]['nb'];
|
||||||
@ -5383,201 +5412,201 @@ class MInsee
|
|||||||
* @param int $lignes
|
* @param int $lignes
|
||||||
* @return Ambigous <string, multitype:multitype:string unknown multitype:multitype:string multitype:string NULL multitype:string unknown Ambigous <string, unknown> multitype:multitype:string Ambigous <number, unknown> , unknown>
|
* @return Ambigous <string, multitype:multitype:string unknown multitype:multitype:string multitype:string NULL multitype:string unknown Ambigous <string, unknown> multitype:multitype:string Ambigous <number, unknown> , unknown>
|
||||||
*/
|
*/
|
||||||
function getAnnoncesBoamp($siren, $idAnnonce='', $type=array('A', 'M'), $offset=0, $lignes=100)
|
public function getAnnoncesBoamp($siren, $idAnnonce='', $type=array('A', 'M'), $offset=0, $lignes=100)
|
||||||
{
|
{
|
||||||
$siren=$siren*1;
|
$siren = intval($siren);
|
||||||
|
|
||||||
if ($siren<001000000) $siren='000'.$siren;
|
$strIdAnn = '';
|
||||||
elseif ($siren<010000000) $siren='00'.$siren;
|
$idA = 0;
|
||||||
elseif ($siren<100000000) $siren='0'.$siren;
|
$tabRet = array();
|
||||||
|
|
||||||
$strIdAnn='';
|
$mBoamp = new MBoamp();
|
||||||
$idA=0;
|
|
||||||
$tabRet=array();
|
|
||||||
|
|
||||||
$mBoamp=new MBoamp();
|
|
||||||
|
|
||||||
|
// --- Recherche dans les avis d'attribution
|
||||||
if ( is_string($type) && $type=='A' || is_array($type) && in_array('A',$type) ) {
|
if ( is_string($type) && $type=='A' || is_array($type) && in_array('A',$type) ) {
|
||||||
|
|
||||||
/** Recherche dans les avis d'attribution **/
|
if ($idAnnonce != '') {
|
||||||
if ($idAnnonce<>'') {
|
$tmp = explode('.', $idAnnonce);
|
||||||
$tmp=explode('.', $idAnnonce);
|
$idA = $tmp[1];
|
||||||
$idA=$tmp[1];
|
if ($tmp[0]=='A') $strIdAnn=" AND l.id='$idA' ";
|
||||||
//if (strlen($tmp[0])==9 && is_numeric($tmp[0])) $rcs=$tmp[0];
|
elseif ($tmp[0]=='O') $strIdAnn="";
|
||||||
if ($tmp[0]=='A') $strIdAnn=" AND l.id='$idA' ";
|
}
|
||||||
elseif ($tmp[0]=='O') $strIdAnn="";
|
|
||||||
}
|
|
||||||
|
|
||||||
$bodacc = $this->iDb->select(
|
$bodacc = $this->iDb->select('jo.boamp_lots l, jo.boamp b, jo.boamp_detail d',
|
||||||
'jo.boamp_lots l, jo.boamp b, jo.boamp_detail d',
|
"l.id, l.idAnn, l.Boamp_Code, l.Boamp_Rubrique, b.Boamp_Rubrique_Lib, b.typeAnnonce, l.Boamp_Date_Parution, b.Boamp_Num, b.Boamp_Annee_Parution, b.Num_AnnoncePre, b.Num_Annonce, b.Boamp_Dept, b.annonce, l.num, l.`desc` AS description, l.nom, d.raisonSociale, l.montantTxt, sum(l.montant) AS montant, l.montantAnMin, l.montantAnMax, l.trancheCond, l.trancheFerme, l.dateAttrib, l.intitule, l.nomenclature, l.objets, l.cpv, l.cpvComp, l.volume, l.execution, l.livraison, l.dureeJours, l.dureeMois, l.dateDeb, l.dateFin, l.dateInsert, d.titre, d.objet, d.titreMarche, d.typeObjetMarche, d.objetAutre, d.autres",
|
||||||
"l.id, l.idAnn, l.Boamp_Code, l.Boamp_Rubrique, b.Boamp_Rubrique_Lib, b.typeAnnonce, l.Boamp_Date_Parution, b.Boamp_Num, b.Boamp_Annee_Parution, b.Num_AnnoncePre, b.Num_Annonce, b.Boamp_Dept, b.annonce, l.num, l.`desc` AS description, l.nom, d.raisonSociale, l.montantTxt, sum(l.montant) AS montant, l.montantAnMin, l.montantAnMax, l.trancheCond, l.trancheFerme, l.dateAttrib, l.intitule, l.nomenclature, l.objets, l.cpv, l.cpvComp, l.volume, l.execution, l.livraison, l.dureeJours, l.dureeMois, l.dateDeb, l.dateFin, l.dateInsert, d.titre, d.objet, d.titreMarche, d.typeObjetMarche, d.objetAutre, d.autres",
|
"l.siren=$siren AND l.idAnn=b.id AND l.idAnn=d.id $strIdAnn GROUP BY b.id ORDER BY l.Boamp_Date_Parution DESC LIMIT $offset,$lignes", false, MYSQL_ASSOC);
|
||||||
"l.siren='$siren' AND l.idAnn=b.id AND l.idAnn=d.id $strIdAnn GROUP BY b.id ORDER BY l.Boamp_Date_Parution DESC LIMIT $offset,$lignes", false, MYSQL_ASSOC
|
|
||||||
);
|
|
||||||
|
|
||||||
$k=0;
|
$k = 0;
|
||||||
if (count($bodacc)>0) {
|
if (count($bodacc)>0) {
|
||||||
foreach ($bodacc as $k=>$ann) {
|
foreach ($bodacc as $k => $ann) {
|
||||||
$tabRetEven=array();
|
$tabRetEven=array();
|
||||||
/*montantTxt, l.montant, l.montantAnMin, , l.trancheCond, l.trancheFerme, l.dateAttrib*/
|
if ($ann['nom']<>'') $strMontant=' "'.strtoupper($ann['raisonSociale']).'"';
|
||||||
if ($ann['nom']<>'') $strMontant=' "'.strtoupper($ann['raisonSociale']).'"';
|
|
||||||
|
|
||||||
if ($ann['montant']*1>0) $strMontant.=' ('.number_format($ann['montant'], 2, ',', ' ').' EUR)';
|
if ($ann['montant']*1>0) $strMontant.=' ('.number_format($ann['montant'], 2, ',', ' ').' EUR)';
|
||||||
elseif ($ann['montantTxt']<>'') $strMontant.=' ('.$ann['montantTxt'].')';
|
elseif ($ann['montantTxt']<>'') $strMontant.=' ('.$ann['montantTxt'].')';
|
||||||
elseif ($ann['montantAnMin']<>'' && $ann['montantAnMax'])
|
elseif ($ann['montantAnMin']<>'' && $ann['montantAnMax'])
|
||||||
$strMontant.=' ('.$ann['montantAnMin'].' à '.
|
$strMontant.=' ('.$ann['montantAnMin'].' à '.$ann['montantAnMax'].')';
|
||||||
$ann['montantAnMax'].')';
|
elseif ($ann['trancheCond']<>'' && $ann['trancheFerme'])
|
||||||
elseif ($ann['trancheCond']<>'' && $ann['trancheFerme'])
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
||||||
$strMontant.=' ('.$ann['trancheCond'].' / '.
|
else $strMontant.='';
|
||||||
$ann['trancheFerme'].')';
|
|
||||||
else $strMontant.='';
|
|
||||||
$tabRetEven[]=array('CodeEven'=>$mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
|
||||||
'LibEven'=>$mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$strMontant);
|
|
||||||
// Axxx pour lot attribué ou Oxxx pour Organisation
|
|
||||||
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
|
||||||
else $numAnn=$ann['Num_Annonce'];
|
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
|
||||||
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution=MAPA&num_annonce='.$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';//&affichage_avis=officiel';
|
|
||||||
else {
|
|
||||||
$lettre = substr($ann['Boamp_Code'],-1);
|
|
||||||
$annee = $ann['Boamp_Annee_Parution'];
|
|
||||||
$num = sprintf("%04d",$ann['Boamp_Num']);
|
|
||||||
$numPar=$lettre.$annee.$num;
|
|
||||||
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution='.$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
|
||||||
}
|
|
||||||
$infosComp='';
|
|
||||||
$objetMarche=trim($ann['objet'].' '.$ann['objetAutre'].' '.$ann['autres']);
|
|
||||||
//titre, titreMarche, typeObjetMarche
|
|
||||||
$tabRet[$k]=array( 'id'=>'A.'.$ann['id'],
|
|
||||||
'BodaccCode'=>$ann['Boamp_Code'],
|
|
||||||
'BodaccNum'=>$ann['Boamp_Num'],
|
|
||||||
'NumAnnonce'=>$numAnn,
|
|
||||||
'DateParution'=>$ann['Boamp_Date_Parution'],
|
|
||||||
'Departement'=>$ann['Boamp_Dept'],
|
|
||||||
//'Tribunal'=>$ann['triNom'],
|
|
||||||
//'TribunalSiret'=>$ann['triSiret'],
|
|
||||||
//'Rubrique'=>$ann['Boamp_Rubrique_Lib'],
|
|
||||||
'typeAnnonce'=>$ann['typeAnnonce'],
|
|
||||||
'dateInsertionSD'=>$ann['dateInsert'],
|
|
||||||
'Montant'=>$ann['montant'],
|
|
||||||
'Organisme'=>strtoupper($ann['raisonSociale']),
|
|
||||||
'Objet'=>$objetMarche,
|
|
||||||
'evenements'=>$tabRetEven,
|
|
||||||
'infosComp'=>$infosComp, // Non géré
|
|
||||||
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($idA<>0)
|
$tabRetEven[] = array(
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
'CodeEven' => $mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
||||||
$tabRet[$k]['texteAnnonce']=$ann['annonce'];
|
'LibEven' => $mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'],$ann['Boamp_Rubrique_Lib']).$strMontant
|
||||||
else
|
);
|
||||||
$tabRet[$k]['texteAnnonce']=
|
|
||||||
strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
// Axxx pour lot attribué ou Oxxx pour Organisation
|
||||||
|
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
||||||
|
else $numAnn=$ann['Num_Annonce'];
|
||||||
|
if ($ann['Boamp_Code']=='MAPA') {
|
||||||
|
$lienMapa = 'http://www.boamp.fr/index.php?action=avis&num_parution=MAPA&num_annonce='.
|
||||||
|
$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
|
} else {
|
||||||
|
$lettre = substr($ann['Boamp_Code'],-1);
|
||||||
|
$annee = $ann['Boamp_Annee_Parution'];
|
||||||
|
$num = sprintf("%04d",$ann['Boamp_Num']);
|
||||||
|
$numPar = $lettre.$annee.$num;
|
||||||
|
$lienMapa = 'http://www.boamp.fr/index.php?action=avis&num_parution='.
|
||||||
|
$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
|
}
|
||||||
|
$infosComp='';
|
||||||
|
$objetMarche=trim($ann['objet'].' '.$ann['objetAutre'].' '.$ann['autres']);
|
||||||
|
//titre, titreMarche, typeObjetMarche
|
||||||
|
$tabRet[$k] = array(
|
||||||
|
'id'=>'A.'.$ann['id'],
|
||||||
|
'BodaccCode'=>$ann['Boamp_Code'],
|
||||||
|
'BodaccNum'=>$ann['Boamp_Num'],
|
||||||
|
'NumAnnonce'=>$numAnn,
|
||||||
|
'DateParution'=>$ann['Boamp_Date_Parution'],
|
||||||
|
'Departement'=>$ann['Boamp_Dept'],
|
||||||
|
//'Tribunal'=>$ann['triNom'],
|
||||||
|
//'TribunalSiret'=>$ann['triSiret'],
|
||||||
|
//'Rubrique'=>$ann['Boamp_Rubrique_Lib'],
|
||||||
|
'typeAnnonce'=>$ann['typeAnnonce'],
|
||||||
|
'dateInsertionSD'=>$ann['dateInsert'],
|
||||||
|
'Montant'=>$ann['montant'],
|
||||||
|
'Organisme'=>strtoupper($ann['raisonSociale']),
|
||||||
|
'Objet'=>$objetMarche,
|
||||||
|
'evenements'=>$tabRetEven,
|
||||||
|
'infosComp'=>$infosComp, // Non géré
|
||||||
|
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($idA<>0) {
|
||||||
|
if ($ann['Boamp_Code']=='MAPA') {
|
||||||
|
$tabRet[$k]['texteAnnonce'] = $ann['annonce'];
|
||||||
|
} else {
|
||||||
|
$tabRet[$k]['texteAnnonce'] = strtr(
|
||||||
|
preg_replace('/<html.*<body.*>/Uis', '',
|
||||||
preg_replace('/<p\s+.*>/Uis', '',
|
preg_replace('/<p\s+.*>/Uis', '',
|
||||||
preg_replace('/( class=".*")/ie', ' ', $ann['annonce']))),
|
preg_replace('/( class=".*")/ie', ' ', $ann['annonce']))),
|
||||||
array(' '=>' ', '</html>'=>'', '</body>'=>'', '</p>'=>'<br/>')
|
array(' '=>' ', '</html>'=>'', '</body>'=>'', '</p>'=>'<br/>')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Recherche dans les avis de marchés
|
||||||
if ( is_string($type) && $type=='M' || is_array($type) && in_array('M',$type) ) {
|
if ( is_string($type) && $type=='M' || is_array($type) && in_array('M',$type) ) {
|
||||||
// Recherche dans les avis de marchés
|
|
||||||
if ($idAnnonce<>'') {
|
if ($idAnnonce<>'') {
|
||||||
$tmp=explode('.', $idAnnonce);
|
$tmp = explode('.', $idAnnonce);
|
||||||
$idA=$tmp[1];
|
$idA = $tmp[1];
|
||||||
//if (strlen($tmp[0])==9 && is_numeric($tmp[0])) $rcs=$tmp[0];
|
if ($tmp[0]=='A') $strIdAnn=" AND d.id='$idA' ";
|
||||||
if ($tmp[0]=='A') $strIdAnn=" AND d.id='$idA' ";
|
elseif ($tmp[0]=='O') $strIdAnn="";
|
||||||
elseif ($tmp[0]=='O') $strIdAnn="";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$bodacc=$this->iDb->select(
|
$bodacc = $this->iDb->select('jo.boamp b, jo.boamp_detail d',
|
||||||
'boamp b, boamp_detail d',
|
|
||||||
"d.id, d.Boamp_Code, d.Boamp_Rubrique, b.Boamp_Rubrique_Lib, b.typeAnnonce, d.Boamp_Date_Parution, b.Boamp_Num, b.Boamp_Annee_Parution, b.Num_AnnoncePre, b.Num_Annonce, b.Boamp_Dept, b.annonce, titre AS description, d.raisonSociale, d.estimValeur AS montantTxt, d.estimValeurMin AS montantAnMin, d.estimValeurMax AS montantAnMax, objet, cpv_obj, cpv_comp, d.dateInsert",
|
"d.id, d.Boamp_Code, d.Boamp_Rubrique, b.Boamp_Rubrique_Lib, b.typeAnnonce, d.Boamp_Date_Parution, b.Boamp_Num, b.Boamp_Annee_Parution, b.Num_AnnoncePre, b.Num_Annonce, b.Boamp_Dept, b.annonce, titre AS description, d.raisonSociale, d.estimValeur AS montantTxt, d.estimValeurMin AS montantAnMin, d.estimValeurMax AS montantAnMax, objet, cpv_obj, cpv_comp, d.dateInsert",
|
||||||
"d.siren='$siren' AND d.id=b.id $strIdAnn GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC",
|
"d.siren=$siren AND d.id=b.id $strIdAnn GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC", false, MYSQL_ASSOC);
|
||||||
false, MYSQL_ASSOC
|
|
||||||
);
|
|
||||||
|
|
||||||
if (count($bodacc)>0) {
|
if (count($bodacc)>0) {
|
||||||
foreach ($bodacc as $k=>$ann) {
|
foreach ($bodacc as $k => $ann) {
|
||||||
$id=$ann['id'];
|
$id = $ann['id'];
|
||||||
$rub=$ann['Boamp_Rubrique'];
|
$rub = $ann['Boamp_Rubrique'];
|
||||||
$tabRetEven=array();
|
$tabRetEven = array();
|
||||||
$strMontant='';
|
$strMontant = '';
|
||||||
if ($ann['objet']<>'') $strMontant.=' "'.$ann['objet'].'"';
|
if ($ann['objet']<>'') $strMontant.=' "'.$ann['objet'].'"';
|
||||||
|
|
||||||
if ($rub=='6' || // Avis d'attribution
|
if ($rub=='6' || // Avis d'attribution
|
||||||
$rub=='7' || // Avis en cas de transparence ex ante volontaire
|
$rub=='7' || // Avis en cas de transparence ex ante volontaire
|
||||||
$rub=='77' || // Avis d'attribution
|
$rub=='77' || // Avis d'attribution
|
||||||
$rub=='8' || // Avis d'attribution
|
$rub=='8' || // Avis d'attribution
|
||||||
$rub=='82' || // Rectificatif
|
$rub=='82' || // Rectificatif
|
||||||
$rub=='83' || // Rectificatif
|
$rub=='83' || // Rectificatif
|
||||||
$rub=='84' || // Avis d'attribution comportant des lots infructueux
|
$rub=='84' || // Avis d'attribution comportant des lots infructueux
|
||||||
$rub=='9' || // Résultat de marché
|
$rub=='9' || // Résultat de marché
|
||||||
$rub=='92' || // Rectificatif
|
$rub=='92' || // Rectificatif
|
||||||
$rub=='93' || // Résultat de marché / Infructueux - Sans suite
|
$rub=='93' || // Résultat de marché / Infructueux - Sans suite
|
||||||
$rub=='94' || // Résultat de marché / Résultat de marché comportant des lots infructueux
|
$rub=='94' || // Résultat de marché / Résultat de marché comportant des lots infructueux
|
||||||
$rub=='96' || // Annulation - Rectificatif - Sans suite - Infructueux
|
$rub=='96' || // Annulation - Rectificatif - Sans suite - Infructueux
|
||||||
$rub=='977' // Annulation - Rectificatif / Avis en cas de transparence ex ante volontaire
|
$rub=='977' // Annulation - Rectificatif / Avis en cas de transparence ex ante volontaire
|
||||||
) {
|
) {
|
||||||
$tabTmp=$this->iDb->select( 'boamp_lots l',
|
$tabTmp = $this->iDb->select('jo.boamp_lots l',
|
||||||
"l.id, l.idAnn, l.Boamp_Code, l.Boamp_Rubrique, l.Boamp_Date_Parution, l.num, l.`desc` AS description, l.nom, l.montantTxt, l.montant, l.montantAnMin, l.montantAnMax, l.trancheCond, l.trancheFerme, l.dateAttrib, l.intitule, l.nomenclature, l.objets, l.cpv, l.cpvComp, l.volume, l.execution, l.livraison, l.dureeJours, l.dureeMois, l.dateDeb, l.dateFin",
|
"l.id, l.idAnn, l.Boamp_Code, l.Boamp_Rubrique, l.Boamp_Date_Parution, l.num, l.desc AS description, l.nom, l.montantTxt, l.montant, l.montantAnMin, l.montantAnMax, l.trancheCond, l.trancheFerme, l.dateAttrib, l.intitule, l.nomenclature, l.objets, l.cpv, l.cpvComp, l.volume, l.execution, l.livraison, l.dureeJours, l.dureeMois, l.dateDeb, l.dateFin",
|
||||||
"l.idAnn=$id", false, MYSQL_ASSOC);
|
"l.idAnn=$id", false, MYSQL_ASSOC);
|
||||||
foreach ($tabTmp as $k2=>$ann2) {
|
foreach ($tabTmp as $k2=>$ann2) {
|
||||||
if ($ann2['nom']<>'') $strMontant.=' "'.strtoupper($ann2['nom']).'"';
|
if ($ann2['nom']<>'') $strMontant.=' "'.strtoupper($ann2['nom']).'"';
|
||||||
if ($ann2['montant']*1>0) $strMontant.=' ('.number_format($ann2['montant'], 2, ',', ' ').' EUR)';
|
if ($ann2['montant']*1>0) $strMontant.=' ('.number_format($ann2['montant'], 2, ',', ' ').' EUR)';
|
||||||
elseif ($ann2['montantTxt']<>'') $strMontant.=' ('.$ann2['montantTxt'].')';
|
elseif ($ann2['montantTxt']<>'') $strMontant.=' ('.$ann2['montantTxt'].')';
|
||||||
elseif ($ann2['montantAnMin']<>'' && $ann2['montantAnMax'])
|
elseif ($ann2['montantAnMin']<>'' && $ann2['montantAnMax'])
|
||||||
$strMontant.=' ('.$ann2['montantAnMin'].' à '.
|
$strMontant.=' ('.$ann2['montantAnMin'].' à '.$ann2['montantAnMax'].')';
|
||||||
$ann2['montantAnMax'].')';
|
elseif ($ann2['trancheCond']<>'' && $ann2['trancheFerme'])
|
||||||
elseif ($ann2['trancheCond']<>'' && $ann2['trancheFerme'])
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
||||||
$strMontant.=' ('.$ann['trancheCond'].' / '.
|
else $strMontant.='';
|
||||||
$ann['trancheFerme'].')';
|
}
|
||||||
else $strMontant.='';
|
}
|
||||||
}
|
$tabRetEven[] = array(
|
||||||
}
|
'CodeEven' => $mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
||||||
$tabRetEven[]=array('CodeEven'=>$mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
'LibEven' => $mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$strMontant
|
||||||
'LibEven'=>$mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$strMontant);
|
);
|
||||||
// Axxx pour lot attribué ou Oxxx pour Organisation
|
|
||||||
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
|
||||||
else $numAnn=$ann['Num_Annonce'];
|
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
|
||||||
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution=MAPA&num_annonce='.$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';//&affichage_avis=officiel';
|
|
||||||
else {
|
|
||||||
$lettre = substr($ann['Boamp_Code'],-1);
|
|
||||||
$annee = $ann['Boamp_Annee_Parution'];
|
|
||||||
$num = sprintf("%04d",$ann['Boamp_Num']);
|
|
||||||
$numPar=$lettre.$annee.$num;
|
|
||||||
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution='.$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
|
||||||
}
|
|
||||||
$infosComp='';
|
|
||||||
$tabRet[$k]=array( 'id'=>'O.'.$id,
|
|
||||||
'BodaccCode'=>$ann['Boamp_Code'],
|
|
||||||
'BodaccNum'=>$ann['Boamp_Num'],
|
|
||||||
'NumAnnonce'=>$numAnn,
|
|
||||||
'DateParution'=>$ann['Boamp_Date_Parution'],
|
|
||||||
'Departement'=>$ann['Boamp_Dept'],
|
|
||||||
//'Tribunal'=>$ann['triNom'],
|
|
||||||
//'TribunalSiret'=>$ann['triSiret'],
|
|
||||||
//'Rubrique'=>$ann['Boamp_Rubrique_Lib'],
|
|
||||||
'typeAnnonce'=>$ann['typeAnnonce'],
|
|
||||||
'dateInsertionSD'=>$ann['dateInsert'],
|
|
||||||
'evenements'=>$tabRetEven,
|
|
||||||
'infosComp'=>$infosComp, // Non géré
|
|
||||||
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($idA<>0)
|
// Axxx pour lot attribué ou Oxxx pour Organisation
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
||||||
$tabRet[$k]['texteAnnonce']=$ann['annonce'];
|
else $numAnn=$ann['Num_Annonce'];
|
||||||
else
|
if ($ann['Boamp_Code']=='MAPA')
|
||||||
$tabRet[$k]['texteAnnonce']=
|
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution=MAPA&num_annonce='.$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';//&affichage_avis=officiel';
|
||||||
strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
else {
|
||||||
preg_replace('/<p\s+.*>/Uis', '',
|
$lettre = substr($ann['Boamp_Code'],-1);
|
||||||
preg_replace('/( class=".*")/ie', ' ', $ann['annonce']))),
|
$annee = $ann['Boamp_Annee_Parution'];
|
||||||
array(' '=>' ', '</html>'=>'', '</body>'=>'', '</p>'=>'<br/>')
|
$num = sprintf("%04d",$ann['Boamp_Num']);
|
||||||
);
|
$numPar=$lettre.$annee.$num;
|
||||||
}
|
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution='.$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
}
|
}
|
||||||
|
$infosComp='';
|
||||||
|
$tabRet[$k] = array(
|
||||||
|
'id'=>'O.'.$id,
|
||||||
|
'BodaccCode'=>$ann['Boamp_Code'],
|
||||||
|
'BodaccNum'=>$ann['Boamp_Num'],
|
||||||
|
'NumAnnonce'=>$numAnn,
|
||||||
|
'DateParution'=>$ann['Boamp_Date_Parution'],
|
||||||
|
'Departement'=>$ann['Boamp_Dept'],
|
||||||
|
//'Tribunal'=>$ann['triNom'],
|
||||||
|
//'TribunalSiret'=>$ann['triSiret'],
|
||||||
|
//'Rubrique'=>$ann['Boamp_Rubrique_Lib'],
|
||||||
|
'typeAnnonce'=>$ann['typeAnnonce'],
|
||||||
|
'dateInsertionSD'=>$ann['dateInsert'],
|
||||||
|
'evenements'=>$tabRetEven,
|
||||||
|
'infosComp'=>$infosComp, // Non géré
|
||||||
|
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($idA<>0) {
|
||||||
|
if ($ann['Boamp_Code']=='MAPA') {
|
||||||
|
$tabRet[$k]['texteAnnonce'] = $ann['annonce'];
|
||||||
|
} else {
|
||||||
|
$tabRet[$k]['texteAnnonce'] = strtr(
|
||||||
|
preg_replace('/<html.*<body.*>/Uis', '',
|
||||||
|
preg_replace('/<p\s+.*>/Uis', '',
|
||||||
|
preg_replace('/( class=".*")/ie', ' ', $ann['annonce']))),
|
||||||
|
array(' '=>' ', '</html>'=>'', '</body>'=>'', '</p>'=>'<br/>')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
debugLog('I', "getAnnoncesBoamp(siren=$siren, idAnnonce=$idAnnonce, $idA)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
debugLog('I', "getAnnoncesBoamp(siren=$siren, idAnnonce=$idAnnonce, $idA)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||||
return $tabRet;
|
return $tabRet;
|
||||||
@ -5592,29 +5621,34 @@ class MInsee
|
|||||||
{
|
{
|
||||||
$bodaccA = array();
|
$bodaccA = array();
|
||||||
$bodaccM = array();
|
$bodaccM = array();
|
||||||
|
|
||||||
|
// --- Recherche dans les avis d'attribution
|
||||||
if ( $type=='' || $type=='A' ) {
|
if ( $type=='' || $type=='A' ) {
|
||||||
|
$bodaccA = $this->iDb->select('jo.boamp_lots l, jo.boamp b, jo.boamp_detail d', "l.id",
|
||||||
/** Recherche dans les avis d'attribution **/
|
"l.siren=$siren AND l.idAnn=b.id AND l.idAnn=d.id GROUP BY b.id ORDER BY l.Boamp_Date_Parution",
|
||||||
$bodaccA=$this->iDb->select(
|
false, MYSQL_ASSOC);
|
||||||
'jo.boamp_lots l, jo.boamp b, jo.boamp_detail d',
|
|
||||||
"l.id",
|
|
||||||
"l.siren='$siren' AND l.idAnn=b.id AND l.idAnn=d.id GROUP BY b.id ORDER BY l.Boamp_Date_Parution",
|
|
||||||
false, MYSQL_ASSOC
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if ( $type=='' || $type=='M') {
|
|
||||||
/** Recherche dans les avis de marchés **/
|
|
||||||
$bodaccM = $this->iDb->select( 'jo.boamp b, jo.boamp_detail d', "d.id",
|
|
||||||
"d.siren='$siren' AND d.id=b.id GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC",
|
|
||||||
false, MYSQL_ASSOC
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Recherche dans les avis de marchés
|
||||||
|
if ( $type=='' || $type=='M') {
|
||||||
|
$bodaccM = $this->iDb->select('jo.boamp b, jo.boamp_detail d', "d.id",
|
||||||
|
"d.siren=$siren AND d.id=b.id GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC",
|
||||||
|
false, MYSQL_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
$nb = count($bodaccA) + count($bodaccM);
|
$nb = count($bodaccA) + count($bodaccM);
|
||||||
|
|
||||||
return $nb;
|
return $nb;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAnnoncesAsso($siren, $idAnnonce=0, $offset=0, $lignes=100)
|
/**
|
||||||
|
*
|
||||||
|
* @param unknown $siren
|
||||||
|
* @param number $idAnnonce
|
||||||
|
* @param number $offset
|
||||||
|
* @param number $lignes
|
||||||
|
*/
|
||||||
|
public function getAnnoncesAsso($siren, $idAnnonce=0, $offset=0, $lignes=100)
|
||||||
{
|
{
|
||||||
debugLog('I', "Début getAnnoncesAsso(siren=$siren, idAnnonce=$idAnnonce)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
debugLog('I', "Début getAnnoncesAsso(siren=$siren, idAnnonce=$idAnnonce)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ class MBilans
|
|||||||
/**
|
/**
|
||||||
* Liste les bilans disponibles au format numérique (et non PDF image) pour une entreprise
|
* Liste les bilans disponibles au format numérique (et non PDF image) pour une entreprise
|
||||||
* @param boolean $accesPartenaire
|
* @param boolean $accesPartenaire
|
||||||
* Accès autorisé aux partenaires distant si le bilan est absenr
|
* Accès autorisé aux partenaires distant si le bilan est absent
|
||||||
* @param number $nbMaxBilans
|
* @param number $nbMaxBilans
|
||||||
* Nombre de bilans maximums retournés
|
* Nombre de bilans maximums retournés
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?
|
<?php
|
||||||
require_once 'framework/common/curl.php';
|
require_once 'framework/common/curl.php';
|
||||||
|
|
||||||
class MBilans {
|
class MBilans
|
||||||
|
{
|
||||||
private $body = '';
|
private $body = '';
|
||||||
private $header = '';
|
private $header = '';
|
||||||
private $codeRetour = 0;
|
private $codeRetour = 0;
|
||||||
|
@ -64,7 +64,7 @@ class Scores_Ws_Server
|
|||||||
'91.121.157.194', //Extranet - ns359466
|
'91.121.157.194', //Extranet - ns359466
|
||||||
'78.31.45.206', //SDSL RAMBOUILLET
|
'78.31.45.206', //SDSL RAMBOUILLET
|
||||||
'127.0.0.1',
|
'127.0.0.1',
|
||||||
'192.168.33.1',
|
'192.168.33.10',
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $listProxyIp = array(
|
protected $listProxyIp = array(
|
||||||
@ -765,16 +765,19 @@ class Scores_Ws_Server
|
|||||||
|
|
||||||
} elseif ($ip != '127.0.0.1') {
|
} elseif ($ip != '127.0.0.1') {
|
||||||
|
|
||||||
// For customized version, check user is in the good service
|
// --- For customized version, check user is in the good service
|
||||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||||
$wsClients = array();
|
$wsClients = array();
|
||||||
foreach( $clients as $section => $params ){
|
foreach( $clients as $section => $params ){
|
||||||
if ($params['actif']) {
|
if ($params['actif']) {
|
||||||
$wsClients[$params['idClient']] = $section;
|
if (count($params['idClient']) > 0) {
|
||||||
|
foreach ($params['idClient'] as $idClient) {
|
||||||
|
$wsClients[$idClient] = $section;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( array_key_exists($userInfos->idClient, $wsClients)
|
if ( array_key_exists($userInfos->idClient, $wsClients) && ( $this->serviceClient === false
|
||||||
&& ( $this->serviceClient === false
|
|
||||||
|| strtolower($this->serviceClientName) != $wsClients[$userInfos->idClient] ) ){
|
|| strtolower($this->serviceClientName) != $wsClients[$userInfos->idClient] ) ){
|
||||||
return '0901';
|
return '0901';
|
||||||
}
|
}
|
||||||
@ -797,44 +800,50 @@ class Scores_Ws_Server
|
|||||||
* Get an array of IP and IP range
|
* Get an array of IP and IP range
|
||||||
* 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
|
* 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
|
||||||
*/
|
*/
|
||||||
if ( !empty($userInfos->filtre_ip) && !in_array($ip, $this->listApplicationIp) ) {
|
|
||||||
$filtreIp = explode(';', trim($userInfos->filtre_ip, ';'));
|
if ( !in_array($ip, $this->listApplicationIp) ) {
|
||||||
if ( count($filtreIp)>0 ) {
|
if ( !empty($userInfos->filtre_ip) ) {
|
||||||
// Extranet
|
$filtreIp = explode(';', trim($userInfos->filtre_ip, ';'));
|
||||||
if ( substr($password,0,7)=='iponly:' ) {
|
if ( count($filtreIp)>0 ) {
|
||||||
$ipToValidate = substr($password,7);
|
|
||||||
}
|
// Extranet
|
||||||
// WebService
|
if ( substr($password,0,7)=='iponly:' ) {
|
||||||
else {
|
$ipToValidate = substr($password,7);
|
||||||
$ipToValidate = $ip;
|
|
||||||
}
|
|
||||||
//Validation
|
|
||||||
$overallIpValidate = false;
|
|
||||||
foreach ( $filtreIp as $filtre ) {
|
|
||||||
if ( strpos($filtre, '*') ) {
|
|
||||||
$filtre = str_replace('*', '0', $filtre) . '-' . str_replace('*', '255', $filtre);
|
|
||||||
}
|
}
|
||||||
// Is it a range ?
|
// WebService
|
||||||
if ( strpos($filtre, '-') ) {
|
|
||||||
$validateIp = new Scores_Validate_IpInNetwork();
|
|
||||||
$validateIp->setNetworkNotation($filtre);
|
|
||||||
$overallIpValidate = $validateIp->isValid($ipToValidate);
|
|
||||||
}
|
|
||||||
// Ip only
|
|
||||||
else {
|
else {
|
||||||
if ( $filtre === $ipToValidate ) {
|
$ipToValidate = $ip;
|
||||||
$overallIpValidate = true;
|
}
|
||||||
|
|
||||||
|
//Validation
|
||||||
|
$overallIpValidate = false;
|
||||||
|
foreach ( $filtreIp as $filtre ) {
|
||||||
|
if ( strpos($filtre, '*') ) {
|
||||||
|
$filtre = str_replace('*', '0', $filtre) . '-' . str_replace('*', '255', $filtre);
|
||||||
|
}
|
||||||
|
// Is it a range ?
|
||||||
|
if ( strpos($filtre, '-') ) {
|
||||||
|
$validateIp = new Scores_Validate_IpInNetwork();
|
||||||
|
$validateIp->setNetworkNotation($filtre);
|
||||||
|
$overallIpValidate = $validateIp->isValid($ipToValidate);
|
||||||
|
}
|
||||||
|
// Ip only
|
||||||
|
else {
|
||||||
|
if ( $filtre === $ipToValidate ) {
|
||||||
|
$overallIpValidate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Break foreach
|
||||||
|
if ( $overallIpValidate === true ) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Break foreach
|
|
||||||
if ( $overallIpValidate === true ) {
|
// Exit with error
|
||||||
break;
|
if ( $overallIpValidate === false ) {
|
||||||
|
return '0904';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Exit with error
|
|
||||||
if ( $overallIpValidate === false ) {
|
|
||||||
return '0904';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,7 +451,6 @@ class SdMetier_Sfr_Scoring
|
|||||||
}
|
}
|
||||||
|
|
||||||
$classInsee = new MInsee();
|
$classInsee = new MInsee();
|
||||||
$classInsee->AnnoncesInMemory = true;
|
|
||||||
|
|
||||||
//Values are already define ?
|
//Values are already define ?
|
||||||
if ( $this->ValDateCalculIndiscore === null ) {
|
if ( $this->ValDateCalculIndiscore === null ) {
|
||||||
@ -614,8 +613,8 @@ class SdMetier_Sfr_Scoring
|
|||||||
if ($this->debug) file_put_contents('sfr.log', "ValInseeAge = ".$this->ValInseeAge."\n", FILE_APPEND);
|
if ($this->debug) file_put_contents('sfr.log', "ValInseeAge = ".$this->ValInseeAge."\n", FILE_APPEND);
|
||||||
|
|
||||||
//Vérification validité du score
|
//Vérification validité du score
|
||||||
$dateUpdate = new Zend_Date(substr($this->ValDateUpdate,0,10), 'yyyy-MM-dd');
|
|
||||||
$dateNow = new Zend_Date();
|
$dateNow = new Zend_Date();
|
||||||
|
$dateUpdate = new Zend_Date(substr($this->ValDateUpdate,0,10), 'yyyy-MM-dd');
|
||||||
$diffUpdate = $dateNow->sub($dateUpdate);
|
$diffUpdate = $dateNow->sub($dateUpdate);
|
||||||
$measureUpdate = new Zend_Measure_Time($diffUpdate->toValue(), Zend_Measure_Time::SECOND);
|
$measureUpdate = new Zend_Measure_Time($diffUpdate->toValue(), Zend_Measure_Time::SECOND);
|
||||||
$measureUpdate->convertTo(Zend_Measure_Time::MONTH);
|
$measureUpdate->convertTo(Zend_Measure_Time::MONTH);
|
||||||
|
@ -121,8 +121,8 @@ class WDB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Database delete
|
* Database delete
|
||||||
* @param unknown $table
|
* @param string $table
|
||||||
* @param unknown $where
|
* @param string $where
|
||||||
* @param string $debug
|
* @param string $debug
|
||||||
* @param string $low_priority
|
* @param string $low_priority
|
||||||
* @return resource
|
* @return resource
|
||||||
@ -133,9 +133,9 @@ class WDB
|
|||||||
$this->errorMsg = '';
|
$this->errorMsg = '';
|
||||||
|
|
||||||
if ($low_priority)
|
if ($low_priority)
|
||||||
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
|
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.';';
|
||||||
else
|
else
|
||||||
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
|
$query='DELETE FROM '.$table.' WHERE '.$where.';';
|
||||||
|
|
||||||
if ($debug) $tdeb=microtime_float();
|
if ($debug) $tdeb=microtime_float();
|
||||||
|
|
||||||
|
@ -121,8 +121,8 @@ class WDB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Database delete
|
* Database delete
|
||||||
* @param unknown $table
|
* @param string $table
|
||||||
* @param unknown $where
|
* @param string $where
|
||||||
* @param string $debug
|
* @param string $debug
|
||||||
* @param string $low_priority
|
* @param string $low_priority
|
||||||
* @return resource
|
* @return resource
|
||||||
@ -133,9 +133,9 @@ class WDB
|
|||||||
$this->errorMsg = '';
|
$this->errorMsg = '';
|
||||||
|
|
||||||
if ($low_priority)
|
if ($low_priority)
|
||||||
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
|
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.';';
|
||||||
else
|
else
|
||||||
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
|
$query='DELETE FROM '.$table.' WHERE '.$where.';';
|
||||||
|
|
||||||
if ($debug) $tdeb=microtime_float();
|
if ($debug) $tdeb=microtime_float();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user