{% extends "app_home/base.html" %}
{% load static %}
{% load i18n %}

{% block navbar_app %}
{% include 'app_home/_sidebar.html' %}
{% endblock %}

{% block title %}
<H2>{% translate 'SMS Stats' %}</H2>
<hr>{% endblock %}


{% block content %}




<h4>Années</h4>
<hr>

<table class="table table-hover table-responsive table-striped">
<thead class="thead-dark"><tr>
<th>Date</th>
<th class=" text-right">Volume</th>
<th class="text-right">Emetteurs (distinct)</th>
<th class="text-right">destinataires (distinct)</th>
</tr>
</thead>
{% for item in stat_year %}
<tr>
<td class="py-1 px-1 mx-0">{{ item.year }}</td>    
<td class="py-1 px-1 mx-0 text-right">{{ item.count }}</td>    
<td class="py-1 text-right">{{ item.numsender }}</td>    
<td class="py-1 text-right">{{ item.numdest }}</td>    
</tr>{% endfor %}
</table>

<h4>Mois</h4>
<hr>

<table class="table table-hover table-responsive table-striped">
<thead class="thead-dark"><tr>
<th>Date</th>
<th class="text-right">Volume</th>
<th class="text-right">Emetteurs (distinct)</th>
<th class="text-right">destinataires (distinct)</th>
</tr>
</thead>
{% for item in stat_month %}
<tr>
<td class="py-1 px-1 mx-0">{{ item.year }}-{{ item.month|stringformat:"02d" }} </td>    
<td class="py-1 px-1 mx-0  text-right">{{ item.count }}</td>    
<td class="py-1 text-right">{{ item.numsender }}</td>    
<td class="py-1 text-right">{{ item.numdest }}</td>    
</tr>{% endfor %}
</table>



<h4>Jour</h4>
<hr>

<table class="table table-hover table-responsive table-striped">
<thead class="thead-dark"><tr>
<th>Date</th>
<th class="text-right">Volume</th>
<th class="text-right">Emetteurs (distinct)</th>
<th class="text-right">destinataires (distinct)</th>
</tr>
</thead>
{% for item in stat_day %}
<tr>
<td class="py-1 px-1 mx-0">{{ item.year }}-{{ item.month|stringformat:"02d" }}-{{ item.day|stringformat:"02d" }}</td>    
<td class="py-1 px-1 mx-0 text-right">{{ item.count }}</td>    
<td class="py-1 text-right">{{ item.numsender }}</td>    
<td class="py-1 text-right">{{ item.numdest }}</td>    
</tr>{% endfor %}
</table>


{% endblock %}


