Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 92f28788 authored by NINASSI Benjamin's avatar NINASSI Benjamin
Browse files

.

parent 31137a0c
Branches
No related tags found
No related merge requests found
<?php <?php
function cmpSection($a, $b){ function cmpSectionDate($a, $b){
$sectionA=$a[20]; $sectionA=$a[20];
$sectionB=$b[20]; $sectionB=$b[20];
if ($sectionA == $sectionB) {
return 0;
}
return ($sectionA < $sectionB) ? -1 : 1;
}
function cmpDate($a, $b){
$dateA=$a[6]; $dateA=$a[6];
$dateB=$b[6]; $dateB=$b[6];
if ($dateA == $dateB) { if ($sectionA == $sectionB) {
return 0; if ($dateA == $dateB) {
return 0;
}
return ($sectionA > $sectionB) ? -1 : 1;
} }
return ($sectionA < $sectionB) ? -1 : 1; return ($sectionA < $sectionB) ? -1 : 1;
} }
...@@ -57,8 +53,7 @@ $dataArraySize = count($dataArray); ...@@ -57,8 +53,7 @@ $dataArraySize = count($dataArray);
print $dataArraySize." lignes après nettoyage \n"; print $dataArraySize." lignes après nettoyage \n";
if($dataArray && $dataArraySize!=0){ if($dataArray && $dataArraySize!=0){
$currentSection=""; $currentSection="";
usort($dataArray, "cmpDate");//on trie le tableau par Date usort($dataArray, "cmpSectionDate");//on trie le tableau par Section croissante puis Date decroissante
usort($dataArray, "cmpSection");//on trie le tableau Section
$colorArray=array("blue","orange","green"); $colorArray=array("blue","orange","green");
$sectionNumber = 0; $sectionNumber = 0;
foreach ($dataArray as $tmp_line){ foreach ($dataArray as $tmp_line){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment