forked from ZwiiCMS-Team/ZwiiCampus
Statistiques
This commit is contained in:
parent
bce93cecba
commit
867d8ac713
@ -72,6 +72,8 @@ class course extends common
|
||||
|
||||
public static $userHistory = [];
|
||||
|
||||
public static $userStat = [];
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
@ -977,6 +979,9 @@ class course extends common
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$floorTime = 99999999999;
|
||||
$topTime = 0;
|
||||
|
||||
foreach ($history as $pageId => $times) {
|
||||
// Dates de consultation de la page
|
||||
@ -986,18 +991,28 @@ class course extends common
|
||||
self::$userHistory[] = [
|
||||
$pages[$pageId]['number'],
|
||||
html_entity_decode($pages[$pageId]['title']),
|
||||
helper::dateUTF8('%d %B %Y %H:%M:%S', $time)
|
||||
helper::dateUTF8('%d %B %Y %H:%M', $time)
|
||||
];
|
||||
$floorTime = $floorTime < $time ? $floorTime : $time;
|
||||
$TopTime = $TopTime > $time ? $TopTime : $time;
|
||||
}
|
||||
} else {
|
||||
self::$userHistory[] = [
|
||||
$pages[$pageId]['number'],
|
||||
html_entity_decode($pages[$pageId]['title']),
|
||||
helper::dateUTF8('%d %B %Y %H:%M:%S', $times)
|
||||
helper::dateUTF8('%d %B %Y %H:%M', $times)
|
||||
];
|
||||
$floorTime = $floorTime < $times ? $floorTime : $times;
|
||||
$topTime = $topTime > $times ?$topTime : $times;
|
||||
}
|
||||
}
|
||||
|
||||
self::$userStat['floor'] = helper::dateUTF8('%d %B %Y %H:%M',$floorTime);
|
||||
self::$userStat['top'] = helper::dateUTF8('%d %B %Y %H:%M',$topTime);
|
||||
$d = $topTime - $floorTime;
|
||||
$d_hours = floor($d / 3600);
|
||||
$d_minutes = floor(($d % 3600) / 60);
|
||||
self::$userStat['time'] = $d_hours . ' heures, ' . $d_minutes . ' minutes ' ;
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -8,16 +8,31 @@
|
||||
</div>
|
||||
<div class="col1 offset10">
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
'href' => helper::baseUrl() . 'course/userHistoryExport/' . $this->getUrl(2) . '/' . $this->getUrl(3),
|
||||
'href' => helper::baseUrl() . 'course/userHistoryExport/' . $this->getUrl(2) . '/' . $this->getUrl(3),
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Exporter',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userHistory): ?>
|
||||
<div class="row">
|
||||
<div class="col4 offset2">
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === self::COURSE_ACCESS_DATE): ?>
|
||||
<p>Espace ouvert le :
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate'])); ?></p
|
||||
<p>Espace fermé le :
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate'])); ?></p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<p>Commencé le : <?php echo $module::$userStat['floor'];?></p>
|
||||
<p>Terminé le : <?php echo $module::$userStat['top'];?></p>
|
||||
<p>Temps passé : <?php echo $module::$userStat['time'];?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([1, 6, 5], $module::$userHistory, ['Ordre', 'Page', 'Consultation'], ['id' => 'dataTables']); ?>
|
||||
<?php echo template::table([1, 6, 5], $module::$userHistory, ['Ordre', 'Page', 'Consultation'], ['id' => 'dataTables']);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
@ -29,7 +29,7 @@ $(document).ready((function () {
|
||||
locale: 'fr',
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 5,
|
||||
target: 6,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user