Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/aae 33 #27

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions public/view/ajoutEleveView.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@

<div class="input-row">
<label class="medium-label">Année Scolaire</label>
<select name="anneeScolaire">
<div class="select">
<select name="anneeScolaire">

<?php
$currentYear = (int)date("Y");
$years = [];
<?php
$currentYear = (int)date("Y");
$years = [];

if ((int)date("m") < 8) {
$currentYear--;
}
$years = [$currentYear - 1, $currentYear, $currentYear + 1, $currentYear + 2];
if ((int)date("m") < 8) {
$currentYear--;
}
$years = [$currentYear - 1, $currentYear, $currentYear + 1, $currentYear + 2];

foreach ($years as $year) : ?>
foreach ($years as $year) : ?>

<option value="<?= $year ?>" <?= $year == $currentYear ? " selected" : "" ?>><?= $year . '-' . ($year + 1) ?></option>
<option value="<?= $year ?>" <?= $year == $currentYear ? " selected" : "" ?>><?= $year . '-' . ($year + 1) ?></option>

<?php endforeach ?>
<?php endforeach ?>

</select>
</select>
<div class="select__arrow"></div>
</div>
</div>


Expand Down
58 changes: 32 additions & 26 deletions public/view/autoEvalDistribuerView.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,49 @@
<!-- Choix de la matière, par défaut celle du questionnaire, mais on peut y mettre ce qu'on veut -->
<div class="input-row">
<label for="questionnaireMatiere">Matière</label>
<select name="idMatiere" id="questionnaireMatiere">

