mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
improve representation of unused credit
This commit is contained in:
parent
4e03ce55bd
commit
e1c617c3b7
2 changed files with 7 additions and 7 deletions
|
@ -77,11 +77,11 @@ namespace controllers\publics;
|
||||||
$stats_start_date_formated = $stats_start_date->format('Y-m-d');
|
$stats_start_date_formated = $stats_start_date->format('Y-m-d');
|
||||||
|
|
||||||
//If user have a quota and the quota start before today, use quota start date instead
|
//If user have a quota and the quota start before today, use quota start date instead
|
||||||
$quota_limit = false;
|
$quota_unused = false;
|
||||||
$quota = $this->internal_quota->get_user_quota($id_user);
|
$quota = $this->internal_quota->get_user_quota($id_user);
|
||||||
if ($quota && (new \DateTime($quota['start_date']) <= $now) && (new \DateTime($quota['expiration_date']) > $now))
|
if ($quota && (new \DateTime($quota['start_date']) <= $now) && (new \DateTime($quota['expiration_date']) > $now))
|
||||||
{
|
{
|
||||||
$quota_limit = $quota['credit'] + $quota['additional'];
|
$quota_unused = $quota['credit'] + $quota['additional'] - $quota['consumed'];
|
||||||
|
|
||||||
$stats_start_date = new \DateTime($quota['start_date']);
|
$stats_start_date = new \DateTime($quota['start_date']);
|
||||||
$stats_start_date_formated = $stats_start_date->format('Y-m-d');
|
$stats_start_date_formated = $stats_start_date->format('Y-m-d');
|
||||||
|
@ -141,7 +141,7 @@ namespace controllers\publics;
|
||||||
'nb_unreads' => $nb_unreads,
|
'nb_unreads' => $nb_unreads,
|
||||||
'avg_sendeds' => $avg_sendeds,
|
'avg_sendeds' => $avg_sendeds,
|
||||||
'avg_receiveds' => $avg_receiveds,
|
'avg_receiveds' => $avg_receiveds,
|
||||||
'quota_limit' => $quota_limit,
|
'quota_unused' => $quota_unused,
|
||||||
'sendeds' => $sendeds,
|
'sendeds' => $sendeds,
|
||||||
'receiveds' => $receiveds,
|
'receiveds' => $receiveds,
|
||||||
'events' => $events,
|
'events' => $events,
|
||||||
|
|
|
@ -123,9 +123,9 @@
|
||||||
<h3 class="panel-title"><i class="fa fa-area-chart fa-fw"></i> Activité de la semaine : </h3>
|
<h3 class="panel-title"><i class="fa fa-area-chart fa-fw"></i> Activité de la semaine : </h3>
|
||||||
<span style="color: #5CB85C;">SMS envoyés (moyenne = <?php echo $avg_sendeds; ?> par jour).</span><br/>
|
<span style="color: #5CB85C;">SMS envoyés (moyenne = <?php echo $avg_sendeds; ?> par jour).</span><br/>
|
||||||
<span style="color: #EDAB4D">SMS reçus (moyenne = <?php echo $avg_receiveds; ?> par jour).</span>
|
<span style="color: #EDAB4D">SMS reçus (moyenne = <?php echo $avg_receiveds; ?> par jour).</span>
|
||||||
<?php if ($quota_limit) { ?>
|
<?php if ($quota_unused) { ?>
|
||||||
<br/>
|
<br/>
|
||||||
<span style="color: #d9534f">Limite max de SMS sur la période (<?= $quota_limit; ?>).</span>
|
<span style="color: #d9534f">Crédits restants : <?= $quota_unused; ?>.</span>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
@ -254,8 +254,8 @@
|
||||||
ykeys: ['sendeds', 'receiveds'],
|
ykeys: ['sendeds', 'receiveds'],
|
||||||
labels: ['SMS envoyés', 'SMS reçus'],
|
labels: ['SMS envoyés', 'SMS reçus'],
|
||||||
lineColors: ['#5CB85C', '#EDAB4D'],
|
lineColors: ['#5CB85C', '#EDAB4D'],
|
||||||
goals: [<?php echo $avg_sendeds; ?>, <?php echo $avg_receiveds; ?><?= $quota_limit ? ',' . $quota_limit : ''; ?>],
|
goals: [<?php echo $avg_sendeds; ?>, <?php echo $avg_receiveds; ?>],
|
||||||
goalLineColors: ['#5CB85C', '#EDAB4D', '#d9534f'],
|
goalLineColors: ['#5CB85C', '#EDAB4D'],
|
||||||
goalStrokeWidth: 2,
|
goalStrokeWidth: 2,
|
||||||
pointSize: 4,
|
pointSize: 4,
|
||||||
hideHover: 'auto',
|
hideHover: 'auto',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue