raspisms/templates/dashboard/show.php

269 lines
10 KiB
PHP
Raw Permalink Normal View History

2019-10-29 14:57:13 +01:00
<?php
//Template dashboard
$this->render('incs/head')
?>
<div id="wrapper">
<?php
$this->render('incs/nav', ['page' => 'dashboard'])
?>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Dashboard <small>Statistiques d'utilisation</small>
</h1>
<ol class="breadcrumb">
<li class="active">
<i class="fa fa-dashboard"></i> Dashboard
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-3 col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-user fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $nb_contacts; ?></div>
<div>Contacts</div>
</div>
</div>
</div>
2019-11-07 17:52:33 +01:00
<a href="<?php echo \descartes\Router::url('Contact', 'list') ?>">
2019-10-29 14:57:13 +01:00
<div class="panel-footer">
<span class="pull-left">Voir vos contacts</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-green">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-group fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
2019-11-09 03:35:12 +01:00
<div class="huge"><?php echo $nb_groups; ?></div>
2019-10-29 14:57:13 +01:00
<div>Groupes</div>
</div>
</div>
</div>
2019-11-09 03:35:12 +01:00
<a href="<?php echo \descartes\Router::url('Group', 'list') ?>">
2019-10-29 14:57:13 +01:00
<div class="panel-footer">
<span class="pull-left">Voir les groupes</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-yellow">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-calendar fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $nb_scheduleds; ?></div>
<div>SMS programmés</div>
</div>
</div>
</div>
2019-11-07 17:52:33 +01:00
<a href="<?php echo \descartes\Router::url('Scheduled', 'list') ?>">
2019-10-29 14:57:13 +01:00
<div class="panel-footer">
<span class="pull-left">Voir les SMS programmés</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-red">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
2019-12-02 01:55:06 +01:00
<i class="fa fa-eye-slash fa-5x"></i>
2019-10-29 14:57:13 +01:00
</div>
<div class="col-xs-9 text-right">
2019-12-02 01:55:06 +01:00
<div class="huge"><?php echo $nb_unreads; ?></div>
<div>SMS non lus</div>
2019-10-29 14:57:13 +01:00
</div>
</div>
</div>
2019-12-02 01:55:06 +01:00
<a href="<?php echo \descartes\Router::url('Received', 'list_unread') ?>">
2019-10-29 14:57:13 +01:00
<div class="panel-footer">
2019-12-02 01:55:06 +01:00
<span class="pull-left">Voir les SMS non lus</span>
2019-10-29 14:57:13 +01:00
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
2021-06-14 20:21:06 +02:00
<div class="panel panel-default dashboard-panel-chart">
2019-10-29 14:57:13 +01:00
<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_unused) { ?>
2021-06-14 20:21:06 +02:00
<br/>
<span style="color: #d9534f">Crédits restants : <?= $quota_unused; ?>.</span>
2021-06-14 20:21:06 +02:00
<?php } ?>
2019-10-29 14:57:13 +01:00
</div>
<div class="panel-body">
<div id="morris-area-chart"></div>
</div>
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
2019-12-20 18:51:13 +01:00
<h3 class="panel-title"><i class="fa fa-upload fa-fw"></i> SMS Envoyés</h3>
2019-10-29 14:57:13 +01:00
</div>
<div class="panel-body">
<?php if (!$sendeds) { ?>
Vous n'avez envoyé aucun SMS pour l'instant.
<?php } else { ?>
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Numéro</th>
<th>Date</th>
</tr>
</thead>
<tbody>
2019-11-07 17:52:33 +01:00
<?php foreach ($sendeds as $sended) { ?>
2019-10-29 14:57:13 +01:00
<tr>
<td><?php echo \controllers\internals\Tool::phone_link($sended['destination']); ?></td>
2019-10-29 14:57:13 +01:00
<td><?php $this->s($sended['at']); ?></td>
</tr>
2019-11-07 17:52:33 +01:00
<?php } ?>
2019-10-29 14:57:13 +01:00
</tbody>
</table>
</div>
<div class="text-right">
2019-11-07 17:52:33 +01:00
<a href="<?php echo \descartes\Router::url('Sended', 'list'); ?>">Voir tous les SMS envoyés <i class="fa fa-arrow-circle-right"></i></a>
2019-10-29 14:57:13 +01:00
</div>
<?php } ?>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-download fa-fw"></i> SMS Reçus</h3>
</div>
<div class="panel-body">
<?php if (!$receiveds) { ?>
Vous n'avez reçu aucun SMS pour l'instant.
<?php } else { ?>
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Numéro</th>
<th>Date</th>
<th>Commande</th>
</tr>
</thead>
<tbody>
2019-11-07 17:52:33 +01:00
<?php foreach ($receiveds as $received) { ?>
<tr>
<td><?php echo \controllers\internals\Tool::phone_link($received['origin']); ?></td>
2019-11-07 17:52:33 +01:00
<td><?php $this->s($received['at']); ?></td>
<td><?php echo ($received['command']) ? 'Oui' : 'Non'; ?></td>
2019-11-07 17:52:33 +01:00
</tr>
<?php } ?>
2019-10-29 14:57:13 +01:00
</tbody>
</table>
</div>
<div class="text-right">
2019-11-07 17:52:33 +01:00
<a href="<?php echo \descartes\Router::url('Received', 'list'); ?>">Voir tous les SMS reçus <i class="fa fa-arrow-circle-right"></i></a>
2019-10-29 14:57:13 +01:00
</div>
<?php } ?>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-clock-o fa-fw"></i> Évènements survenus</h3>
</div>
<div class="panel-body">
<?php if (!$events) { ?>
2019-11-14 22:33:00 +01:00
Aucun évènement n'est encore survenu.
2019-10-29 14:57:13 +01:00
<?php } else { ?>
<div class="list-group">
2019-11-07 17:52:33 +01:00
<?php foreach ($events as $event) { ?>
2019-10-29 14:57:13 +01:00
<a href="#" class="list-group-item">
<span class="badge"><?php $this->s($event['at']); ?></span>
2019-11-07 17:52:33 +01:00
<i class="fa fa-fw <?php echo \controllers\internals\Tool::event_type_to_icon($event['type']); ?>"></i> <?php $this->s($event['text']); ?>
2019-10-29 14:57:13 +01:00
</a>
2019-11-07 17:52:33 +01:00
<?php } ?>
2019-10-29 14:57:13 +01:00
</div>
<div class="text-right">
2019-11-07 17:52:33 +01:00
<a href="<?php echo \descartes\Router::url('Event', 'list'); ?>">Voirs tous les évènements survenus <i class="fa fa-arrow-circle-right"></i></a>
2019-10-29 14:57:13 +01:00
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<script>
jQuery(document).ready(function()
{
Morris.Area({
element: 'morris-area-chart',
behaveLikeLine: true,
fillOpacity: 0.4,
data: <?php echo $data_area_chart;?>,
xkey: 'period',
parseTime: false,
2019-10-29 14:57:13 +01:00
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'],
2019-10-29 14:57:13 +01:00
goalStrokeWidth: 2,
pointSize: 4,
hideHover: 'auto',
resize: true
});
});
</script>
<!-- /#wrapper -->
<?php
$this->render('incs/footer');