templates/admin/dashboard/index.html.twig line 1

Open in your IDE?
  1. {% extends 'admin/base.html.twig' %}
  2. {% block title %}Dashboard{% endblock %}
  3. {% block javascripts %}
  4. <script>
  5.     $(document).ready(function(){
  6.         $("#adminReport").submit(function () {
  7.             $(".submitBtn").attr("disabled", true).html('<i class="fa fa-spinner fa-spin"></i>');
  8.             return true;
  9.         });
  10.     });
  11. </script>
  12. {% endblock %}
  13.     {% block body %}
  14. <div class="container-fluid content p-5">
  15.     <div class="row">
  16.             <h2> Courses of : {% if app.request.query.get('q') %} {{ app.request.query.get('q') }} {% else %} {{ currentDay|date('d/m/Y') }} {% endif %}</h2>
  17.             <form class="ml-auto mb-4">
  18.                 <div class="input-group">
  19.                     <div class="input-group-prepend">
  20.                         <span class="input-group-text" id="dateInput">See another day</span>
  21.                     </div>
  22.                     <input type="date" id="date" name="q"
  23.                            value="{{ app.request.query.get('q') ?  app.request.query.get('q') : currentDay|date('d/m/Y') }}"
  24.                            min="{{ currentDay|date('d/m/Y') }}" max="31/12/2100"
  25.                            aria-describedby="dateInput"
  26.                     >
  27.                     <div class="input-group-append">
  28.                         <button type="submit" class="btn btn-primary mb-2">See</button>
  29.                     </div>
  30.                 </div>
  31.             </form>
  32.             <div class="table-responsive scrollme">
  33.                 <small><em class="text-secondary">{% trans %}Ceci est un tableau, faite défiler sur la droite pour voir le reste des informations{% endtrans %}</em></small>
  34.                 <table class="table table-striped">
  35.                     <thead class="thead-dark">
  36.                     <tr>
  37.                         <th scope="col">الجدول</th>
  38.                         <th scope="col">المعلم</th>
  39.                         <th scope="col">الطالب</th>
  40.                         <th scope="col">الفصل</th>
  41.                         <th scope="col">أعطى المعلم الدرس ؟</th>
  42.                         <th scope="col">دقائق الضائعة في هذا الدرس</th>
  43.                         <th scope="col">هل عوض دقائق ؟ كم</th>
  44.                         <th scope="col">كم تبقى كتعويض لهذا الإشتراك <br> أو لهذه المجموعة ؟</th>
  45.                         <th scope="col">ملاحظات</th>
  46.                         {% if is_granted('ROLE_AR') %}
  47.                             <th scope="col">تنبيه للطالب المتأخر</th>
  48.                         {% endif %}
  49.                         {% if is_granted('ROLE_ADMIN') %}
  50.                             <th scope="col">خصم</th>
  51.                         {% endif %}
  52.                         {% if is_granted('ROLE_AR') %}
  53.                             <th scope="col">تعديل</th>
  54.                         {% endif %}
  55.                         <th scope="col">Last update</th>
  56.                     </tr>
  57.                     </thead>
  58.                     <form id="adminReport" action="{{ path('admin_course_tracking')}}" method="post">
  59.                         <tbody>
  60.                         {% for course in coursesOfTheDay %}
  61.                             <tr>
  62.                                 <th scope="row">{{ course.courseDate|date('H:i') }}
  63.                                     <br><small>{{ course.absenceLogRelated ? 'هذا درس تعويض' : '' }}</small>
  64.                                 </th>
  65.                                 <td>{{ course.teacherSchedule.teacher.userId.fullname }}
  66.                                     <br>
  67.                                     <small><a href="{{ path('admin_teacher_switch', {'id': course.id}) }}">غير إلى معلم بديل</a></small>
  68.                                 </td>
  69.                                 <td>
  70.                                     {% if course.subscriptionOrder %}
  71.                                         <a target="_blank" href="{{ path('admin_subscription_show', {'id': course.subscriptionOrder.id}) }}">{{ course.subscriptionOrder.participant ? course.subscriptionOrder.participant.fullname : course.subscriptionOrder.user.fullname }}</a>
  72.                                         {% if course.subscriptionOrder.participant %}
  73.                                             {% if course.subscriptionOrder.participant.isChild == true   %}
  74.                                                 {% if course.subscriptionOrder.participant.age < 5 %}
  75.                                                     <i class="fas fa-baby text-warning"></i>
  76.                                                     {% if course.subscriptionOrder.participant.age < 3 %}
  77.                                                         <br>
  78.                                                         <i class="fas fa-exclamation-circle text-danger"></i> <small>{% trans %}Cet enfant à moins de 3 ans{% endtrans %}</small>
  79.                                                     {% endif %}
  80.                                                     {% else %}
  81.                                                         <i class="fas fa-child"></i>
  82.                                                 {% endif %}
  83.                                             {% endif %}
  84.                                         {% endif %}
  85.                                     {% elseif course.sessionGroup %}
  86.                                         <a target="_blank" href="{{ path('admin_session_student_index', {'id': course.sessionGroup.id}) }}">{{ course.sessionGroup.displayNameEn }}</a>
  87.                                         <br>
  88.                                         <small>درس مجموعة</small>
  89.                                     {% elseif course.videoRegistration %}
  90.                                         <a target="_blank" href="{{ path('video_courses_registration_show', {'id': course.videoRegistration.id}) }}">{{ course.videoRegistration.participant ? course.videoRegistration.participant.fullname : course.videoRegistration.user.fullname }}</a>
  91.                                         <br>
  92.                                         <small> درس فيديو</small>
  93.                                     {% elseif course.ticketOrder %}
  94.                                         <a target="_blank" href="{{ path('admin_ticketOrder_show', {'id': course.ticketOrder.id}) }}">{{ course.ticketOrder.participant ? course.ticketOrder.participant.fullname : course.ticketOrder.user.fullname }}</a>
  95.                                         <br>
  96.                                         <small>🚨&nbsp;Ticket</small>
  97.                                     {% elseif course.userTestLevel %}
  98.                                         <a target="_blank" href="{{ path('user_placement_test_show', {'id': course.userTestLevel.id}) }}">{{ course.userTestLevel.participant ? course.userTestLevel.participant.fullname : course.userTestLevel.user.fullname }}</a>
  99.                                         <br>
  100.                                         <small>🚨&nbsp;Level Test</small>
  101.                                     {% endif %}
  102.                                 </td>
  103.                                 <td>
  104.                                     {% if course.teacherSchedule.room %}
  105.                                         {{ course.teacherSchedule.room.name }} <br>
  106.                                         <i class="fas fa-external-link-alt"></i>&nbsp;<a target="_blank" href="{{ course.teacherSchedule.room.urlWithPassword }}"><small>{% trans %}Accès direct (sans mot de passe){% endtrans %}</small> </a>
  107.                                         <br>
  108.                                         <i class="fas fa-external-link-alt"></i>&nbsp;<a target="_blank" href="{{ course.teacherSchedule.room.urlWithoutPassword }}"><small>{% trans %}Accès classique (avec mot de passe) :{% endtrans %} <strong>{{ course.teacherSchedule.room.roomPassword }}</strong></small> </a>
  109.                                         {% else %}
  110.                                         ATTENTION: NO ROOM FOR THIS SCHEDULE!!
  111.                                     {% endif %}
  112.                                 </td>
  113.                                 <td>
  114.                                     {% if course.isDone == true %}
  115.                                         <i class="fas fa-check text-success"></i>
  116.                                     {% elseif course.isCanceled == true %}
  117.                                         <i class="fas fa-times text-danger"></i>
  118.                                     {% else %}
  119.                                         {% if is_granted('ROLE_AR') %}
  120.                                             <div class="form-check">
  121.                                                 <input class="form-check-input" type="checkbox" value="{{ course.id }}" id="{{ course.id }}"  name="done[{{ course.id }}]">
  122.                                                 <label for="{{ course.id }}" class="text-success font-weight-bold">نعم</label>
  123.                                             </div>
  124.                                             <div class="form-check">
  125.                                                 <input onclick="return confirm('متأكدة أن المعلم غاب؟');" class="form-check-input" type="checkbox" value="{{ course.id }}" id="{{ course.id }}"  name="notDone[{{ course.id }}]">
  126.                                                 <label for="{{ course.id }}" class="text-danger font-weight-bold">لا</label>
  127.                                             </div>
  128.                                             <div class="form-check">
  129.                                                 <input class="form-check-input" type="checkbox" value="{{ course.id }}" id="{{ course.id }}"  name="studentAbsent[{{ course.id }}]">
  130.                                                 <label for="{{ course.id }}" class="text-warning font-weight-bold">انتظار</label>
  131.                                             </div>
  132.                                         {% endif %}
  133.                                     {% endif %}
  134.                                 </td>
  135.                                 {% if course.isDone == true or course.isCanceled == true %}
  136.                                     <td>
  137.                                         {{ course.LostMinutes ? course.LostMinutes : '' }}
  138.                                     </td>
  139.                                     <td>
  140.                                         {{ course.catchUpMinutes ? course.catchUpMinutes : '' }}
  141.                                     </td>
  142.                                     <td>
  143.                                         {{ course.isWaiting == true ? 'الطالب كان غائب' : '' }}
  144.                                     </td>
  145.                                     <td>
  146.                                         {{ course.comment ? course.comment : '' }}
  147.                                     </td>
  148.                                     <td></td>
  149.                                 {% else %}
  150.                                     <td>
  151.                                         {% if is_granted('ROLE_AR') %}
  152.                                             <input type="number" name="lostMinutes[{{ course.id }}]" min="0" max="45" value="">
  153.                                         {% endif %}
  154.                                     </td>
  155.                                     <td>
  156.                                         {% if is_granted('ROLE_AR') %}
  157.                                             <input type="number" name="catchupMinutes[{{ course.id }}]" min="0" max="45" value="">
  158.                                         {% endif %}
  159.                                     </td>
  160.                                     <td>
  161.                                         {% if course.subscriptionOrder %}
  162.                                             {{ course.subscriptionOrder.totalLostMinutes ? course.subscriptionOrder.totalLostMinutes : '' }}
  163.                                         {% endif %}
  164.                                         {% if course.sessionGroup %}
  165.                                             {{ course.sessionGroup.totalLostMinutes ? course.sessionGroup.totalLostMinutes : '' }}
  166.                                         {% endif %}
  167.                                     </td>
  168.                                     <td>
  169.                                         {% if is_granted('ROLE_AR') %}
  170.                                             {{ course.comment ? 'ملاحظات مسجلة: '~ course.comment : '' }}
  171.                                             <div class="form-row">
  172.                                                 {{ course.comment ? 'سجل ملاحظات زائدة : ': ' ' }}
  173.                                                 <input class="form-control" type="text" name="comment[{{ course.id }}]" value="">
  174.                                             </div>
  175.                                         {% endif %}
  176.                                     </td>
  177.                                     {% if is_granted('ROLE_AR') %}
  178.                                         <td>
  179.                                             {% if course.subscriptionOrder %}
  180.                                                 <a href="{{ path('subscription_warning_late_student', {'id': course.subscriptionOrder.id}) }}"  class="btn btn-danger">ارسلي التنبه</a>
  181.                                             {% endif %}
  182.                                             {% if course.userTestLevel %}
  183.                                                 <a methods="post" href="{{ path('admin_placement_test_alert', {'id': course.userTestLevel.id, 'course' : course.id}) }}" class="btn btn-danger">ارسلي التنبه</a>
  184.                                             {% endif %}
  185.                                         </td>
  186.                                     {% endif %}
  187.                                 {% endif %}
  188.                                 {% if is_granted('ROLE_ADMIN') %}
  189.                                     <td {{ course.teacherSchedule.teacher.currency == 'USD' ? 'class="alert alert-info"' : '' }}>
  190.                                         {% if course.penalty %}
  191.                                             {{ course.penalty }} {{ course.teacherSchedule.teacher.currency }}
  192.                                         {% else %}
  193.                                             <input type="number" name="penalty[{{ course.id }}]" min="0" max="100" step="any" value="">
  194.                                         {% endif %}
  195.                                     </td>
  196.                                 {% endif %}
  197.                                 {% if is_granted('ROLE_AR') %}
  198.                                     <td>
  199.                                         {% if course.isDone == true or course.isCanceled == true %}
  200.                                             <a href="{{ path('admin_course_tracking_edit', {'id': course.id }) }}"><i class="fas fa-edit"></i></a>
  201.                                         {% endif %}
  202.                                     </td>
  203.                                 {% endif %}
  204.                                 <td>
  205.                                     {% if course.updateBy %}
  206.                                         <small>
  207.                                             Update by {{ course.updateBy }} <br>
  208.                                             at {{ course.updateAt|date('d/m/Y H:i') }}
  209.                                         </small>
  210.                                     {% endif %}
  211.                                 </td>
  212.                             </tr>
  213.                         {% else %}
  214.                             <tr>
  215.                                 <td colspan="13" class="text-center">Pas de cours aujourd'hui</td>
  216.                             </tr>
  217.                         {% endfor %}
  218.                         </tbody>
  219.                         {% if is_granted('ROLE_AR') %}
  220.                             <tfoot>
  221.                             <td colspan="12" class="text-center">
  222.                                 <button type="submit" name="submitReportTracking" class="btn btn-success submitBtn">ارسلي التقرير</button>
  223.                             </td>
  224.                             </tfoot>
  225.                         {% endif %}
  226.                     </form>
  227.                 </table>
  228.             </div>
  229.     </div>
  230. </div>
  231. </div>
  232. {% endblock %}