improve icons for credit

This commit is contained in:
osaajani 2021-06-14 20:21:06 +02:00
parent c3637ab3ab
commit ca9b7c7c6e
6 changed files with 42 additions and 7 deletions

View File

@ -89,6 +89,13 @@ footer img
opacity: 0.7;
}
/** DASHBOARD **/
.dashboard-panel-chart .panel-title
{
margin-bottom: 10px;
}
/** GROUPES **/
.list-contacts
{

View File

@ -123,6 +123,26 @@ namespace controllers\internals;
break;
case 'QUOTA_LIMIT_CLOSE':
$logo = 'fa-exclamation';
break;
case 'QUOTA_LIMIT_REACHED':
$logo = 'fa-exclamation-triangle';
break;
case 'QUOTA_RENEWAL':
$logo = 'fa-retweet';
break;
case 'QUOTA_CONSUME':
$logo = 'fa-euro';
break;
default:
$logo = 'fa-question';
}

View File

@ -78,9 +78,12 @@ namespace controllers\publics;
$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
$quota_limit = false;
$quota = $this->internal_quota->get_user_quota($id_user);
if ($quota && (new \DateTime($quota['start_date']) <= $now) && (new \DateTime($quota['expiration_date']) > $now))
{
$quota_limit = $quota['credit'] + $quota['additional'];
$stats_start_date = new \DateTime($quota['start_date']);
$stats_start_date_formated = $stats_start_date->format('Y-m-d');
}
@ -124,7 +127,7 @@ namespace controllers\publics;
$total_receiveds += $nb_received;
}
$nb_days = $stats_start_date->diff($now)->days;
$nb_days = $stats_start_date->diff($now)->days + 1;
$avg_sendeds = round($total_sendeds / $nb_days, 2);
$avg_receiveds = round($total_receiveds / $nb_days, 2);
@ -139,6 +142,7 @@ namespace controllers\publics;
'nb_unreads' => $nb_unreads,
'avg_sendeds' => $avg_sendeds,
'avg_receiveds' => $avg_receiveds,
'quota_limit' => $quota_limit,
'sendeds' => $sendeds,
'receiveds' => $receiveds,
'events' => $events,

View File

@ -85,7 +85,7 @@
<?php if ($quota) { ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-area-chart fa-fw"></i> Quota de SMS</h4>
<h4 class="panel-title"><i class="fa fa-euro fa-fw"></i> Quota de SMS</h4>
</div>
<div class="panel-body">
<strong>Crédit de base :</strong> <?php $this->s($quota['credit']); ?><br/>

View File

@ -118,11 +118,15 @@
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel panel-default dashboard-panel-chart">
<div class="panel-heading">
<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: #EDAB4D">SMS reçus (moyenne = <?php echo $avg_receiveds; ?> par jour).</span>
<?php if ($quota_limit) { ?>
<br/>
<span style="color: #d9534f">Limite max de SMS sur la période (<?= $quota_limit; ?>).</span>
<?php } ?>
</div>
<div class="panel-body">
<div id="morris-area-chart"></div>
@ -250,8 +254,8 @@
ykeys: ['sendeds', 'receiveds'],
labels: ['SMS envoyés', 'SMS reçus'],
lineColors: ['#5CB85C', '#EDAB4D'],
goals: [<?php echo $avg_sendeds; ?>, <?php echo $avg_receiveds; ?>],
goalLineColors: ['#5CB85C', '#EDAB4D'],
goals: [<?php echo $avg_sendeds; ?>, <?php echo $avg_receiveds; ?><?= $quota_limit ? ',' . $quota_limit : ''; ?>],
goalLineColors: ['#5CB85C', '#EDAB4D', '#d9534f'],
goalStrokeWidth: 2,
pointSize: 4,
hideHover: 'auto',

View File

@ -145,7 +145,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-area-chart fa-fw"></i> Alerte limite de SMS atteinte</h4>
<h4 class="panel-title"><i class="fa fa-exclamation-triangle fa-fw"></i> Alerte limite de SMS atteinte</h4>
</div>
<div class="panel-body">
<form action="<?php echo \descartes\Router::url('Setting', 'update', ['setting_name' => 'alert_quota_limit_reached', 'csrf' => $_SESSION['csrf']]); ?>" method="POST">
@ -296,7 +296,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-area-chart fa-fw"></i> Alerte limite de SMS proche</h4>
<h4 class="panel-title"><i class="fa fa-exclamation fa-fw"></i> Alerte limite de SMS proche</h4>
</div>
<div class="panel-body">
<form action="<?php echo \descartes\Router::url('Setting', 'update', ['setting_name' => 'alert_quota_limit_close', 'csrf' => $_SESSION['csrf']]); ?>" method="POST">