2019-09-20 12:57:06 +00:00
|
|
|
<?php
|
|
|
|
require_once "header.php";
|
2019-09-21 12:51:58 +00:00
|
|
|
?>
|
2019-09-20 12:57:06 +00:00
|
|
|
|
2019-09-27 17:18:54 +00:00
|
|
|
<div class="mt-4 mb-4">
|
|
|
|
<h1 class="display-4">Poser des questions</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if (isset($give_questions) && !$has_error) { ?>
|
|
|
|
<div class="alert alert-success">
|
|
|
|
Vos questions ont bien été mises à jour !
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
<h1>Veuillez toujours enregistrer votre travail ailleurs que sur la plateforme !</h1>
|
|
|
|
</div>
|
2019-09-21 12:51:58 +00:00
|
|
|
|
|
|
|
<?php
|
2019-09-20 12:57:06 +00:00
|
|
|
for ($i = 0; $i < 2; ++$i) {
|
|
|
|
$receiver = $receivers[$i];
|
|
|
|
$video = $videos[$i]; ?>
|
2019-09-27 17:18:54 +00:00
|
|
|
<div class="jumbotron">
|
|
|
|
<h2>Questions pour l'équipe <?= $receiver->getName() ?> (<?= $receiver->getTrigram() ?>) :</h2>
|
|
|
|
<div class="alert alert-info">
|
2019-09-27 21:37:12 +00:00
|
|
|
<strong>Lien de la vidéo :</strong> <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a>
|
2019-09-27 17:18:54 +00:00
|
|
|
</div>
|
|
|
|
<?php displayVideo($video->getLink()) ?>
|
|
|
|
<br/>
|
|
|
|
<form method="POST" enctype="multipart/form-data">
|
|
|
|
<input type="hidden" name="to" value="<?= $receiver->getTrigram() ?>"/>
|
|
|
|
|
2019-09-20 12:57:06 +00:00
|
|
|
<?php
|
2019-09-21 11:37:48 +00:00
|
|
|
for ($j = 0; $j < 6; ++$j) {
|
2019-09-27 17:18:54 +00:00
|
|
|
$question = $questions[$i][$j];
|
|
|
|
|
|
|
|
if ($question->getQuestion() == null && $j) { ?>
|
|
|
|
<a id="button_<?= $i ?>_<?= $j ?>" class="btn btn-secondary btn-lg btn-block"
|
|
|
|
style="display: <?= $j == 0 || $questions[$i][$j - 1]->getQuestion() != null ? "block" : "none" ?>"
|
|
|
|
onclick="addQuestion(<?= $i ?>, <?= $j ?>)">Ajouter une question</a>
|
|
|
|
<br/>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div id="block_<?= $i ?>_<?= $j ?>" style="display: <?= $question->getQuestion() == null ? "none" : "block" ?>;">
|
|
|
|
<div class="form-group-row">
|
|
|
|
<label for="question_<?= $j + 1 ?>_<?= $i ?>">Question <?= $j + 1 ?> :</label>
|
|
|
|
<textarea class="form-control" id="question_<?= $j + 1 ?>_<?= $i ?>"
|
|
|
|
name="question_<?= $j + 1 ?>"><?= $question->getQuestion() ?></textarea>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($question->getAttachedFile() != null) { ?>
|
|
|
|
<br/>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
Pièce jointe : <a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<div class="form-group-row">
|
|
|
|
<label for="file_<?= $j + 1 ?>_<?= $i ?>">Ajouter une pièce jointe (<em>facultatif</em>)
|
|
|
|
:</label>
|
|
|
|
<input type="file" name="file_<?= $j + 1 ?>" id="file_<?= $j + 1 ?>"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-09-20 12:57:06 +00:00
|
|
|
<?php } ?>
|
2019-09-27 17:18:54 +00:00
|
|
|
|
|
|
|
<input type="checkbox" name="no_drawing" id="no_drawing_<?= $i ?>"/> <label for="no_drawing_<?= $i ?>">Je
|
|
|
|
confirme que mes pièces jointes ne contiennent pas de texte.</label>
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="give_questions"
|
|
|
|
value="Poser les questions"/>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function addQuestion(i, j) {
|
|
|
|
document.getElementById("button_" + i + "_" + j).style.display = "none";
|
|
|
|
document.getElementById("block_" + i + "_" + j).style.display = "block";
|
|
|
|
document.getElementById("button_" + i + "_" + (j + 1)).style.display = "block";
|
|
|
|
}
|
|
|
|
</script>
|
2019-09-20 12:57:06 +00:00
|
|
|
<?php }
|
|
|
|
|
|
|
|
require_once "footer.php";
|