213 lines
8.6 KiB
PHP
213 lines
8.6 KiB
PHP
<?php
|
|
|
|
if (isset($_REQUEST['source']) && trim($_REQUEST['source'])<>'') $source=$_REQUEST['source'];
|
|
else $source='IMR';
|
|
|
|
if (isset($_REQUEST['annee']) && trim($_REQUEST['annee'])<>'') $annee=$_REQUEST['annee'];
|
|
else $annee=0;
|
|
|
|
/**
|
|
* Inclusion du fichier de configuration des includes Métiers de S&D
|
|
*/
|
|
include '/var/www/includes/config.php';
|
|
|
|
/**
|
|
* Inclusion du Framework
|
|
*/
|
|
if( !defined('FWK_PATH') )
|
|
include '/var/www/framework/fwk.php';
|
|
|
|
$t1=microtime_float();
|
|
include_once(INCLUDE_PATH.'insee/classMInsee.php');
|
|
include_once(INCLUDE_PATH.'bodacc/classMBodacc.php');
|
|
include_once(FWK_PATH.'common/dates.php');
|
|
|
|
$iDb=new WDB('jo');
|
|
$iDb2=new WDB('sdv1');
|
|
|
|
session_start();
|
|
$tabSirenPC=array();
|
|
|
|
$authorized = false;
|
|
|
|
if(isset($_GET['logout']) && ($_SESSION['auth'])) {
|
|
$_SESSION['auth'] = null;
|
|
session_destroy();
|
|
echo "logging out...";
|
|
}
|
|
|
|
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
|
|
$user=addslashes(trim($_SERVER['PHP_AUTH_USER']));
|
|
$pwd =addslashes(trim($_SERVER['PHP_AUTH_PW']));
|
|
$tabTmp=$iDb2->select( 'utilisateurs',
|
|
'id, login, email',
|
|
"login='$user' AND password='$pwd' AND idClient=1 AND actif=1 AND deleted=0");
|
|
$_SESSION['userId']=$tabTmp[0]['id'];
|
|
$_SESSION['userMail']=$tabTmp[0]['login'];
|
|
|
|
if ( $_SESSION['userId'] ) {//&& $_SESSION['auth']) {
|
|
$authorized = true;
|
|
}
|
|
} else {
|
|
|
|
//if (isset($_GET["login"]) && (! $authorized)) {
|
|
header('WWW-Authenticate: Basic Realm="Login please"');
|
|
header('HTTP/1.0 401 Unauthorized');
|
|
$_SESSION['auth'] = true;
|
|
print('Login now or forever hold your clicks...');
|
|
exit;
|
|
}
|
|
|
|
if (!$authorized) {
|
|
?><h1>you have <? echo ($authorized) ? '' : 'not'; ?> logged!</h1><?
|
|
} else {
|
|
|
|
//echo '<!--';
|
|
$nomAncre='';
|
|
if (isset($_POST['envoyer'])) {
|
|
foreach ($_POST['envoyer'] as $idEnv=>$env) {
|
|
$nomAncre='#n'.$idEnv;
|
|
}}
|
|
?>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html" />
|
|
<title>Gestion des informations de la base de données</title>
|
|
<link rel="stylesheet" type="text/css" href="../nonimg/gestion.css" />
|
|
<script language='javascript' src='../nonimg/calendar.js'></script>
|
|
</head>
|
|
<?
|
|
$iInsee=new MInsee();
|
|
$iBodacc=new MBodacc();
|
|
|
|
if($source=='IMR') $libSource='INPI IMR';
|
|
elseif($source=='BILAN') $libSource='INPI Bilans';
|
|
elseif($source=='INSEE') $libSource='INSEE Evènements';
|
|
?>
|
|
<h3 align="center">Chargement selon la source <?=$libSource?></h3>
|
|
<h4 align="center">
|
|
<select name="source" onChange="window.location='./chargementsSources.php?annee=<?=$annee?>&source=' + this.value;" style="font-family:arial; font-size:11;">
|
|
<option value="IMR" <?if($source=='IMR') echo 'selected';?>>INPI IMR</option>
|
|
<option value="BILAN" <?if($source=='BILAN') echo 'selected';?>>INPI Bilans</option>
|
|
<option value="INSEE" <?if($source=='INSEE') echo 'selected';?>>INSEE Evènements</option>
|
|
</select>
|
|
|
|
<select name="annee" onChange="window.location='./chargementsSources.php?source=<?=$source?>&annee=' + this.value;" style="font-family:arial; font-size:11;">
|
|
<option value="0" <?if($annee==0) echo 'selected';?>>Toutes les années</option>
|
|
<? for ($i=2005; $i<=date('Y'); $i++) { ?>
|
|
<option value="<?=$i?>" <?if($i==$annee) echo 'selected';?>><?=$i?></option>
|
|
<? } ?>
|
|
</select>
|
|
|
|
<a href="../">RETOUR</a>
|
|
</h4>
|
|
<?php
|
|
$strAnnee='';
|
|
|
|
if ($annee>2004 && $annee<=date('Y'))
|
|
$strAnnee=" AND YEAR(dateCreation)=$annee ";
|
|
|
|
if ($source=='IMR') {
|
|
$tabTmp=$iDb->select( 'rncs_chargements',
|
|
'nomFichier, dateCreation, nbEntrep , nbRecords, dateFlux, dateDispo, taille, dateChargementDeb, dateChargementFin, TIMEDIFF(dateChargementFin,dateChargementDeb) AS dureeChargement, stock , nbLignesTot, nbLignes1, nbLignes1a, nbLignes2, nbLignes2a, nbLignes2p, nbLignes3, nbLignes3a, nbLignes4, nbLignes4a, nbLignes5, nbLignes5a, nbEvenAnn, remarque, dateInsert, dateUpdate',
|
|
"1 $strAnnee",false,MYSQL_ASSOC);
|
|
} elseif ($source=='BILAN') {
|
|
$tabTmp=$iDb->select( 'bilans_chargements',
|
|
'nomFichier, dateCreation, nbBilans AS nbEntrep, nbRecords, dateFlux, dateDispo, taille, dateChargementDeb, dateChargementFin, TIMEDIFF(dateChargementFin,dateChargementDeb) AS dureeChargement, 0 AS stock, nbLignesTot, nbLignes1, nbLignes2, nbLignes3, nbLignes4, remarque, dateInsert, dateUpdate,
|
|
nbBilansLus, nbBilansDouble, nbBilansSaisieOK, nbBilansSaisieAnno, nbBilansSaisieErr, nbBilansInsert, nbBilansUpdate, nbBilansIgnore, idFichier',
|
|
"1 $strAnnee",false,MYSQL_ASSOC);
|
|
} elseif ($source=='INSEE') {
|
|
//nomFichier,dateCreation,nbRecords,dateFlux,dateDispo,taille,dateChargementDeb,dateChargementFin,
|
|
//stock,nbLignesLues,nbSiretFaux,nbErreurInsert,nbCreationsSiren,nbCreationsSiret,nbUpdates,
|
|
//typeDiffusion,remarque,dateInsert
|
|
$tabTmp=$iDb->select( 'insee.insee_chargements',
|
|
'nomFichier, dateCreation, nbRecords AS nbEntrep, nbRecords, dateFlux, dateDispo, taille, dateChargementDeb, dateChargementFin, TIMEDIFF(dateChargementFin,dateChargementDeb) AS dureeChargement, stock, nbLignesLues AS nbLignesTot, nbLignesLues AS nbLignes1, nbSiretFaux, nbErreurInsert, nbCreationsSiren, nbCreationsSiret, nbUpdates',
|
|
"1 $strAnnee",false,MYSQL_ASSOC);
|
|
}
|
|
?>
|
|
<table BgColor="#177AE9" cellspacing="1" cellpadding="2" border="0" align="center" BorderColor="#000020">
|
|
<tr>
|
|
<td><b><font color="Black">Nom du fichier</font></b></td>
|
|
<td><b><font color="Black">Date création</font></b></td>
|
|
<td><b><font color="Black">Nb lignes</font></b></td>
|
|
<td><b><font color="Black">Date dispo.</font></b></td>
|
|
<?php
|
|
if ($source=='IMR') {
|
|
?>
|
|
<td><b><font color="Black">Etab.</font></b></td>
|
|
<td><b><font color="Black">Dirigeants</font></b></td>
|
|
<td><b><font color="Black">Jugements</font></b></td>
|
|
<td><b><font color="Black">Actes </font></b></td>
|
|
<td><b><font color="Black">Nb annonces</font></b></td>
|
|
<?php
|
|
} elseif ($source=='BILAN') {
|
|
?>
|
|
<td><b><font color="Black">Nb Bilans</font></b></td>
|
|
<td><b><font color="Black">Nb Saisie OK</font></b></td>
|
|
<td><b><font color="Black">Nb non saisit</font></b></td>
|
|
<td><b><font color="Black">MAJ</font></b></td>
|
|
<td><b><font color="Black">idFichier</font></b></td>
|
|
<?php
|
|
} elseif ($source=='INSEE') {
|
|
?>
|
|
<td><b><font color="Black">Nb Creations Siren</font></b></td>
|
|
<td><b><font color="Black">Nb Creations Siret</font></b></td>
|
|
<td><b><font color="Black">Nb MAJ</font></b></td>
|
|
<td><b><font color="Black">Nb Erreurs</font></b></td>
|
|
<?php
|
|
}
|
|
?>
|
|
</tr>
|
|
<?
|
|
|
|
$iDb2=new WDB('insee');
|
|
$numPre=$numAnnPre=0;
|
|
foreach ($tabTmp as $i=>$tabAnn) {
|
|
if ($tabAnn['nbLignesTot']==$tabAnn['nbRecords'] &&
|
|
$tabAnn['nbLignes1']==$tabAnn['nbEntrep']) $bgcolor='#E2EEFC';
|
|
else $bgcolor='#E2E0FC';
|
|
?>
|
|
<tr BgColor="<?=$bgcolor?>"><td><?=$tabAnn['nomFichier']?></td>
|
|
<td><?=$tabAnn['dateCreation']?></td>
|
|
<td><?=$tabAnn['nbRecords']?> lignes<br/>
|
|
<?if ($tabAnn['nbLignesTot']<>$tabAnn['nbRecords']) echo '<b>dont '.$tabAnn['nbLignesTot'].' chargées</b><br/>';?>
|
|
<?=$tabAnn['nbEntrep']?> entrep.
|
|
<?if ($tabAnn['nbLignes1']<>$tabAnn['nbEntrep']) echo '<br/><b>dont '.$tabAnn['nbLignes1'].' chargées</b>';?>
|
|
<?if ($source=='IMR') echo '<br/><i>dont '.$tabAnn['nbLignes1a'].' nouv.</i>';?></td>
|
|
<td>Dispo : <?=$tabAnn['dateDispo']?><br/>
|
|
Chargé : <?=$tabAnn['dateChargementDeb'].' en '.$tabAnn['dureeChargement']?></td>
|
|
<?php
|
|
if ($source=='IMR') {
|
|
?>
|
|
<td><?=$tabAnn['nbLignes2'].' étabs<br/><i>'.$tabAnn['nbLignes2a'].' nouv.<br/>( '.$tabAnn['nbLignes2p']?> prov.)</i></td>
|
|
<td><?=$tabAnn['nbLignes3'].' dir.<br/><i>'.$tabAnn['nbLignes3a']?> nouv.</i></td>
|
|
<td><?=$tabAnn['nbLignes4'].' jug.<br/><i>'.$tabAnn['nbLignes4a']?> nouv.</i></td>
|
|
<td><?=$tabAnn['nbLignes5'].' jug.<br/><i>'.$tabAnn['nbLignes5a']?> nouv.</i><t>
|
|
<td><?=$tabAnn['nbEvenAnn']?></td>
|
|
<?php
|
|
} elseif ($source=='BILAN') {
|
|
?>
|
|
<td><?=$tabAnn['nbBilansLus']?></td>
|
|
<td><?=$tabAnn['nbBilansSaisieOK']+$tabAnn['nbBilansSaisieAnno']?> dont <?=$tabAnn['nbBilansSaisieAnno']?> av. anno.</td>
|
|
<td><?=$tabAnn['nbBilansSaisieErr']?></td>
|
|
<td><?=$tabAnn['nbBilansInsert']?> ajouts, <?=$tabAnn['nbBilansUpdate']?> maj et <?=$tabAnn['nbBilansIgnore']?> ignorés</td>
|
|
<td><?=$tabAnn['idFichier']?></td>
|
|
<?php
|
|
} elseif ($source=='INSEE') {
|
|
?>
|
|
<td><?=$tabAnn['nbCreationsSiren']?></td>
|
|
<td><?=$tabAnn['nbCreationsSiret']?></td>
|
|
<td><?=$tabAnn['nbUpdates']?></td>
|
|
<td><?=$tabAnn['nbErreurInsert']?> / <?=$tabAnn['nbSiretFaux']?></td>
|
|
<?php
|
|
}
|
|
?>
|
|
</tr>
|
|
<?
|
|
}
|
|
?>
|
|
</table>
|
|
<a name="end"></a>
|
|
<?
|
|
}
|
|
?>
|