|
|
|
@ -4226,6 +4226,9 @@ class MInsee
|
|
|
|
|
$where.=" AND e.ROLE IN('".implode("','",$tabCodRol)."') ";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- Type annonce
|
|
|
|
@ -4255,6 +4258,9 @@ class MInsee
|
|
|
|
|
$where.= implode(' OR ',$tabTmp);
|
|
|
|
|
$where.= ')';
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $where;
|
|
|
|
@ -4286,7 +4292,7 @@ class MInsee
|
|
|
|
|
foreach ($tabEven as $even) {
|
|
|
|
|
if ( intval($even)!=0 ) {
|
|
|
|
|
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
|
|
|
|
|
$this->debutPlan = str_replace('-','',$annonce['dateJugement']); // SSAAMMJJ
|
|
|
|
|
if ( preg_match('/dur.e(?:.*)plan(?:.*)(\d+)\s+ans?/Uisu', $annonce['annonce'], $matches) ) {
|
|
|
|
@ -4690,7 +4696,7 @@ class MInsee
|
|
|
|
|
if ($idAnnonce != 0) {
|
|
|
|
|
// --- Annonce
|
|
|
|
|
if (substr($idAnnonce,0,2) == '0.') {
|
|
|
|
|
$idAnnonce == substr($idAnnonce,2);
|
|
|
|
|
$idAnnonce = substr($idAnnonce,2);
|
|
|
|
|
$sqlAnnonceWhere = "a.id=$idAnnonce";
|
|
|
|
|
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
|
|
|
|
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
|
|
|
@ -4725,16 +4731,21 @@ class MInsee
|
|
|
|
|
$sqlBodacc = $this->getAnnoncesLegalesBodacc()." WHERE ".$sqlBodaccWhere;
|
|
|
|
|
|
|
|
|
|
// --- Where Histo
|
|
|
|
|
$sqlHistoRubrique = $this->getAnnoncesLegalesRubrique('histo', $rubrique);
|
|
|
|
|
if ($sqlHistoRubrique !== false) {
|
|
|
|
|
$sqlHistoWhere = "e.E1GSIR=$siren";
|
|
|
|
|
$sqlHistoWhere.= $this->getAnnoncesLegalesRubrique('histo', $rubrique);
|
|
|
|
|
$sqlHistoWhere.= $sqlHistoRubrique;
|
|
|
|
|
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
|
|
|
|
|
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
|
|
|
|
|
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
|
|
|
|
|
$sqlHisto = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- Where Annonce
|
|
|
|
|
$sqlAnnonceRubrique = $this->getAnnoncesLegalesRubrique('annonce', $rubrique);
|
|
|
|
|
if ($sqlAnnonceRubrique !== false) {
|
|
|
|
|
$sqlAnnonceWhere = "a.siren=$siren";
|
|
|
|
|
$sqlAnnonceWhere.= $this->getAnnoncesLegalesRubrique('annonce', $rubrique);
|
|
|
|
|
$sqlAnnonceWhere.= $sqlAnnonceRubrique;
|
|
|
|
|
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
|
|
|
|
if ($visualisation === true) {
|
|
|
|
|
// --- Ne pas afficher les annonces si la procédure à plus de 4 mois
|
|
|
|
@ -4742,9 +4753,17 @@ class MInsee
|
|
|
|
|
}
|
|
|
|
|
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
|
|
|
|
$sqlAnnonce = $this->getAnnoncesLegalesAnnonce()." WHERE ".$sqlAnnonceWhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- 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);
|
|
|
|
|
|
|
|
|
@ -5327,18 +5346,23 @@ class MInsee
|
|
|
|
|
//$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;
|
|
|
|
|
if (count($bodacc)>0) {
|
|
|
|
|
foreach ($bodacc as $k=>$ann) {
|
|
|
|
|
$tabRetEven=array();
|
|
|
|
|
$tabRetEven[]=array('CodeEven'=>$mBalo->getLibEven($ann['Categorie']),
|
|
|
|
|
'LibEven'=> $ann['Categorie']);
|
|
|
|
|
if (count($bodacc) > 0) {
|
|
|
|
|
foreach ($bodacc as $k => $ann) {
|
|
|
|
|
$tabRetEven = array();
|
|
|
|
|
$tabRetEven[] = array(
|
|
|
|
|
'CodeEven' => $mBalo->getLibEven($ann['Categorie']),
|
|
|
|
|
'LibEven' => $ann['Categorie']
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$tabRet[$k]=array( 'id'=>$ann['Num_Affaire'].'.'.$ann['Num_Parution'],
|
|
|
|
|
$tabRet[$k]=array(
|
|
|
|
|
'id'=>$ann['Num_Affaire'].'.'.$ann['Num_Parution'],
|
|
|
|
|
'BodaccCode'=>'BALO',
|
|
|
|
|
'BodaccNum'=>$ann['Num_Parution'],
|
|
|
|
|
'NumAnnonce'=>$ann['Num_Affaire'],
|
|
|
|
@ -5352,8 +5376,12 @@ class MInsee
|
|
|
|
|
'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;
|
|
|
|
@ -5364,9 +5392,10 @@ class MInsee
|
|
|
|
|
* @param string $siren
|
|
|
|
|
* @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;
|
|
|
|
|
if (count($bodacc)>0) {
|
|
|
|
|
$nb = $bodacc[0]['nb'];
|
|
|
|
@ -5383,71 +5412,68 @@ class MInsee
|
|
|
|
|
* @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>
|
|
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
|
elseif ($siren<010000000) $siren='00'.$siren;
|
|
|
|
|
elseif ($siren<100000000) $siren='0'.$siren;
|
|
|
|
|
$strIdAnn = '';
|
|
|
|
|
$idA = 0;
|
|
|
|
|
$tabRet = array();
|
|
|
|
|
|
|
|
|
|
$strIdAnn='';
|
|
|
|
|
$idA=0;
|
|
|
|
|
$tabRet=array();
|
|
|
|
|
|
|
|
|
|
$mBoamp=new MBoamp();
|
|
|
|
|
$mBoamp = new MBoamp();
|
|
|
|
|
|
|
|
|
|
// --- Recherche dans les avis d'attribution
|
|
|
|
|
if ( is_string($type) && $type=='A' || is_array($type) && in_array('A',$type) ) {
|
|
|
|
|
|
|
|
|
|
/** Recherche dans les avis d'attribution **/
|
|
|
|
|
if ($idAnnonce<>'') {
|
|
|
|
|
$tmp=explode('.', $idAnnonce);
|
|
|
|
|
$idA=$tmp[1];
|
|
|
|
|
//if (strlen($tmp[0])==9 && is_numeric($tmp[0])) $rcs=$tmp[0];
|
|
|
|
|
if ($idAnnonce != '') {
|
|
|
|
|
$tmp = explode('.', $idAnnonce);
|
|
|
|
|
$idA = $tmp[1];
|
|
|
|
|
if ($tmp[0]=='A') $strIdAnn=" AND l.id='$idA' ";
|
|
|
|
|
elseif ($tmp[0]=='O') $strIdAnn="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$bodacc = $this->iDb->select(
|
|
|
|
|
'jo.boamp_lots l, jo.boamp b, jo.boamp_detail d',
|
|
|
|
|
$bodacc = $this->iDb->select('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.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) {
|
|
|
|
|
foreach ($bodacc as $k=>$ann) {
|
|
|
|
|
foreach ($bodacc as $k => $ann) {
|
|
|
|
|
$tabRetEven=array();
|
|
|
|
|
/*montantTxt, l.montant, l.montantAnMin, , l.trancheCond, l.trancheFerme, l.dateAttrib*/
|
|
|
|
|
if ($ann['nom']<>'') $strMontant=' "'.strtoupper($ann['raisonSociale']).'"';
|
|
|
|
|
|
|
|
|
|
if ($ann['montant']*1>0) $strMontant.=' ('.number_format($ann['montant'], 2, ',', ' ').' EUR)';
|
|
|
|
|
elseif ($ann['montantTxt']<>'') $strMontant.=' ('.$ann['montantTxt'].')';
|
|
|
|
|
elseif ($ann['montantAnMin']<>'' && $ann['montantAnMax'])
|
|
|
|
|
$strMontant.=' ('.$ann['montantAnMin'].' à '.
|
|
|
|
|
$ann['montantAnMax'].')';
|
|
|
|
|
$strMontant.=' ('.$ann['montantAnMin'].' à '.$ann['montantAnMax'].')';
|
|
|
|
|
elseif ($ann['trancheCond']<>'' && $ann['trancheFerme'])
|
|
|
|
|
$strMontant.=' ('.$ann['trancheCond'].' / '.
|
|
|
|
|
$ann['trancheFerme'].')';
|
|
|
|
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
|
|
|
|
else $strMontant.='';
|
|
|
|
|
$tabRetEven[]=array('CodeEven'=>$mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
|
|
|
|
'LibEven'=>$mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$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 {
|
|
|
|
|
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';
|
|
|
|
|
$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'],
|
|
|
|
|
$tabRet[$k] = array(
|
|
|
|
|
'id'=>'A.'.$ann['id'],
|
|
|
|
|
'BodaccCode'=>$ann['Boamp_Code'],
|
|
|
|
|
'BodaccNum'=>$ann['Boamp_Num'],
|
|
|
|
|
'NumAnnonce'=>$numAnn,
|
|
|
|
@ -5466,12 +5492,12 @@ class MInsee
|
|
|
|
|
'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', '',
|
|
|
|
|
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/>')
|
|
|
|
@ -5479,30 +5505,29 @@ class MInsee
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- Recherche dans les avis de marchés
|
|
|
|
|
if ( is_string($type) && $type=='M' || is_array($type) && in_array('M',$type) ) {
|
|
|
|
|
// Recherche dans les avis de marchés
|
|
|
|
|
|
|
|
|
|
if ($idAnnonce<>'') {
|
|
|
|
|
$tmp=explode('.', $idAnnonce);
|
|
|
|
|
$idA=$tmp[1];
|
|
|
|
|
//if (strlen($tmp[0])==9 && is_numeric($tmp[0])) $rcs=$tmp[0];
|
|
|
|
|
$tmp = explode('.', $idAnnonce);
|
|
|
|
|
$idA = $tmp[1];
|
|
|
|
|
if ($tmp[0]=='A') $strIdAnn=" AND d.id='$idA' ";
|
|
|
|
|
elseif ($tmp[0]=='O') $strIdAnn="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$bodacc=$this->iDb->select(
|
|
|
|
|
'boamp b, boamp_detail d',
|
|
|
|
|
$bodacc = $this->iDb->select('jo.boamp b, jo.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.siren='$siren' AND d.id=b.id $strIdAnn GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC",
|
|
|
|
|
false, MYSQL_ASSOC
|
|
|
|
|
);
|
|
|
|
|
"d.siren=$siren AND d.id=b.id $strIdAnn GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC", false, MYSQL_ASSOC);
|
|
|
|
|
|
|
|
|
|
if (count($bodacc)>0) {
|
|
|
|
|
foreach ($bodacc as $k=>$ann) {
|
|
|
|
|
$id=$ann['id'];
|
|
|
|
|
$rub=$ann['Boamp_Rubrique'];
|
|
|
|
|
$tabRetEven=array();
|
|
|
|
|
$strMontant='';
|
|
|
|
|
foreach ($bodacc as $k => $ann) {
|
|
|
|
|
$id = $ann['id'];
|
|
|
|
|
$rub = $ann['Boamp_Rubrique'];
|
|
|
|
|
$tabRetEven = array();
|
|
|
|
|
$strMontant = '';
|
|
|
|
|
if ($ann['objet']<>'') $strMontant.=' "'.$ann['objet'].'"';
|
|
|
|
|
|
|
|
|
|
if ($rub=='6' || // Avis d'attribution
|
|
|
|
@ -5519,24 +5544,25 @@ class MInsee
|
|
|
|
|
$rub=='96' || // Annulation - Rectificatif - Sans suite - Infructueux
|
|
|
|
|
$rub=='977' // Annulation - Rectificatif / Avis en cas de transparence ex ante volontaire
|
|
|
|
|
) {
|
|
|
|
|
$tabTmp=$this->iDb->select( '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",
|
|
|
|
|
$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.idAnn=$id", false, MYSQL_ASSOC);
|
|
|
|
|
foreach ($tabTmp as $k2=>$ann2) {
|
|
|
|
|
if ($ann2['nom']<>'') $strMontant.=' "'.strtoupper($ann2['nom']).'"';
|
|
|
|
|
if ($ann2['montant']*1>0) $strMontant.=' ('.number_format($ann2['montant'], 2, ',', ' ').' EUR)';
|
|
|
|
|
elseif ($ann2['montantTxt']<>'') $strMontant.=' ('.$ann2['montantTxt'].')';
|
|
|
|
|
elseif ($ann2['montantAnMin']<>'' && $ann2['montantAnMax'])
|
|
|
|
|
$strMontant.=' ('.$ann2['montantAnMin'].' à '.
|
|
|
|
|
$ann2['montantAnMax'].')';
|
|
|
|
|
$strMontant.=' ('.$ann2['montantAnMin'].' à '.$ann2['montantAnMax'].')';
|
|
|
|
|
elseif ($ann2['trancheCond']<>'' && $ann2['trancheFerme'])
|
|
|
|
|
$strMontant.=' ('.$ann['trancheCond'].' / '.
|
|
|
|
|
$ann['trancheFerme'].')';
|
|
|
|
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
|
|
|
|
else $strMontant.='';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$tabRetEven[]=array('CodeEven'=>$mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
|
|
|
|
'LibEven'=>$mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$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'];
|
|
|
|
@ -5550,7 +5576,8 @@ class MInsee
|
|
|
|
|
$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,
|
|
|
|
|
$tabRet[$k] = array(
|
|
|
|
|
'id'=>'O.'.$id,
|
|
|
|
|
'BodaccCode'=>$ann['Boamp_Code'],
|
|
|
|
|
'BodaccNum'=>$ann['Boamp_Num'],
|
|
|
|
|
'NumAnnonce'=>$numAnn,
|
|
|
|
@ -5566,12 +5593,12 @@ class MInsee
|
|
|
|
|
'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', '',
|
|
|
|
|
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/>')
|
|
|
|
@ -5579,6 +5606,8 @@ class MInsee
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
debugLog('I', "getAnnoncesBoamp(siren=$siren, idAnnonce=$idAnnonce, $idA)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
|
|
|
|
return $tabRet;
|
|
|
|
|
}
|
|
|
|
@ -5592,29 +5621,34 @@ class MInsee
|
|
|
|
|
{
|
|
|
|
|
$bodaccA = array();
|
|
|
|
|
$bodaccM = array();
|
|
|
|
|
|
|
|
|
|
// --- Recherche dans les avis d'attribution
|
|
|
|
|
if ( $type=='' || $type=='A' ) {
|
|
|
|
|
|
|
|
|
|
/** Recherche dans les avis d'attribution **/
|
|
|
|
|
$bodaccA=$this->iDb->select(
|
|
|
|
|
'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
|
|
|
|
|
);
|
|
|
|
|
$bodaccA = $this->iDb->select('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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- Recherche dans les avis de marchés
|
|
|
|
|
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
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$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);
|
|
|
|
|
|
|
|
|
|
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__);
|
|
|
|
|
|
|
|
|
|