Correction requete SQL Boamp
This commit is contained in:
parent
0222b6d629
commit
eaddebacdb
@ -5327,18 +5327,23 @@ 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(
|
||||||
|
'id'=>$ann['Num_Affaire'].'.'.$ann['Num_Parution'],
|
||||||
'BodaccCode'=>'BALO',
|
'BodaccCode'=>'BALO',
|
||||||
'BodaccNum'=>$ann['Num_Parution'],
|
'BodaccNum'=>$ann['Num_Parution'],
|
||||||
'NumAnnonce'=>$ann['Num_Affaire'],
|
'NumAnnonce'=>$ann['Num_Affaire'],
|
||||||
@ -5352,8 +5357,12 @@ class MInsee
|
|||||||
'evenements'=>$tabRetEven,
|
'evenements'=>$tabRetEven,
|
||||||
'Lien_Annonce_Pdf'=>basename($ann['Url_Annonce_Pdf']),
|
'Lien_Annonce_Pdf'=>basename($ann['Url_Annonce_Pdf']),
|
||||||
);
|
);
|
||||||
if ($idAnnonce<>0) $tabRet[$k]['texteAnnonce']=strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
if ($idAnnonce<>0)
|
||||||
preg_replace('/( class=".*")/ie', ' ', $ann['Annonce_Html'])), array(' '=>' ', '</html>'=>'', '</body>'=>''));
|
$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 +5373,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,71 +5393,68 @@ 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 (strlen($tmp[0])==9 && is_numeric($tmp[0])) $rcs=$tmp[0];
|
|
||||||
if ($tmp[0]=='A') $strIdAnn=" AND l.id='$idA' ";
|
if ($tmp[0]=='A') $strIdAnn=" AND l.id='$idA' ";
|
||||||
elseif ($tmp[0]=='O') $strIdAnn="";
|
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'].' / '.
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
||||||
$ann['trancheFerme'].')';
|
|
||||||
else $strMontant.='';
|
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
|
// Axxx pour lot attribué ou Oxxx pour Organisation
|
||||||
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
||||||
else $numAnn=$ann['Num_Annonce'];
|
else $numAnn=$ann['Num_Annonce'];
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
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';
|
$lienMapa = 'http://www.boamp.fr/index.php?action=avis&num_parution=MAPA&num_annonce='.
|
||||||
else {
|
$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
|
} else {
|
||||||
$lettre = substr($ann['Boamp_Code'],-1);
|
$lettre = substr($ann['Boamp_Code'],-1);
|
||||||
$annee = $ann['Boamp_Annee_Parution'];
|
$annee = $ann['Boamp_Annee_Parution'];
|
||||||
$num = sprintf("%04d",$ann['Boamp_Num']);
|
$num = sprintf("%04d",$ann['Boamp_Num']);
|
||||||
$numPar=$lettre.$annee.$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';
|
$lienMapa = 'http://www.boamp.fr/index.php?action=avis&num_parution='.
|
||||||
|
$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
}
|
}
|
||||||
$infosComp='';
|
$infosComp='';
|
||||||
$objetMarche=trim($ann['objet'].' '.$ann['objetAutre'].' '.$ann['autres']);
|
$objetMarche=trim($ann['objet'].' '.$ann['objetAutre'].' '.$ann['autres']);
|
||||||
//titre, titreMarche, typeObjetMarche
|
//titre, titreMarche, typeObjetMarche
|
||||||
$tabRet[$k]=array( 'id'=>'A.'.$ann['id'],
|
$tabRet[$k] = array(
|
||||||
|
'id'=>'A.'.$ann['id'],
|
||||||
'BodaccCode'=>$ann['Boamp_Code'],
|
'BodaccCode'=>$ann['Boamp_Code'],
|
||||||
'BodaccNum'=>$ann['Boamp_Num'],
|
'BodaccNum'=>$ann['Boamp_Num'],
|
||||||
'NumAnnonce'=>$numAnn,
|
'NumAnnonce'=>$numAnn,
|
||||||
@ -5466,12 +5473,12 @@ class MInsee
|
|||||||
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($idA<>0)
|
if ($idA<>0) {
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
if ($ann['Boamp_Code']=='MAPA') {
|
||||||
$tabRet[$k]['texteAnnonce']=$ann['annonce'];
|
$tabRet[$k]['texteAnnonce'] = $ann['annonce'];
|
||||||
else
|
} else {
|
||||||
$tabRet[$k]['texteAnnonce']=
|
$tabRet[$k]['texteAnnonce'] = strtr(
|
||||||
strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
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/>')
|
||||||
@ -5479,30 +5486,29 @@ class MInsee
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 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
|
||||||
@ -5519,24 +5525,25 @@ class MInsee
|
|||||||
$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'].' / '.
|
$strMontant.=' ('.$ann['trancheCond'].' / '.$ann['trancheFerme'].')';
|
||||||
$ann['trancheFerme'].')';
|
|
||||||
else $strMontant.='';
|
else $strMontant.='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tabRetEven[]=array('CodeEven'=>$mBoamp->getCodEvenSd($ann['Boamp_Rubrique']),
|
$tabRetEven[] = array(
|
||||||
'LibEven'=>$mBoamp->getLibEvenBoamp($ann['Boamp_Rubrique'], $ann['Boamp_Rubrique_Lib']).$strMontant);
|
'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
|
// Axxx pour lot attribué ou Oxxx pour Organisation
|
||||||
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
if ($ann['Num_AnnoncePre']<>0) $numAnn=$ann['Num_AnnoncePre'].'-'.$ann['Num_Annonce'];
|
||||||
else $numAnn=$ann['Num_Annonce'];
|
else $numAnn=$ann['Num_Annonce'];
|
||||||
@ -5550,7 +5557,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';
|
$lienMapa='http://www.boamp.fr/index.php?action=avis&num_parution='.$numPar.'&num_annonce='.$ann['Num_Annonce'].'&total=500&_s=0&indice=0';
|
||||||
}
|
}
|
||||||
$infosComp='';
|
$infosComp='';
|
||||||
$tabRet[$k]=array( 'id'=>'O.'.$id,
|
$tabRet[$k] = array(
|
||||||
|
'id'=>'O.'.$id,
|
||||||
'BodaccCode'=>$ann['Boamp_Code'],
|
'BodaccCode'=>$ann['Boamp_Code'],
|
||||||
'BodaccNum'=>$ann['Boamp_Num'],
|
'BodaccNum'=>$ann['Boamp_Num'],
|
||||||
'NumAnnonce'=>$numAnn,
|
'NumAnnonce'=>$numAnn,
|
||||||
@ -5566,12 +5574,12 @@ class MInsee
|
|||||||
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
'Lien_Annonce_Html'=>$lienMapa, // Non géré
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($idA<>0)
|
if ($idA<>0) {
|
||||||
if ($ann['Boamp_Code']=='MAPA')
|
if ($ann['Boamp_Code']=='MAPA') {
|
||||||
$tabRet[$k]['texteAnnonce']=$ann['annonce'];
|
$tabRet[$k]['texteAnnonce'] = $ann['annonce'];
|
||||||
else
|
} else {
|
||||||
$tabRet[$k]['texteAnnonce']=
|
$tabRet[$k]['texteAnnonce'] = strtr(
|
||||||
strtr( preg_replace('/<html.*<body.*>/Uis', '',
|
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/>')
|
||||||
@ -5579,6 +5587,8 @@ class MInsee
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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 +5602,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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Recherche dans les avis de marchés
|
||||||
if ( $type=='' || $type=='M') {
|
if ( $type=='' || $type=='M') {
|
||||||
/** Recherche dans les avis de marchés **/
|
$bodaccM = $this->iDb->select('jo.boamp b, jo.boamp_detail d', "d.id",
|
||||||
$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",
|
||||||
"d.siren='$siren' AND d.id=b.id GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC",
|
false, MYSQL_ASSOC);
|
||||||
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__);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user