add stats about credit in use account and update dates for home graph

This commit is contained in:
osaajani 2021-06-14 19:48:42 +02:00
parent 03ae69b82a
commit c3637ab3ab
9 changed files with 90 additions and 31 deletions

View file

@ -81,7 +81,22 @@
</div>
<?php } ?>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-xs-12 col-md-6">
<?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>
</div>
<div class="panel-body">
<strong>Crédit de base :</strong> <?php $this->s($quota['credit']); ?><br/>
<strong>Crédit additionel :</strong> <?php $this->s($quota['additional']); ?><br/>
<strong>Crédit consommés :</strong> <?php $this->s($quota['consumed']); ?> (<?= $quota_percent * 100; ?>%)<br/>
<strong>Renouvellement automatique :</strong> <?php $this->s(($quota['auto_renew'] ? 'Oui, renouvellement le ' : 'Non, fin le ') . $quota['expiration_date']); ?><br/>
<strong>Report des crédits non utilisés :</strong> <?= $quota['report_unused'] ? 'Oui' : 'Non'; ?><br/>
<strong>Report des crédits additionels non utilisés :</strong> <?= $quota['report_unused_additional'] ? 'Oui' : 'Non'; ?><br/>
</div>
</div>
<?php } ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-at fa-fw"></i> Modifier e-mail</h4>

View file

@ -62,6 +62,9 @@
</div>
<fieldset>
<legend>Quota de SMS</legend>
<?php if (($user['quota']['expiration_date'] ?? false) && (new \DateTime() > new \DateTime($user['quota']['expiration_date']))) { ?>
<div class="alert alert-danger text-left">Le quota de cet utilisateur est expiré depuis le <b><?php $this->s($user['quota']['expiration_date']); ?></b> est n'as pas été renouvelé, il n'est donc plus appliqué !</div>
<?php } ?>
<div class="form-group">
<label>Définir un quota pour cet utilisateur : </label>

View file

@ -95,8 +95,11 @@ jQuery(document).ready(function ()
{
data: 'quota_percentage',
render: function (data, type, row, meta) {
return jQuery.fn.dataTable.render.text().display(data) + "%";
return '<input name="user_ids[]" type="checkbox" value="' + data + '">';
var html = jQuery.fn.dataTable.render.text().display(data) + "%";
if (row['quota_expired_at'] !== undefined) {
html += ' - <span class="danger">Quota expiré le ' + jQuery.fn.dataTable.render.text().display(row['quota_expired_at']) + '</span>';
}
return html;
},
},
{