Correction notice

This commit is contained in:
Michael RICOIS 2010-03-25 10:06:58 +00:00
parent 94df8e6399
commit ed3621e1a8
2 changed files with 36 additions and 30 deletions

View File

@ -8,13 +8,11 @@
* Retourne le tableau structuré
*/
function defaultTriTab($tab){
$tabIndex = array();
$i=0;
$tabIndex = array();
$listTrier = array();
foreach($tab as $item){
if(!array_key_exists($item['siren'], $tabIndex)){
//Tableau d'index
$tabIndex[$item['siren']] = $i;
//Création du tableau trier
$listTrier[$i]['siren'] = $item['siren'];
$listTrier[$i]['nic'] = $item['nic'];
@ -27,15 +25,23 @@ function defaultTriTab($tab){
'dateAjout' => $item['dateAjout'],
'dateDerEnvoi' => $item['dateDerEnvoi'],
);
//Tableau d'index
$tabIndex[$item['siren']] = $i;
}else{
$key = $tabIndex[$item['siren']];
$nbSource = count($listTrier[$key]['sources'][$item['source']]);
$source = array(
'email'=>$item['email'],
'ref'=>$item['ref'],
'dateAjout'=>$item['dateAjout'],
'dateDerEnvoi'=> $item['dateDerEnvoi'],
);
if ( array_key_exists(
$item['source'],
$listTrier[$key]['sources'] ) ){
$nbSource = count($listTrier[$key]['sources'][$item['source']]);
}else{
$nbSource = 0;
}
$listTrier[$key]['sources'][$item['source']][$nbSource] = $source;
}
$i++;

View File

@ -15,7 +15,7 @@ $idEntreprise = isset($_REQUEST['idEntreprise'])?
$_REQUEST['idEntreprise'] : '';
$siret = isset($_REQUEST['siret'])? $_REQUEST['siret'] : '';
if($_REQUEST['action']=='supprimer'){
if ( isset($_REQUEST['action']) && $_REQUEST['action']=='supprimer'){
require_once 'surveillance/surveillance.php';
deleteSurveillance( $siret,
$_REQUEST['email'],
@ -76,6 +76,7 @@ require_once 'surveillance/function.php';
//Appel de la fonction de tri
require_once 'surveillance/surveillance_tri.php';
$listTrier = $fonctionTri($listSurveillance);
FB::log($listTrier, 'listTrier');
?>
<script type="text/javascript">
$(document).ready(function()
@ -276,7 +277,6 @@ if($totPage != 1)
if($vue=='default'){
foreach($listTrier as $item)
{
$firephp->log($item, 'item');
?>
<tr>
<td class="aleft">