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. <form action="#" method="post">
  265. <div class="modal-body">
  266. <div class="form-group">
  267. {% for module in modules %}
  268. {% for course in module.courses %}
  269. <li class="list-group-item">
  270. <input class="form-check-input me-1" type="checkbox" checked name="selected_courses[]" value={{course.id}} >
  271. {{course.wording}}
  272. </li>
  273. {% endfor %}
  274. {% endfor %}
  275. </div>
  276. </div>
  277. <div class="modal-footer border-top-0 d-flex justify-content-center">
  278. <button type="submit" class="btn btn-success">Submit</button>
  279. </div>
  280. </form>
  281. </div>
  282. </div>
  283. </div>
  284. <!-- Modal pour le parametrage de la presentation des bulletins. -->
  285. <div class="modal fade" id="form_modal_reportcard_params" tabindex="-1" role="dialog" aria-labelledby="exampleModalRange" aria-hidden="true">
  286. <div class="modal-dialog modal-dialog-centered" role="document">
  287. <div class="modal-content">
  288. <div class="modal-header border-bottom-0">
  289. <h5 class="modal-title" id="exampleModalLabel">Reajuster les parametres de production des bulletins</h5>
  290. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  291. <span aria-hidden="true">&times;</span>
  292. </button>
  293. </div>
  294. <form method="post">
  295. <div class="modal-body">
  296. <div class="form-group">
  297. <label for="header_font_size">Taille de des caracteres dans l entete</label>
  298. <input type="range" class="form-control" name="header_font_size" id="header_font_size" min="1" max="1.6" step="0.01">
  299. </div>
  300. <div class="form-group">
  301. <label for="line_height">Hauteur des lignes dans le tableau</label>
  302. <input type="range" class="form-control" name="line_height" id="line_height" min="0.5" max="1.5" step="0.01">
  303. </div>
  304. <div class="form-check">
  305. <input class="form-check-input" type="checkbox" id="copyright" name="copyright">
  306. <label class="form-check-label" for="copyright">
  307. Ajout du copyright en pied du bulletin?
  308. </label>
  309. </div>
  310. <div class="form-check">
  311. <input class="form-check-input" type="checkbox" id="reverse" name="reverse">
  312. <label class="form-check-label" for="reverse">
  313. Sens inverse
  314. </label>
  315. </div>
  316. </div>
  317. <div class="modal-footer border-top-0 d-flex justify-content-center">
  318. <button type="submit" class="btn btn-success">Submit</button>
  319. </div>
  320. </form>
  321. </div>
  322. </div>
  323. </div>
  324. {% endblock %}
  325. {% block javascripts %}
  326. {{ parent() }}
  327. <script type="text/javascript">
  328. // Attendre que le DOM soit complètement chargé
  329. $(document).ready(function() {
  330. // Modal pour les cours
  331. $('#form_modal_courses').on('show.bs.modal', function(event) {
  332. var button = $(event.relatedTarget);
  333. var actionUrl = button.data('action');
  334. $('#form_modal_courses form').attr('action', actionUrl);
  335. });
  336. // Modal pour les paramètres
  337. $('[data-toggle="modal"]').on('click', function () {
  338. var actionUrl = $(this).data('action');
  339. console.log(actionUrl);
  340. $('#form_modal_reportcard_params form').attr('action', actionUrl);
  341. });
  342. });
  343. </script>
  344. <script type="text/javascript">
  345. // Fonction pour générer une couleur aléatoire
  346. const randomRgbColor = () => {
  347. let r = Math.floor(Math.random() * 256);
  348. let g = Math.floor(Math.random() * 256);
  349. let b = Math.floor(Math.random() * 256);
  350. return 'rgb(' + r + ',' + g + ',' + b + ')';
  351. };
  352. // Initialisation des graphiques après chargement du DOM
  353. document.addEventListener('DOMContentLoaded', function() {
  354. // Graphique des performances scolaires
  355. const schoolPerformanceCanvas = document.getElementById("schoolPerformanceGraph");
  356. if (schoolPerformanceCanvas) {
  357. // Détruire le graphique existant s'il existe
  358. const existingChart = Chart.getChart(schoolPerformanceCanvas);
  359. if (existingChart) {
  360. existingChart.destroy();
  361. }
  362. const datasets = [];
  363. {% if session1 is defined %}
  364. datasets.push({
  365. label: "Session 1",
  366. data: {{ session1|raw }},
  367. fill: false,
  368. backgroundColor: randomRgbColor()
  369. });
  370. {% endif %}
  371. {% if session2 is defined %}
  372. datasets.push({
  373. label: "Session 2",
  374. data: {{ session2|raw }},
  375. fill: false,
  376. backgroundColor: randomRgbColor()
  377. });
  378. {% endif %}
  379. {% if session3 is defined %}
  380. datasets.push({
  381. label: "Session 3",
  382. data: {{ session3|raw }},
  383. fill: false,
  384. backgroundColor: randomRgbColor()
  385. });
  386. {% endif %}
  387. {% if session4 is defined %}
  388. datasets.push({
  389. label: "Session 4",
  390. data: {{ session4|raw }},
  391. fill: false,
  392. backgroundColor: randomRgbColor()
  393. });
  394. {% endif %}
  395. {% if session5 is defined %}
  396. datasets.push({
  397. label: "Session 5",
  398. data: {{ session5|raw }},
  399. fill: false,
  400. backgroundColor: randomRgbColor()
  401. });
  402. {% endif %}
  403. {% if session6 is defined %}
  404. datasets.push({
  405. label: "Session 6",
  406. data: {{ session6|raw }},
  407. fill: false,
  408. backgroundColor: randomRgbColor()
  409. });
  410. {% endif %}
  411. // Créer le graphique seulement si on a des données
  412. if (datasets.length > 0) {
  413. new Chart(schoolPerformanceCanvas.getContext('2d'), {
  414. type: "bar",
  415. data: {
  416. labels: {{ cours|raw }},
  417. datasets: datasets,
  418. },
  419. options: {
  420. responsive: true,
  421. plugins: {
  422. title: {
  423. display: true,
  424. text: 'Performances générales annuelles',
  425. font: {
  426. size: 24,
  427. style: 'bold',
  428. family: 'Helvetica Neue',
  429. },
  430. position: 'bottom',
  431. }
  432. }
  433. }
  434. });
  435. }
  436. }
  437. // Graphique des examens officiels
  438. initOfficialExamsChart();
  439. });
  440. // Fonction pour initialiser le graphique des examens officiels
  441. function initOfficialExamsChart() {
  442. const canvas = document.getElementById('officialExamsGraph');
  443. // Vérifier si le canvas existe
  444. if (!canvas) {
  445. return;
  446. }
  447. // Détruire le graphique existant s'il existe
  448. const existingChart = Chart.getChart(canvas);
  449. if (existingChart) {
  450. existingChart.destroy();
  451. }
  452. const mentionCountCategories = {{ mentionCountCategories|raw }};
  453. // Vérifier si on a des données
  454. if (!mentionCountCategories || mentionCountCategories.length === 0) {
  455. return;
  456. }
  457. const colors = mentionCountCategories.map(() => randomRgbColor());
  458. new Chart(canvas.getContext('2d'), {
  459. type: 'pie',
  460. data: {
  461. labels: {{ mentionCategories|raw }},
  462. datasets: [{
  463. data: mentionCountCategories,
  464. backgroundColor: colors
  465. }]
  466. },
  467. options: {
  468. responsive: true,
  469. plugins: {
  470. title: {
  471. display: true,
  472. text: 'Résultats aux examens officiels',
  473. position: 'bottom',
  474. font: {
  475. size: 24,
  476. family: 'Helvetica Neue'
  477. }
  478. }
  479. }
  480. }
  481. });
  482. }
  483. </script>
  484. {% endblock %}