summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.idea/vcs.xml6
-rwxr-xr-xabsences/index.php32
-rwxr-xr-xcontent/index.php20
-rwxr-xr-xfiles/index.php14
-rwxr-xr-xholidays/index.php2
-rwxr-xr-xhomework/index.php16
-rwxr-xr-xincludes/navigation.php45
-rwxr-xr-xme/index.php67
-rwxr-xr-xmenu/index.php4
-rwxr-xr-xschool/index.php5
-rwxr-xr-xtimetable/index.php16
11 files changed, 177 insertions, 50 deletions
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="Git" />
+ </component>
+</project> \ No newline at end of file
diff --git a/absences/index.php b/absences/index.php
index bcc58f3..b9d6392 100755
--- a/absences/index.php
+++ b/absences/index.php
@@ -1,13 +1,41 @@
<?php
-$title = "Absences et retards";
+$title = "Absences";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+$absences = data_absences();
+
?>
-<div class="container"><br><h2><?= $title ?></h2><div class="alert alert-warning"><b>Cette page n'est pas encore disponible.</b> Nots est un logiciel en développement actif, et certaines pages ne sont pas encore disponibles. <a href="/about">En savoir plus.</a></div></div>
+<div class="container">
+ <br><h2><?= $title ?></h2>
+
+ <?php foreach (array_reverse($absences["data"]["absences"]["absences"]) as $absence): ?>
+ <div style="margin-top: 5px; padding-top: 5px; padding-bottom: 5px; margin-left: 10px; padding-left: 10px; border-left-style: solid; border-color: #ddd; border-left-width: 5px;">
+ <b><?= $absence["reason"] ?></b><?php if (!$absence["justified"]): ?> <span class="btn btn-danger">Non justifiée</span><?php elseif (!$absence["solved"]): ?> <span class="btn btn-warning">Non résolue</span><?php endif; ?><br>
+ <?php
+
+ $fmt = new \IntlDateFormatter('fr_FR');
+ $fmt->setPattern('d MMM yyyy, H:m');
+
+ $fmt1 = new \IntlDateFormatter('fr_FR');
+ $fmt1->setPattern('d MMM yyyy');
+
+ $fmt2 = new \IntlDateFormatter('fr_FR');
+ $fmt2->setPattern('H:m');
+
+ ?>
+ <?php if ($fmt1->format(new \DateTime(date("c", ($absence["from"] + 3600000) / 1000))) === $fmt1->format(new \DateTime(date("c", ($absence["to"] + 3600000) / 1000)))): ?>
+ le <?= $fmt1->format(new \DateTime(date("c", ($absence["from"] + 3600000) / 1000))) ?> de <?= $fmt2->format(new \DateTime(date("c", ($absence["from"] + 3600000) / 1000))) ?> à <?= $fmt2->format(new \DateTime(date("c", ($absence["to"] + 3600000) / 1000))) ?>
+ <?php else: ?>
+ du <?= $fmt->format(new \DateTime(date("c", ($absence["from"] + 3600000) / 1000))) ?> au <?= $fmt->format(new \DateTime(date("c", ($absence["to"] + 3600000) / 1000))) ?>
+ <?php endif; ?><br>
+ <?= $absence["hours"] ?> heure<?= $absence["hours"] > 1 ? "s" : "" ?> de cours manquée<?= $absence["hours"] > 1 ? "s" : "" ?>
+ </div>
+ <?php endforeach; ?>
+</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?>
diff --git a/content/index.php b/content/index.php
index e0c0e8a..fee991a 100755
--- a/content/index.php
+++ b/content/index.php
@@ -1,6 +1,6 @@
<?php
-$title = "Contenu des cours";
+$title = "Cours";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
@@ -12,9 +12,21 @@ $contents = data_contents()["data"]["contents"];
<div class="container">
<br>
- <h2><?= $title ?></h2>
-
- <?php $i = 2; foreach ($contents as $content): ?>
+ <h2>Cours</h2>
+
+ <div class="dropdown" style="margin-bottom: 10px;">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
+ Contenus
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="/timetable">Emploi du temps</a></li>
+ <li><a class="dropdown-item disabled" href="#">Contenus</a></li>
+ <li><a class="dropdown-item" href="/homework">Devoirs</a></li>
+ <li><a class="dropdown-item" href="/files">Fichiers</a></li>
+ </ul>
+ </div>
+
+ <?php $i = 2; foreach (array_reverse($contents) as $content): ?>
<details open>
<summary>
<b><?= getSubject($content["subject"]) ?></b> · <?= implode(", ", $content["teachers"]) ?> · <?php
diff --git a/files/index.php b/files/index.php
index 0448ce3..89e0c43 100755
--- a/files/index.php
+++ b/files/index.php
@@ -10,7 +10,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
<div class="container">
<br>
- <h2><?= $title ?></h2>
+ <h2>Cours</h2>
+
+ <div class="dropdown" style="margin-bottom: 10px;">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
+ Devoirs
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="/timetable">Emploi du temps</a></li>
+ <li><a class="dropdown-item" href="/content">Contenus</a></li>
+ <li><a class="dropdown-item" href="/homework">Devoirs</a></li>
+ <li><a class="dropdown-item disabled" href="#">Fichiers</a></li>
+ </ul>
+ </div>
<table>
<?php $index = 1; foreach (data_files()["data"]["files"] as $file): ?>
diff --git a/holidays/index.php b/holidays/index.php
index f731d46..005d405 100755
--- a/holidays/index.php
+++ b/holidays/index.php
@@ -13,7 +13,7 @@ $holidays = $params["publicHolidays"];
<div class="container">
<br>
- <h2><?= $title ?></h2>
+ <h2>Vacances scolaires</h2>
<div class="alert alert-secondary">
<b>Prochaines vacances :</b> <?php foreach (array_values(array_filter($holidays, function ($i) {
diff --git a/homework/index.php b/homework/index.php
index b50fdb6..2699295 100755
--- a/homework/index.php
+++ b/homework/index.php
@@ -1,6 +1,6 @@
<?php
-$title = "Travail à faire";
+$title = "Cours";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
@@ -12,7 +12,19 @@ $homeworks = data_homeworks()["data"]["homeworks"];
<div class="container">
<br>
- <h2><?= $title ?></h2>
+ <h2>Cours</h2>
+
+ <div class="dropdown" style="margin-bottom: 10px;">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
+ Devoirs
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="/timetable">Emploi du temps</a></li>
+ <li><a class="dropdown-item" href="/content">Contenus</a></li>
+ <li><a class="dropdown-item disabled" href="#">Devoirs</a></li>
+ <li><a class="dropdown-item" href="/files">Fichiers</a></li>
+ </ul>
+ </div>
<?php foreach ($homeworks as $homework): if (($homework["for"] + 7200000) / 1000 >= time()): ?>
<div style="margin-top: 5px; padding-top: 5px; margin-left: 10px; padding-left: 10px; border-left-style: solid; border-color: <?= $homework["color"] ?>; border-left-width: 5px;margin-bottom:10px;">
diff --git a/includes/navigation.php b/includes/navigation.php
index c6f1f2e..24779c9 100755
--- a/includes/navigation.php
+++ b/includes/navigation.php
@@ -10,46 +10,23 @@
<li class="nav-item">
<a class="nav-link" href="/">Accueil</a>
</li>
- <li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Mes données</a>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" href="/school">Établissement et compte</a></li>
- <li><a class="dropdown-item" href="/custom">Personalisation</a></li>
- <li><a class="dropdown-item" href="/about">À propos de Nots</a></li>
- <li><hr class="dropdown-divider"></hr></li>
- <li><a class="dropdown-item" href="/logout">Déconnexion</a></li>
- </ul>
+ <li class="nav-item">
+ <a class="nav-link" href="/timetable">Cours</a>
</li>
- <li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Cahier de textes</a>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" href="/content">Contenu des cours</a></li>
- <li><a class="dropdown-item" href="/homework">Travail à faire</a></li>
- <li><a class="dropdown-item" href="/files">Fichiers partagés</a></li>
- </ul>
+ <li class="nav-item">
+ <a class="nav-link" href="/marks">Notes</a>
</li>
- <li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Notes et évaluations</a>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" href="/marks">Notes</a></li>
- <!--<li><a class="dropdown-item" href="/evaluations">Évaluations</a></li>-->
- <li><a class="dropdown-item" href="/reportcards">Bulletins</a></li>
- </ul>
+ <li class="nav-item">
+ <a class="nav-link" href="/menu">Menu</a>
</li>
- <li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Vie scolaire</a>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" href="/timetable">Emploi du temps</a></li>
- <li><a class="dropdown-item" href="/teachers">Équipe pédagogique</a></li>
- <li><a class="dropdown-item" href="/absences">Absences et retards</a></li>
- <li><a class="dropdown-item" href="/events">Punitions et événements</a></li>
- </ul>
+ <li class="nav-item">
+ <a class="nav-link" href="/me">Moi</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Communication</a>
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Plus</a>
<ul class="dropdown-menu">
- <li><a class="dropdown-item" href="/menu">Menu</a></li>
- <li><a class="dropdown-item" href="/holidays">Vacances scolaires</a></li>
+ <li><a class="dropdown-item" href="/about">À propos de Nots</a></li>
+ <li><a class="dropdown-item" href="/logout">Déconnexion</a></li>
</ul>
</li>
<li class="nav-item" style="margin-left: auto;margin-top:7px;">
diff --git a/me/index.php b/me/index.php
new file mode 100755
index 0000000..0a3752b
--- /dev/null
+++ b/me/index.php
@@ -0,0 +1,67 @@
+<?php
+
+$title = "Moi";
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+global $key;
+global $fullVersion;
+global $_name;
+
+$data = data_params()["data"]["params"];
+$user = data_user()["data"]["user"];
+
+?>
+
+<div class="container">
+ <br>
+
+ <div style="text-align: center;">
+ <h3 style="margin-top: 10px;"><?= $_name ?></h3>
+ </div>
+
+ <p>Année scolaire <?= $data["schoolYear"] ?></p>
+
+ <?php foreach ($user["establishmentsInfo"] as $establishment): ?>
+ <b>
+ <?= $establishment["name"] ?><br>
+ </b>
+ <p>
+ <?= $establishment["address"][0] ?>
+ <?= trim($establishment["address"][1]) !== "" ? "<br>" . $establishment["address"][1] : "" ?><br>
+ <?= $establishment["postalCode"] ?> <?= $establishment["postalLabel"] ?> <?= $establishment["city"] ?><br>
+ <?= trim($establishment["province"]) !== "" ? $establishment["province"] . ", " : "" ?><?= $establishment["country"] ?>
+ <?= trim($establishment["website"]) !== "" ? "<br><a href='https://$establishment[website]'>" . $establishment["website"] . "</a>" : "" ?>
+ </p>
+ <?php endforeach; ?>
+
+ <b>
+ <?= $_name ?>
+ </b>
+ <p>
+ Classes : <?= implode(", ", $user["studentClass"]) ?><br>
+ Groupes : <?= implode(", ", array_map(function ($i) {
+ return $i["name"];
+ }, $user["groups"])) ?>
+ </p>
+
+ <hr>
+
+ <div class="list-group">
+ <a href="/absences" class="list-group-item list-group-item-action">
+ <img src="/icons/absences.svg" style="margin-right:5px;"><span style="vertical-align: middle;">Absences</span>
+ </a>
+ <a href="/teachers" class="list-group-item list-group-item-action">
+ <img src="/icons/teachers.svg" style="margin-right:5px;"><span style="vertical-align: middle;">Équipe pédagogique</span>
+ </a>
+ <a href="/holidays" class="list-group-item list-group-item-action">
+ <img src="/icons/holidays.svg" style="margin-right:5px;"><span style="vertical-align: middle;">Vacances scolaires</span>
+ </a>
+ <a href="/custom" class="list-group-item list-group-item-action">
+ <img src="/icons/custom.svg" style="margin-right:5px;"><span style="vertical-align: middle;">Personalisation</span>
+ </a>
+ </div>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?>
diff --git a/menu/index.php b/menu/index.php
index 1ac010f..7713339 100755
--- a/menu/index.php
+++ b/menu/index.php
@@ -11,7 +11,9 @@ $menu = data_menu()["data"]["menu"];
?>
<div class="container">
- <br><h2><?= $title ?></h2>
+ <br>
+
+ <h2>Menu</h2>
<?php foreach ($menu as $item): if ($item["date"] / 1000 < time()): ?>
<details>
diff --git a/school/index.php b/school/index.php
index 77f6f9b..30369e5 100755
--- a/school/index.php
+++ b/school/index.php
@@ -17,7 +17,7 @@ global $_name;
<div class="container"><br><h2><?= $title ?></h2></div>
<div class="container">
- <p><i>Année scolaire <?= $data["schoolYear"] ?></i></p>
+ <p>Année scolaire <?= $data["schoolYear"] ?></p>
<?php foreach ($user["establishmentsInfo"] as $establishment): ?>
<b>
@@ -39,8 +39,7 @@ global $_name;
Classes : <?= implode(", ", $user["studentClass"]) ?><br>
Groupes : <?= implode(", ", array_map(function ($i) {
return $i["name"];
- }, $user["groups"])) ?><br>
- Identifiant Nots : <code><?= $_userID ?></code>
+ }, $user["groups"])) ?>
</p>
</div>
diff --git a/timetable/index.php b/timetable/index.php
index 869a26f..38e6b6e 100755
--- a/timetable/index.php
+++ b/timetable/index.php
@@ -1,6 +1,6 @@
<?php
-$title = "Emploi du temps";
+$title = "Cours";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
@@ -12,7 +12,19 @@ $timetable = data_timetable()["data"]["timetable"];
<div class="container">
<br>
- <h2><?= $title ?></h2>
+ <h2>Cours</h2>
+
+ <div class="dropdown">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
+ Emploi du temps
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item disabled" href="#">Emploi du temps</a></li>
+ <li><a class="dropdown-item" href="/content">Contenus</a></li>
+ <li><a class="dropdown-item" href="/homework">Devoirs</a></li>
+ <li><a class="dropdown-item" href="/files">Fichiers</a></li>
+ </ul>
+ </div>
<table>
<?php $day = null; $lastEnd = null; $index = 0; foreach ($timetable as $lesson): $newDay = false; if ($lesson["to"] / 1000 > time()): ?>