templates/student/show.html.twig line 1

Open in your IDE?
  1. {% extends 'layout/backEndLayout.html.twig' %}
  2. {% block title %}
  3. Présentation de l̀annee scolaire -
  4. {{ parent() }}
  5. {% endblock %}
  6. {% set totalP =0 %}
  7. {% if(payments is defined) %}
  8. {% for p in payments %}
  9. {% set totalP = totalP + p.amount %}
  10. {% endfor %}
  11. {% endif %}
  12. {% block content %}
  13. <div class="row mt-3">
  14. <div class="col-12 ">
  15. <article class="p-3">
  16. <div class="card-header d-flex justify-content-evenly">
  17. {% if(sub is defined) %}
  18. <a class="btn btn-info mb-10" href="{{ path('admin_classrooms_show', {id: sub.classroom.id}) }}">
  19. <i class="fa fa-list"></i>
  20. </a>
  21. {% endif %}
  22. <h4 class="my-0 font-weight-normal text-center text-justify text-uppercase">
  23. Identite de l eleve
  24. </h4>
  25. {% if is_granted('ROLE_ADMIN') %}
  26. <a class="btn btn-info mb-10" href="{{ path('admin_students_new') }}">
  27. <i class="fa fa-plus"></i>
  28. </a>
  29. <a class="btn btn-outline-warning" href="{{ path('admin_students_edit', {id: student.id}) }}">
  30. <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
  31. </a>
  32. <a class="btn btn-outline-danger" href="#" onclick="event.preventDefault() ; confirm('Are you sure ?') && document.getElementById('js-student-delete-form').submit();">
  33. <i class="fa fa-trash"></i>
  34. </a>
  35. {% endif %}
  36. </div>
  37. <div class="container">
  38. <div class="card-deck mb-3 text-center">
  39. <table class="table table-hover record_properties center">
  40. <tbody>
  41. <tr>
  42. <th scope="row">
  43. Photo d identite
  44. </th>
  45. <td>
  46. {% if(file_exists is defined) %}
  47. <img src="{{ (file_exists ? asset('assets/images/student/'~ student.imageName ) : (student.gender ? asset('assets/images/student/female-default-avatar.jpg') : asset('assets/images/student/male-default-avatar.jpg'))) }}" alt="{{ student.imageName }}" class="w-25 card-img-top"></div>
  48. {% endif %}
  49. </td>
  50. </tr>
  51. <tr>
  52. <th scope="row">
  53. Matricule
  54. </th>
  55. <th>
  56. {{ student.matricule }}
  57. </th>
  58. </tr>
  59. <tr>
  60. <th scope="row">
  61. Nom
  62. </th>
  63. <td>
  64. {{ student.lastName }}
  65. </td>
  66. </tr>
  67. <tr>
  68. <th scope="row">
  69. Prénom
  70. </th>
  71. <td>
  72. {{ student.firstName }}
  73. </td>
  74. </tr>
  75. <tr>
  76. <th scope="row">
  77. Sexe
  78. </th>
  79. <td>
  80. {% if student.gender %}
  81. F
  82. {% else %}
  83. M
  84. {% endif %}
  85. </td>
  86. </tr>
  87. <tr>
  88. <th scope="row">
  89. Date de naissace
  90. </th>
  91. <td>
  92. {% if student.birthday %}
  93. {{ student.birthday|date('Y-m-d') }}
  94. {% endif %}
  95. </td>
  96. </tr>
  97. <tr>
  98. <th scope="row">
  99. Lieu de naissance
  100. </th>
  101. <td>
  102. {{ student.birthplace }}
  103. </td>
  104. </tr>
  105. <tr>
  106. <th scope="row">
  107. Père
  108. </th>
  109. <td>
  110. {{ student.fatherName }}
  111. </td>
  112. </tr>
  113. <tr>
  114. <th scope="row">
  115. Mère
  116. </th>
  117. <td>
  118. {{ student.motherName }}
  119. </td>
  120. </tr>
  121. <tr>
  122. <th scope="row">
  123. Contact 1
  124. </th>
  125. <td>
  126. {{ student.primaryContact }}
  127. </td>
  128. </tr>
  129. <tr>
  130. <th scope="row">
  131. Contact 2
  132. </th>
  133. <td>
  134. {{ student.secondaryContact }}
  135. </td>
  136. </tr>
  137. <tr>
  138. <th scope="row">
  139. Maladie particulière
  140. </th>
  141. <td>
  142. {{ student.particularDisease }}
  143. </td>
  144. </tr>
  145. <tr>
  146. <th scope="row">
  147. Autres
  148. </th>
  149. <td>
  150. {{ student.otherInformations }}
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. <div class=" d-flex justify-content-evenly ">
  156. {% if is_granted('ROLE_ADMIN') %}
  157. <a target="_blank" class="btn btn-outline-primary" href="{{ path('admin_student_receipt', {id: student.id}) }}">
  158. <i class="fa fa-money"></i>
  159. Recu de scolarite
  160. </a>
  161. <a target="_blank" class="btn btn-outline-secondary" href="{{ path('admin_student_badge', {id: student.id}) }}">
  162. <i class="fa fa-id-badge"></i>
  163. Badge
  164. </a>
  165. <a target="_blank" class="btn btn-outline-info" href="{{ path('admin_student_certificate', {id: student.id}) }}">
  166. <i class="fa fa-file"></i>
  167. Certificat scolairite
  168. </a>
  169. <a target="_blank" class="btn btn-outline-file open-reportcard-modal" data-toggle="modal" data-target="#form_modal_reportcard_params" data-href="{{ path('admin_students_reportcards_quat_2024', {id: student.id}) }}" >
  170. <i class="fa fa-file"></i>
  171. Bull Trim
  172. </a>
  173. <a target="_blank" class="btn btn-outline-file open-reportcard-modal" data-toggle="modal" data-target="#form_modal_reportcard_params" data-href="{{ path('admin_students_reportcards_year', {id: student.id}) }}">
  174. <i class="fa fa-file"></i>
  175. Bull Ann
  176. </a>
  177. <form id="js-student-delete-form" action="{{ path('admin_students_delete', {id: student.id}) }}" method="post" style="display: none;">
  178. <input type="hidden" name="csrf_token" value="{{ csrf_token('students_deletion' ~ student.id ) }}" id="">
  179. <input type="hidden" name="_method" value="DELETE">
  180. </form>
  181. {% endif %}
  182. </div>
  183. </div>
  184. </div>
  185. </article>
  186. </div>
  187. </div>
  188. <div class="row jumbotron">
  189. <div class="col-6">
  190. <br/>
  191. <br/>
  192. <div class="text-center">
  193. <h2>
  194. Scolarité-Versements éffectués pour l'élève
  195. </h2>
  196. </div>
  197. <table class="table table-striped table-hover table-bordered records_list center">
  198. <thead>
  199. <tr>
  200. <th scope="col">
  201. Date
  202. </th>
  203. <th scope="col">
  204. Montant
  205. </th>
  206. </tr>
  207. </thead>
  208. <tbody>
  209. {% if(payments is defined) %}
  210. {% set total =0 %}
  211. {% for p in payments %}
  212. <tr>
  213. <td>
  214. {% if p.updatedAt %}
  215. {{ p.updatedAt|date('Y-m-d') }}
  216. {% endif %}
  217. </td>
  218. <td>
  219. {{ p.amount }}
  220. </td>
  221. </tr>
  222. {% set total = total + p.amount %}
  223. {% endfor %}
  224. <tr>
  225. <td class="center">
  226. <b>
  227. Total
  228. </b>
  229. </td>
  230. <td>
  231. {{ total }}
  232. </td>
  233. </tr>
  234. {% endif %}
  235. </tbody>
  236. </table>
  237. </div>
  238. <div class="col-6">
  239. <br/>
  240. <br/>
  241. <div class="text-center">
  242. <h2>
  243. Scolarité-Versements éffectués pour l'élève
  244. </h2>
  245. </div>
  246. <table class="table table-striped table-hover table-bordered records_list center">
  247. <thead>
  248. <tr>
  249. <th scope="col">
  250. Rang
  251. </th>
  252. <th scope="col">
  253. Delaie
  254. </th>
  255. <th scope="col">
  256. Montant prevu
  257. </th>
  258. <th scope="col">
  259. Montant verse
  260. </th>
  261. </tr>
  262. </thead>
  263. <tbody>
  264. {% if(installments is defined) %}
  265. {% set total =0 %}
  266. {% for p in installments %}
  267. {% set total = total + p.amount %}
  268. <tr>
  269. <td>{{ p.ranking }}</td>
  270. <td>{{ p.deadline|date('Y-m-d') }}</td>
  271. <td>{{ p.amount }}</td>
  272. <td>
  273. {% if( totalP >= total )%}
  274. {{ p.amount }}
  275. {% set totalP = totalP - p.amount %}
  276. {% else %}
  277. {{totalP}}
  278. {% endif %}
  279. </td>
  280. </tr>
  281. {% endfor %}
  282. <tr>
  283. <td class="center">
  284. <b>
  285. Total
  286. </b>
  287. </td>
  288. <td>
  289. {{ total }}
  290. </td>
  291. </tr>
  292. {% endif %}
  293. </tbody>
  294. </table>
  295. </div>
  296. </div>
  297. <div class="row jumbotron">
  298. <div class="col">
  299. <div class="text-center">
  300. <h2>
  301. Ancienneté de l'élève
  302. </h2>
  303. </div>
  304. <table class="table table-striped table-hover table-bordered records_list center">
  305. <thead>
  306. <tr>
  307. <th scope="col">
  308. Date d'inscription
  309. </th>
  310. <th scope="col">
  311. Année
  312. </th>
  313. <th scope="col">
  314. Classe
  315. </th>
  316. <th scope="col">
  317. Resultat
  318. </th>
  319. </tr>
  320. </thead>
  321. <tbody>
  322. {% if(student.subscriptions) %}
  323. {% for s in student.subscriptions %}
  324. <tr>
  325. <td>
  326. {% if s.createdAt %}
  327. {{ s.createdAt|date('Y-m-d H:m:s') }}
  328. {% endif %}
  329. </td>
  330. <td>
  331. {{ s.schoolYear.wording }}
  332. </td>
  333. <td>
  334. <a href="{{ path('admin_classrooms_show', {id: s.classRoom.id}) }}">
  335. {{ s.classRoom.name }}
  336. </a>
  337. </td>
  338. <td>
  339. {% if is_granted('ROLE_ADMIN') %}
  340. <a href="{{ path('admin_subscriptions_show', {id: s.id}) }}">
  341. {{ s.verbalOfficialExamResult }}
  342. {% if(s.classRoom.apc) %}
  343. (Examen officiel)
  344. {% endif %}
  345. </a>
  346. {% else %}
  347. {{ s.verbalOfficialExamResult }}
  348. {% if(s.classRoom.apc) %}
  349. (Examen officiel)
  350. {% endif %}
  351. {% endif %}
  352. </td>
  353. </tr>
  354. {% endfor %}
  355. {% endif %}
  356. </tbody>
  357. </table>
  358. <article class="p-3">
  359. <canvas id="studentPerformanceGraph" width="600" height="300"></canvas>
  360. </article>
  361. </div>
  362. </div>
  363. <!-- Modal pour le parametrage de la presentation des bulletins. -->
  364. <div class="modal fade" id="form_modal_reportcard_params" tabindex="-1" role="dialog" aria-labelledby="exampleModalRange" aria-hidden="true">
  365. <div class="modal-dialog modal-dialog-centered" role="document">
  366. <div class="modal-content">
  367. <div class="modal-header border-bottom-0">
  368. <h5 class="modal-title" id="exampleModalLabel">Reajuster les parametres de production des bulletins</h5>
  369. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  370. <span aria-hidden="true">&times;</span>
  371. </button>
  372. </div>
  373. <form method="post">
  374. <div class="modal-body">
  375. <div class="form-group">
  376. <label for="header_font_size">Taille de des caracteres dans l entete</label>
  377. <input type="range" class="form-control" name="header_font_size" id="header_font_size" min="1" max="1.6" step="0.01">
  378. </div>
  379. <div class="form-group">
  380. <label for="line_height">Hauteur des lignes dans le tableau</label>
  381. <input type="range" class="form-control" name="line_height" id="line_height" min="0.5" max="1.5" step="0.01">
  382. </div>
  383. <div class="form-check">
  384. <input class="form-check-input" type="checkbox" id="copyright" name="copyright">
  385. <label class="form-check-label" for="copyright">
  386. Ajout du copyright en pied du bulletin?
  387. </label>
  388. </div>
  389. </div>
  390. <div class="modal-footer border-top-0 d-flex justify-content-center">
  391. <button type="submit" class="btn btn-success">Submit</button>
  392. </div>
  393. </form>
  394. </div>
  395. </div>
  396. </div>
  397. {% endblock %}
  398. {% block javascripts %}
  399. {{ parent() }}
  400. <script>
  401. document.addEventListener('DOMContentLoaded', function () {
  402. let targetUrl = null;
  403. document.querySelectorAll('.open-reportcard-modal').forEach(btn => {
  404. btn.addEventListener('click', function (e) {
  405. // Empêche l’ouverture directe du lien
  406. e.preventDefault();
  407. // Récupère le href ou data-href
  408. targetUrl = this.getAttribute('href') || this.dataset.href;
  409. // Met à jour dynamiquement l'action du formulaire
  410. const form = document.querySelector('#form_modal_reportcard_params form');
  411. if (form && targetUrl) {
  412. form.setAttribute('action', targetUrl);
  413. }
  414. // Ouvre le modal manuellement si besoin
  415. $('#form_modal_reportcard_params').modal('show');
  416. });
  417. });
  418. });
  419. $('#form_modal_reportcard_params').on('hidden.bs.modal', function () {
  420. // Supprime le fond grisé s’il n’a pas été retiré automatiquement
  421. $('body').removeClass('modal-open');
  422. $('.modal-backdrop').remove();
  423. });
  424. </script>
  425. <script type="text/javascript">
  426. const studentPerformanceGraph =$("#studentPerformanceGraph");
  427. const datasets = [];
  428. // Generate a random color
  429. const randomRgbColor = () => {
  430. let r = Math.floor(Math.random() * 256); // Random between 0-255
  431. let g = Math.floor(Math.random() * 256); // Random between 0-255
  432. let b = Math.floor(Math.random() * 256); // Random between 0-255
  433. return 'rgb(' + r + ',' + g + ',' + b + ')';
  434. };
  435. {% if session1 is defined %}
  436. datasets.push( {
  437. label: "Session 1",
  438. data : {{session1|raw}},
  439. fill : false,
  440. backgroundColor: randomRgbColor()
  441. } )
  442. {% endif %}
  443. {% if session2 is defined %}
  444. datasets.push( {
  445. label: "Session 2",
  446. data : {{session2|raw}},
  447. fill : false,
  448. backgroundColor: randomRgbColor()
  449. } )
  450. {% endif %}
  451. {% if session3 is defined %}
  452. datasets.push( {
  453. label: "Session 3",
  454. data : {{session3|raw}},
  455. fill : false,
  456. backgroundColor: randomRgbColor()
  457. } )
  458. {% endif %}
  459. {% if session4 is defined %}
  460. datasets.push( {
  461. label: "Session 4",
  462. data : {{session4|raw}},
  463. fill : false,
  464. backgroundColor: randomRgbColor()
  465. } )
  466. {% endif %}
  467. {% if session5 is defined %}
  468. datasets.push( {
  469. label: "Session 5",
  470. data : {{session5|raw}},
  471. fill : false,
  472. backgroundColor: randomRgbColor()
  473. } )
  474. {% endif %}
  475. {% if session6 is defined %}
  476. datasets.push( {
  477. label: "Session 6",
  478. data : {{session3|raw}},
  479. fill : false,
  480. backgroundColor: randomRgbColor()
  481. } )
  482. {% endif %}
  483. let graph = new Chart(studentPerformanceGraph, {
  484. type: "bar",
  485. data: {
  486. labels: {{ cours|raw }},
  487. datasets: datasets,
  488. },
  489. options: {
  490. plugins: {
  491. title: {
  492. display: true,
  493. text: 'Performances annuelles ',
  494. font: {
  495. size: 24,
  496. style: 'bold',
  497. family: 'Helvetica Neue',
  498. },
  499. position: 'bottom',
  500. }
  501. }
  502. }
  503. }
  504. );
  505. </script>
  506. {% endblock %}