Diverses corrections

This commit is contained in:
Michael RICOIS 2012-01-30 21:09:14 +00:00
parent c1514c0cd0
commit 1b45991ab2
3 changed files with 20 additions and 35 deletions

View File

@ -6,7 +6,7 @@ defined('APPLICATION_PATH')
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
@ -407,7 +407,7 @@ if ($opts->id) {
}
foreach($tabIdentifiant as $item)
{
echo "Ligne $row+1\n";
echo "Ligne ".($row+1)."\n";
$siretValide = false;
$sirenValide = false;
@ -701,14 +701,12 @@ function bilanNData($siren, $nic, $values = false)
{
require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values);
$annee = 0;
$tabData = array();
$mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9);
print_r($tabBilans);
if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee);
$tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) {
@ -742,13 +740,12 @@ function bilanN1Data($siren, $nic, $values = false)
{
require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values);
$annee = 1;
$tabData = array();
$mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9);
if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee);
$tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) {
@ -782,13 +779,12 @@ function bilanN2Data($siren, $nic, $values = false)
{
require_once 'Metier/partenaires/classMBilans.php';
$tabPostes = explode(',', $values);
$annee = 2;
$tabData = array();
$mBil = new MBilans($siren);
$tabBilans = $mBil->listeBilans(false, 9);
if (count($tabBilans)>0) {
$tabBi = findBilan($tabBilans, $annee);
$tabBi = findBilan($siren, $tabBilans, $annee);
$tabData['bilanNdateCloture'] = $tabBi['DATE_CLOTURE'];
$tabData['bilanNdureeMois'] = $tabBi['DUREE_MOIS'];
if (count($tabPostes)>0) {
@ -802,16 +798,19 @@ function bilanN2Data($siren, $nic, $values = false)
return $tabData;
}
function findBilan($tabBilans, $position = 0)
function findBilan($siren, $tabBilans, $position = 0)
{
require_once 'Metier/partenaires/classMBilans.php';
$mBil = new MBilans($siren);
//Trier et Supprimer les bilans consolidés
$tabBilN = $tabBilS = array();
foreach ($tabBilans as $typeMil => $bilan) {
$annee = substr($typeMil,1);
$temp = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1));
$annee = $bilan['millesime'];
if (substr($typeMil,0,1)=='N') {
$tabBilN[$annee] = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1));
$tabBilN[$annee] = $temp;
} elseif (substr($typeMil,0,1)=='S') {
$tabBilS[$annee] = $mBil->getBilan(substr($typeMil,1), substr($typeMil,0,1));
$tabBilS[$annee] = $temp;
}
}
$tabBil = $tabBilN + $tabBilS; //On comble les trous par des bilans simplifié

View File

@ -1,23 +1,8 @@
<?php
define('BODACC_LOCAL_DIR', '/home/data/bodacc/');
define('JAL_LOCAL_DIR', '/home/data/jal/');
define('HUGIN_LOCAL_DIR', '/home/data/infosreg/hugin/');
define('ACTUSNEWS_LOCAL_DIR', '/home/data/infosreg/actusnews/');
define('DIRELEASE_LOCAL_DIR', '/home/data/infosreg/direlease/');
define('LESECHOS_LOCAL_DIR', '/home/data/infosreg/lesechos/');
/** Paramètres du FTP de BusinessWire : Communiqués de presse **/
define('BUSINESSWIRE_LOCAL_DIR_INCOMING', '/home/data/ftp/businesswire/');
define('BUSINESSWIRE_LOCAL_DIR', '/home/data/infosreg/businesswire/');
/** Dossiers locaux pour les documents a telecharger (PDF kbis, marques, etc...) **/
define('DOC_WEB_LOCAL', realpath('d:/www/dataws/').'/');
define('DOC_WEB_LOCAL', realpath('d:/www/dataenrichissement/').'/');
define('DOC_WEB_URL', '/data/');
/** LOGGING **/
define('LOG_PATH', realpath('d:/www/dataws/log/'));
define('LOG_PATH', realpath('d:/www/dataenrichissement/log/'));

View File

@ -20,7 +20,8 @@ class WDB {
if ($database=='') $this->database=MYSQL_DEFAULT_DB;
else $this->database=$database;
if (defined(MYSQL_PORT)) $this->host = $this->host.':'.MYSQL_PORT;
//if (defined(MYSQL_PORT)) $this->host = $this->host.':'.MYSQL_PORT;
$this->host = $this->host.':53336';
$this->con_id = mysql_connect($this->host, $this->user, $this->password);
if (!($this->con_id === false)) {