templates/classroom/show.html.twig line 1

Open in your IDE?
  1. {% extends "layout/backEndLayout.html.twig" %}
  2. {% block content %}
  3.     <div class="row mt-4">
  4.         <div class="col-1 mar-bot30">
  5.           {% if is_granted('ROLE_ADMIN') %}
  6.             <a class="btn btn-info" href="{{ path('admin_classrooms_new') }}">
  7.                 <i class="fa fa-plus"></i>
  8.                 
  9.                                                                                                                                                 
  10.                                                                                                                             
  11.                                                                                                             
  12.                                                                                             
  13.      
  14.             </a>
  15.             {% endif %}
  16.         </div>
  17.           
  18.           
  19.         </div>
  20.         <div class="col-11 jumbotron">
  21.             <article class="p-3">
  22.                 <table class="table table-hover record_properties center">
  23.                     <tbody>
  24.                         <tr>
  25.                             <th scope="row">
  26.                                 Nom
  27.                                                                                                                                                                                                                                                             
  28.                                                                                                                                                                                                                             
  29.                                                                                                                                                                                             
  30.                                                                                                                                                             
  31.                                                                                                                             
  32.                                                                                             
  33.                                                             
  34.                             </th>
  35.                             <td>
  36.                                 {{ classroom.name }}
  37.                             </td>
  38.                         </tr>
  39.                         <tr>
  40.                             <th scope="row">
  41.                                 Niveau
  42.                                                                                                                                                                                                                                                             
  43.                                                                                                                                                                                                                             
  44.                                                                                                                                                                                             
  45.                                                                                                                                                             
  46.                                                                                                                             
  47.                                                                                             
  48.                                                             
  49.                             </th>
  50.                             <td>
  51.                                 {{ classroom.level }}
  52.                             </td>
  53.                         </tr>
  54.                         <tr>
  55.                             <th scope="row">
  56.                                 Titulaire
  57.                                                                                                                                                                                                                                                             
  58.                                                                                                                                                                                                                             
  59.                                                                                                                                                                                             
  60.                                                                                                                                                             
  61.                                                                                                                             
  62.                                                                                             
  63.                                                             
  64.                             </th>
  65.                             <td>
  66.                                 {% if mainteacher is null %}
  67.                                     
  68.                                     {% else %}
  69.                                       {{mainteacher.fullName}}
  70.                                 {% endif %}
  71.                              
  72.                             </td>
  73.                         </tr>
  74.                         <tr>
  75.                             <th scope="row">
  76.                                 Classe d'examen                                                                                                                                                                                                                                                             
  77.                                                                                                                                                                                                                             
  78.                                                                                                                                                                                             
  79.                                                                                                                                                             
  80.                                                                                                                             
  81.                                                                                             
  82.                                                             
  83.                             </th>
  84.                             <td>
  85.                                 {% if (classroom.apc == true) %}
  86.                                     OUI
  87.                                                                                                                                                                                                                                                                                                                                 
  88.                                                                                                                                                                                                                                                                                             
  89.                                                                                                                                                                                                                                                         
  90.                                                                                                                                                                                                                     
  91.                                                                                                                                                                                 
  92.                                                                                                                                             
  93.                                                                                                         
  94.                                                                     
  95.                                 {% else %}
  96.                                     NON
  97.                                                                                                                                                                                                                                                                                                                                 
  98.                                                                                                                                                                                                                                                                                             
  99.                                                                                                                                                                                                                                                         
  100.                                                                                                                                                                                                                     
  101.                                                                                                                                                                                 
  102.                                                                                                                                             
  103.                                                                                                         
  104.                                                                     
  105.                                 {% endif %}
  106.                             </td>
  107.                         </tr>
  108.                     </tbody>
  109.                 </table>
  110.                 <div class="btn-group record_actions">
  111.                     <a class="btn btn-info" href="{{ path('admin_classrooms') }}">
  112.                         <i class="fa fa-list"></i>
  113.                         {{ 'Listing'|trans({}, 'admin') }}
  114.                     </a>
  115.                     {% if is_granted('ROLE_ADMIN') %}
  116.                         <a class="btn btn-primary" href="{{ path('admin_classrooms_edit', {id: classroom.id}) }}">
  117.                             <i class="fa fa-edit"></i>
  118.                             {{ 'Edit'|trans({}, 'admin') }}
  119.                         </a>
  120.                 
  121.                     <a target="_blank" class="btn btn-file"  data-toggle="modal" data-target="#form_modal_courses" >
  122.                         <i class="fa fa-file-excel-o"></i>
  123.                         Recap. Seq
  124.                                                                                                                                                                                                                     
  125.                                                                                                                                                                                             
  126.                                                                                                                                                                     
  127.                                                                                                                                             
  128.                                                                                                                     
  129.                                                                                             
  130.                                                                     
  131.                                             
  132.                     </a>
  133.                     <a target="_blank" class="btn btn-warning" href="{{ path('admin_classrooms_reportcards_seq', {id: classroom.id}) }}">
  134.                         <i class="fa fa-file"></i>
  135.                         Bull Seq
  136.                                                                                                                                                                                                                     
  137.                                                                                                                                                                                             
  138.                                                                                                                                                                     
  139.                                                                                                                                             
  140.                                                                                                                     
  141.                                                                                             
  142.                                                                     
  143.                                             
  144.                     </a>
  145.                     <a  target="_blank" class="btn btn-file" href="{{ path('admin_classrooms_reportcards_trim', {id: classroom.id}) }}">
  146.                         <i class="fa fa-file"></i>
  147.                         Bull Trim
  148.                                                                                                                                                                                                                     
  149.                                                                                                                                                                                             
  150.                                                                                                                                                                     
  151.                                                                                                                                             
  152.                                                                                                                     
  153.                                                                                             
  154.                                                                     
  155.                                             
  156.                     </a>
  157.                     <a target="_blank" class="btn btn-outline-warning" href="{{ path('admin_classrooms_recapitulatif_trim', {id: classroom.id}) }}">
  158.                         <i class="fa fa-file-excel-o"></i>
  159.                         Recap Trim
  160.                                                                                                                                                                                                                     
  161.                                                                                                                                                                                             
  162.                                                                                                                                                                     
  163.                                                                                                                                             
  164.                                                                                                                     
  165.                                                                                             
  166.                                                                     
  167.                                             
  168.                     </a>
  169.                     <a  target="_blank" class="btn btn-file" href="{{ path('admin_class_reportcards_apc_year', {id: classroom.id}) }}">
  170.                         <i class="fa fa-file"></i>
  171.                         Bull Ann V1
  172.                                                                                                                                                                                                                     
  173.                                                                                                                                                                                             
  174.                                                                                                                                                                     
  175.                                                                                                                                             
  176.                                                                                                                     
  177.                                                                                             
  178.                                                                     
  179.                                             
  180.                     </a>
  181.                     <a target="_blank" class="btn btn-file" data-toggle="modal" data-target="#form_modal_reportcard_params" >
  182.                         <i class="fa fa-file"></i>
  183.                         Bull Ann V2
  184.                                                                                                                                                                                                                     
  185.                                                                                                                                                                                             
  186.                                                                                                                                                                     
  187.                                                                                                                                             
  188.                                                                                                                     
  189.                                                                                             
  190.                                                                     
  191.                                             
  192.                     </a>
  193.                     <a  target="_blank" class="btn btn-light" href="{{ path('admin_current_fulfilled_eval_show', {id: classroom.id}) }}">
  194.                         <i class="fa fa-list-ul"></i>
  195.                         Dépot des PV
  196.                                                                                                                                                                                                                     
  197.                                                                                                                                                                                             
  198.                                                                                                                                                                     
  199.                                                                                                                                             
  200.                                                                                                                     
  201.                                                                                             
  202.                                                                     
  203.                                             
  204.                     </a>
  205.                     
  206.                         <button class="btn btn-danger" type="submit">
  207.                             <i class="fa fa-trash-o"></i>
  208.                             {{ 'Delete'|trans({}, 'admin') }}
  209.                         </button>
  210.                     {% endif %}
  211.                 </div>
  212.                 <div class="card-header text-center">
  213.                     <h2>
  214.                         Liste des Ã©lèves incrits dans la classe 
  215.                                                                                                                                                                                             
  216.                                                                                                                                                                     
  217.                                                                                                                                             
  218.                                                                                                                     
  219.                                                                                             
  220.                                                                     
  221.                                             
  222.                     </h2>
  223.                 </div>
  224.                 <table class="table table-striped table-hover table-bordered records_list center">
  225.                     <thead>
  226.                         <tr>
  227.                             <th scope="col">
  228.                                 Matricule
  229.                                                                                                                                                                                                                                                             
  230.                                                                                                                                                                                                                             
  231.                                                                                                                                                                                             
  232.                                                                                                                                                             
  233.                                                                                                                             
  234.                                                                                             
  235.                                                             
  236.                             </th>
  237.                             <th scope="col">
  238.                                 Nom
  239.                                                                                                                                                                                                                                                             
  240.                                                                                                                                                                                                                             
  241.                                                                                                                                                                                             
  242.                                                                                                                                                             
  243.                                                                                                                             
  244.                                                                                             
  245.                                                             
  246.                             </th>
  247.                             <th scope="col">
  248.                                 Prénom
  249.                                                                                                                                                                                                                                                             
  250.                                                                                                                                                                                                                             
  251.                                                                                                                                                                                             
  252.                                                                                                                                                             
  253.                                                                                                                             
  254.                                                                                             
  255.                                                             
  256.                             </th>
  257.                             <th scope="col">
  258.                                 Photo
  259.                                                                                                                                                                                                                                                             
  260.                                                                                                                                                                                                                             
  261.                                                                                                                                                                                             
  262.                                                                                                                                                             
  263.                                                                                                                             
  264.                                                                                             
  265.                                                             
  266.                             </th>
  267.                         </tr>
  268.                     </thead>
  269.                     <tbody>
  270.                         {% set effectif =0 %}
  271.                         {% for std in studentEnrolled %}
  272.                             <tr>
  273.                                 <td>
  274.                                     <a href="{{ path('admin_students_show', {id: std.id}) }}">
  275.                                         {{ std.matricule }}
  276.                                     </a>
  277.                                 </td>
  278.                                 <td>
  279.                                     {{ std.lastname }}
  280.                                 </td>
  281.                                 <td>
  282.                                     {{ std.firstname }}
  283.                                 </td>
  284.                                 <td>
  285.                                     {{ fileExists[std.id] }}
  286.                                 </td>
  287.                                 {% set effectif = effectif + 1 %}
  288.                             </tr>
  289.                         {% endfor %}
  290.                         <tr>
  291.                             <td class="center" colspan="2">
  292.                                 Effectif
  293.                                                                                                                                                                                                                                                             
  294.                                                                                                                                                                                                                             
  295.                                                                                                                                                                                             
  296.                                                                                                                                                             
  297.                                                                                                                             
  298.                                                                                             
  299.                                                             
  300.                             </td>
  301.                             <td>
  302.                                 {{ effectif }}
  303.                             </td>
  304.                         </tr>
  305.                     </tbody>
  306.                 </table>
  307.                 <div class="card-header text-center">
  308.                     <h2>
  309.                         Matières programmées dans la classe 
  310.                                                                                                                                                                                             
  311.                                                                                                                                                                     
  312.                                                                                                                                             
  313.                                                                                                                     
  314.                                                                                             
  315.                                                                     
  316.                                             
  317.                     </h2>
  318.                 </div>
  319.                 <table class="table table-striped table-hover table-bordered records_list center">
  320.                     <thead>
  321.                         <tr>
  322.                             <th scope="col">
  323.                                 Module 
  324.                                                                                                                                                                                                                                                             
  325.                                                                                                                                                                                                                             
  326.                                                                                                                                                                                             
  327.                                                                                                                                                             
  328.                                                                                                                             
  329.                                                                                             
  330.                                                             
  331.                             </th>
  332.                             <th scope="col">
  333.                                 Code 
  334.                                                                                                                                                                                                                                                             
  335.                                                                                                                                                                                                                             
  336.                                                                                                                                                                                             
  337.                                                                                                                                                             
  338.                                                                                                                             
  339.                                                                                             
  340.                                                             
  341.                             </th>
  342.                             <th scope="col">
  343.                                 Intitulé 
  344.                                                                                                                                                                                                                                                             
  345.                                                                                                                                                                                                                             
  346.                                                                                                                                                                                             
  347.                                                                                                                                                             
  348.                                                                                                                             
  349.                                                                                             
  350.                                                             
  351.                             </th>
  352.                             <th scope="col">
  353.                                 Coef 
  354.                                                                                                                                                                                                                                                             
  355.                                                                                                                                                                                                                             
  356.                                                                                                                                                                                             
  357.                                                                                                                                                             
  358.                                                                                                                             
  359.                                                                                             
  360.                                                             
  361.                             </th>
  362.                             <th scope="col">
  363.                                 Enseignant 
  364.                                                                                                                                                                                                                                                             
  365.                                                                                                                                                                                                                             
  366.                                                                                                                                                                                             
  367.                                                                                                                                                             
  368.                                                                                                                             
  369.                                                                                             
  370.                                                             
  371.                             </th>
  372.                         </tr>
  373.                     </thead>
  374.                     <tbody>
  375.                         {% set totalCoef =0 %}
  376.                         {% for module in modules %}
  377.                             <tr>
  378.                                 {% for course in module.courses %}
  379.                                     <tr>
  380.                                         <td>
  381.                                             {{ module.name }}
  382.                                         </td>
  383.                                         <td>
  384.                                             <a href="{{ path('admin_courses_show', {id: course.id}) }}">
  385.                                                 {{ course.code }}
  386.                                             </a>
  387.                                         </td>
  388.                                         <td>
  389.                                             {{ course.wording }}
  390.                                         </td>
  391.                                         <td>
  392.                                             {{ course.coefficient }}
  393.                                         </td>
  394.                                         <td>
  395.                                             {% if attributions[course.id] is defined %}
  396.                                                 {% if is_granted('ROLE_ADMIN') %}
  397.                                                     <a href="{{ path('admin_attributions_edit', {id: attributions[course.id].id}) }}">
  398.                                                         {{attributions[course.id].teacher.fullName}}
  399.                                                     </a>
  400.                                                 {% else %}
  401.                                                     {{attributions[course.id].teacher.fullName}}
  402.                                                 {% endif %}
  403.                                             {% else %}
  404.                                             {% if is_granted('ROLE_ADMIN') %}
  405.                                                 <a href="{{ path('admin_attributions_new') }}">
  406.                                                     Pas encore attribue
  407.                                                 </a>
  408.                                              {% endif %}
  409.                                             {% endif %}
  410.                                         </td>
  411.                                         {% set totalCoef = totalCoef+course.coefficient %}
  412.                                     </tr>
  413.                                 {% endfor %}
  414.                             </tr>
  415.                             <tr>
  416.                                 <td class="center" colspan="3">
  417.                                     total cumul coef 
  418.                                                                                                                                                                                                                                                                                             
  419.                                                                                                                                                                                                                                                         
  420.                                                                                                                                                                                                                     
  421.                                                                                                                                                                                 
  422.                                                                                                                                             
  423.                                                                                                         
  424.                                                                     
  425.                                 </td>
  426.                                 <td>
  427.                                     {{ totalCoef }}
  428.                                 </td>
  429.                             </tr>
  430.                         {% endfor %}
  431.                     </tbody>
  432.                 </table>
  433.             </article>
  434.             <section id="graphs">
  435.                 <article class="p-3">
  436.                     <canvas id="schoolPerformanceGraph" width="700" height="250"></canvas>
  437.                 </article>
  438.                 {% if classroom.apc %}
  439.                   <article class="p-3">
  440.                     <canvas id="officialExamsGraph" width="200" height="220" ></canvas>
  441.                 </article>
  442.                 {% endif %}
  443.             </section>
  444.         </div>
  445.     </div>
  446. <!-- Modal pour le choix de cours qui vont figurer dans le recaputulatif sequentiel -->
  447. <div class="modal fade" id="form_modal_courses" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  448.   <div class="modal-dialog modal-dialog-centered" role="document">
  449.     <div class="modal-content">
  450.       <div class="modal-header border-bottom-0">
  451.         <h5 class="modal-title" id="exampleModalLabel">Choisir les cours a qui doivent figurer dans le recapitulatif</h5>
  452.         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  453.           <span aria-hidden="true">&times;</span>
  454.         </button>
  455.       </div>
  456.       <form action="{{ path('admin_classrooms_recapitulatif_seq', {'id':classroom.id}) }}" method="post">
  457.         <div class="modal-body">
  458.           <div class="form-group">
  459.              {% for module in modules %}
  460.                 {% for course in module.courses %}
  461.                 <li class="list-group-item">
  462.                         <input class="form-check-input me-1" type="checkbox" checked name="selected_courses[]" value={{course.id}} >
  463.                         {{course.wording}}
  464.                 </li>
  465.                 {% endfor %}
  466.              {% endfor %}
  467.           </div>
  468.         </div>
  469.       
  470.         <div class="modal-footer border-top-0 d-flex justify-content-center">
  471.           <button type="submit" class="btn btn-success">Submit</button>
  472.         </div>
  473.       </form>
  474.     </div>
  475.   </div>
  476. </div>
  477. <!-- Modal pour le parametrage de la presentation des bulletins. -->
  478. <div class="modal fade" id="form_modal_reportcard_params" tabindex="-1" role="dialog" aria-labelledby="exampleModalRange" aria-hidden="true">
  479.   <div class="modal-dialog modal-dialog-centered" role="document">
  480.     <div class="modal-content">
  481.       <div class="modal-header border-bottom-0">
  482.         <h5 class="modal-title" id="exampleModalLabel">Reajuster les parametres de production des bulletins</h5>
  483.         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  484.           <span aria-hidden="true">&times;</span>
  485.         </button>
  486.       </div>
  487.       <form action="{{ path('admin_class_reportcards_3_apc_year', {'id':classroom.id}) }}" method="post">
  488.         <div class="modal-body">
  489.            <div class="form-group">
  490.             <label for="header_font_size">Taille de des caracteres dans l entete</label>
  491.             <input type="range" class="form-control" name="header_font_size" id="header_font_size" min="1" max="1.6" step="0.01">
  492.           </div>
  493.           <div class="form-group">
  494.             <label for="line_height">Hauteur des lignes dans le tableau</label>
  495.             <input type="range" class="form-control" name="line_height" id="line_height" min="0.5" max="1.5" step="0.01">
  496.           </div>
  497.           <div class="form-check">
  498.             <input class="form-check-input" type="checkbox"  id="copyright"  name="copyright">
  499.             <label class="form-check-label" for="copyright">
  500.                 Ajout du copyright en pied du bulletin?
  501.             </label>
  502.          </div>
  503.          <div class="form-check">
  504.             <input class="form-check-input" type="checkbox"  id="reverse"  name="reverse">
  505.             <label class="form-check-label" for="reverse">
  506.                 Sens inverse
  507.             </label>
  508.          </div>
  509.         </div>
  510.       
  511.         <div class="modal-footer border-top-0 d-flex justify-content-center">
  512.           <button type="submit" class="btn btn-success">Submit</button>
  513.         </div>
  514.       </form>
  515.     </div>
  516.   </div>
  517. </div>
  518. {% endblock %}
  519. {% block javascripts %}
  520.     {{ parent() }}
  521.     
  522.     <script type="text/javascript">
  523.                         const schoolPerformanceGraph = $("#schoolPerformanceGraph");                       
  524.                         const datasets = [];
  525.                         //Generate a random color
  526.                         const randomRgbColor = () => {
  527.                             let r = Math.floor(Math.random() * 256); // Random between 0-255
  528.                             let g = Math.floor(Math.random() * 256); // Random between 0-255
  529.                             let b = Math.floor(Math.random() * 256); // Random between 0-255
  530.                             return 'rgb(' + r + ',' + g + ',' + b + ')';
  531.                         };
  532.                        
  533.                        
  534.                                 {% if session1 is defined %}
  535.                                     datasets.push( {
  536.                                         label: "Session 1",
  537.                                         data : {{session1|raw}},
  538.                                         fill : false,
  539.                                         backgroundColor: randomRgbColor()
  540.                                     } )
  541.                                 {% endif %}
  542.                                 {% if session2 is defined %}
  543.                                     datasets.push( {
  544.                                         label: "Session 2",
  545.                                         data : {{session2|raw}},
  546.                                         fill : false,
  547.                                         backgroundColor: randomRgbColor()
  548.                                     } )
  549.                                 {% endif %}
  550.                                  {% if session3 is defined %}
  551.                                     datasets.push( {
  552.                                         label: "Session 3",
  553.                                         data : {{session3|raw}},
  554.                                         fill : false,
  555.                                         backgroundColor: randomRgbColor()
  556.                                     } )
  557.                                 {% endif %}
  558.                                  {% if session4 is defined %}
  559.                                     datasets.push( {
  560.                                         label: "Session 4",
  561.                                         data : {{session4|raw}},
  562.                                         fill : false,
  563.                                         backgroundColor: randomRgbColor()
  564.                                     } )
  565.                                 {% endif %}
  566.                                  {% if session5 is defined %}
  567.                                     datasets.push( {
  568.                                         label: "Session 5",
  569.                                         data : {{session5|raw}},
  570.                                         fill : false,
  571.                                         backgroundColor: randomRgbColor()
  572.                                     } )
  573.                                 {% endif %}
  574.                                  {% if session6 is defined %}
  575.                                     datasets.push( {
  576.                                         label: "Session 6",
  577.                                         data : {{session6|raw}},
  578.                                         fill : false,
  579.                                         backgroundColor: randomRgbColor()
  580.                                     } )
  581.                                 {% endif %}
  582.                            
  583.                             
  584.                            
  585.                             
  586.                         
  587.                              
  588.                        
  589.                        let graph = new Chart(schoolPerformanceGraph, {
  590.                             type:"bar",
  591.                             data : {
  592.                                 labels: {{ cours|raw }},
  593.                                 datasets: datasets,
  594.                             }, 
  595.                              options: {
  596.                                 plugins: {
  597.                                     title: {
  598.                                         display: true,
  599.                                         text: 'Performances generales annuelles ',
  600.                                         font: {
  601.                                             size: 24,
  602.                                             style: 'bold',
  603.                                             family: 'Helvetica Neue',
  604.                                         },
  605.                                         position: 'bottom',
  606.                                         
  607.                                     }
  608.                                 }
  609.                             }
  610.                         });
  611.        
  612.              
  613.                                 
  614.                                     
  615.     
  616.     // Get the chart element for student category
  617.     let studentCategoryChartElement = document.querySelector("#studentCategoryChart");
  618.     // Create the chart for student category
  619.     let studentCategoryChart = new Chart(studentCategoryChartElement, {
  620.         type: "pie",
  621.         data: {
  622.             labels: ["Passed", "Failed"],
  623.             datasets: [{
  624.                 data: [/* Add data here for the number of students passed and failed */],
  625.                 backgroundColor: ["green", "red"]
  626.             }]
  627.         }
  628.     });
  629.     // Get the chart element for mention category
  630.     let officialExamsGraph = document.querySelector("#officialExamsGraph");
  631.     // Create the chart for mention category
  632.     const colors = [];
  633.     const mentionCountCategories = {{mentionCountCategories}};
  634.     mentionCountCategories.map(cat => {
  635.         colors.push(randomRgbColor());
  636.     })
  637.     let officialExamsChart = new Chart(officialExamsGraph, {
  638.         type: "pie",
  639.         data: {
  640.             labels:  {{ mentionCategories|raw }},
  641.             datasets: [{
  642.                 data: {{mentionCountCategories|raw}},
  643.                 backgroundColor: colors
  644.             }]
  645.         }, 
  646.          options: {
  647.                                 plugins: {
  648.                                     title: {
  649.                                         display: true,
  650.                                         text: 'Resultats aux examens officiels ',
  651.                                         font: {
  652.                                             size: 24,
  653.                                             style: 'bold',
  654.                                             family: 'Helvetica Neue',
  655.                                         },
  656.                                         position: 'bottom',
  657.                                         
  658.                                     }
  659.                                 }
  660.                             }
  661.     });
  662. </script>
  663. {% endblock %}