<?php
while ($row = $matieres->fetch()) {
$id = htmlspecialchars($row['id']);
$libelle = htmlspecialchars($row['libelle']);
$selected = $id == $questionnaire['id_matiere'] ? ' selected' : '';

echo ('<option value="' . $id . '" ' . $selected . '>' . $libelle . '</option>
');
}

?>
</select>
<div class="select">
<select name="idMatiere" id="questionnaireMatiere">

<?php
while ($row = $matieres->fetch()) {
$id = htmlspecialchars($row['id']);
$libelle = htmlspecialchars($row['libelle']);
$selected = $id == $questionnaire['id_matiere'] ? ' selected' : '';

echo ('<option value="' . $id . '" ' . $selected . '>' . $libelle . '</option>
');
}

?>
</select>
<div class="select__arrow"></div>
</div>
</div>


<div class="input-row">
<label>Année Scolaire</label>
<select name="anneeScolaire">
<div class="select">
<select name="anneeScolaire">

<?php
$currentYear = (int)date("Y");
$years = [];
<?php
$currentYear = (int)date("Y");
$years = [];

if ((int)date("m") < 8) {
$currentYear--;
}
$years = [$currentYear - 1, $currentYear, $currentYear + 1, $currentYear + 2];
if ((int)date("m") < 8) {
$currentYear--;
}
$years = [$currentYear - 1, $currentYear, $currentYear + 1, $currentYear + 2];

foreach ($years as $year) : ?>
foreach ($years as $year) : ?>

<option value="<?= $year ?>" <?= $year == $currentYear ? " selected" : "" ?>><?= $year . '-' . ($year + 1) ?></option>
<option value="<?= $year ?>" <?= $year == $currentYear ? " selected" : "" ?>><?= $year . '-' . ($year + 1) ?></option>

<?php endforeach ?>
<?php endforeach ?>

</select>
</select>
<div class="select__arrow"></div>
</div>
</div>


Expand Down
94 changes: 47 additions & 47 deletions public/view/detailEleveView.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php
$title = "profil de l'élève " . htmlspecialchars($eleve['login']);
$title = "Profil de l'élève " . htmlspecialchars($eleve['login']);
ob_start();

require('view/headerUserView.php');
$annee = (int)$eleve['anneeScolaire'];
?>

<h1><?= $title ?></h1>
<article class="title-list">
<h1><?= $title ?></h1>
</article>

<form action="index.php" method="POST">
<input type="hidden" name="idEleve" value="<?= htmlspecialchars($eleve['id']) ?>">
Expand All @@ -15,73 +17,71 @@

<p>Année scolaire : <?= $annee . "-" . ($annee + 1) ?></p>

<div>
<p>Classe</p>
<?php while ($classe = $classes->fetch()) : ?>
<div>
<label>
<input type="radio" name="idClasse" value="<?= (int)$classe['id'] ?>" <?= ($classe['id'] == $eleve['id_classe']) ? " checked" : "" ?>>
<?= htmlspecialchars($classe['libelle']) ?></label>
</div>
<?php endwhile ?>
</div>


<div>
<p>Nom de la classe</p>
<?php while ($classeNom = $classeNoms->fetch()) : ?>
<div>
<label>
<input type="radio" name="idClasseNom" value="<?= (int)$classeNom['id'] ?>" <?= ($classeNom['id'] == $eleve['id_classeNom']) ? " checked" : "" ?>>
<?= htmlspecialchars($classeNom['libelle']) ?></label>
</div>
<?php endwhile ?>
</div>

<div>
<p>Options de cours</p>
<?php
$optionsEleve = explode(";", htmlspecialchars($eleve['optionCours']));
while ($option = $optionCours->fetch()) :
?>
<div>
<label>
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<< Control group -->
<div class="container">
<div class="control-group">
<h2>Classe</h2>
<?php while ($classe = $classes->fetch()) : ?>
<label class="control control--radio"><?= htmlspecialchars($classe['libelle']) ?>
<input type="radio" name="idClasse" value="<?= (int)$classe['id'] ?>" <?= ($classe['id'] == $eleve['id_classe']) ? " checked" : "" ?>>
<div class="control__indicator"></div>
</label>
<?php endwhile ?>
</div>

<div class="control-group">
<h2>Nom de la classe</h2>
<?php while ($classeNom = $classeNoms->fetch()) : ?>
<label class="control control--radio"><?= htmlspecialchars($classeNom['libelle']) ?>
<input type="radio" name="idClasseNom" value="<?= (int)$classeNom['id'] ?>" <?= ($classeNom['id'] == $eleve['id_classeNom']) ? " checked" : "" ?>>
<div class="control__indicator"></div>
</label>
<?php endwhile ?>
</div>

<div class="control-group">
<h2>Options de cours</h2>
<?php
$optionsEleve = explode(";", htmlspecialchars($eleve['optionCours']));
while ($option = $optionCours->fetch()) :
?>
<!-- <div> -->
<label class="control control--checkbox"><?= htmlspecialchars($option['libelle']) ?>
<input type="checkbox" name="idOptionCours[]" value="<?= htmlspecialchars($option['id']) ?>" <?= in_array($option['id'], $optionsEleve) ? " checked" : "" ?>>
<?= htmlspecialchars($option['libelle']) ?></label>
</div>
<?php endwhile ?>
<div class="control__indicator"></div>
</label>
<!-- </div> -->
<?php endwhile ?>
</div>
</div>

<input type="submit" value="Valider">

<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<< Control group -->
<label class="btn btn-detail">
<input type="submit" value="Valider">
</label>
</form>

<form action="index.php" method="POST">
<input type="hidden" name="action" value="show_listeEleves">

<input type="hidden" name="action" value="show_listeEleves">
<label class="btn btn-back btn-detail">
<input type="submit" value="Retour">
</label>

</form>

<form action="index.php" method="POST">
<br><br><br>
<input type="hidden" name="idEleve" value="<?= htmlspecialchars($eleve['id']) ?>">
<input type="hidden" name="action" value="do_deleteEleve">

<input type="hidden" name="action" value="do_deleteEleve">
<label class="btn btn-detail btn-error">
<input type="submit" value="Supprimer cet élève">
</label>

</form>

<form action="index.php" method="POST">
<input type="hidden" name="dateCreation" value="<?= htmlspecialchars($eleve['dateCreation']) ?>">
<input type="hidden" name="action" value="do_deleteEleveDate">
<label class="btn btn-detail btn-error">
<input type="submit" value="Supprimer tous les élèves
créés le <?= htmlspecialchars($eleve['dateCreation']) ?>">
<label class="btn btn-detail btn-error btn-delete">
<input type="submit" value="Supprimer tous les élèves créés &#10; le <?= htmlspecialchars($eleve['dateCreation']) ?>">
</label>
</form>

Expand Down
498 changes: 490 additions & 8 deletions public/view/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/view/dist/styles.css

Large diffs are not rendered by default.

43 changes: 29 additions & 14 deletions public/view/listeElevesView.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,65 +32,80 @@
<label class="medium-label">Identifiant</label>
<input type="text" name="login" max="200" value="<?=$filterLogin?>">
</div>

<div class="input-row">

<!-- ************** -->
<div class="input-row">
<label class="medium-label">Année Scolaire</label>
<select name="anneeScolaire">
<div class="select">
<select name="anneeScolaire">
<?php
while ($annee = $listAnneeScolaire->fetch()) :
?>
<option value="<?= htmlspecialchars($annee['valueYear']) ?>" <?= $annee['valueYear'] == $filterAnneScolaire ? " selected" : "" ?>><?= htmlspecialchars($annee['displayYear']) ?></option>
<option class="select--option" value="<?= htmlspecialchars($annee['valueYear']) ?>" <?= $annee['valueYear'] == $filterAnneScolaire ? " selected" : "" ?>><?= htmlspecialchars($annee['displayYear']) ?></option>
<?php endwhile; ?>
</select>
</select>
<div class="select__arrow"></div>
</div>
</div>


<div class="input-row">
<label class="medium-label">Classe</label>
<select name="idclasse">
<div class="select">
<select name="idclasse">
<option value="0">- Toutes -</option>
<?php
while ($classe = $listClasse->fetch()) :
?>
<option value="<?= htmlspecialchars($classe['id']) ?>" <?= $classe['id'] == $filterIdClasse ? " selected" : "" ?>><?= htmlspecialchars($classe['libelle']) ?></option>
<?php endwhile; ?>
</select>
</select>
<div class="select__arrow"></div>
</div>
</div>

<div class="input-row">
<label class="medium-label">Nom de la classe</label>
<select name="idclasseNom">
<div class="select">
<select name="idclasseNom">
<option value="0">- Tous -</option>
<?php
while ($classeNom = $listClasseNom->fetch()) :
?>
<option value="<?= htmlspecialchars($classeNom['id']) ?>" <?= $classeNom['id'] == $filterIdClasseNom ? " selected" : "" ?>><?= htmlspecialchars($classeNom['libelle']) ?></option>
<?php endwhile; ?>
</select>
</select>
<div class="select__arrow"></div>
</div>
</div>

<div class="input-row">
<label class="medium-label">Option de cours</label>
<select name="idOptionCours">
<div class="select">
<select name="idOptionCours">
<option value="0">- Toutes -</option>
<?php
while ($option = $listOptionCours->fetch()) :
?>
<option value="<?= htmlspecialchars($option['id']) ?>" <?= $option['id'] == $filterIdOptionCours ? " selected" : "" ?>><?= htmlspecialchars($option['libelle']) ?></option>
<?php endwhile; ?>
</select>
</select>
<div class="select__arrow"></div>
</div>
</div>

<div class="input-row">
<label class="medium-label">Date de création</label>
<select name="dateCreation">
<div class="select">
<select name="dateCreation">
<option value="1900-01-01">- Toutes -</option>
<?php
while ($dateCrea = $listDateCreation->fetch()) :
?>
<option value="<?= htmlspecialchars($dateCrea['valueDate']) ?>" <?= $dateCrea['valueDate'] == $filterDateCreation ? " selected" : "" ?>><?= htmlspecialchars($dateCrea['displayDate']) ?></option>
<?php endwhile; ?>
</select>
</select>
<div class="select__arrow"></div>
</div>
</div>

<label class="btn btn-detail">
Expand Down
7 changes: 6 additions & 1 deletion public/view/profDetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@
<input type="checkbox" name="isAdmin" <?= $isAdmin ? "checked" : "" ?>>
</div>


<!-- /////// -->

<div class="input-row">
<label class="w-100 large-label">Matière</label>
<div class="select">
<select name="idMatiere" required>
<?php while ($row = $matieres->fetch()) : ?>
<option value="<?= htmlspecialchars($row['id']) ?>" <?= ($row['id'] == $idMatiere) ? " selected" : "" ?>><?= htmlspecialchars($row['libelle']) ?></option>
<?php endwhile; ?>
</select>

<div class="select__arrow"></div>
</div>
</div>

<label class="btn btn-detail">
Expand Down
13 changes: 8 additions & 5 deletions public/view/profilProfView.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@

<div class="input-row">
<label class="large-label">Matière</label>
<select name="idMatiere">
<?php while ($matiere = $matieres->fetch()) : ?>
<option value="<?= htmlspecialchars($matiere['id']) ?>" <?= $matiere['id'] == $prof["id_matiere"] ? " selected" : "" ?>><?= htmlspecialchars($matiere['libelle']) ?></option>
<?php endwhile ?>
</select>
<div class="select">
<select name="idMatiere">
<?php while ($matiere = $matieres->fetch()) : ?>
<option value="<?= htmlspecialchars($matiere['id']) ?>" <?= $matiere['id'] == $prof["id_matiere"] ? " selected" : "" ?>><?= htmlspecialchars($matiere['libelle']) ?></option>
<?php endwhile ?>
</select>
<div class="select__arrow"></div>
</div>
</div>
<label class="btn btn-detail">
<input type="submit" value="Enregistrer les modifications">
Expand Down
Loading