Desgn "Mon compte" & mini-corrections

This commit is contained in:
galaxyoyo 2019-09-24 23:44:38 +02:00
parent b6434cafb8
commit 90952ecb7c
13 changed files with 158 additions and 125 deletions

View File

@ -240,7 +240,7 @@ class User
{ {
global $DB; global $DB;
$this->receive_animath_mails = $receive_animath_mails; $this->receive_animath_mails = $receive_animath_mails;
$DB->prepare("UPDATE `users` SET `receive_animath_mails` = ? WHERE `id` = ?;")->execute([$receive_animath_mails, $this->getId()]); $DB->prepare("UPDATE `users` SET `receive_animath_mails` = ? WHERE `id` = ?;")->execute([$receive_animath_mails ? 1 : 0, $this->getId()]);
} }
public function getAllDocuments($problem) public function getAllDocuments($problem)

View File

@ -9,7 +9,7 @@ $user = $_SESSION["user"];
$has_error = false; $has_error = false;
$error_message = null; $error_message = null;
if (isset($_POST["update_team"])) { if (isset($_POST["update_account"])) {
$my_account = new MyAccount($_POST); $my_account = new MyAccount($_POST);
try { try {
$my_account->makeVerifications(); $my_account->makeVerifications();
@ -21,7 +21,7 @@ if (isset($_POST["update_team"])) {
} }
} }
if (isset($_POST["submitted_password"])) { if (isset($_POST["update_password"])) {
$new_password = new NewPassword($_POST); $new_password = new NewPassword($_POST);
try { try {
$new_password->makeVerifications(); $new_password->makeVerifications();
@ -59,6 +59,8 @@ class MyAccount
foreach ($keys as $key) foreach ($keys as $key)
$this->$key = $this->$key != null && $this->$key != "" ? $this->$key : $this->user->$key; $this->$key = $this->$key != null && $this->$key != "" ? $this->$key : $this->user->$key;
$this->receive_animath_mails = $this->receive_animath_mails == "on";
} }
public function makeVerifications() public function makeVerifications()

View File

@ -1,7 +1,12 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
if (isset($admin) && !$has_error) { ?> <div class="mt-4 mb-4">
<h1 class="display-4">Ajouter un administrateur</h1>
</div>
<?php if (isset($admin) && !$has_error) { ?>
<div class="alert alert-success"> <div class="alert alert-success">
Organisateur ajouté avec succès ! Ses identifiants ont été transmis par mail. Organisateur ajouté avec succès ! Ses identifiants ont été transmis par mail.
</div> </div>

View File

@ -10,14 +10,14 @@ if (isset($new_team) && !$has_error) { ?>
<?php } else { ?> <?php } else { ?>
<form method="POST"> <form method="POST">
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td style="width: 30%;"> <td style="width: 30%;">
<label for="name">Nom :</label> <label for="name">Nom :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<input style="width: 100%;" type="text" id="name" name="name" /> <input type="text" id="name" name="name" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -25,7 +25,7 @@ if (isset($new_team) && !$has_error) { ?>
<label for="trigram">Trigramme :</label> <label for="trigram">Trigramme :</label>
</td> </td>
<td> <td>
<input style="width: 100%;" type="text" id="trigram" name="trigram" /> <input type="text" id="trigram" name="trigram" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -33,7 +33,7 @@ if (isset($new_team) && !$has_error) { ?>
<label for="problem">Problème :</label> <label for="problem">Problème :</label>
</td> </td>
<td> <td>
<select style="width: 100%;" id="problem" name="problem"> <select id="problem" name="problem">
<?php <?php
for ($i = 1; $i <= 4; ++$i) for ($i = 1; $i <= 4; ++$i)
echo "<option value='$i'>$i</option>"; echo "<option value='$i'>$i</option>";
@ -49,7 +49,7 @@ if (isset($new_team) && !$has_error) { ?>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="add_team" value="Ajouter une équipe" /> <input type="submit" name="add_team" value="Ajouter une équipe" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -18,7 +18,7 @@ for ($i = 0; $i < 2; ++$i) {
<?php displayVideo($sol->getLink()) ?> <?php displayVideo($sol->getLink()) ?>
<h5>Questions échangées :</h5> <h5>Questions échangées :</h5>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<?php <?php
for ($j = 0; $j < 6; ++$j) { for ($j = 0; $j < 6; ++$j) {
@ -97,14 +97,14 @@ for ($i = 0; $i < 2; ++$i) {
<form method="POST"> <form method="POST">
<input type="hidden" name="team" value="<?= $i + 1 ?>" /> <input type="hidden" name="team" value="<?= $i + 1 ?>" />
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td style="width: 30%;"> <td style="width: 30%;">
<label for="link">Lien de la vidéo à soumettre :</label> <label for="link">Lien de la vidéo à soumettre :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<input style="width: 100%;" type="url" id="link" name="link" /> <input type="url" id="link" name="link" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -119,7 +119,7 @@ for ($i = 0; $i < 2; ++$i) {
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="upload_answer" value="Envoyer la vidéo" /> <input type="submit" name="upload_answer" value="Envoyer la vidéo" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -21,7 +21,7 @@ if (isset($_GET["mdp_oublie"])) { ?>
<form method="POST" class="jumbotron mt-5"> <form method="POST" class="jumbotron mt-5">
<h1 class="display-4">Réinitialisation du mot de passe</h1> <h1 class="display-4">Réinitialisation du mot de passe</h1>
<label for="email">E-mail associée au compte :</label> <label for="email">E-mail associée au compte :</label>
<input type="email" class="form-control" id="email" name="email"/> <input type="email" class="form-control" id="email" name="email" required/>
<input class="btn btn-lg btn-primary btn-block" type="submit" name="forgotten_password" <input class="btn btn-lg btn-primary btn-block" type="submit" name="forgotten_password"
value="Envoyer l'e-mail de récupération"/> value="Envoyer l'e-mail de récupération"/>
</form> </form>
@ -31,11 +31,11 @@ if (isset($_GET["mdp_oublie"])) { ?>
<input type="hidden" name="token" value="<?= $_GET["token"] ?>"/> <input type="hidden" name="token" value="<?= $_GET["token"] ?>"/>
<div class="form-group"> <div class="form-group">
<label for="password">Nouveau mot de passe :</label> <label for="password">Nouveau mot de passe :</label>
<input type="password" id="password" name="password" class="form-control"/> <input type="password" id="password" name="password" class="form-control" required/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="confirm_password">Confirmer le mot de passe :</label> <label for="confirm_password">Confirmer le mot de passe :</label>
<input type="password" id="confirm_password" name="confirm_password" class="form-control"/> <input type="password" id="confirm_password" name="confirm_password" class="form-control" required/>
</div> </div>
<input type="submit" name="reset_password" class="btn btn-block btn-primary" <input type="submit" name="reset_password" class="btn btn-block btn-primary"
value="Changer le mot de passe"/> value="Changer le mot de passe"/>
@ -48,11 +48,11 @@ if (isset($_GET["mdp_oublie"])) { ?>
<div class="form-group"> <div class="form-group">
<label for="email">E-mail :</label> <label for="email">E-mail :</label>
<input class="form-control" type="email" id="email" name="email" <input class="form-control" type="email" id="email" name="email"
value="<?php if (isset($email)) echo $email ?>"/> value="<?php if (isset($email)) echo $email ?>" required/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">Mot de passe :</label> <label for="password">Mot de passe :</label>
<input class="form-control" type="password" id="password" name="password"/> <input class="form-control" type="password" id="password" name="password" required/>
</div> </div>
<input class="btn btn-primary btn-block" name="login" type="submit" value="Se connecter"/> <input class="btn btn-primary btn-block" name="login" type="submit" value="Se connecter"/>
</form> </form>

View File

@ -31,14 +31,14 @@ if ($video_validated != null && $video_validated->getId() != $video->getId()) {
?> ?>
<form method="POST"> <form method="POST">
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td style="width: 30%;"> <td style="width: 30%;">
<label for="link">Lien de la vidéo à soumettre :</label> <label for="link">Lien de la vidéo à soumettre :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<input style="width: 100%;" type="url" id="link" name="link" /> <input type="url" id="link" name="link" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -53,7 +53,7 @@ if ($video_validated != null && $video_validated->getId() != $video->getId()) {
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="upload" value="Envoyer la vidéo" /> <input type="submit" name="upload" value="Envoyer la vidéo" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -26,7 +26,7 @@ if ($_SESSION["role"] == Role::ADMIN) { ?>
<hr /> <hr />
<form method="POST"> <form method="POST">
<label for="other_teams">L'équipe va recevoir les questions des équipes suivantes (merci d'en sélectionner exactement 2) :</label> <label for="other_teams">L'équipe va recevoir les questions des équipes suivantes (merci d'en sélectionner exactement 2) :</label>
<select style="width: 100%;" id="other_teams" name="other_teams[]" multiple> <select id="other_teams" name="other_teams[]" multiple>
<?php <?php
/** @var Team $other_team */ /** @var Team $other_team */
foreach ($other_teams as $other_team) { foreach ($other_teams as $other_team) {
@ -39,7 +39,7 @@ if ($_SESSION["role"] == Role::ADMIN) { ?>
} }
?> ?>
</select> </select>
<input style="width: 100%;" type="submit" name="update_video_teams" value="Mettre à jour" /> <input type="submit" name="update_video_teams" value="Mettre à jour" />
</form> </form>
<?php } ?> <?php } ?>
@ -50,13 +50,13 @@ if ($_SESSION["role"] == Role::ADMIN) { ?>
<?php printDocuments($documents) ?> <?php printDocuments($documents) ?>
<form method="POST"> <form method="POST">
<input style="width: 100%;" type="submit" name="download_zip" value="Télécharger l'archive"/> <input type="submit" name="download_zip" value="Télécharger l'archive"/>
</form> </form>
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?> <?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?>
<hr /> <hr />
<form method="POST"> <form method="POST">
<input style="width: 100%;" type="submit" name="validate" value="Valider l'équipe"/> <input type="submit" name="validate" value="Valider l'équipe"/>
</form> </form>
<?php <?php
} }

View File

@ -1,91 +1,117 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
<div class="mt-4 mb-4">
<h1 class="display-4">Mon compte</h1>
</div>
<?php
if (!$has_error && (isset($my_account) || isset($new_password))) { if (!$has_error && (isset($my_account) || isset($new_password))) {
?> ?>
<h2>Votre compte a bien été mis à jour !</h2> <div class="alert alert-success">
Votre compte a bien été mis à jour !
</div>
<?php <?php
if (isset($my_account) && $user->getEmail() != $my_account->email) { if (isset($my_account) && $user->getEmail() != $my_account->email) { ?>
echo "Votre adresse mail a bien été changée. Veuillez vérifier votre boîte mail pour valider votre nouvelle adresse, vous en aurez besoin pour vous reconnecter."; <div class="alert alert-info">
} Votre adresse mail a bien été changée. Veuillez vérifier votre boîte mail pour valider votre nouvelle
?> adresse, vous en aurez besoin pour vous reconnecter.
</div>
<?php } ?>
<?php } ?> <?php } ?>
<form method="POST"> <form method="POST">
<table style="width: 100%">
<tr> <div class="form-row">
<td style="width: 30%"><label for="email">E-mail :</label></td> <div class="form-group col-md-6">
<td style="width: 70%"><?= $user->getEmail() ?></td> <label for="surname">Nom :</label>
</tr> <input class="form-control" type="text" id="surname" name="surname"
<tr> value="<?= $user->getSurname() ?>" required/>
<td colspan="2"><input style="width: 100%" type="email" id="email" name="email"/></td> </div>
</tr>
<tr> <div class="form-group col-md-6">
<td><label for="surname">Nom :</label></td> <label for="first_name">Prénom :</label>
<td><?= $user->getSurname() ?></td> <input class="form-control" type="text" id="first_name" name="first_name"
</tr> value="<?= $user->getFirstName() ?>" required/>
<tr> </div>
<td colspan="2"><input style="width: 100%" type="text" id="surname" name="surname"/></td> </div>
</tr>
<tr> <div class="form-row">
<td><label for="firstname">Prénom :</label></td> <div class="form-group col-md-12">
<td><?= $user->getFirstName() ?></td> <label for="email">E-mail :</label>
</tr> <input class="form-control" type="email" id="email" name="email"
<tr> value="<?= $user->getEmail() ?>" required/>
<td colspan="2"><input style="width: 100%" type="text" id="firstname" name="firstname"/></td> </div>
</tr> </div>
<div class="form-row">
<label for="receive_animath_mails">J'accepte de recevoir des mails de la part d'Animath :</label>
<input class="form-control" type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
<?= $user->doReceiveAnimathMails() ? "checked" : "" ?> />
</div>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?> <?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<tr> <div class="form-row">
<td><label for="school">Établissement dans lequel l'élève étudie :</label></td> <div class="form-group col-md-6">
<td><?= $user->getSchool() ?></td> <label id="school_label" for="school">Établissement dans lequel l'élève étudie :</label>
</tr> <input class="form-control" type="text" id="school" name="school"
<tr> value="<?= $user->getSchool() ?>"/>
<td colspan="2"><input style="width: 100%" type="text" id="school" name="school"/></td> </div>
</tr>
<tr> <div class="form-group col-md-6">
<td><label for="class">Classe :</label></td> <label id="class_label" for="class">Classe :</label>
<td><select style="width: 100%" id="class" name="class"> <select id="class" name="class" class="custom-select">
<option value="terminale" <?php if ($user->getClass() == SchoolClass::TERMINALE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?></option> <option value="terminale"><?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?>
<option value="premiere" <?php if ($user->getClass() == SchoolClass::PREMIERE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?></option> <?= $user->getClass() == SchoolClass::TERMINALE ? "selected" : "" ?></option>
<option value="seconde" <?php if ($user->getClass() == SchoolClass::SECONDE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option> <option value="premiere"><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?>
</select></td> <?= $user->getClass() == SchoolClass::PREMIERE ? "selected" : "" ?></option>
</tr> <option value="seconde"><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?>
<?= $user->getClass() == SchoolClass::SECONDE ? "selected" : "" ?></option>
</select>
</div>
</div>
<?php } else { ?> <?php } else { ?>
<tr>
<td><label for="description">Description :</label></td> <div class="form-group row">
<td><textarea style="width: 100%" id="description" name="description"><?= $user->getDescription() ?></textarea></td> <label id="description_label" for="description">Description :</label>
</tr> <textarea class="form-control" id="description"
name="description"><?= $user->getDescription() ?></textarea>
</div>
<?php } ?> <?php } ?>
<tr>
<td style="text-align: center;" colspan="2"><input type="checkbox" id="receive_animath_mails" name="receive_animath_mails" <?= $user->doReceiveAnimathMails() ? "checked" : "" ?> /> <label for="receive_animath_mails">J'accepte de recevoir des mails de la part d'Animath</label></td>
</tr>
<tr>
<td colspan="2"><input type="submit" style="width: 100%" name="update_team" value="Mettre à jour mes données"/></td>
</tr>
</table>
</form>
<div style="padding: 20px"></div> <div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" name="update_account" type="submit"
value="Enregistrer les modifications"/>
</div>
</form>
<form method="POST"> <hr />
<input type="hidden" name="submitted_password" value="true"/>
<table style="width: 100%"> <form method="POST">
<tr>
<td style="width: 30%"><label for="old_password">Ancien mot de passe :</label></td> <div class="form-row">
<td style="width: 70%"><input style="width: 100%" type="password" id="old_password" name="old_password"/></td> <div class="form-group col-md-4">
</tr> <label for="old_password">Ancien mot de passe :</label>
<tr> <input class="form-control" type="password" id="old_password" name="old_password" required/>
<td><label for="new_password">Nouveau mot de passe :</label></td> </div>
<td><input style="width: 100%" type="password" id="new_password" name="new_password"/></td>
</tr> <div class="form-group col-md-4">
<tr> <label for="new_password">Nouveau mot de passe :</label>
<td><label for="confirm_password">Confirmer le mot de passe :</label></td> <input class="form-control" type="password" id="new_password" name="new_password" required/>
<td><input style="width: 100%" type="password" id="confirm_password" name="confirm_password"/></td> </div>
</tr>
<tr> <div class="form-group col-md-4">
<td colspan="2"><input type="submit" style="width: 100%" value="Mettre à jour mon mot de passe"/></td> <label for="confirm_password">Confirmer le mot de passe :</label>
</tr> <input class="form-control" type="password" id="confirm_password" name="confirm_password" required/>
</table> </div>
</form> </div>
<div class="form-group row">
<input class="btn btn-secondary btn-lg btn-block" type="submit" name="update_password" value="Mettre à jour mon mot de passe"/>
</div>
</form>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -38,14 +38,14 @@ for ($i = 1; $i <= 5; ++$i) {
<form method="POST"> <form method="POST">
<input type="hidden" name="team_edit" value="true"/> <input type="hidden" name="team_edit" value="true"/>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td style="width: 30%;"> <td style="width: 30%;">
<label for="name">Nom :</label> <label for="name">Nom :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $team->getName() ?>"/> <input type="text" id="name" name="name" value="<?= $team->getName() ?>"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -53,7 +53,7 @@ for ($i = 1; $i <= 5; ++$i) {
<label for="trigram">Trigramme :</label> <label for="trigram">Trigramme :</label>
</td> </td>
<td> <td>
<input style="width: 100%;" type="text" id="trigram" name="trigram" <input type="text" id="trigram" name="trigram"
value="<?= $team->getTrigram() ?>"/> value="<?= $team->getTrigram() ?>"/>
</td> </td>
</tr> </tr>
@ -62,7 +62,7 @@ for ($i = 1; $i <= 5; ++$i) {
<label for="problem">Problème :</label> <label for="problem">Problème :</label>
</td> </td>
<td> <td>
<select style="width: 100%;" id="problem" name="problem"> <select id="problem" name="problem">
<?php <?php
for ($i = 1; $i <= 4; ++$i) for ($i = 1; $i <= 4; ++$i)
echo "<option value=\"$i\" " . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n"; echo "<option value=\"$i\" " . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n";
@ -72,7 +72,7 @@ for ($i = 1; $i <= 5; ++$i) {
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" value="Modifier l'équipe"/> <input type="submit" value="Modifier l'équipe"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -94,30 +94,30 @@ for ($i = 1; $i <= 5; ++$i) {
<hr/> <hr/>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<input type="hidden" name="type" value="photo_consent"/> <input type="hidden" name="type" value="photo_consent"/>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td> <td>
<label for="file">Fichier :</label> <label for="file">Fichier :</label>
</td> </td>
<td> <td>
<input style="width: 100%;" type="file" id="file" name="document"/> <input type="file" id="file" name="document"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="send_document" value="Envoyer le document"/> <input type="submit" name="send_document" value="Envoyer le document"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form> </form>
<hr/> <hr/>
<table style="width: 100%;"> <table >
<tr> <tr>
<td style="width: 50%;"> <td style="width: 50%;">
<form method="post"> <form method="post">
<input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/> <input type="submit" name="leave_team" value="Quitter l'équipe"/>
</form> </form>
</td> </td>
<?php <?php
@ -127,7 +127,7 @@ for ($i = 1; $i <= 5; ++$i) {
<form method="post"> <form method="post">
<input type="checkbox" name="engage" id="engage"/> <label for="engage">Je m'engage à <input type="checkbox" name="engage" id="engage"/> <label for="engage">Je m'engage à
participer à l'intégralité des Correspondances</label><br/> participer à l'intégralité des Correspondances</label><br/>
<input style="width: 100%;" type="submit" name="request_validation" <input type="submit" name="request_validation"
value="Demander la validation"/> value="Demander la validation"/>
</form> </form>
</td> </td>
@ -152,7 +152,7 @@ for ($i = 1; $i <= 5; ++$i) {
$answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $asker); $answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $asker);
?> ?>
<h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5> <h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<?php <?php
for ($j = 0; $j < 6; ++$j) { for ($j = 0; $j < 6; ++$j) {
@ -231,7 +231,7 @@ for ($i = 1; $i <= 5; ++$i) {
<br/> <br/>
<h5>Vos questions :</h5> <h5>Vos questions :</h5>
<br/> <br/>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<?php <?php
for ($j = 0; $j < 6; ++$j) { for ($j = 0; $j < 6; ++$j) {

View File

@ -15,7 +15,7 @@ for ($i = 0; $i < 2; ++$i) {
<br/> <br/>
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
<input type="hidden" name="to" value="<?= $receiver->getTrigram() ?>"/> <input type="hidden" name="to" value="<?= $receiver->getTrigram() ?>"/>
<table style="width: 100%;"> <table >
<tbody> <tbody>
<?php <?php
for ($j = 0; $j < 6; ++$j) { for ($j = 0; $j < 6; ++$j) {
@ -25,7 +25,7 @@ for ($i = 0; $i < 2; ++$i) {
<label for="question_<?= $j + 1 ?>">Question <?= $j + 1 ?> <?= $j >= 3 ? "(<em>facultatif</em>)" : "" ?> :</label> <label for="question_<?= $j + 1 ?>">Question <?= $j + 1 ?> <?= $j >= 3 ? "(<em>facultatif</em>)" : "" ?> :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<textarea style="width: 100%;" id="question_<?= $j + 1 ?>" name="question_<?= $j + 1 ?>"><?= $question->getQuestion() ?></textarea> <textarea id="question_<?= $j + 1 ?>" name="question_<?= $j + 1 ?>"><?= $question->getQuestion() ?></textarea>
</td> </td>
</tr> </tr>
<?php <?php
@ -44,7 +44,7 @@ for ($i = 0; $i < 2; ++$i) {
<label for="file_<?= $j + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label> <label for="file_<?= $j + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
</td> </td>
<td> <td>
<input style="width: 100%;" type="file" name="file_<?= $j + 1 ?>" id="file_<?= $j + 1 ?>" /> <input type="file" name="file_<?= $j + 1 ?>" id="file_<?= $j + 1 ?>" />
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
@ -55,7 +55,7 @@ for ($i = 0; $i < 2; ++$i) {
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="give_questions" value="Poser les questions" /> <input type="submit" name="give_questions" value="Poser les questions" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -10,19 +10,19 @@ if (isset($join_team) && !$has_error) { ?>
<?php if ($has_error) echo "<h2>Erreur : " . $error_message . "</h2>"; ?> <?php if ($has_error) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
<form method="POST"> <form method="POST">
<table style="width: 100%;"> <table >
<tbody> <tbody>
<tr> <tr>
<td style="width: 30%;"> <td style="width: 30%;">
<label for="access_code">Code d'accès :</label> <label for="access_code">Code d'accès :</label>
</td> </td>
<td style="width: 70%;"> <td style="width: 70%;">
<input style="width: 100%;" type="text" id="access_code" name="access_code" /> <input type="text" id="access_code" name="access_code" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" name="join_team" type="submit" value="Rejoindre l'équipe" /> <input name="join_team" type="submit" value="Rejoindre l'équipe" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -13,7 +13,7 @@ foreach ($questions as $questions_team) {
?> ?>
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
<input type="hidden" name="from" value="<?= $from->getTrigram() ?>" /> <input type="hidden" name="from" value="<?= $from->getTrigram() ?>" />
<table style="width: 100%;"> <table >
<tbody> <tbody>
<?php <?php
for ($i = 0; $i < sizeof($questions_team); ++$i) { for ($i = 0; $i < sizeof($questions_team); ++$i) {
@ -45,7 +45,7 @@ foreach ($questions as $questions_team) {
<label for="answer_<?= $i + 1 ?>">Réponse :</label> <label for="answer_<?= $i + 1 ?>">Réponse :</label>
</td> </td>
<td> <td>
<textarea style="width: 100%;" id="answer_<?= $i + 1 ?>" name="answer_<?= $i + 1 ?>"><?= $question->getAnswer() ?></textarea> <textarea id="answer_<?= $i + 1 ?>" name="answer_<?= $i + 1 ?>"><?= $question->getAnswer() ?></textarea>
</td> </td>
</tr> </tr>
<?php <?php
@ -64,7 +64,7 @@ foreach ($questions as $questions_team) {
<label for="file_<?= $i + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label> <label for="file_<?= $i + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
</td> </td>
<td> <td>
<input style="width: 100%;" type="file" name="file_<?= $i + 1 ?>" id="file_<?= $i + 1 ?>" /> <input type="file" name="file_<?= $i + 1 ?>" id="file_<?= $i + 1 ?>" />
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
@ -75,7 +75,7 @@ foreach ($questions as $questions_team) {
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input style="width: 100%;" type="submit" name="answer" value="Répondre aux questions posées" /> <input type="submit" name="answer" value="Répondre aux questions posées" />
</td> </td>
</tr> </tr>
</tbody> </tbody>