Correction
This commit is contained in:
parent
01a732e38d
commit
14e32fc188
@ -15,31 +15,48 @@ set_include_path(implode(PATH_SEPARATOR, array(
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
/** Zend_Application */
|
||||
require_once 'Zend/Application.php';
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
|
||||
|
||||
require_once APPLICATION_PATH.'/configs/config.php';
|
||||
|
||||
require_once 'framework/fwk.php';
|
||||
require_once 'framework/common/chiffres.php';
|
||||
require_once 'framework/common/dates.php';
|
||||
require_once 'framework/mail/sendMail.php';
|
||||
require_once 'Metier/conversion/bilAltares.php';
|
||||
require_once 'Metier/partenaires/classMLiens.php';
|
||||
require_once 'Metier/partenaires/classMLiens2.php';
|
||||
require_once 'Metier/partenaires/classMBanques.php';
|
||||
|
||||
|
||||
define ('FB_FTP_LOCALDIR', '/home/data/ftp/fransbonhomme/');
|
||||
|
||||
$tabCreation=array(
|
||||
'a'=>'N/D',
|
||||
'a1'=>'Création',
|
||||
'a3'=>'Achat',
|
||||
'a4'=>'Apport',
|
||||
'a6'=>'Prise en location gérance',
|
||||
'a7'=>'Partage',
|
||||
'a8'=>'Reprise',
|
||||
'aA'=>'Reprise globale de l\'exploitation agricole',
|
||||
'aB'=>'Poursuite de l\'exploitation agricole par le conjoint',
|
||||
'aC'=>'Transfert de propriété de l\'exploitation agricole',
|
||||
'aD'=>'Apport d\'exploitation(s) agricole(s) individuelle(s)',
|
||||
'aE'=>'Reprise d\'exploitation agricole individuelle',
|
||||
$tabCreation = array(
|
||||
'a'=>'N/D',
|
||||
'a1' => 'Création',
|
||||
'a2' => 'Création suite à déménagement',
|
||||
'a3' => 'Achat',
|
||||
'a4' => 'Apport',
|
||||
'a6' => 'Prise en location gérance',
|
||||
'a7' => 'Partage',
|
||||
'a8' => 'Reprise',
|
||||
'aA' => 'Reprise globale de l\'exploitation agricole',
|
||||
'aB' => 'Poursuite de l\'exploitation agricole par le conjoint',
|
||||
'aC' => 'Transfert de propriété de l\'exploitation agricole',
|
||||
'aD' => 'Apport d\'exploitation(s) agricole(s) individuelle(s)',
|
||||
'aE' => 'Reprise d\'exploitation agricole individuelle',
|
||||
);
|
||||
|
||||
$tabTypeExploitation = array(
|
||||
@ -165,8 +182,8 @@ for ($iFic=0; isset($tabFichLigneCmd[$iFic]); $iFic++)
|
||||
$siren=substr($ligne, 0, 9);
|
||||
$ref =substr($ligne, 9, 10);
|
||||
if ($iInsee->valideSiren($siren)) {
|
||||
$tabId=@$iInsee->getIdentiteEntreprise($siren,0,0,false,false);
|
||||
$tabIndiscore=@calculIndiScore($siren, 0, false, 3, false);
|
||||
$tabId = $iInsee->getIdentiteEntreprise($siren,0,0,false,false);
|
||||
$tabIndiscore = calculIndiScore($siren, 0, false, 2, false);
|
||||
// calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mailDebug=true) {
|
||||
$siretOut=$tabId['SiretSiege'];
|
||||
$tabTmp=$iDb->select('scores_surveillance',
|
||||
@ -406,18 +423,56 @@ for ($iFic=0; isset($tabFichLigneCmd[$iFic]); $iFic++)
|
||||
|
||||
/** § commentaires **/
|
||||
$nbLiP=$nbLiM=0;
|
||||
$startLi = false;
|
||||
$startPaiement = 0;
|
||||
foreach ($tabIndiscore['tabCommentaires'] as $i=>$txt) {
|
||||
if ($i==5000) continue;
|
||||
if ($i==10000700 || $i==10000800 || $i==10001000)
|
||||
$rapport.=initstr('', 80).EOL;
|
||||
$ligneLiP=$ligneLiM=false;
|
||||
if (preg_match('/LI\+/i', $txt)) { $ligneLiP=true; $nbLiP++; }
|
||||
elseif (preg_match('/LI\-/i', $txt)) { $ligneLiM=true; $nbLiM++; }
|
||||
if (($nbLiP>5 && $ligneLiP) || ($nbLiM>5 && $ligneLiM))
|
||||
|
||||
if ($i==10001000 || $startPaiement==1) {
|
||||
$rapport.= initstr('', 80).EOL;
|
||||
$startPaiement++;
|
||||
} else {
|
||||
$startPaiement=0;
|
||||
}
|
||||
|
||||
if ($i==10000700 || $i==10000800) {
|
||||
$rapport.= initstr('', 80).EOL;
|
||||
$startLi = true;
|
||||
} else {
|
||||
$startLi = false;
|
||||
}
|
||||
|
||||
$ligneLi = false;
|
||||
if (preg_match('/LI\+/i', $txt)) { $ligneLi=true; $nbLiP++; }
|
||||
elseif (preg_match('/LI\-/i', $txt)) { $ligneLi=true; $nbLiM++; }
|
||||
|
||||
if (!$startLi && !$ligneLi && $startPaiement==0) {
|
||||
continue;
|
||||
$rapport.=wordwrap(strip_tags(strtr(html_entity_decode($txt, ENT_QUOTES),
|
||||
array('<LI+>'=>'+','<LI->'=>'-',' '=>' ','€'=>'E'))),80,EOL).EOL;
|
||||
}
|
||||
//Plus de 5 LI, on arrete
|
||||
if ( ($nbLiP>5 && $ligneLiP) || ($nbLiM>5 && $ligneLiM) ) {
|
||||
continue;
|
||||
}
|
||||
//echo "Ligne : $i => $txt\n";
|
||||
|
||||
/*$txt = strtr($txt, array(
|
||||
'<LI+>'=>'+',
|
||||
'<LI->'=>'-',
|
||||
' '=>' ',
|
||||
'€'=>'E',
|
||||
'€'=>'E',
|
||||
chr(160)=>' ',
|
||||
));*/
|
||||
//$txt = str_replace(array('<LI+>','<LI->',' ','€','€',chr(160)), array('+','-',' ','E','E',' '), $txt);
|
||||
$txt = str_replace(array('<LI+>','<LI->','€'), array('+','-','E'), $txt);
|
||||
//echo ".=> $txt\n";
|
||||
$txt = html_entity_decode($txt, ENT_QUOTES, 'UTF-8');
|
||||
//echo ".=> $txt\n";
|
||||
$txt = wordwrap(strip_tags($txt),80,EOL).EOL;
|
||||
//echo ".=> $txt\n";
|
||||
$rapport.= $txt;
|
||||
}
|
||||
//exit;
|
||||
//unsetGlobals();
|
||||
//print_r($tabIndiscore['tabCommentaires']);
|
||||
//die();
|
||||
@ -436,6 +491,7 @@ for ($iFic=0; isset($tabFichLigneCmd[$iFic]); $iFic++)
|
||||
|
||||
echo $rapport;
|
||||
//die(print_r($tabIndiscore));
|
||||
$rapport = utf8_decode($rapport);
|
||||
file_put_contents($fichierOut, $entete.EOL.$rapport, FILE_APPEND);
|
||||
|
||||
if ($demandeFtp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user