2012-10-16 07:44:31 +00:00
|
|
|
|
#!/usr/bin/php -c/var/www/batch/config/php_batch_sd.ini
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
|
|
|
|
|
|
|
|
include_once(FWK_PATH.'common/chiffres.php');
|
|
|
|
|
include_once(FWK_PATH.'common/dates.php');
|
|
|
|
|
include_once(INCLUDE_PATH.'bodacc/classMBodacc.php');
|
|
|
|
|
include_once(INCLUDE_PATH.'insee/classMInsee.php');
|
|
|
|
|
include_once(INCLUDE_PATH.'partenaires/classMLiens.php');
|
|
|
|
|
|
|
|
|
|
$iDb=new WDB('sdv1');
|
|
|
|
|
$iBodacc=new MBodacc();
|
|
|
|
|
$iInsee=new MInsee();
|
|
|
|
|
|
|
|
|
|
$strInfoScript='Usage : '.basename($argv[0]). " <option>
|
2013-06-19 08:24:49 +00:00
|
|
|
|
MAJ des liens Associ<EFBFBD>s G<EFBFBD>rants.
|
2012-10-16 07:44:31 +00:00
|
|
|
|
|
|
|
|
|
Options :
|
2013-06-19 08:24:49 +00:00
|
|
|
|
-i=XXX Reprendre <EFBFBD> la ligne XXX
|
2012-10-16 07:44:31 +00:00
|
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$iDeb=0;
|
|
|
|
|
|
|
|
|
|
$argv=$_SERVER['argv'];
|
|
|
|
|
|
|
|
|
|
for ($i=1,$j=0; isset($argv[$i]); $i++) {
|
|
|
|
|
if (substr($argv[$i],0,1)=='-') {
|
|
|
|
|
switch (substr($argv[$i],1,1)) {
|
|
|
|
|
case 'i': $iDeb=substr($argv[$i],3); break;
|
|
|
|
|
case '-':
|
|
|
|
|
case '?': die($strInfoScript); break;
|
|
|
|
|
default: die('Option '. $argv[$i] . " inconnue !\n");
|
|
|
|
|
}
|
|
|
|
|
} else $tabFichier[]=$argv[$i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$nbSiren=$iDb->select( /*'logs',
|
|
|
|
|
'siren, count(*) as nb',
|
2013-06-19 08:24:49 +00:00
|
|
|
|
"page='identite' AND siren IN (SELECT DISTINCT(siren) FROM jo.rncs_dirigeants WHERE fonction_lib='Associ<63>-g<>rant') GROUP BY siren",*/
|
2012-10-16 07:44:31 +00:00
|
|
|
|
//'jo.rncs_dirigeants',
|
|
|
|
|
'jo.etablissements_old',
|
|
|
|
|
'DISTINCT(siren)',
|
2013-06-19 08:24:49 +00:00
|
|
|
|
//"fonction_lib='Associ<63>-g<>rant'",
|
2012-10-16 07:44:31 +00:00
|
|
|
|
//"cj=5498",
|
|
|
|
|
"cj=5202",
|
|
|
|
|
false, MYSQL_ASSOC, true);
|
|
|
|
|
|
2013-06-19 08:24:49 +00:00
|
|
|
|
echo date ('Y/m/d - H:i:s') . " - Il y a $nbSiren siren <20> traiter !".EOL;
|
2012-10-16 07:44:31 +00:00
|
|
|
|
$i=0;
|
|
|
|
|
while ($tab=$iDb->fetch(MYSQL_ASSOC)) {
|
|
|
|
|
$i++;
|
|
|
|
|
if ($i<=$iDeb) continue;
|
|
|
|
|
$siren=$tab['siren'];
|
|
|
|
|
echo date ('Y/m/d - H:i:s') . " - Ligne $i/$nbSiren - $siren : ";//.$tab['nb'].' consultations... ';
|
|
|
|
|
$mLiens=new MLiens($siren);
|
|
|
|
|
$tabA=$mLiens->getActionnaires($siren, true);
|
|
|
|
|
$nbA=count($tabA);
|
|
|
|
|
echo "$nbA liens ";
|
|
|
|
|
if ($tabA[0]['Siren']*1>0)
|
|
|
|
|
echo "dont au moins 1 avec siren";
|
|
|
|
|
echo EOL;
|
|
|
|
|
//die();
|
|
|
|
|
//sleep(2);
|
|
|
|
|
}
|
|
|
|
|
echo date ('Y/m/d - H:i:s') . " - Fin du Traitement.".EOL;
|
|
|
|
|
?>
|