#!/usr/bin/php -c/var/www/batch/config/php_batch_sd.ini select( 'bodacc_detail', 'id, siren, VenteMt, Bodacc_Date_Parution, publication, publicationNom, publicationDate, SUBSTRING(codePostal,1,3) AS dep3', "id>15000000 AND Rubrique='ventes' GROUP BY id", false, MYSQL_ASSOC); $nb=count($rep); echo "num\tidAnn\tsiren\tmontantVte\tdateJal\tdateBod\tnomJalBod\tdept\tJal\tidJal".EOL; foreach($rep as $i=>$vte) { $id=$vte['id']; $nom=$vte['publication']; $datePub=$vte['publicationDate']; $dateBod=$vte['Bodacc_Date_Parution']; $siren=$vte['siren']; $mt=$vte['VenteMt']; if (strlen($nom)<10) continue; $dep=$vte['dep3']*1; if ($dep<970) $dep=substr($vte['dep3'],0,2); echo "$i/$nb\t$id\t$siren\t$mt\t$datePub\t$dateBod\t$nom\t$dep\t"; $nom2=trim(addslashes($vte['publicationNom'])); $rep=$iDb->select('tabJAL', "id, nomJal", "dep=$dep AND nomJal='$nom2'", false, MYSQL_ASSOC); $idJal=@$rep[0]['id']*1; if ($idJal==0) { $rep=$iDb->select('tabJAL', "id, nomJal, MATCH(nomJal) AGAINST('$nom2') AS pertinence", "dep=$dep HAVING pertinence>1 ORDER BY pertinence DESC LIMIT 0,3", false, MYSQL_ASSOC); $idJal=@$rep[0]['id']; } $nomJal=@$rep[0]['nomJal']; echo "$nomJal\t$idJal".EOL; //die(); //$nomTrouve".EOL; } die(); */ /* $tabSiren=array(318919065, 328412440, 347902587, 349339341, 379699770, 379776057, 379848146, 398984062, 414789016, 414813246, 572140788, 674800859); foreach($tabSiren as $siren) { $tabIndiscore=@calculIndiScore($siren, 0, false, 3, false); print_r($tabIndiscore); } die(); */ $ape77=$ca5=$ratios=false; $strInfoScript='Usage : '.basename($argv[0]). "