batch/1.1/old/getBilans.php
2012-10-16 07:44:31 +00:00

165 lines
4.6 KiB
PHP

#!/usr/bin/php -c/var/www/batch/config/php_batch_sd.ini
<?php
include_once(FWK_PATH.'common/chiffres.php');
include_once(FWK_PATH.'common/dates.php');
include_once(FWK_PATH.'common/ftp.php');
include_once(INCLUDE_PATH.'insee/classMInsee.php');
include_once(INCLUDE_PATH.'partenaires/classMBilans.php');
$tabSiren=array(353151459,
947151239,
303217368,
409797230,
493200281,
378063903,
398862078,
308101591,
410645121,
389580606,
317898492,
405209099,
438732083,
442825410,
451439459,
337753149,
313525909,
379639420,
401136312,
403058415,
331503656,
418963005,
312904394,
332746718,
412442022,
421615295,
504873852,
342583796,
307016121,
408308120,
314843277,
391806056,
433887130,
709802599,
490257573,
438736407,
421131558,
450249040,
341209724,
796680668,
452643190,
388622086,
432919108,
440099059,
344202114,
320979834,
324569748,
334981735,
378441919,
430410969,
448310771,
452553175,
424232064,
420969164,
449718071,
433032661,
398989657,
422996280,
441029337,
302695325,
309917623,
310966650,
335218624,
338808785,
343712709,
348038357,
388830903,
390048700,
392466058,
410172159,
410971790,
414998906,
451257547,
303573927,
305009482,
326465028,
601720386,
380562918,
435088919,
315044321,
309979565,
331182691,
501870661,
408711075,
434855169,
483872289,
391448552,
393417522,
403547102,
555133172,
304975279,
350148532,
417790797,
636820201,
300434180,
344134796,
393660329,
433604691,
378502264,
440525376,
338385685,
301918371,
442639662,
397658931,
309004331,
408770758,
438026346,
409136272,
438549065,
430344150,
417949161,
479932428,
413496316,
573780905,
722780665,
424443893,
329690648,
451161806,
318732781,
403218449,
448929604,
300237633,
383751419,
408829224,
382626802,
421848789,
443574926,
479466062,
484026612,
349588541,
319587234,
380655548,
422593491,
341284099,
393852702,
403885320);
$fp=fopen('./bilansToyotaFS.csv', 'a');
fwrite($fp, "siren;mil;dateProvPartenaire;dateInsert;dureeExercice;dateExercicePre;dureeExercicePre;".EOL);
foreach ($tabSiren as $siren) {
$mBil=new MBilans($siren);
$tabBilans=@$mBil->listeBilans(true);
fwrite($fp, "$siren;");
foreach ($tabBilans as $mil=>$bilan) {
fwrite($fp, "$mil;". $bilan['dateProvPartenaire'].';'.
$bilan['dateInsert'].';'.
$bilan['dureeExercice'].';'.
$bilan['dateExercicePre'].';'.
$bilan['dureeExercicePre']);
break;
}
fwrite($fp, EOL);
}
?>