Commit 2bba08ad authored by Roca Philippe's avatar Roca Philippe
Browse files

création des convocations avec qrcode

parent c4bd5866
......@@ -166,6 +166,7 @@ class AdministrationController
}
/** On regarde l'heure pour le curseur du planning */
date_default_timezone_set('Europe/Paris');
$h1 = strtotime($evaluation->debut);
$h2 = strtotime(date("H:i:00"));
$curseur = ($h2-$h1)/60;
......
......@@ -142,6 +142,7 @@ class AffichageController
}
/** On regarde l'heure pour le curseur du planning */
date_default_timezone_set('Europe/Paris');
$h1 = strtotime($evaluation->debut);
$h2 = strtotime(date("H:i:00"));
$curseur = ($h2-$h1)/60;
......@@ -159,4 +160,29 @@ class AffichageController
return $this->conteneur->view->render($response,'affichagePlanning.twig', $contenu);
}
public function convocations($request, $response)
{
$evaluation = new EvaluationObjets($this->conteneur);
$evaluation = $evaluation->evalutationActive();
$participants = new ParticipantObjets($this->conteneur);
$participants = $participants->particpantsAvecSession($evaluation->id);
foreach ($participants as $participant)
{
$session = new SessionObjets($this->conteneur);
$session = $session->trouverSession($evaluation->id, $participant->id_session);
$participant->session = $session->titre;
$programme = new PlanningObjets($this->conteneur);
$participant->programme = $programme->programmeParticipant($participant);
}
$contenu = [
'title' => $evaluation->titre,
'evaluation' => $evaluation,
'participants' => $participants,
];
return $this->conteneur->view->render($response,'affichageConvocations.twig', $contenu);
}
}
\ No newline at end of file
......@@ -131,4 +131,15 @@ class PlanningObjets
'id_action' => $id_action,
]);
}
public function programmeParticipant($participant)
{
$actions = $this->conteneur->db->prepare("SELECT a.*, s.titre AS titre_session, l.nom AS lieu FROM planning_actions AS a, sessions AS s, planning_sites AS l WHERE a.id_equipe = :id_equipe AND a.id_session = s.id AND a.id_site = l.id ORDER BY a.debut ASC");
$actions->execute([
'id_equipe' => $participant->id,
]);
$actions = $actions->fetchAll(PDO::FETCH_OBJ);
return $actions;
}
}
{% extends '/layout/login.twig' %}
{% block title %}{{ title }}{% endblock %}
{% block logo %}
{% endblock %}
{% block css %}
<link href="../css/bootstrap.css" rel="stylesheet" >
<link href="../css/offcanvas.css" rel="stylesheet">
<link href="../css/app.css" rel="stylesheet">
{% endblock %}
{% block content %}
<h1>Impression des convocations</h1>
{% for participant in participants %}
{% if loop.index is odd %}
<DIV STYLE="page-break-before:always"></DIV>
{% endif %}
<table width="100%">
<tr>
<td width="45%" rowspan="3" valign="top">
<h2>{{ evaluation.titre }} {{ evaluation.annee }}</h2>
<h3>{{ evaluation.soustitre }}</h3>
<hr>
<h4>Mon programme</h4>
<hr>
{% for action in participant.programme %}
<p>{{ action.debut }} - <b>{{ action.titre_session }}</b> - {{ action.lieu }} <i>({{ action.duree }}min)</i></p>
{% endfor %}
<hr>
<p><i>Attention : il est impératif de se présenter 5min avant l'horaire sur le lieu indiqué.</i></p>
</td>
<td width="10%" rowspan="3" valign="top">
</td>
<td align="center">
<img src="../img/convocation_haut_{{ evaluation.id }}.png" width="100%">&nbsp;
</td>
</tr>
<tr>
<td align="center">
<h2><b>{{ participant.nom }}</b>
<br>
{{ participant.etablissement }}</h2>
<p>
<img src="../qrcodes/equipe_{{ participant.id }}.png" height="200px">&nbsp;
</p>
<h2>
{{ participant.session }}
</h2>
</td>
</tr>
<tr>
<td align="center">
<img src="../img/convocation_bas_{{ evaluation.id }}.png" width="100%">
</td>
</tr>
</table>
{% if loop.index is odd %}
<br><br>
<br><br>
<br><br>
<br><br>
{% endif %}
{% endfor %}
{% endblock %}
\ No newline at end of file
......@@ -12,7 +12,7 @@
<link href="../css/offcanvas.css" rel="stylesheet">
<link href="../css/app.css" rel="stylesheet">
<meta http-equiv="refresh" content="30">
<meta http-equiv="refresh" content="60">
{% endblock %}
......@@ -48,28 +48,26 @@
{% for site in sites %}
<div class="col padding-no ">
<h6 class=" text-muted text-center"><br>{{ site.nom }} </h6>&nbsp;
<div class="planning" style="height: {{ hauteur }}px;">
<div class="planning" style="height: {{ hauteur }}px; ">
{% for action in site.actions %}
{% if action.titre == false and action.id_equipe != participantActif.id and action.statut == 0 %}
<div class="alert alert-danger" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px;">
<div class="alert alert-danger" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px; padding : 0px 5px;">
<span class="time">{{ action.debut[0:5] }}</span> {{ action.nom }} / {{ action.etablissement }}
<br><i>{{ action.session }}</i>
</div>
{% elseif action.titre == false and action.id_equipe != participantActif.id and action.statut == 1 %}
<div class="alert alert-success" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px;">
<div class="alert alert-success" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px; padding : 0px 5px;">
<span class="time">{{ action.debut[0:5] }}</span> {{ action.nom }} / {{ action.etablissement }}
<br><i>{{ action.session }}</i>
</div>
{% elseif action.titre == false and action.id_equipe == participantActif.id %}
<div class="alert alert-primary" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px;">
<div class="alert alert-primary" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px; padding : 0px 5px;">
<span class="time">{{ action.debut[0:5] }}</span> {{ action.nom }} / {{ action.etablissement }}
</div>
{% elseif action.id_equipe == 0 %}
<div class="alert alert-warning" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px;">
<div class="alert alert-warning" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px; padding : 0px 5px;">
<span class="time">{{ action.debut[0:5] }}</span> {{ action.titre }}
</div>
{% elseif action.id_equipe != 0 and action.titre != false %}
<div class="alert alert-secondary" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px;">
<div class="alert alert-secondary" role="alert" style="top : {{ action.top * 2 }}px; height: {{ action.duree * 2 - 5}}px; padding : 0px 5px;">
<span class="time">{{ action.debut[0:5] }}</span> {{ action.nom }} / {{ action.etablissement }} <i> {{ action.titre }}</i>
</div>
{% endif %}
......
......@@ -12,6 +12,7 @@ $app->group('/affichage', function (){
$this->get('/', AffichageController::class . ':accueil')->setName('affichage');
$this->get('/bilan', AffichageController::class . ':bilan')->setName('affichageBilan');
$this->get('/planning', AffichageController::class . ':planning')->setName('affichagePlanning');
$this->get('/convocations', AffichageController::class . ':convocations')->setName('affichageConvocations');
......
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