templates/default/stat.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block logo_large %}
  3.         LOCCA CASHMAG
  4. {% endblock %}
  5. {% block title %}
  6.         LOCCA CASHMAG
  7. {% endblock %}
  8. {% block page_title %}
  9.         TICKET STATISTICS 
  10.         <form action="{{ path('manage_stat' )}}" method="POST">
  11.         <input
  12.         type="datetime-local"
  13.         class="datetime-local"
  14.         name="debut"
  15.         value="{{ dateDebut|date('c') |split('+') |first }}"/> 
  16.         
  17.         -- au --
  18.   
  19.         <input
  20.         type="datetime-local"
  21.         class="datetime-local"
  22.         name="fin"
  23.         value="{{ dateFin| date('c') |split('+') |first }}" />
  24.         <input type="submit" id="bydate" style="display:none" class="btn btn-primary mb-2" value="Valider"/>
  25.         </form>
  26.         <br>
  27.         <div><h3>Total CA de la période : {{ totalCaDeLaPeriode |number_format(2, ',', ' ')}}</h3></div>
  28. {% endblock %}
  29. {% block page_subtitle %}
  30.         Application rapatriement Base de donnée  
  31.         </br>
  32.         {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  33.         <p>Email Utilisateur: {{ app.user.email }}</p>
  34.         {% endif %}
  35. {% endblock %}
  36. {% block sidebar_nav %}
  37.         {% include 'navbar.html.twig' %}
  38. {% endblock %}
  39. {% block page_content %}
  40.         {% include 'flash-message.html.twig' %}
  41. <style>
  42. .overlay {
  43.     background-color:#EFEFEF;
  44.     position: fixed;
  45.     width: 100%;
  46.     height: 100%;
  47.     z-index: 1000;
  48.     top: 0px;
  49.     left: 0px;
  50.     opacity: .5; 
  51.     filter: alpha(opacity=50); 
  52.     display: none;
  53.   }
  54. .spinner {
  55.         position: absolute;
  56.         left: 50%;
  57.         top: 50%;
  58.         height:60px;
  59.         width:60px;
  60.         margin:0px auto;
  61.         -webkit-animation: rotation .6s infinite linear;
  62.         -moz-animation: rotation .6s infinite linear;
  63.         -o-animation: rotation .6s infinite linear;
  64.         animation: rotation .6s infinite linear;
  65.         border-left:6px solid rgba(0,174,239,.15);
  66.         border-right:6px solid rgba(0,174,239,.15);
  67.         border-bottom:6px solid rgba(0,174,239,.15);
  68.         border-top:6px solid rgba(0,174,239,.8);
  69.         border-radius:100%;
  70.         z-index:99999;
  71.         display: none;
  72.         }
  73.     
  74.         @-webkit-keyframes rotation {
  75.         from {-webkit-transform: rotate(0deg);}
  76.         to {-webkit-transform: rotate(359deg);}
  77.         }
  78.         @-moz-keyframes rotation {
  79.         from {-moz-transform: rotate(0deg);}
  80.         to {-moz-transform: rotate(359deg);}
  81.         }
  82.         @-o-keyframes rotation {
  83.         from {-o-transform: rotate(0deg);}
  84.         to {-o-transform: rotate(359deg);}
  85.         }
  86.         @keyframes rotation {
  87.         from {transform: rotate(0deg);}
  88.         to {transform: rotate(359deg);}
  89.         }
  90. </style>
  91. <div class="spinner"></div>
  92. <div class="overlay"></div>
  93.   
  94. <div class="row yearschosen 2022" >
  95.   {% for pointOfSalesCA in allPointOfSalesCA %}
  96.     {# {% set date = month ~ "/1/2022" %} #}
  97.     <div class="col-lg-4 col-md-6 col-sm-6 col-12">
  98.     
  99.                 <div class="small-box">
  100.                         <div>
  101.                                 <h4>{{ pointOfSalesCA.name}}</h4>
  102.                         </div>
  103.                         <div>
  104.                                 <h4>Total vente : {{ pointOfSalesCA.number}}</h4>
  105.                         </div>
  106.                         <div >
  107.                                 <h4>Chifre d'affaire : {{ pointOfSalesCA.ca |number_format(2, ',', ' ')}} </h4>
  108.                         </div>
  109.                 </div>
  110.         </div>
  111.   {% endfor %}
  112. </div>
  113. <div class="box box-primary">
  114.     <div class="box-header with-border">
  115.         <h3 class="box-title">Chiffres d'Affaire (CA) / point de vente du {{ dateDebut|date('d F Y') }}  Au {{ dateFin|date('d F Y') }}</h3>
  116.         <div class="box-tools pull-right">
  117.             <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  118.             </button>
  119.             <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  120.         </div>
  121.     </div>
  122.     <div class="box-body">
  123.         <div class="chart">
  124.             <canvas id="myChart1"></canvas>
  125.         </div>
  126.     </div>
  127. </div>
  128. {% endblock %}
  129. {% block footer %}
  130.         {% include 'footer.html.twig' %}
  131. {% endblock %}
  132. {% block javascripts %}
  133. {{ parent() }}
  134. <script>
  135. $(document).on('change', '.datetime-local', function() {
  136.   $("#bydate").show();
  137. });
  138. </script>
  139. <script>
  140. var myChart1 = document.getElementById('myChart1').getContext('2d');
  141. // Global Options
  142. //Chart.defaults.global.defaultFontFamily = 'Lato';
  143. // Chart.defaults.global.defaultFontSize = 18;
  144. // Chart.defaults.global.defaultFontColor = '#777';
  145.  var pointDeVenteName = {{ pointDeVenteName|json_encode|raw }};
  146.  var ArrayCA = {{ ArrayCA|json_encode|raw }};
  147.  var nbrVente = {{ nbrVente|json_encode }};
  148. var massPopChart = new Chart(myChart1, {
  149.   type:'bar', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
  150.   data:{
  151.     labels:pointDeVenteName,
  152.   datasets: [
  153.     {
  154.       label: 'Chiffre affaire',
  155.       data: ArrayCA,
  156.       borderColor: 'rgb(54, 162, 235)',
  157.       backgroundColor: 'rgba(54, 162, 235, 0.2)',
  158.     }]
  159.   },
  160.   options:{
  161.     title:{
  162.       display:true,
  163.       text:'Largest Cities In Massachusetts',
  164.       fontSize:25,
  165.       responsive: true
  166.     },
  167.     legend:{
  168.       display:true,
  169.       position:'right',
  170.       labels:{
  171.         fontColor:'#000'
  172.       }
  173.     },
  174.     layout:{
  175.       padding:{
  176.         left:50,
  177.         right:0,
  178.         bottom:0,
  179.         top:0
  180.       }
  181.     },
  182.     tooltips:{
  183.       enabled:true
  184.     }
  185.   }
  186. });
  187. </script>
  188. {% endblock %}