{% extends 'base.html.twig' %}{% block title %}{% endblock %}{% block body %}<style> body{ font-family: Poppins } .main-content{ background: #fff; height: auto; } .bouttonfilltre{ margin-top: 30px; background: #C64864; color: #fff; } .page-content { padding: 0px 10px; }</style> {{ form_start(filterForm) }} <div class="row" style=" background: #c3e2e2; border: 1px dotted; padding: 32px; text-align: right;"> <div class="col-6"> {{ form_row(filterForm.endDate, {'attr': {'class': 'form-control'}}) }} </div> <div class="col-6"> {{ form_row(filterForm.startDate, {'attr': {'class': 'form-control'}}) }} </div> <div class="col-12" style="text-align: center"> {{ form_row(filterForm.filter, {'attr': {'class': 'form-control bouttonfilltre'}})}} </div> </div> {{ form_end(filterForm) }}{% set current_month = "now"|date("m") %} <h2 style=" font-family: Poppins; text-align: center ; color: #1bbc9b;margin: 30px 0px"> {{ current_month }} تقرير الطلبات الجديدة لشهر </h2> {% if orders is not empty %} <h5 style="color: #fff ; background:#028080 ; padding: 10px ; text-align: right"> مجموع طلباتي {{ totalAmount }} درهم </h5> {# Affichez le total ici #} <div class="table-bordered"> <table class="table"> <thead> <tr style="text-align: right"> <th>تاريخ الطلب</th> <th>مبلغ الطلب</th> <th>رقم الطلب</th> </tr> </thead> <tbody> {% for order in orders %} <tr style="text-align: right"> <td>{{ order.date|date('Y-m-d') }}</td> <td>{{ order.total }}</td> <td>{{ order.numerocommande }}</td> </tr> {% endfor %} </tbody> </table> {% else %} <p>لم يتم العثور على طلبيات .</p> {% endif %} </div><h5 style=" text-align : right ; color: #fff ; margin-top: 30px ; background:#028080 ; padding: 10px"> ملخص الطلبات والعمولات من شبكتي </h5> <table class="table" id="table"> <thead> <tr style="text-align: right"> <th>مجموع الطلبيات </th> <th>الأرباح </th> <th>الجيل </th> </tr> </thead> <tbody> {% set totalCommissions = 0 %} {% set totalOrders = 0 %} {% for data in commissionsByLevel %} {% set orderAmount = totalOrdersByLevel[data.level]|default(0) %} {% set commissionAmount = data.totalCommissions|default(0) %} {% set totalCommissions = totalCommissions + commissionAmount %} {% set totalOrders = totalOrders + orderAmount %} <tr style="text-align: right"> <td>{{ orderAmount }} dh </td> <td> {{ commissionAmount | number_format(2, '.', ',') }} <span style="text-align: left">dh</span> </td> <td>G {{ data.level }}</td> </tr> {% endfor %} <tr style="text-align: right"> <th style="background: #ff00ff ; color: #ffffff ; font-weight: 800;"> </th> <td style="background: #ff00ff ; color: #ffffff ; font-weight: 800;"> <span>{{ totalCommissions }} dh</span> </td> <th style="background: #ff00ff ; color: #ffffff ; font-weight: 800;"> المجموع </th> </tr> </tbody> </table> <h5 style="text-align: right ; color: #fff ; margin-top: 30px ; background:#028080 ; padding: 10px"> تفاصيل الطلبات والعمولات من شبكتي </h5> {% for generation, details in detailsByGeneration %} <h5 style=" text-align: right ; background: aquamarine; padding: 5px;"> {{ generation }} الجيل </h5> <div style="overflow-x: auto; /* Active le défilement horizontal si le contenu déborde */ width: 100%; margin-bottom: 100px/* Vo"> <table class="table" id="tableo" > <thead> <tr style="text-align: right"> <th>مبلغ الطلب</th> <th>العمولة</th> <th>رقم الطلب</th> <th>رقم التسجيل</th> <th>الإسم و النسب</th> </tr> </thead> <tbody style="text-align: right"> {% for detail in details %} <tr> <td>{{ detail.orderAmount }} dh</td> <td>{{ detail.commission }} dh</td> <td>{{ detail.orderNumber }}</td> <td>{{ detail.userMatricule }}</td> <td>{{ detail.userfirstname}} {{ detail.userLastName}}</td> </tr> {% else %} <tr> <td colspan="5">لا توجد بيانات متاحة</td> </tr> {% endfor %} </tbody> </table> </div> {% endfor %}{% endblock %}{% block javascripts %} {{ parent() }} <script type="text/javascript"> $(document).ready( function () { $('#table')({ scrollX: true, language: { url: '//cdn.datatables.net/plug-ins/1.10.20/i18n/French.json' } }); } ); </script> <script type="text/javascript"> $(document).ready( function () { $('#tableo')({ scrollX: true, language: { url: '//cdn.datatables.net/plug-ins/1.10.20/i18n/French.json' } }); } ); </script>{% endblock %}