Commit a734a47c authored by François Agneray's avatar François Agneray
Browse files

Fixed bug comptage GT17

parent c2bd994e
......@@ -53,6 +53,8 @@ final class DashboardParticipantParcoursAction
if (array_key_exists('jour', $params)) {
$agendas = $this->getAgendas($params['jour'],$params['debut'],$params['fin'],$participant->getId());
$a['agendas'] = $agendas;
$nbGt17 = $this->getGt($params['jour'], $participant->getId());
$a['nbgt17'] = count($nbGt17);
$inscription = $this->getInscription($params['jour'],$params['debut'],$params['fin'],$participant->getId());
$nbInscriptions = count($inscription);
if ($nbInscriptions > 0) {
......@@ -115,6 +117,17 @@ final class DashboardParticipantParcoursAction
return $query->getResult();
}
public function getGt($jour,$id) {
$date_debut=$jour." 17:00:00";
$date_fin=$jour." 20:00:00";
$dql = "SELECT pa FROM App\Entity\ParticipantAgenda pa LEFT JOIN pa.agenda a ";
$dql .= "WHERE pa.participant=$id ";
$dql .= "AND a.dateDebut between '$date_debut' and '$date_fin'";
$query = $this->em->createQuery($dql);
return $query->getResult();
}
public function getInscription($jour,$debut,$fin,$id) {
$date_debut=$jour." ".$debut;
$date_fin=$jour." ".$fin;
......
......@@ -192,7 +192,7 @@
<td class="text-center" id="action_{{ id_agenda }}">
{% if agenda.check == 0 %}
{% set gt_h_debut = agenda['agenda'].getDateDebut() | date("H") %}
{% if agenda['agenda'].getFormation().getType() == 'Groupe de Travail' and gt_h_debut >= 17 %}
{% if agenda['agenda'].getFormation().getType() == 'Groupe de Travail' and gt_h_debut >= 17 and nbgt17 < 1 %}
<input type="hidden" id="vinscrit_{{ id_agenda }}" value="2">
{% if prct < 100 %}
<a href="dashboard-participant-parcours-formation?token={{token}}&agenda={{id_agenda}}&valid=true&jour={{jour}}&debut={{debut}}&fin={{fin}}"
......
......@@ -193,7 +193,7 @@
<td class="text-center" id="action_{{ id_agenda }}">
{% if agenda.check == 0 %}
{% set gt_h_debut = agenda['agenda'].getDateDebut() | date("H") %}
{% if agenda['agenda'].getFormation().getType() == 'Groupe de Travail' and gt_h_debut >= 17 %}
{% if agenda['agenda'].getFormation().getType() == 'Groupe de Travail' and gt_h_debut >= 17 and nbgt17 < 1 %}
<input type="hidden" id="vinscrit_{{ id_agenda }}" value="2">
{% if prct < 100 %}
<a href="dashboard-participant-parcours-formation?token={{token}}&agenda={{id_agenda}}&valid=true&jour={{jour}}&debut={{debut}}&fin={{fin}}"
......
......@@ -175,6 +175,7 @@ $(document).ready(function(){
});
$('#tab_agenda').DataTable({
"pageLength": 50,
"dom": 'frtilp',
"columnDefs":[
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment