{% extends 'layout/backEndLayout.html.twig' %}
{% block title %}
Présentation de l̀annee scolaire -
{{ parent() }}
{% endblock %}
{% set totalP =0 %}
{% if(payments is defined) %}
{% for p in payments %}
{% set totalP = totalP + p.amount %}
{% endfor %}
{% endif %}
{% block content %}
<div class="row mt-3">
<div class="col-12 ">
<article class="p-3">
<div class="card-header d-flex justify-content-evenly">
{% if(sub is defined) %}
<a class="btn btn-info mb-10" href="{{ path('admin_classrooms_show', {id: sub.classroom.id}) }}">
<i class="fa fa-list"></i>
</a>
{% endif %}
<h4 class="my-0 font-weight-normal text-center text-justify text-uppercase">
Identite de l eleve
</h4>
{% if is_granted('ROLE_ADMIN') %}
<a class="btn btn-info mb-10" href="{{ path('admin_students_new') }}">
<i class="fa fa-plus"></i>
</a>
<a class="btn btn-outline-warning" href="{{ path('admin_students_edit', {id: student.id}) }}">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
</a>
<a class="btn btn-outline-danger" href="#" onclick="event.preventDefault() ; confirm('Are you sure ?') && document.getElementById('js-student-delete-form').submit();">
<i class="fa fa-trash"></i>
</a>
{% endif %}
</div>
<div class="container">
<div class="card-deck mb-3 text-center">
<table class="table table-hover record_properties center">
<tbody>
<tr>
<th scope="row">
Photo d identite
</th>
<td>
{% if(file_exists is defined) %}
<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>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">
Matricule
</th>
<th>
{{ student.matricule }}
</th>
</tr>
<tr>
<th scope="row">
Nom
</th>
<td>
{{ student.lastName }}
</td>
</tr>
<tr>
<th scope="row">
Prénom
</th>
<td>
{{ student.firstName }}
</td>
</tr>
<tr>
<th scope="row">
Sexe
</th>
<td>
{% if student.gender %}
F
{% else %}
M
{% endif %}
</td>
</tr>
<tr>
<th scope="row">
Date de naissace
</th>
<td>
{% if student.birthday %}
{{ student.birthday|date('Y-m-d') }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">
Lieu de naissance
</th>
<td>
{{ student.birthplace }}
</td>
</tr>
<tr>
<th scope="row">
Père
</th>
<td>
{{ student.fatherName }}
</td>
</tr>
<tr>
<th scope="row">
Mère
</th>
<td>
{{ student.motherName }}
</td>
</tr>
<tr>
<th scope="row">
Contact 1
</th>
<td>
{{ student.primaryContact }}
</td>
</tr>
<tr>
<th scope="row">
Contact 2
</th>
<td>
{{ student.secondaryContact }}
</td>
</tr>
<tr>
<th scope="row">
Maladie particulière
</th>
<td>
{{ student.particularDisease }}
</td>
</tr>
<tr>
<th scope="row">
Autres
</th>
<td>
{{ student.otherInformations }}
</td>
</tr>
</tbody>
</table>
<div class=" d-flex justify-content-evenly ">
{% if is_granted('ROLE_ADMIN') %}
<a target="_blank" class="btn btn-outline-primary" href="{{ path('admin_student_receipt', {id: student.id}) }}">
<i class="fa fa-money"></i>
Recu de scolarite
</a>
<a target="_blank" class="btn btn-outline-secondary" href="{{ path('admin_student_badge', {id: student.id}) }}">
<i class="fa fa-id-badge"></i>
Badge
</a>
<a target="_blank" class="btn btn-outline-info" href="{{ path('admin_student_certificate', {id: student.id}) }}">
<i class="fa fa-file"></i>
Certificat scolairite
</a>
<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}) }}" >
<i class="fa fa-file"></i>
Bull Trim
</a>
<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}) }}">
<i class="fa fa-file"></i>
Bull Ann
</a>
<form id="js-student-delete-form" action="{{ path('admin_students_delete', {id: student.id}) }}" method="post" style="display: none;">
<input type="hidden" name="csrf_token" value="{{ csrf_token('students_deletion' ~ student.id ) }}" id="">
<input type="hidden" name="_method" value="DELETE">
</form>
{% endif %}
</div>
</div>
</div>
</article>
</div>
</div>
<div class="row jumbotron">
<div class="col-6">
<br/>
<br/>
<div class="text-center">
<h2>
Scolarité-Versements éffectués pour l'élève
</h2>
</div>
<table class="table table-striped table-hover table-bordered records_list center">
<thead>
<tr>
<th scope="col">
Date
</th>
<th scope="col">
Montant
</th>
</tr>
</thead>
<tbody>
{% if(payments is defined) %}
{% set total =0 %}
{% for p in payments %}
<tr>
<td>
{% if p.updatedAt %}
{{ p.updatedAt|date('Y-m-d') }}
{% endif %}
</td>
<td>
{{ p.amount }}
</td>
</tr>
{% set total = total + p.amount %}
{% endfor %}
<tr>
<td class="center">
<b>
Total
</b>
</td>
<td>
{{ total }}
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
<div class="col-6">
<br/>
<br/>
<div class="text-center">
<h2>
Scolarité-Versements éffectués pour l'élève
</h2>
</div>
<table class="table table-striped table-hover table-bordered records_list center">
<thead>
<tr>
<th scope="col">
Rang
</th>
<th scope="col">
Delaie
</th>
<th scope="col">
Montant prevu
</th>
<th scope="col">
Montant verse
</th>
</tr>
</thead>
<tbody>
{% if(installments is defined) %}
{% set total =0 %}
{% for p in installments %}
{% set total = total + p.amount %}
<tr>
<td>{{ p.ranking }}</td>
<td>{{ p.deadline|date('Y-m-d') }}</td>
<td>{{ p.amount }}</td>
<td>
{% if( totalP >= total )%}
{{ p.amount }}
{% set totalP = totalP - p.amount %}
{% else %}
{{totalP}}
{% endif %}
</td>
</tr>
{% endfor %}
<tr>
<td class="center">
<b>
Total
</b>
</td>
<td>
{{ total }}
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
<div class="row jumbotron">
<div class="col">
<div class="text-center">
<h2>
Ancienneté de l'élève
</h2>
</div>
<table class="table table-striped table-hover table-bordered records_list center">
<thead>
<tr>
<th scope="col">
Date d'inscription
</th>
<th scope="col">
Année
</th>
<th scope="col">
Classe
</th>
<th scope="col">
Resultat
</th>
</tr>
</thead>
<tbody>
{% if(student.subscriptions) %}
{% for s in student.subscriptions %}
<tr>
<td>
{% if s.createdAt %}
{{ s.createdAt|date('Y-m-d H:m:s') }}
{% endif %}
</td>
<td>
{{ s.schoolYear.wording }}
</td>
<td>
<a href="{{ path('admin_classrooms_show', {id: s.classRoom.id}) }}">
{{ s.classRoom.name }}
</a>
</td>
<td>
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('admin_subscriptions_show', {id: s.id}) }}">
{{ s.verbalOfficialExamResult }}
{% if(s.classRoom.apc) %}
(Examen officiel)
{% endif %}
</a>
{% else %}
{{ s.verbalOfficialExamResult }}
{% if(s.classRoom.apc) %}
(Examen officiel)
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
<article class="p-3">
<canvas id="studentPerformanceGraph" width="600" height="300"></canvas>
</article>
</div>
</div>
<!-- Modal pour le parametrage de la presentation des bulletins. -->
<div class="modal fade" id="form_modal_reportcard_params" tabindex="-1" role="dialog" aria-labelledby="exampleModalRange" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-bottom-0">
<h5 class="modal-title" id="exampleModalLabel">Reajuster les parametres de production des bulletins</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="post">
<div class="modal-body">
<div class="form-group">
<label for="header_font_size">Taille de des caracteres dans l entete</label>
<input type="range" class="form-control" name="header_font_size" id="header_font_size" min="1" max="1.6" step="0.01">
</div>
<div class="form-group">
<label for="line_height">Hauteur des lignes dans le tableau</label>
<input type="range" class="form-control" name="line_height" id="line_height" min="0.5" max="1.5" step="0.01">
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="copyright" name="copyright">
<label class="form-check-label" for="copyright">
Ajout du copyright en pied du bulletin?
</label>
</div>
</div>
<div class="modal-footer border-top-0 d-flex justify-content-center">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
document.addEventListener('DOMContentLoaded', function () {
let targetUrl = null;
document.querySelectorAll('.open-reportcard-modal').forEach(btn => {
btn.addEventListener('click', function (e) {
// Empêche l’ouverture directe du lien
e.preventDefault();
// Récupère le href ou data-href
targetUrl = this.getAttribute('href') || this.dataset.href;
// Met à jour dynamiquement l'action du formulaire
const form = document.querySelector('#form_modal_reportcard_params form');
if (form && targetUrl) {
form.setAttribute('action', targetUrl);
}
// Ouvre le modal manuellement si besoin
$('#form_modal_reportcard_params').modal('show');
});
});
});
$('#form_modal_reportcard_params').on('hidden.bs.modal', function () {
// Supprime le fond grisé s’il n’a pas été retiré automatiquement
$('body').removeClass('modal-open');
$('.modal-backdrop').remove();
});
</script>
<script type="text/javascript">
const studentPerformanceGraph =$("#studentPerformanceGraph");
const datasets = [];
// Generate a random color
const randomRgbColor = () => {
let r = Math.floor(Math.random() * 256); // Random between 0-255
let g = Math.floor(Math.random() * 256); // Random between 0-255
let b = Math.floor(Math.random() * 256); // Random between 0-255
return 'rgb(' + r + ',' + g + ',' + b + ')';
};
{% if session1 is defined %}
datasets.push( {
label: "Session 1",
data : {{session1|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
{% if session2 is defined %}
datasets.push( {
label: "Session 2",
data : {{session2|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
{% if session3 is defined %}
datasets.push( {
label: "Session 3",
data : {{session3|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
{% if session4 is defined %}
datasets.push( {
label: "Session 4",
data : {{session4|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
{% if session5 is defined %}
datasets.push( {
label: "Session 5",
data : {{session5|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
{% if session6 is defined %}
datasets.push( {
label: "Session 6",
data : {{session3|raw}},
fill : false,
backgroundColor: randomRgbColor()
} )
{% endif %}
let graph = new Chart(studentPerformanceGraph, {
type: "bar",
data: {
labels: {{ cours|raw }},
datasets: datasets,
},
options: {
plugins: {
title: {
display: true,
text: 'Performances annuelles ',
font: {
size: 24,
style: 'bold',
family: 'Helvetica Neue',
},
position: 'bottom',
}
}
}
}
);
</script>
{% endblock %}