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