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. </a>
  9. {% endif %}
  10. </div>
  11. </div>
  12. <div class="col-11 jumbotron">
  13. <article class="p-3">
  14. <table class="table table-hover record_properties center">
  15. <tbody>
  16. <tr>
  17. <th scope="row">
  18. Nom
  19. </th>
  20. <td>
  21. {{ classroom.name }}
  22. </td>
  23. </tr>
  24. <tr>
  25. <th scope="row">
  26. Niveau
  27. </th>
  28. <td>
  29. {{ classroom.level }}
  30. </td>
  31. </tr>
  32. <tr>
  33. <th scope="row">
  34. Titulaire
  35. </th>
  36. <td>
  37. {% if mainteacher is null %}
  38. {% else %}
  39. {{mainteacher.fullName}}
  40. {% endif %}
  41. </td>
  42. </tr>
  43. <tr>
  44. <th scope="row">
  45. Classe d'examen
  46. </th>
  47. <td>
  48. {% if (classroom.apc == true) %}
  49. OUI
  50. {% else %}
  51. NON
  52. {% endif %}
  53. </td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. <div class="btn-group record_actions">
  58. <a class="btn btn-info" href="{{ path('admin_classrooms') }}">
  59. <i class="fa fa-list"></i>
  60. </a>
  61. {% if is_granted('ROLE_ADMIN') %}
  62. <a class="btn btn-primary" href="{{ path('admin_classrooms_edit', {id: classroom.id}) }}">
  63. <i class="fa fa-edit"></i>
  64. </a>
  65. <a target="_blank" class="btn btn-file" id="recap_seq" data-toggle="modal" data-target="#form_modal_courses" data-action="{{ path('admin_classrooms_recapitulatif_seq', {'id':classroom.id}) }}">
  66. <i class="fa fa-file-pdf-o"></i>
  67. Recap. Seq
  68. </a>
  69. <a target="_blank" class="btn btn-warning" href="{{ path('admin_classrooms_reportcards_seq', {id: classroom.id}) }}">
  70. <i class="fa fa-file"></i>
  71. Bull Seq
  72. </a>
  73. <a target="_blank" class="btn btn-file" data-toggle="modal" id="bull_trim" data-target="#form_modal_reportcard_params" data-action="{{ path('admin_classrooms_reportcards_trim_2024', {'id':classroom.id}) }}">
  74. <i class="fa fa-file"></i>
  75. Bull Trim
  76. </a>
  77. <a target="_blank" class="btn btn-outline-info" id="bull_ann" data-toggle="modal" data-target="#form_modal_reportcard_params" data-action="{{ path('admin_class_reportcards_year_2024', {'id': classroom.id}) }}" >
  78. <i class="fa fa-file-pdf-o"></i>
  79. Bull Ann
  80. </a>
  81. <a target="_blank" class="btn btn-outline-warning" id="recap_trim" data-toggle="modal" data-target="#form_modal_courses" data-action="{{ path('admin_classrooms_recapitulatif_trim', {id: classroom.id}) }}" >
  82. <i class="fa fa-file-pdf-o"></i>
  83. Recap Trim
  84. </a>
  85. <a target="_blank" class="btn btn-outline-success" id="recap_trim_excel" data-toggle="modal" data-target="#form_modal_courses" data-action="{{ path('admin_classrooms_recapitulatif_ann_excel', {id: classroom.id}) }}" >
  86. <i class="fa fa-file-excel-o"></i>
  87. Recap Ann
  88. </a>
  89. <a target="_blank" class="btn btn-file" href="{{ path('admin_class_reportcards_apc_year', {id: classroom.id}) }}">
  90. <i class="fa fa-file"></i>
  91. Bull Ann V1
  92. </a>
  93. <button class="btn btn-danger" type="submit">
  94. <i class="fa fa-trash-o"></i>
  95. </button>
  96. {% endif %}
  97. </div>
  98. <div class="card-header text-center">
  99. <h2>
  100. Liste des élèves incrits dans la classe
  101. </h2>
  102. </div>
  103. <table class="table table-striped table-hover table-bordered records_list center">
  104. <thead>
  105. <tr>
  106. <th scope="col">
  107. Matricule
  108. </th>
  109. <th scope="col">
  110. Nom
  111. </th>
  112. <th scope="col">
  113. Prénom
  114. </th>
  115. <th scope="col">
  116. Photo
  117. </th>
  118. <th scope="col">
  119. Action
  120. </th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. {% set effectif =0 %}
  125. {% for std in studentEnrolled %}
  126. <tr>
  127. <td>
  128. <a href="{{ path('admin_students_show', {id: std.id}) }}">
  129. {{ std.matricule }}
  130. </a>
  131. </td>
  132. <td>
  133. {{ std.lastname }}
  134. </td>
  135. <td>
  136. {{ std.firstname }}
  137. </td>
  138. <td>
  139. {{ fileExists[std.id] }}
  140. </td>
  141. <td>
  142. {% if is_granted('ROLE_ADMIN') %}
  143. <a class="btn btn-outline-danger" href="{{ path('admin_students_unregister', {id: std.id, room_id:classroom.id}) }}">
  144. <i class="fa fa-ban"></i>
  145. </a>
  146. <a class="btn btn-outline-warning" href="{{ path('admin_students_edit', {id: std.id}) }}">
  147. <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
  148. </a>
  149. {% endif %}
  150. </td>
  151. {% set effectif = effectif + 1 %}
  152. </tr>
  153. {% endfor %}
  154. <tr>
  155. <td class="center" colspan="2">
  156. Effectif
  157. </td>
  158. <td>
  159. {{ effectif }}
  160. </td>
  161. </tr>
  162. </tbody>
  163. </table>
  164. <div class="card-header text-center">
  165. <h2>
  166. Matières programmées dans la classe
  167. </h2>
  168. </div>
  169. <table class="table table-striped table-hover table-bordered records_list center">
  170. <thead>
  171. <tr>
  172. <th scope="col">
  173. Module
  174. </th>
  175. <th scope="col">
  176. Code
  177. </th>
  178. <th scope="col">
  179. Intitulé
  180. </th>
  181. <th scope="col">
  182. Coef
  183. </th>
  184. <th scope="col">
  185. Enseignant
  186. </th>
  187. </tr>
  188. </thead>
  189. <tbody>
  190. {% set totalCoef =0 %}
  191. {% for module in modules %}
  192. <tr>
  193. {% for course in module.courses %}
  194. <tr>
  195. <td>
  196. {{ module.name }}
  197. </td>
  198. <td>
  199. <a href="{{ path('admin_courses_show', {id: course.id}) }}">
  200. {{ course.code }}
  201. </a>
  202. </td>
  203. <td>
  204. {{ course.wording }}
  205. </td>
  206. <td>
  207. {{ course.coefficient }}
  208. </td>
  209. <td>
  210. {% if attributions[course.id] is defined %}
  211. {% if is_granted('ROLE_ADMIN') %}
  212. <a href="{{ path('admin_attributions_edit', {id: attributions[course.id].id}) }}">
  213. {{attributions[course.id].teacher.fullName}}
  214. </a>
  215. {% else %}
  216. {{attributions[course.id].teacher.fullName}}
  217. {% endif %}
  218. {% else %}
  219. {% if is_granted('ROLE_ADMIN') %}
  220. <a href="{{ path('admin_attributions_new') }}">
  221. Pas encore attribue
  222. </a>
  223. {% endif %}
  224. {% endif %}
  225. </td>
  226. {% set totalCoef = totalCoef+course.coefficient %}
  227. </tr>
  228. {% endfor %}
  229. </tr>
  230. <tr>
  231. <td class="center" colspan="3">
  232. total cumul coef
  233. </td>
  234. <td>
  235. {{ totalCoef }}
  236. </td>
  237. </tr>
  238. {% endfor %}
  239. </tbody>
  240. </table>
  241. </article>
  242. <section id="graphs">
  243. <article class="p-3">
  244. <canvas id="schoolPerformanceGraph" width="700" height="250"></canvas>
  245. </article>
  246. {% if classroom.apc %}
  247. <article class="p-3">
  248. <canvas id="officialExamsGraph" width="200" height="220" ></canvas>
  249. </article>
  250. {% endif %}
  251. </section>
  252. </div>
  253. </div>
  254. <!-- Modal pour le choix de cours qui vont figurer dans le recaputulatif sequentiel -->
  255. <div class="modal fade" id="form_modal_courses" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  256. <div class="modal-dialog modal-dialog-centered" role="document">
  257. <div class="modal-content">
  258. <div class="modal-header border-bottom-0">
  259. <h5 class="modal-title" id="exampleModalLabel">Choisir les cours a qui doivent figurer dans le recapitulatif</h5>
  260. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  261. <span aria-hidden="true">&times;</span>
  262. </button>
  263. </div>
  264. <!-- href=" -->
  265. <form action="#" method="post">
  266. <div class="modal-body">
  267. <div class="form-group">
  268. {% for module in modules %}
  269. {% for course in module.courses %}
  270. <li class="list-group-item">
  271. <input class="form-check-input me-1" type="checkbox" checked name="selected_courses[]" value={{course.id}} >
  272. {{course.wording}}
  273. </li>
  274. {% endfor %}
  275. {% endfor %}
  276. </div>
  277. </div>
  278. <div class="modal-footer border-top-0 d-flex justify-content-center">
  279. <button type="submit" class="btn btn-success">Submit</button>
  280. </div>
  281. </form>
  282. </div>
  283. </div>
  284. </div>
  285. <!-- Modal pour le parametrage de la presentation des bulletins. -->
  286. <div class="modal fade" id="form_modal_reportcard_params" tabindex="-1" role="dialog" aria-labelledby="exampleModalRange" aria-hidden="true">
  287. <div class="modal-dialog modal-dialog-centered" role="document">
  288. <div class="modal-content">
  289. <div class="modal-header border-bottom-0">
  290. <h5 class="modal-title" id="exampleModalLabel">Reajuster les parametres de production des bulletins</h5>
  291. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  292. <span aria-hidden="true">&times;</span>
  293. </button>
  294. </div>
  295. <form method="post">
  296. <div class="modal-body">
  297. <div class="form-group">
  298. <label for="header_font_size">Taille de des caracteres dans l entete</label>
  299. <input type="range" class="form-control" name="header_font_size" id="header_font_size" min="1" max="1.6" step="0.01">
  300. </div>
  301. <div class="form-group">
  302. <label for="line_height">Hauteur des lignes dans le tableau</label>
  303. <input type="range" class="form-control" name="line_height" id="line_height" min="0.5" max="1.5" step="0.01">
  304. </div>
  305. <div class="form-check">
  306. <input class="form-check-input" type="checkbox" id="copyright" name="copyright">
  307. <label class="form-check-label" for="copyright">
  308. Ajout du copyright en pied du bulletin?
  309. </label>
  310. </div>
  311. <div class="form-check">
  312. <input class="form-check-input" type="checkbox" id="reverse" name="reverse">
  313. <label class="form-check-label" for="reverse">
  314. Sens inverse
  315. </label>
  316. </div>
  317. </div>
  318. <div class="modal-footer border-top-0 d-flex justify-content-center">
  319. <button type="submit" class="btn btn-success">Submit</button>
  320. </div>
  321. </form>
  322. </div>
  323. </div>
  324. </div>
  325. {% endblock %}
  326. {% block javascripts %}
  327. {{ parent() }}
  328. <script type="text/javascript">
  329. // Attendre que le DOM soit complètement chargé
  330. $(document).ready(function() {
  331. // Quand le modal est ouvert
  332. $('#form_modal_courses').on('show.bs.modal', function(event) {
  333. // Récupérer l'élément qui a déclenché l'ouverture du modal
  334. var button = $(event.relatedTarget);
  335. // Récupérer l'URL dynamique depuis l'attribut "data-action"
  336. var actionUrl = button.data('action');
  337. // Mettre à jour l'attribut "action" du formulaire
  338. $('#form_modal_courses form').attr('action', actionUrl);
  339. });
  340. });
  341. </script>
  342. <script type="text/javascript">
  343. $(document).ready(function () {
  344. // Quand on clique sur un lien qui ouvre le modal
  345. $('[data-toggle="modal"]').on('click', function () {
  346. // Récupère l'URL depuis data-action
  347. var actionUrl = $(this).data('action');
  348. console.log(actionUrl);
  349. // Met à jour l'attribut action du formulaire du modal
  350. $('#form_modal_reportcard_params form').attr('action', actionUrl);
  351. });
  352. });
  353. </script>
  354. <script type="text/javascript">
  355. const schoolPerformanceGraph = $("#schoolPerformanceGraph");
  356. const datasets = [];
  357. //Generate a random color
  358. const randomRgbColor = () => {
  359. let r = Math.floor(Math.random() * 256); // Random between 0-255
  360. let g = Math.floor(Math.random() * 256); // Random between 0-255
  361. let b = Math.floor(Math.random() * 256); // Random between 0-255
  362. return 'rgb(' + r + ',' + g + ',' + b + ')';
  363. };
  364. {% if session1 is defined %}
  365. datasets.push( {
  366. label: "Session 1",
  367. data : {{session1|raw}},
  368. fill : false,
  369. backgroundColor: randomRgbColor()
  370. } )
  371. {% endif %}
  372. {% if session2 is defined %}
  373. datasets.push( {
  374. label: "Session 2",
  375. data : {{session2|raw}},
  376. fill : false,
  377. backgroundColor: randomRgbColor()
  378. } )
  379. {% endif %}
  380. {% if session3 is defined %}
  381. datasets.push( {
  382. label: "Session 3",
  383. data : {{session3|raw}},
  384. fill : false,
  385. backgroundColor: randomRgbColor()
  386. } )
  387. {% endif %}
  388. {% if session4 is defined %}
  389. datasets.push( {
  390. label: "Session 4",
  391. data : {{session4|raw}},
  392. fill : false,
  393. backgroundColor: randomRgbColor()
  394. } )
  395. {% endif %}
  396. {% if session5 is defined %}
  397. datasets.push( {
  398. label: "Session 5",
  399. data : {{session5|raw}},
  400. fill : false,
  401. backgroundColor: randomRgbColor()
  402. } )
  403. {% endif %}
  404. {% if session6 is defined %}
  405. datasets.push( {
  406. label: "Session 6",
  407. data : {{session6|raw}},
  408. fill : false,
  409. backgroundColor: randomRgbColor()
  410. } )
  411. {% endif %}
  412. let graph = new Chart(schoolPerformanceGraph, {
  413. type:"bar",
  414. data : {
  415. labels: {{ cours|raw }},
  416. datasets: datasets,
  417. },
  418. options: {
  419. plugins: {
  420. title: {
  421. display: true,
  422. text: 'Performances generales annuelles ',
  423. font: {
  424. size: 24,
  425. style: 'bold',
  426. family: 'Helvetica Neue',
  427. },
  428. position: 'bottom',
  429. }
  430. }
  431. }
  432. });
  433. // Get the chart element for student category
  434. let studentCategoryChartElement = document.querySelector("#studentCategoryChart");
  435. // Create the chart for student category
  436. let studentCategoryChart = new Chart(studentCategoryChartElement, {
  437. type: "pie",
  438. data: {
  439. labels: ["Passed", "Failed"],
  440. datasets: [{
  441. data: [/* Add data here for the number of students passed and failed */],
  442. backgroundColor: ["green", "red"]
  443. }]
  444. }
  445. });
  446. // Get the chart element for mention category
  447. let officialExamsGraph = document.querySelector("#officialExamsGraph");
  448. // Create the chart for mention category
  449. const colors = [];
  450. const mentionCountCategories = {{mentionCountCategories}};
  451. mentionCountCategories.map(cat => {
  452. colors.push(randomRgbColor());
  453. })
  454. let officialExamsChart = new Chart(officialExamsGraph, {
  455. type: "pie",
  456. data: {
  457. labels: {{ mentionCategories|raw }},
  458. datasets: [{
  459. data: {{mentionCountCategories|raw}},
  460. backgroundColor: colors
  461. }]
  462. },
  463. options: {
  464. plugins: {
  465. title: {
  466. display: true,
  467. text: 'Resultats aux examens officiels ',
  468. font: {
  469. size: 24,
  470. style: 'bold',
  471. family: 'Helvetica Neue',
  472. },
  473. position: 'bottom',
  474. }
  475. }
  476. }
  477. });
  478. </script>
  479. {% endblock %}