diff -urN cahier-de-prepa6.0.0/agenda.php cahier-de-prepa6.1.0/agenda.php
--- cahier-de-prepa6.0.0/agenda.php	2016-08-30 17:00:12.228710776 +0200
+++ cahier-de-prepa6.1.0/agenda.php	2016-10-01 23:26:29.713892510 +0200
@@ -268,6 +268,7 @@
 
 FIN;
 }
+echo "  </div>\n";
 
 if ( $edition ) {
   // Récupération des types d'événement
diff -urN cahier-de-prepa6.0.0/ajax.php cahier-de-prepa6.1.0/ajax.php
--- cahier-de-prepa6.0.0/ajax.php	2016-08-30 15:04:22.420328143 +0200
+++ cahier-de-prepa6.1.0/ajax.php	2017-08-25 03:29:03.302921678 +0200
@@ -439,7 +439,7 @@
               if ( $champ == 'titre' )
                 recent($mysqli,1,$id,$r['mat'],array('titre'=>( strlen($valeur) ? $valeur : 'Information')));
               else
-                recent($mysqli,1,$id,array('texte'=>$valeur));
+                recent($mysqli,1,$id,$r['mat'],array('texte'=>$valeur));
             }
           }
           else
@@ -1345,7 +1345,7 @@
                 $m .= "<br>Ligne $i : ok ($prenom $nom, identifiant $login)";
                 $n = $n+1;
                 if ( $mail )  {
-                  $lien = ( $https ? 'https' : 'http' )."://$site/connexion?reponseinvitation&mail=$mail&p=".sha1($site.$mdp.$mail);
+                  $lien = ( $https ? 'https' : 'http' )."://$site/connexion?reponseinvitation&mail=".str_replace('@','ø',$mail).'&p='.sha1($site.$mdp.$mail);
                   // Récupération de l'adresse électronique du professeur connecté
                   $resultat = $mysqli->query("SELECT mail FROM utilisateurs WHERE id = ${_SESSION['id']}");
                   $s = $resultat->fetch_row();
@@ -1545,7 +1545,7 @@
             $nom = substr((str_replace(array($r['ext'],'\\','/'),array('','-','-'),$valeur)),0,100);
             // real_escape_string seulement pour la requête SQL
             $nouveau_nom = $mysqli->real_escape_string($nom);
-            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = \'".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
+            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = '".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
               exec('mv documents/'.escapeshellarg("${r['lien']}/${r['nom']}${r['ext']}").' documents/'.escapeshellarg("${r['lien']}/$nom${r['ext']}"));
               $message = '{"etat":"ok","message":"Nom du document modifié"}';
               $mysqli->query('ALTER TABLE docs ORDER BY parents,nom_nat');
@@ -1568,7 +1568,7 @@
           if ( $nom != $r['nom'] )  {
             // real_escape_string seulement pour la requête SQL
             $nouveau_nom = $mysqli->real_escape_string($nom);
-            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = \'".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
+            if ( requete('docs',"UPDATE docs SET nom = '$nouveau_nom', nom_nat = '".zpad($nouveau_nom)."' WHERE id = $id",$mysqli) )  {
               exec('mv documents/'.escapeshellarg("${r['lien']}/${r['nom']}${r['ext']}").' documents/'.escapeshellarg("${r['lien']}/$nom${r['ext']}"));
               $message[] = 'Nom du document modifié';
               // Modification de l'éventuelle information récente
@@ -1648,7 +1648,7 @@
               $taille = intval($_FILES['fichier']['size']/1024);
               $taille = ( $taille < 1024 ) ? "$taille&nbsp;ko" : intval($taille/1024).'&nbsp;Mo';
               // Modifications dans la base de données
-              requete('docs',"UPDATE docs SET upload = DATE(NOW()), taille = '$taille' WHERE id = $id",$mysqli);
+              requete('docs',"UPDATE docs SET upload = CURDATE(), taille = '$taille' WHERE id = $id",$mysqli);
               // Info récente si document visible (éventuellement nouvelle)
               if ( $protection < 5 )  {
                 // Besoin du chemin si pas d'info récente liée au document
@@ -1711,7 +1711,7 @@
         if ( move_uploaded_file($_FILES['fichier']['tmp_name'],"documents/$lien/$nom$ext") )  {
           // Écriture MySQL
           if ( requete('docs',"INSERT INTO docs SET parent = $parent, parents = '${r['parents']},$parent',
-                               matiere = ${r['matiere']}, nom = '".$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."', upload = DATE(NOW()),
+                               matiere = ${r['matiere']}, nom = '".$mysqli->real_escape_string($nom).'\', nom_nat = \''.zpad($mysqli->real_escape_string($nom))."', upload = CURDATE(),
                                taille = '$taille', lien = '$lien', ext='".$mysqli->real_escape_string($ext)."', protection = $protection",$mysqli) )  {
             $id = $mysqli->insert_id;
             $message = $_SESSION['message'] = '{"etat":"ok","message":"Document ajouté"}';
@@ -1880,8 +1880,18 @@
     // validation préliminaire
     elseif ( isset($_REQUEST['type']) && isset($_REQUEST['matiere']) && isset($_REQUEST['debut']) && isset($_REQUEST['fin']) && ( ctype_digit($tid = $_REQUEST['type']) ) && ( ctype_digit($mid = $_REQUEST['matiere']) ) )  {
       // Validation des dates
-      $debut = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',( strlen($_REQUEST['debut']) > 14 ) ? $_REQUEST['debut'] : $_REQUEST['debut'].' 0h00');
-      $fin = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',( strlen($_REQUEST['fin']) > 14 ) ? $_REQUEST['fin'] : $_REQUEST['fin'].' 0h00');
+      $debut = $_REQUEST['debut'];
+      if ( strlen($debut) == 10 )
+        $debut .= ' 00h00';
+      elseif ( strlen($debut) == 15 )
+        $debut = substr($debut,0,11).'0'.substr($debut,11);
+      $fin = $_REQUEST['fin'];
+      if ( strlen($fin) == 10 )
+        $fin .= ' 00h00';
+      elseif ( strlen($fin) == 15 )
+        $fin = substr($fin,0,11).'0'.substr($fin,11);
+      $debut = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',$debut);
+      $fin = preg_filter('/(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2})h(\d{2})/','$3-$2-$1 $4:$5',$fin);
       if ( is_null($debut) || is_null($fin) || ( $debut > $fin ) )
         $message = '{"etat":"nok","message":"Les dates/heures choisies ne sont pas valables."}';
       else  {
@@ -2020,13 +2030,13 @@
           }
           // Seulement nouvel horaire : rattrapage de colle
           elseif ( !strlen($ancien_sql) && strlen($nouveau_sql) )  {
-            $validation = " '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,60)";
+            $validation = " '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,80)";
             $texte .= " est rattrapée le $nouveau".(( strlen($_REQUEST['salle']) ) ? ' en salle '.$mysqli->real_escape_string($_REQUEST['salle']) : '').'.';
             $insertion = "($matiere,2,'$nouveau_sql','$nouveau_sql','<p>$texte</p>')";
           }
           // Ancien et nouvel horaires : déplacement de colle
           else  {
-            $validation = " '$ancien_sql' BETWEEN debut AND ADDDATE(debut,60) AND '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,60)";
+            $validation = " '$ancien_sql' BETWEEN debut AND ADDDATE(debut,80) AND '$nouveau_sql' BETWEEN debut AND ADDDATE(debut,80)";
             $texte .= " est déplacée du $ancien au $nouveau".(( strlen($_REQUEST['salle']) ) ? ' en salle '.$mysqli->real_escape_string($_REQUEST['salle']) : '').'.';
             $insertion = "($matiere,1,'$ancien_sql','$ancien_sql','<p>$texte</p>'),($matiere,2,'$nouveau_sql','$nouveau_sql','<p>$texte</p>')";
           }
diff -urN cahier-de-prepa6.0.0/CHANGELOG.php cahier-de-prepa6.1.0/CHANGELOG.php
--- cahier-de-prepa6.0.0/CHANGELOG.php	2016-08-30 18:32:07.947297752 +0200
+++ cahier-de-prepa6.1.0/CHANGELOG.php	2017-08-25 00:56:49.635069812 +0200
@@ -1,4 +1,4 @@
-Version actuelle : 6.0.0 (30/08/16)
+Version actuelle : 6.1.0 (25/08/17)
 ===================
 Changements :
 1.0   31/08/11 Première version
@@ -193,30 +193,45 @@
   * Flux RSS multiples et personnalisés
   * Améliorations des enregistrements des informations récentes
   * Améliorations et uniformisations d'affichage
+6.1.0 25/08/17 Correction de bug : problème des invitations (liens avec @)
+  * Nouvelle version du planning annuel pour 2017-2018
+  * La version 7 viendra courant septembre.
 
 ===================
 
 Todo :
 
-[ 6.1 ] Novembre 2016
-  * FAQ
-  * Affichage des événements uniquement si la matière concerne le visiteur
-  * Protection individuelle des événements, possibilité de cacher/montrer
-  * Mails : ajouts de liens
-  * Validations/suppressions multiples d'utilisateurs
+[ 7.0 ] Septembre 2017
+  * Modification complète des envois de mails et mise en place d'un système de forum.
+  * Possibilité pour les élèves de contacter professeurs et colleurs si autorisé.
+  * Gestion des accès entièrement revue
+  * Création d'un nouveau type d'utilisateur : administration
+  * Possibilité de modifier le type d'un utilisateur existant
+  * Gestion des utilisateurs
+    * Validations/suppressions multiples d'utilisateurs
+    * Possibilité de "désactiver" un compte sans le supprimer, pour les élèves partis en cours d'année
   * Protection individuelle des informations
-  * Recherche dans les événements
-  * Agenda : vue sous forme de liste d'événements
+  * Améliorations de l'agenda
+    * Possibilité de montrer/cacher un événement
+    * Protection individuelle des événements
+    * Possibilité de lier des événements à des personnes précises
+    * Améliorations générales de l'ergonomie
+    * Vue de l'agenda sous forme de liste d'événements
+    * Recherche dans les événements
   * Raccourcis cdt : texte pré-défini
-  * Types cdt : suppression massive (idem pages)
+  * FAQ
 
-[ 6.2 ] Février 2017
-  * Récupération des documents/données
+[ 7.1 ] Janvier 2018
+  * Timeout revu. Connexion automatique sans mot de passe pour les pages sans danger.
+  * Système de récupération des données/documents
   * Paramétrage des styles pour les titres, des couleurs
-  * Assouplissement de la correction automatique des textarea
+  * Modification globale des répertoires ou matières : répercution sur les information récentes
   * Notes : gestions de modifications de personnes, matières
 
+=======
+
 Autres remarques / propositions :
+  * Types cdt : suppression massive (idem pages)
   * Préférences globales : création de compte, protection globale, 
   * Suppressions (modifications ?) multiples de documents/informations
   * Tags dans les cahiers de texte
@@ -231,10 +246,8 @@
   * meilleure compréhension des visibilités dans le menu
   * notes : garder des notes malgré suppression de l'association colleur/matière ou élève/matière (changement de matière, Y PCSI)
   * notes : savoir combien de notes sont attribuées à un compte avant suppression (gestion des doublons)
-  * mail : possibilité d'envoi par les élèves ; paramétrage côté prof/colleurs pour ne pas recevoir
   * news : date de création, date de mise à jour ?
   * modification de docs par les élèves
   * modification d'items de l'agenda par les élèves
   * ajout de la possibilité d'envoi de notification à chaque saisie de document/information/programme de colle
   * prévention javascript de changement de page en cours d'édition
-
diff -urN cahier-de-prepa6.0.0/connexion.php cahier-de-prepa6.1.0/connexion.php
--- cahier-de-prepa6.0.0/connexion.php	2016-07-21 23:13:31.397494588 +0200
+++ cahier-de-prepa6.1.0/connexion.php	2017-08-25 00:47:53.657017642 +0200
@@ -18,7 +18,7 @@
 /////////////////////////////////////////////////////////////////////
 
 // Oubli d'identifiant
-if ( isset($_REQUEST['oublimdp']) && isset($_REQUEST['mail']) && strlen($mail = $_REQUEST['mail']) )  {
+if ( isset($_REQUEST['oublimdp']) && isset($_REQUEST['mail']) && strlen($mail = str_replace('ø','@',$_REQUEST['mail'])) )  {
 
   // Recherche de l'adresse électronique dans la base de données
   $resultat = $mysqli->query('SELECT id, login, mail, mdp FROM utilisateurs WHERE LENGTH(mail)');
@@ -60,7 +60,7 @@
     // On ajoute 15 minutes au temps utilisé :
     // de xh00 à xh45, on a jusqu'à (x+1)h, de xh45 à (x+1)h on a jusqu'à (x+2)h
     $t = time() + 900;
-    $lien = ( $https ? 'https' : 'http' )."://$site/connexion?oublimdp&mail=$mail&p=".sha1($site.date('Y-m-d-H',$t).$utilisateur['mdp']);
+    $lien = ( $https ? 'https' : 'http' )."://$site/connexion?oublimdp&mail=".str_replace('@','ø',$mail).'&p='.sha1($site.date('Y-m-d-H',$t).$utilisateur['mdp']);
     $s = strstr($site.'/','/',true);
     if ( !isset($mailadmin) )  $mailadmin = 'admin@cahier-de-prepa.fr';
     mail($mail,'=?UTF-8?B?'.base64_encode('[Cahier de Prépa] Changement de mot de passe').'?=',
@@ -92,7 +92,7 @@
   $resultat = $mysqli->query('SELECT id FROM utilisateurs WHERE LENGTH(mdp) = 0');
   if ( $creationinterdite = $resultat->num_rows )
     $resultat->free();
-  elseif ( isset($_REQUEST['mail']) && strlen($mail = strtolower(trim($_REQUEST['mail']))) )  {
+  elseif ( isset($_REQUEST['mail']) && strlen($mail = str_replace('ø','@',strtolower(trim($_REQUEST['mail'])))) )  {
     // Vérifications
     if ( !filter_var($mail,FILTER_VALIDATE_EMAIL) )  {
       $mysqli->close();
@@ -183,7 +183,7 @@
       // On ajoute 15 minutes au temps utilisé : de xh00 à xh45,
       // on a jusqu'à (x+1)h, de xh45 à (x+1)h on a jusqu'à (x+2)h
       $t = time() + 900;
-      $lien = ( $https ? 'https' : 'http' )."://$site/connexion?creationcompte&mail=$mail&p=".sha1($site.$mdp.date('Y-m-d-H',$t).$mail);
+      $lien = ( $https ? 'https' : 'http' )."://$site/connexion?creationcompte&mail=".str_replace('@','ø',$mail).'&p='.sha1($site.$mdp.date('Y-m-d-H',$t).$mail);
       if ( !isset($mailadmin) )  $mailadmin = 'admin@cahier-de-prepa.fr';
       mail($mail,'=?UTF-8?B?'.base64_encode('[Cahier de Prépa] Création de compte').'?=',
 'Bonjour
@@ -207,7 +207,7 @@
 }
 
 // Réponse à une invitation
-elseif ( isset($_REQUEST['reponseinvitation']) && isset($_REQUEST['mail']) && strlen($mail = $_REQUEST['mail']) && isset($_REQUEST['p']) && ( $_REQUEST['p'] == sha1($site.$mdp.$mail) ) )  {
+elseif ( isset($_REQUEST['reponseinvitation']) && isset($_REQUEST['mail']) && strlen($mail = str_replace('ø','@',$_REQUEST['mail'])) && isset($_REQUEST['p']) && ( $_REQUEST['p'] == sha1($site.$mdp.$mail) ) )  {
   // Recherche de l'adresse électronique dans la base de données
   $resultat = $mysqli->query('SELECT id, login, mail, LENGTH(mdp) AS lmdp FROM utilisateurs WHERE LENGTH(mail)');
   while ( $r = $resultat->fetch_assoc() )
diff -urN cahier-de-prepa6.0.0/css/style.css cahier-de-prepa6.1.0/css/style.css
--- cahier-de-prepa6.0.0/css/style.css	2016-08-30 14:51:42.652649986 +0200
+++ cahier-de-prepa6.1.0/css/style.css	2016-09-09 11:08:48.337403096 +0200
@@ -179,6 +179,7 @@
  
 /* Édition : formulaires */
 input, select, textarea { box-sizing: border-box; -webkit-box-sizing: border-box; border: 1px solid; border-radius: 2px; padding: 0 0.3em; }
+#fichier { border: none; font-size: 0.8em; height: 1.9em; }
 p.ligne { padding: 0; clear: right; }
 .ligne label { font-weight: 700; }
 .ligne input, .ligne select, .ligne code { width: 65%; float: right; margin-top: -0.1em; margin-left: 0.2em; line-height: 1em; height: 1.5em; box-sizing: border-box; }
@@ -245,6 +246,7 @@
 
 /* Pour l'impression */
 @media print {
+  body { font-size: 90%; font-family:Serif; }
   #colonne, #recherchecolle, #recherchecdt, #rechercheagenda, [id^="aide-"], [id^="form-"], footer, a[class^="icon-"] { display: none; }
   .editable, .titrecdt.edition, form.titrecdt, .editabledest { border: none; }
   h1 { font-size: 1.7em; text-align: center; margin: 0; padding: 0 0 1em; }
diff -urN cahier-de-prepa6.0.0/css/style.min.css cahier-de-prepa6.1.0/css/style.min.css
--- cahier-de-prepa6.0.0/css/style.min.css	2016-08-30 18:10:54.730794496 +0200
+++ cahier-de-prepa6.1.0/css/style.min.css	2016-09-09 11:11:06.778955925 +0200
@@ -1 +1 @@
-html,body{height:100%}body{font-size:100%;font-family:Arial,Helvetica,sans-serif;position:relative;width:100%;margin:0 auto;max-width:1500px;background-color:#f6f6f6}h1{font-size:2.2em;text-align:center;margin:0;padding:1em 2em}h2{font-size:1.8em;margin:1em 0 .8em;padding:0}h3{font-size:1.5em;margin:1em 0 .5em;padding:0 1% 0}h4{font-size:1.3em;margin:.5em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}ul{margin:.5em 0;padding:0 2% 0 6%}p{margin:0;padding:0 2%}p+p{margin-top:.5em}div,form{margin:0;padding:0}img{border:0;max-width:100%}div,p,section,article{text-align:justify}article>*:first-child{margin-top:0}article>*:last-child{margin-bottom:0}section>h2:first-child{margin-top:0}@media screen and (min-width:800px){#colonne{width:280px;float:left;margin:0 30px 3em}nav{margin:0;padding:1em 20px .7em}.icon-menu,.icon-recent{display:none}#recent{margin-top:1.5em;padding:1em 20px}section{position:relative;margin:0 30px 0 340px;padding:0 0 3em}header+section{width:96%;margin:0 auto;max-width:1500px;text-align:center}footer{font-size:.8em}}@media screen and (max-width:800px){h1{font-size:1.8em;padding:.3em 3em}h2{font-size:1.65em}#colonne,nav,#recent{display:none}#colonne.visible{display:block}nav.visible,#recent.visible{display:block;position:fixed;z-index:10;top:3.3em;left:.5em;padding:1em 20px .7em;width:80%;min-width:200px;max-width:280px;max-height:70%;overflow:auto;box-shadow:.5em .5em .5em #777;-moz-box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}.icon-menu,.icon-recent{position:fixed;z-index:10;top:.8em;left:.5em;font-size:1.2em;cursor:pointer}.icon-recent{left:2.5em}section{position:relative;width:96%;margin:0 2%;padding:0 0 3em}header+section{text-align:center}footer{font-size:.6em}}article{margin:1em 0;padding:1em 2%;background-color:#cdd5e4}article:first-child,.general+article{margin-top:0!important}footer{text-align:center;width:90%;padding:1em 5%;clear:both;position:fixed;left:0;bottom:0;z-index:15;border-top:1px solid black;background-color:#DDD;opacity:.97;filter:alpha(opacity=97)}.pdf{height:0;width:100%;overflow:hidden;position:relative}.portrait{padding-bottom:138%}.paysage{padding-bottom:74%}.hauteur50{padding-bottom:50%}.pdf object{position:absolute}.warning{text-align:center;width:50%;margin:1em auto;padding:.5em 3%}.annonce{margin:1em 3%;padding:.5em 4%}.note{margin:.5em 2%;padding:0 4%}.warning,.annonce{color:#ba0d1f;border:2px solid #ba0d1f}.note{color:#ba0d1f}.oubli{font-size:.8em;text-align:center}.oubli a{text-decoration:none;color:#333}p.titrecdt{text-align:right;text-decoration:underline}.titrecdt.edition{text-align:left;text-decoration:none;padding-right:1%}.topbarre{height:1.5em;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}h1 span{font-size:70%;vertical-align:7%;margin-left:.4em}#recherchecdt a,#recherchecolle a,#rechercheagenda a{float:none!important;margin-left:.5em}#rechercheagenda a{vertical-align:sub}.topbarre select#semaines{margin-left:1.3em;width:8.5em;height:1.7em}.topbarre select#seances{margin-left:1.3em;width:11em;height:1.7em}.topbarre input{position:absolute;margin:0 .8em 0 1.5em;padding-left:1.8em;width:-moz-available;height:1.7em}.topbarre span{position:relative;left:1.9em;cursor:pointer;top:.1em}@media screen and (max-width:980px) and (min-width:800px),screen and (max-width:600px){#recherchecdt input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}#recherchecdt span{left:1.3em}}@media screen and (max-width:450px){#recherchecdt a,#recherchecdt select{margin-left:.3em!important}#recherchecdt input{margin-left:.3em}#recherchecdt select{width:6em!important}#recherchecdt span{left:.3em}}@media screen and (max-width:400px){#recherchecolle a,#recherchecolle select{margin-left:.3em!important}#recherchecolle input{margin-left:0!important}#recherchecolle select{width:6em}#recherchecolle span{left:.3em}}@media screen and (max-width:350px){#recherchecolle input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}}@media screen and (-webkit-min-device-pixel-ratio:0){.topbarre{height:1.4em;vertical-align:bottom}#recherchecolle input{width:40%}.topbarre span{top:.2em}#recherchecdt a,#recherchecolle a{vertical-align:middle}}#parentsdoc{margin-bottom:1.5em;padding:.3em 2% 0}#parentsdoc *{padding-top:0}#parentsdoc span{position:static;cursor:auto}.rep,.doc{padding:0;margin-left:2%;margin-right:2%;border-bottom:1px dotted #BBB}.repcontenu,.docdonnees{float:right;font-size:.8em;padding-top:.2em;padding-left:.5em}#parentsdoc a,.rep a,.doc a{text-decoration:none;color:black}#parentsdoc .nom,.rep .nom,.doc .nom{font-weight:700;margin-left:.5em}.general{position:absolute;top:-4.1em;right:1em}.general+.general{right:2.2em}.general+.general+.general{right:3.4em}.general+.general+.general+.general{right:4.6em}.edition{display:inline;text-align:left;padding-right:3em}h3.edition.editable{padding-right:1%}.edition ~ div,.edition+p,.edition ~ form{margin-top:.75em}article.cache{background-color:#AAA;opacity:.6;filter:alpha(opacity=60)}#log{position:fixed;top:3%;left:3%;padding:.3em 2%;z-index:20;margin-right:3%}.ok{background-color:#EFE;color:#090;border:1px solid #090}.nok{background-color:#FEE;color:#D00;border:1px solid #D00}.ok span{color:#090}.nok span{color:#D00}#log span{cursor:pointer;position:relative;right:-0.8em;top:.1em}#fenetre_fond{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.2;filter:alpha(opacity=20);z-index:12}#fenetre{position:fixed;left:50%;z-index:14;padding:0 2%;overflow:auto;background-color:#e7eefe;opacity:.97;filter:alpha(opacity=97);box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}#fenetre>*:last-child{margin-bottom:1em}@media screen and (min-width:800px){#fenetre{top:10%;width:70%;margin-left:-37%;max-height:80%}}@media screen and (max-width:800px){.general{top:-2.2em}#fenetre{top:4%;width:92%;margin-left:-48%;max-height:92%}}#fenetre a[class^="icon-"]{margin-top:1.5em}#fenetre hr{margin:1.5em 0}#epingle{margin-top:1.5em}#epingle h3{padding-left:0}[id^="aide-"],[id^="form-"]{display:none}#fenetre [name="titre"]{margin:2em 0 1em}#fenetre [name="titre"]+*{display:inline}form.titrecdt{padding:.2em 0 .5em;margin-top:.2em}.suppression{text-align:center}#fenetre.usermat h3{margin-bottom:0}#fenetre.usermat a.icon-ajoute,#fenetre a.icon-supprime{margin-top:.8em}#fenetre.usermat .ligne,#fenetre.usergrp .ligne{border-bottom:1px dotted #BBB}#fenetre.usermat input,#fenetre.usergrp input{margin-top:.2em}#fenetre th+th,#fenetre td+td{text-align:center;width:2em;padding:.15em}#fenetre th a{float:none}#fenetre th{border:none!important}#fenetre td{border-top:none!important;border-left:none!important;border-right:none!important;border-bottom:1px dotted #BBB!important}#planning{text-align:center}.labelchecked{color:#999}#planning tr:hover,#utilisateurs tr:hover,#notes tr:hover,.usergrp .ligne:hover,.usermat .ligne:hover{background-color:#EFF}input,select,textarea{box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid;border-radius:2px;padding:0 .3em}p.ligne{padding:0;clear:right}.ligne label{font-weight:700}.ligne input,.ligne select,.ligne code{width:65%;float:right;margin-top:-0.1em;margin-left:.2em;line-height:1em;height:1.5em;box-sizing:border-box}.ligne input[type="checkbox"],.ligne input[type="radio"]{width:1em;margin-top:.2em}input.ligne{width:100%;margin-bottom:.5em;line-height:1em;height:1.5em;display:block}.supprmultiple{margin-top:.3em;margin-bottom:0!important}.usermat{margin-top:.5em;padding:0;clear:right}.usermat a{padding:0!important}table{width:100%;margin:1em 0;border-collapse:collapse;border:medium solid #999}table td{padding:.15em .5%}table th{padding:.15em 3%}table td,table th{border:thin solid #AAA!important}table td .icon-edite{float:left!important;margin:0 .2em 0 .1em}div.placeholder:before{content:attr(data-placeholder);color:#AAA;margin-left:4px;z-index:12}span.placeholder{color:#AAA;position:absolute;margin:.25em 2.5% 0 5px;z-index:12;font-size:.8em}p.ligne span.placeholder{left:35%;margin-top:.1em;margin-left:1em}#fenetre span.placeholder,#fenetre div.placeholder:before{z-index:15}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:1px dotted #BBB;position:relative}.editable a[class^="icon-"],p.titrecdt a[class^="icon-"],.editabledest a[class^="icon-"]{float:none}.avecform{padding:0;border:none!important}h3.editable a[class^="icon-"],h3 span.editable a[class^="icon-"]{font-weight:500;font-size:.67em;padding-top:.1em}h3.avecform span{font-weight:500;font-size:.6em;margin-top:.5em;width:80%;overflow:hidden;white-space:nowrap}h3.avecform input{width:50%}textarea{width:100%;margin:0 0 .2em}textarea+div{min-height:6em;border:1px dotted #CCC;background-color:#FFF}.boutons{clear:right;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}.boutons button{cursor:default;background-color:transparent;border-top:0;border-left:none;border-bottom:1px solid #BBB;border-right:1px solid #BBB;height:1.5em;font-size:100%;width:2em}.boutons button+button{margin-left:-0.2em}div.editable a[class^="icon-"]{position:absolute;right:3px;top:0}div.editable a.icon-annule{top:1.5em}div.edithtml a.icon-ok{top:1.6em}div.edithtml a.icon-annule{top:3.1em}nav,#recent{background-color:#99b3e5}nav a[class^="icon-"]{float:none!important;display:inline!important;margin:.5em 3% 1em;color:#001030}nav a{display:block;margin-bottom:.2em;padding:0;text-decoration:none;color:#002877}nav a:hover{color:#CDF}nav h3{font-size:1.2em;margin:.5em 3% .1em;padding-top:.3em;color:#001030;border-top:1px solid #001030}nav hr{margin:.5em 3% .5em;color:#001030;border-top:1px solid #001030;border-bottom:0}nav a.menurep{padding-left:3%;font-size:.9em}#actuel{font-style:italic}nav h3 span{font-weight:500;font-size:.83em;margin-right:.2em;color:#001030!important}#recent a{display:block;margin-bottom:.4em;padding:0;text-decoration:none;color:#002877;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#recent a span{color:#002877}#recent h3{font-size:1.2em;margin:0 3% .5em;color:#001030}th.semaines{vertical-align:bottom;padding:1.6em 0;text-align:center}td.semaines{padding-bottom:1em!important;vertical-align:bottom;text-align:center;padding:.2em 5px}td.semaines span{display:block;font-weight:700;margin:0;padding:0;width:1.2em;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);white-space:nowrap;zoom:1}td.pasnote{font-style:italic;text-align:center}.collsel{font-weight:700}.collnosel,.dejanote{color:#AAA}#recherchenote{padding:0 1em}#notes td+td{text-align:right}@media print{#colonne,#recherchecolle,#recherchecdt,#rechercheagenda,[id^="aide-"],[id^="form-"],footer,a[class^="icon-"]{display:none}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:0}h1{font-size:1.7em;text-align:center;margin:0;padding:0 0 1em}h2{font-size:1.5em;margin:.7em 0;padding:0}h3{font-size:1.35em;margin:.6em 0;padding:0 1% 0}h4{font-size:1.2em;margin:.4em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}article{border:1px solid #999}}#calendrier{margin-top:1em}#calendrier table{table-layout:fixed}#semaine,.semaine-bg,.evenements{margin:0}#semaine{font-weight:900;text-align:center}#semaine th{overflow:hidden;text-overflow:clip}.semaine-bg{border-top:0;position:absolute;z-index:1}.autremois{background-color:#e7eefe;color:#002877}#aujourdhui{background-color:#99b3e5}.evenements{position:relative;z-index:2;border-top:0;border-bottom:0}.evenements thead{border-bottom:1px solid #999}.evenements th{padding:.15em .5%;text-align:right}.evenements td{padding:2px 3px 1px;border:none!important}.evnmt{padding:1px 3px;border-radius:5px;white-space:nowrap;overflow:hidden;font-size:.8em;cursor:pointer}.evnmt_suivi{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-2px}.evnmt_suite{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-3px}
\ No newline at end of file
+html,body{height:100%}body{font-size:100%;font-family:Arial,Helvetica,sans-serif;position:relative;width:100%;margin:0 auto;max-width:1500px;background-color:#f6f6f6}h1{font-size:2.2em;text-align:center;margin:0;padding:1em 2em}h2{font-size:1.8em;margin:1em 0 .8em;padding:0}h3{font-size:1.5em;margin:1em 0 .5em;padding:0 1% 0}h4{font-size:1.3em;margin:.5em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}ul{margin:.5em 0;padding:0 2% 0 6%}p{margin:0;padding:0 2%}p+p{margin-top:.5em}div,form{margin:0;padding:0}img{border:0;max-width:100%}div,p,section,article{text-align:justify}article>*:first-child{margin-top:0}article>*:last-child{margin-bottom:0}section>h2:first-child{margin-top:0}@media screen and (min-width:800px){#colonne{width:280px;float:left;margin:0 30px 3em}nav{margin:0;padding:1em 20px .7em}.icon-menu,.icon-recent{display:none}#recent{margin-top:1.5em;padding:1em 20px}section{position:relative;margin:0 30px 0 340px;padding:0 0 3em}header+section{width:96%;margin:0 auto;max-width:1500px;text-align:center}footer{font-size:.8em}}@media screen and (max-width:800px){h1{font-size:1.8em;padding:.3em 3em}h2{font-size:1.65em}#colonne,nav,#recent{display:none}#colonne.visible{display:block}nav.visible,#recent.visible{display:block;position:fixed;z-index:10;top:3.3em;left:.5em;padding:1em 20px .7em;width:80%;min-width:200px;max-width:280px;max-height:70%;overflow:auto;box-shadow:.5em .5em .5em #777;-moz-box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}.icon-menu,.icon-recent{position:fixed;z-index:10;top:.8em;left:.5em;font-size:1.2em;cursor:pointer}.icon-recent{left:2.5em}section{position:relative;width:96%;margin:0 2%;padding:0 0 3em}header+section{text-align:center}footer{font-size:.6em}}article{margin:1em 0;padding:1em 2%;background-color:#cdd5e4}article:first-child,.general+article{margin-top:0!important}footer{text-align:center;width:90%;padding:1em 5%;clear:both;position:fixed;left:0;bottom:0;z-index:15;border-top:1px solid black;background-color:#DDD;opacity:.97;filter:alpha(opacity=97)}.pdf{height:0;width:100%;overflow:hidden;position:relative}.portrait{padding-bottom:138%}.paysage{padding-bottom:74%}.hauteur50{padding-bottom:50%}.pdf object{position:absolute}.warning{text-align:center;width:50%;margin:1em auto;padding:.5em 3%}.annonce{margin:1em 3%;padding:.5em 4%}.note{margin:.5em 2%;padding:0 4%}.warning,.annonce{color:#ba0d1f;border:2px solid #ba0d1f}.note{color:#ba0d1f}.oubli{font-size:.8em;text-align:center}.oubli a{text-decoration:none;color:#333}p.titrecdt{text-align:right;text-decoration:underline}.titrecdt.edition{text-align:left;text-decoration:none;padding-right:1%}.topbarre{height:1.5em;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}h1 span{font-size:70%;vertical-align:7%;margin-left:.4em}#recherchecdt a,#recherchecolle a,#rechercheagenda a{float:none!important;margin-left:.5em}#rechercheagenda a{vertical-align:sub}.topbarre select#semaines{margin-left:1.3em;width:8.5em;height:1.7em}.topbarre select#seances{margin-left:1.3em;width:11em;height:1.7em}.topbarre input{position:absolute;margin:0 .8em 0 1.5em;padding-left:1.8em;width:-moz-available;height:1.7em}.topbarre span{position:relative;left:1.9em;cursor:pointer;top:.1em}@media screen and (max-width:980px) and (min-width:800px),screen and (max-width:600px){#recherchecdt input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}#recherchecdt span{left:1.3em}}@media screen and (max-width:450px){#recherchecdt a,#recherchecdt select{margin-left:.3em!important}#recherchecdt input{margin-left:.3em}#recherchecdt select{width:6em!important}#recherchecdt span{left:.3em}}@media screen and (max-width:400px){#recherchecolle a,#recherchecolle select{margin-left:.3em!important}#recherchecolle input{margin-left:0!important}#recherchecolle select{width:6em}#recherchecolle span{left:.3em}}@media screen and (max-width:350px){#recherchecolle input{display:none;top:1.8em;padding-left:.1em;right:2em;margin-left:2em!important}}@media screen and (-webkit-min-device-pixel-ratio:0){.topbarre{height:1.4em;vertical-align:bottom}#recherchecolle input{width:40%}.topbarre span{top:.2em}#recherchecdt a,#recherchecolle a{vertical-align:middle}}#parentsdoc{margin-bottom:1.5em;padding:.3em 2% 0}#parentsdoc *{padding-top:0}#parentsdoc span{position:static;cursor:auto}.rep,.doc{padding:0;margin-left:2%;margin-right:2%;border-bottom:1px dotted #BBB}.repcontenu,.docdonnees{float:right;font-size:.8em;padding-top:.2em;padding-left:.5em}#parentsdoc a,.rep a,.doc a{text-decoration:none;color:black}#parentsdoc .nom,.rep .nom,.doc .nom{font-weight:700;margin-left:.5em}.general{position:absolute;top:-4.1em;right:1em}.general+.general{right:2.2em}.general+.general+.general{right:3.4em}.general+.general+.general+.general{right:4.6em}.edition{display:inline;text-align:left;padding-right:3em}h3.edition.editable{padding-right:1%}.edition ~ div,.edition+p,.edition ~ form{margin-top:.75em}article.cache{background-color:#AAA;opacity:.6;filter:alpha(opacity=60)}#log{position:fixed;top:3%;left:3%;padding:.3em 2%;z-index:20;margin-right:3%}.ok{background-color:#EFE;color:#090;border:1px solid #090}.nok{background-color:#FEE;color:#D00;border:1px solid #D00}.ok span{color:#090}.nok span{color:#D00}#log span{cursor:pointer;position:relative;right:-0.8em;top:.1em}#fenetre_fond{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.2;filter:alpha(opacity=20);z-index:12}#fenetre{position:fixed;left:50%;z-index:14;padding:0 2%;overflow:auto;background-color:#e7eefe;opacity:.97;filter:alpha(opacity=97);box-shadow:.5em .5em .5em #777;-webkit-box-shadow:.5em .5em .5em #777}#fenetre>*:last-child{margin-bottom:1em}@media screen and (min-width:800px){#fenetre{top:10%;width:70%;margin-left:-37%;max-height:80%}}@media screen and (max-width:800px){.general{top:-2.2em}#fenetre{top:4%;width:92%;margin-left:-48%;max-height:92%}}#fenetre a[class^="icon-"]{margin-top:1.5em}#fenetre hr{margin:1.5em 0}#epingle{margin-top:1.5em}#epingle h3{padding-left:0}[id^="aide-"],[id^="form-"]{display:none}#fenetre [name="titre"]{margin:2em 0 1em}#fenetre [name="titre"]+*{display:inline}form.titrecdt{padding:.2em 0 .5em;margin-top:.2em}.suppression{text-align:center}#fenetre.usermat h3{margin-bottom:0}#fenetre.usermat a.icon-ajoute,#fenetre a.icon-supprime{margin-top:.8em}#fenetre.usermat .ligne,#fenetre.usergrp .ligne{border-bottom:1px dotted #BBB}#fenetre.usermat input,#fenetre.usergrp input{margin-top:.2em}#fenetre th+th,#fenetre td+td{text-align:center;width:2em;padding:.15em}#fenetre th a{float:none}#fenetre th{border:none!important}#fenetre td{border-top:none!important;border-left:none!important;border-right:none!important;border-bottom:1px dotted #BBB!important}#planning{text-align:center}.labelchecked{color:#999}#planning tr:hover,#utilisateurs tr:hover,#notes tr:hover,.usergrp .ligne:hover,.usermat .ligne:hover{background-color:#EFF}input,select,textarea{box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid;border-radius:2px;padding:0 .3em}#fichier{border:0;font-size:.8em;height:1.9em}p.ligne{padding:0;clear:right}.ligne label{font-weight:700}.ligne input,.ligne select,.ligne code{width:65%;float:right;margin-top:-0.1em;margin-left:.2em;line-height:1em;height:1.5em;box-sizing:border-box}.ligne input[type="checkbox"],.ligne input[type="radio"]{width:1em;margin-top:.2em}input.ligne{width:100%;margin-bottom:.5em;line-height:1em;height:1.5em;display:block}.supprmultiple{margin-top:.3em;margin-bottom:0!important}.usermat{margin-top:.5em;padding:0;clear:right}.usermat a{padding:0!important}table{width:100%;margin:1em 0;border-collapse:collapse;border:medium solid #999}table td{padding:.15em .5%}table th{padding:.15em 3%}table td,table th{border:thin solid #AAA!important}table td .icon-edite{float:left!important;margin:0 .2em 0 .1em}div.placeholder:before{content:attr(data-placeholder);color:#AAA;margin-left:4px;z-index:12}span.placeholder{color:#AAA;position:absolute;margin:.25em 2.5% 0 5px;z-index:12;font-size:.8em}p.ligne span.placeholder{left:35%;margin-top:.1em;margin-left:1em}#fenetre span.placeholder,#fenetre div.placeholder:before{z-index:15}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:1px dotted #BBB;position:relative}.editable a[class^="icon-"],p.titrecdt a[class^="icon-"],.editabledest a[class^="icon-"]{float:none}.avecform{padding:0;border:none!important}h3.editable a[class^="icon-"],h3 span.editable a[class^="icon-"]{font-weight:500;font-size:.67em;padding-top:.1em}h3.avecform span{font-weight:500;font-size:.6em;margin-top:.5em;width:80%;overflow:hidden;white-space:nowrap}h3.avecform input{width:50%}textarea{width:100%;margin:0 0 .2em}textarea+div{min-height:6em;border:1px dotted #CCC;background-color:#FFF}.boutons{clear:right;background-color:#DDD;border:1px solid #BBB;width:auto;padding:0;margin-bottom:0;border-radius:4px}.boutons button{cursor:default;background-color:transparent;border-top:0;border-left:none;border-bottom:1px solid #BBB;border-right:1px solid #BBB;height:1.5em;font-size:100%;width:2em}.boutons button+button{margin-left:-0.2em}div.editable a[class^="icon-"]{position:absolute;right:3px;top:0}div.editable a.icon-annule{top:1.5em}div.edithtml a.icon-ok{top:1.6em}div.edithtml a.icon-annule{top:3.1em}nav,#recent{background-color:#99b3e5}nav a[class^="icon-"]{float:none!important;display:inline!important;margin:.5em 3% 1em;color:#001030}nav a{display:block;margin-bottom:.2em;padding:0;text-decoration:none;color:#002877}nav a:hover{color:#CDF}nav h3{font-size:1.2em;margin:.5em 3% .1em;padding-top:.3em;color:#001030;border-top:1px solid #001030}nav hr{margin:.5em 3% .5em;color:#001030;border-top:1px solid #001030;border-bottom:0}nav a.menurep{padding-left:3%;font-size:.9em}#actuel{font-style:italic}nav h3 span{font-weight:500;font-size:.83em;margin-right:.2em;color:#001030!important}#recent a{display:block;margin-bottom:.4em;padding:0;text-decoration:none;color:#002877;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#recent a span{color:#002877}#recent h3{font-size:1.2em;margin:0 3% .5em;color:#001030}th.semaines{vertical-align:bottom;padding:1.6em 0;text-align:center}td.semaines{padding-bottom:1em!important;vertical-align:bottom;text-align:center;padding:.2em 5px}td.semaines span{display:block;font-weight:700;margin:0;padding:0;width:1.2em;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);white-space:nowrap;zoom:1}td.pasnote{font-style:italic;text-align:center}.collsel{font-weight:700}.collnosel,.dejanote{color:#AAA}#recherchenote{padding:0 1em}#notes td+td{text-align:right}@media print{body{font-size:90%;font-family:Serif}#colonne,#recherchecolle,#recherchecdt,#rechercheagenda,[id^="aide-"],[id^="form-"],footer,a[class^="icon-"]{display:none}.editable,.titrecdt.edition,form.titrecdt,.editabledest{border:0}h1{font-size:1.7em;text-align:center;margin:0;padding:0 0 1em}h2{font-size:1.5em;margin:.7em 0;padding:0}h3{font-size:1.35em;margin:.6em 0;padding:0 1% 0}h4{font-size:1.2em;margin:.4em 0 .2em;padding:0 2.5% 0}h5{font-size:1.1em;margin:.2em 0 0;padding:0 4% 0}h6{font-size:1em;margin:.2em 0 0;padding:0 5.5% 0}article{border:1px solid #999}}#calendrier{margin-top:1em}#calendrier table{table-layout:fixed}#semaine,.semaine-bg,.evenements{margin:0}#semaine{font-weight:900;text-align:center}#semaine th{overflow:hidden;text-overflow:clip}.semaine-bg{border-top:0;position:absolute;z-index:1}.autremois{background-color:#e7eefe;color:#002877}#aujourdhui{background-color:#99b3e5}.evenements{position:relative;z-index:2;border-top:0;border-bottom:0}.evenements thead{border-bottom:1px solid #999}.evenements th{padding:.15em .5%;text-align:right}.evenements td{padding:2px 3px 1px;border:none!important}.evnmt{padding:1px 3px;border-radius:5px;white-space:nowrap;overflow:hidden;font-size:.8em;cursor:pointer}.evnmt_suivi{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-2px}.evnmt_suite{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-3px}
\ No newline at end of file
diff -urN cahier-de-prepa6.0.0/def_sql.php cahier-de-prepa6.1.0/def_sql.php
--- cahier-de-prepa6.0.0/def_sql.php	2016-08-30 14:43:42.175818682 +0200
+++ cahier-de-prepa6.1.0/def_sql.php	2017-08-25 03:55:12.296954564 +0200
@@ -12,7 +12,7 @@
 DROP DATABASE IF EXISTS `$base`;
 CREATE DATABASE `$base` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 DELETE FROM mysql.user WHERE User = '$base' OR User = '$base-adm';
-INSERT INTO mysql.user (Host, User, Password) 
+INSERT INTO mysql.user (Host, User, Authentication_string) 
   VALUES ('$serveur', '$base', PASSWORD('$mdp')),
          ('$serveur', '$base-adm', PASSWORD('$mdp'));
 DELETE FROM mysql.db WHERE Db = '$base';
@@ -45,7 +45,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 CREATE TABLE `utilisateurs` (
-  `id` tinyint(2) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  `id` smallint(3) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
   `login` varchar(50) NOT NULL UNIQUE,
   `nom` varchar(50) NOT NULL,
   `prenom` varchar(50) NOT NULL,
@@ -262,38 +262,38 @@
          (7, 8, 'Jour férié', 'fer', 'CC3333'),
          (8, 9, 'Vacances', 'vac', '66CC33');
 
+INSERT INTO semaines (debut) VALUES ('2017-09-04'),('2017-09-11'),('2017-09-18'),('2017-09-25'),
+  ('2017-10-02'),('2017-10-09'),('2017-10-16'),('2017-10-23'),('2017-10-30'),('2017-11-06'),('2017-11-13'),('2017-11-20'),('2017-11-27'),
+  ('2017-12-04'),('2017-12-11'),('2017-12-18'),('2017-12-25'),('2018-01-01'),('2018-01-08'),('2018-01-15'),('2018-01-22'),
+  ('2018-01-29'),('2018-02-05'),('2018-02-12'),('2018-02-19'),('2018-02-26'),('2018-03-05'),('2018-03-12'),('2018-03-19'),('2018-03-26'),
+  ('2018-04-03'),('2018-04-09'),('2018-04-16'),('2018-04-23'),('2018-04-30'),('2018-05-07'),('2018-05-14'),('2018-05-22'),('2018-05-28'),
+  ('2018-06-04'),('2018-06-11'),('2018-06-18'),('2018-06-25'),('2018-07-02');
+UPDATE semaines SET colle = 1;
 
 INSERT INTO agenda (id,matiere,debut,fin,type,texte)
-  VALUES (1, 0, '2016-08-15 00:00:00', '2016-08-15 00:00:00', 7, '<p>Assomption</p>'),
-         (2, 0, '2016-11-01 00:00:00', '2016-11-01 00:00:00', 7, '<p>Toussaint</p>'),
-         (3, 0, '2016-11-11 00:00:00', '2016-11-11 00:00:00', 7, '<p>Armistice 1918</p>'),
-         (4, 0, '2016-12-25 00:00:00', '2016-12-25 00:00:00', 7, '<p>Noël</p>'),
-         (5, 0, '2017-01-01 00:00:00', '2017-01-01 00:00:00', 7, '<p>Jour de l''an</p>'),
-         (6, 0, '2017-04-17 00:00:00', '2017-04-17 00:00:00', 7, '<p>Pâques</p>'),
-         (7, 0, '2017-05-01 00:00:00', '2017-05-01 00:00:00', 7, '<p>Fête du travail</p>'),
-         (8, 0, '2017-05-08 00:00:00', '2017-05-08 00:00:00', 7, '<p>Armistice 1945</p>'),
-         (9, 0, '2017-05-25 00:00:00', '2017-05-25 00:00:00', 7, '<p>Ascension</p>'),
-         (10, 0, '2017-06-05 00:00:00', '2017-06-05 00:00:00', 7, '<p>Pentecôte</p>'),
-         (11, 0, '2017-07-14 00:00:00', '2017-07-14 00:00:00', 7, '<p>Fête Nationale</p>'),
-         (12, 0, '2016-07-06 00:00:00', '2016-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
-         (13, 0, '2016-10-20 00:00:00', '2016-11-02 00:00:00', 8, '<p>Vacances de la Toussaint</p>'),
-         (14, 0, '2016-12-18 00:00:00', '2017-01-02 00:00:00', 8, '<p>Vacances de Noël</p>'),
-         (15, 0, '2017-02-19 00:00:00', '2017-03-05 00:00:00', 8, '<p>Vacances d''hiver, zone A</p>'),
-         (16, 0, '2017-02-10 00:00:00', '2017-02-26 00:00:00', 8, '<p>Vacances d''hiver, zone B</p>'),
-         (17, 0, '2017-02-03 00:00:00', '2017-02-19 00:00:00', 8, '<p>Vacances d''hiver, zone C</p>'),
-         (18, 0, '2017-04-16 00:00:00', '2017-05-01 00:00:00', 8, '<p>Vacances de printemps, zone A</p>'),
-         (19, 0, '2017-04-09 00:00:00', '2017-04-23 00:00:00', 8, '<p>Vacances de printemps, zone B</p>'),
-         (20, 0, '2017-04-02 00:00:00', '2017-04-17 00:00:00', 8, '<p>Vacances de printemps, zone C</p>'),
-         (21, 0, '2017-07-09 00:00:00', '2017-08-31 00:00:00', 8, '<p>Vacances d''été</p>'),
-         (22, 0, '2016-09-01 00:00:00', '2016-09-01 00:00:00', 1, '<div class="annonce">C''est la rentrée ! Bon courage pour cette nouvelle année&nbsp;!</div>');
-
-INSERT INTO semaines (debut) VALUES ('2016-09-01'),('2016-09-04'),('2016-09-11'),('2016-09-18'),('2016-09-25'),
-  ('2016-10-03'),('2016-10-10'),('2016-10-17'),('2016-10-20'),('2016-11-03'),('2016-11-07'),('2016-11-14'),('2016-11-21'),('2016-11-28'),
-  ('2016-12-05'),('2016-12-12'),('2016-12-19'),('2016-12-26'),('2017-01-03'),('2017-01-09'),('2017-01-16'),('2017-01-23'),
-  ('2017-01-30'),('2017-02-06'),('2017-02-13'),('2017-02-20'),('2017-02-27'),('2017-03-06'),('2017-03-13'),('2017-03-20'),('2017-03-27'),
-  ('2017-04-03'),('2017-04-10'),('2017-04-18'),('2017-04-24'),('2017-05-02'),('2017-05-09'),('2017-05-15'),('2017-05-22'),('2017-05-29'),
-  ('2017-06-05'),('2017-06-12'),('2017-06-19'),('2017-06-26'),('2017-07-03');
-UPDATE semaines SET colle = 1;
+  VALUES 
+         (1, 0, '2017-09-04 00:00:00', '2017-09-04 00:00:00', 1, '<div class="annonce">C''est la rentrée ! Bon courage pour cette nouvelle année&nbsp;!</div>'),
+         (2, 0, '2017-08-15 00:00:00', '2017-08-15 00:00:00', 7, '<p>Assomption</p>'),
+         (3, 0, '2017-11-01 00:00:00', '2017-11-01 00:00:00', 7, '<p>Toussaint</p>'),
+         (4, 0, '2017-11-11 00:00:00', '2017-11-11 00:00:00', 7, '<p>Armistice 1918</p>'),
+         (5, 0, '2017-12-25 00:00:00', '2017-12-25 00:00:00', 7, '<p>Noël</p>'),
+         (6, 0, '2018-01-01 00:00:00', '2018-01-01 00:00:00', 7, '<p>Jour de l''an</p>'),
+         (7, 0, '2018-04-02 00:00:00', '2018-04-02 00:00:00', 7, '<p>Pâques</p>'),
+         (8, 0, '2018-05-01 00:00:00', '2018-05-01 00:00:00', 7, '<p>Fête du travail</p>'),
+         (9, 0, '2018-05-08 00:00:00', '2018-05-08 00:00:00', 7, '<p>Armistice 1945</p>'),
+         (10, 0, '2018-05-10 00:00:00', '2018-05-10 00:00:00', 7, '<p>Ascension</p>'),
+         (11, 0, '2018-05-21 00:00:00', '2018-05-21 00:00:00', 7, '<p>Pentecôte</p>'),
+         (12, 0, '2018-07-14 00:00:00', '2018-07-14 00:00:00', 7, '<p>Fête Nationale</p>'),
+         (13, 0, '2017-07-06 00:00:00', '2017-09-03 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (14, 0, '2017-10-22 00:00:00', '2017-11-05 00:00:00', 8, '<p>Vacances de la Toussaint</p>'),
+         (15, 0, '2017-12-24 00:00:00', '2018-01-07 00:00:00', 8, '<p>Vacances de Noël</p>'),
+         (16, 0, '2018-02-11 00:00:00', '2018-02-25 00:00:00', 8, '<p>Vacances d''hiver, zone A</p>'),
+         (17, 0, '2018-02-25 00:00:00', '2018-03-11 00:00:00', 8, '<p>Vacances d''hiver, zone B</p>'),
+         (18, 0, '2018-02-18 00:00:00', '2018-03-04 00:00:00', 8, '<p>Vacances d''hiver, zone C</p>'),
+         (19, 0, '2018-04-08 00:00:00', '2018-04-22 00:00:00', 8, '<p>Vacances de printemps, zone A</p>'),
+         (20, 0, '2018-04-22 00:00:00', '2018-05-06 00:00:00', 8, '<p>Vacances de printemps, zone B</p>'),
+         (21, 0, '2018-04-15 00:00:00', '2018-04-29 00:00:00', 8, '<p>Vacances de printemps, zone C</p>'),
+         (22, 0, '2018-07-09 00:00:00', '2018-08-31 00:00:00', 8, '<p>Vacances d''été</p>');
 
 FIN;
 ?>
diff -urN cahier-de-prepa6.0.0/fonctions.php cahier-de-prepa6.1.0/fonctions.php
--- cahier-de-prepa6.0.0/fonctions.php	2016-08-30 18:14:47.789078427 +0200
+++ cahier-de-prepa6.1.0/fonctions.php	2016-12-24 17:26:37.180825823 +0100
@@ -232,6 +232,8 @@
   if ( file_exists("documents/rss/log.$mois.php") )
     $fichierlog = fopen("documents/rss/log.$mois.php",'ab');
   else  {
+    if ( !is_dir('documents/rss') )
+      mkdir('documents/rss',0777);
     $fichierlog = fopen("documents/rss/log.$mois.php",'wb');
     fwrite($fichierlog,'<?php exit(); ?>');
   }
@@ -421,7 +423,7 @@
     
   // RSS
   $rss = sha1($GLOBALS['base'].'00');
-  $rss = ( $autorisation ) ? sha1("?!${GLOBALS['base']}0|toutes") : sha1("?!${GLOBALS['base']}$autorisation|${_SESSION['matieres']}");
+  $rss = ( $autorisation ) ? sha1("?!${GLOBALS['base']}$autorisation|${_SESSION['matieres']}") : sha1("?!${GLOBALS['base']}0|toutes");
   // Message si non vide
   if ( strlen($message) )
     $message = "  <div class=\"warning\">$message</div>\n";
diff -urN cahier-de-prepa6.0.0/index.php cahier-de-prepa6.1.0/index.php
--- cahier-de-prepa6.0.0/index.php	2016-08-30 11:45:20.905130342 +0200
+++ cahier-de-prepa6.1.0/index.php	2016-09-02 10:27:19.508667976 +0200
@@ -68,44 +68,45 @@
 $mathjax = false;
 
 // Agenda éventuel
-$resultat = $mysqli->query('SELECT val FROM prefs WHERE nom=\'nb_agenda_index\' OR nom=\'protection_agenda\' ORDER BY nom');
-$r = $resultat->fetch_row();
-$n = $r[0];
-$r = $resultat->fetch_row();
-$resultat->free();
-if ( $autorisation >= $r[0] )  {
-  $resultat = $mysqli->query('SELECT m.nom AS matiere, t.nom AS type, texte,
-                            DATE_FORMAT(debut,\'%w%Y%m%e\') AS d, DATE_FORMAT(fin,\'%w%Y%m%e\') AS f,
-                            DATE_FORMAT(debut,\'%kh%i\') AS hd, DATE_FORMAT(fin,\'%kh%i\') AS hf
-                            FROM agenda AS a JOIN `agenda-types` AS t ON a.type = t.id LEFT JOIN matieres AS m ON a.matiere = m.id
-                            WHERE NOW() <= fin AND ADDDATE(NOW(),7) >= debut ORDER BY debut,fin LIMIT '.$n);
-  if ( $resultat->num_rows )  {
-    echo "\n  <h2><a href=\"agenda\" title=\"Afficher l'agenda du mois\" style=\"text-decoration: none;\"><span class=\"icon-agenda\"></span></a>&nbsp;Prochains événements</h2>\n\n  <article>";
-    while ( $r = $resultat->fetch_assoc() )  {
-      // Événement sur un seul jour
-      if ( ( $d = $r['d'] ) == ( $f = $r['f'] ) )  {
-        $date = substr(ucfirst(format_date($d)),0,-5);
-        if ( ( $hd = $r['hd'] ) != '0h00' )
-          $date .= ( $hd == $r['hf'] ) ? ' à '.str_replace('00','',$hd) : ' de '.str_replace('00','',$hd).' à '.str_replace('00','',$r['hf']);
+if ( $page['id'] == 1 )  {
+  $resultat = $mysqli->query('SELECT val FROM prefs WHERE nom=\'nb_agenda_index\' OR nom=\'protection_agenda\' ORDER BY nom');
+  $r = $resultat->fetch_row();
+  $n = $r[0];
+  $r = $resultat->fetch_row();
+  $resultat->free();
+  if ( $autorisation >= $r[0] )  {
+    $resultat = $mysqli->query('SELECT m.nom AS matiere, t.nom AS type, texte,
+                              DATE_FORMAT(debut,\'%w%Y%m%e\') AS d, DATE_FORMAT(fin,\'%w%Y%m%e\') AS f,
+                              DATE_FORMAT(debut,\'%kh%i\') AS hd, DATE_FORMAT(fin,\'%kh%i\') AS hf
+                              FROM agenda AS a JOIN `agenda-types` AS t ON a.type = t.id LEFT JOIN matieres AS m ON a.matiere = m.id
+                              WHERE CURDATE() <= DATE(fin) AND ADDDATE(CURDATE(),7) >= DATE(debut) ORDER BY debut,fin LIMIT '.$n);
+    if ( $resultat->num_rows )  {
+      echo "\n  <h2><a href=\"agenda\" title=\"Afficher l'agenda du mois\" style=\"text-decoration: none;\"><span class=\"icon-agenda\"></span></a>&nbsp;Prochains événements</h2>\n\n  <article>";
+      while ( $r = $resultat->fetch_assoc() )  {
+        // Événement sur un seul jour
+        if ( ( $d = $r['d'] ) == ( $f = $r['f'] ) )  {
+          $date = substr(ucfirst(format_date($d)),0,-5);
+          if ( ( $hd = $r['hd'] ) != '0h00' )
+            $date .= ( $hd == $r['hf'] ) ? ' à '.str_replace('00','',$hd) : ' de '.str_replace('00','',$hd).' à '.str_replace('00','',$r['hf']);
+        }
+        // Événement sur plusieurs jours
+        else  {
+          if ( ( $hd = $r['hd'] ) == '0h00' )
+            $date = 'Du '.substr(format_date($d),0,-5).' au '.substr(format_date($f),0,-5);
+          else
+            $date = 'Du '.substr(format_date($d),0,-5).' à '.str_replace('00','',$r['hd']).' au '.substr(format_date($f),0,-5).' à '.str_replace('00','',$r['hf']);
+        }
+        $titre = ( strlen($r['matiere']) ) ? "${r['type']} en ${r['matiere']}" : $r['type'];
+        echo "\n  <h3>$date&nbsp;: $titre</h3>\n";
+        if ( strlen($r['texte']) )
+          echo "  <p>${r['texte']}</p>\n";
       }
-      // Événement sur plusieurs jours
-      else  {
-        if ( ( $hd = $r['hd'] ) == '0h00' )
-          $date = 'Du '.substr(format_date($d),0,-5).' au '.substr(format_date($f),0,-5);
-        else
-          $date = 'Du '.substr(format_date($d),0,-5).' à '.str_replace('00','',$r['hd']).' au '.substr(format_date($f),0,-5).' à '.str_replace('00','',$r['hf']);
-      }
-      $titre = ( strlen($r['matiere']) ) ? "${r['type']} en ${r['matiere']}" : $r['type'];
-      echo "\n  <h3>$date&nbsp;: $titre</h3>\n";
-      if ( strlen($r['texte']) )
-        echo "  <p>${r['texte']}</p>\n";
+      $resultat->free();
+      echo "  </article>\n\n";
     }
-    $resultat->free();
-    echo "  </article>\n\n";
   }
 }
 
-
 // Affichage public sans édition
 if ( !$edition )  {
   // Affichage des informations diffusées
diff -urN cahier-de-prepa6.0.0/installation.php cahier-de-prepa6.1.0/installation.php
--- cahier-de-prepa6.0.0/installation.php	2015-10-28 00:27:28.094145602 +0100
+++ cahier-de-prepa6.1.0/installation.php	2016-08-31 00:31:54.617596669 +0200
@@ -11,8 +11,8 @@
   <title>Cahier de Prépa&nbsp;: installation</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
-  <link rel="stylesheet" href="css/style-min.css">
-  <link rel="stylesheet" href="css/icones-min.css">
+  <link rel="stylesheet" href="css/style.min.css">
+  <link rel="stylesheet" href="css/icones.min.css">
   <script type="text/javascript" src="js/jquery.min.js"></script>
   <!--[if lte IE 8]><script src="js/html5shiv.min.js"></script><![endif]--> 
   <!--[if lte IE 8]><script src="js/respond.min.js"></script><![endif]-->
@@ -292,8 +292,8 @@
 affiche('Présence du répertoire Général',$resultat->num_rows);
 $resultat->free();
 
-// La base de données doit contenir 45 semaines en 2015-16
-$resultat = $mysqli->query('SELECT id FROM semaines WHERE debut > \'2015-08-01\' AND debut < \'2016-08-01\'');
+// La base de données doit contenir 45 semaines en 2016-17
+$resultat = $mysqli->query('SELECT id FROM semaines WHERE debut > \'2016-08-01\' AND debut < \'2017-08-01\'');
 affiche('Définition des semaines',$resultat->num_rows == 45);
 $resultat->free();
 $mysqli->close();
diff -urN cahier-de-prepa6.0.0/MAJSQL.sql cahier-de-prepa6.1.0/MAJSQL.sql
--- cahier-de-prepa6.0.0/MAJSQL.sql	2016-08-30 14:43:33.019727265 +0200
+++ cahier-de-prepa6.1.0/MAJSQL.sql	2017-08-25 03:54:01.540135896 +0200
@@ -259,7 +259,7 @@
 TRUNCATE TABLE notes;
 UPDATE matieres SET colles = 0, cdt = 0;
 TRUNCATE TABLE semaines;
-INSERT INTO semaines (debut) VALUES ('2016-09-01'),('2016-09-04'),('2016-09-11'),('2016-09-18'),('2016-09-25'),
+INSERT INTO semaines (debut) VALUES ('2016-09-01'),('2016-09-05'),('2016-09-12'),('2016-09-19'),('2016-09-26'),
   ('2016-10-03'),('2016-10-10'),('2016-10-17'),('2016-10-20'),('2016-11-03'),('2016-11-07'),('2016-11-14'),('2016-11-21'),('2016-11-28'),
   ('2016-12-05'),('2016-12-12'),('2016-12-19'),('2016-12-26'),('2017-01-03'),('2017-01-09'),('2017-01-16'),('2017-01-23'),
   ('2017-01-30'),('2017-02-06'),('2017-02-13'),('2017-02-20'),('2017-02-27'),('2017-03-06'),('2017-03-13'),('2017-03-20'),('2017-03-27'),
@@ -330,5 +330,46 @@
 -- Autres modifications
 ALTER TABLE groupes CHANGE eleves eleves VARCHAR( 250 ) NOT NULL;
 
-
+--
+-- Voilà les modifications à effectuer sur chaque base pour passer de Cahier de
+-- Prépa 6.0.0 à Cahier de Prépa 6.1.0
+--
+-- Semaines 2017-2018 -> Suppression des cahiers de texte, programmes de colles, notes, événements ; renouvellement du planning
+TRUNCATE TABLE cdt;
+TRUNCATE TABLE colles;
+TRUNCATE TABLE notes;
+DELETE FROM agenda WHERE fin < '2017-09-01';
+UPDATE matieres SET colles = 0, cdt = 0, notes = 0;
+TRUNCATE TABLE semaines;
+INSERT INTO semaines (debut) VALUES ('2017-09-04'),('2017-09-11'),('2017-09-18'),('2017-09-25'),
+  ('2017-10-02'),('2017-10-09'),('2017-10-16'),('2017-10-23'),('2017-10-30'),('2017-11-06'),('2017-11-13'),('2017-11-20'),('2017-11-27'),
+  ('2017-12-04'),('2017-12-11'),('2017-12-18'),('2017-12-25'),('2018-01-01'),('2018-01-08'),('2018-01-15'),('2018-01-22'),
+  ('2018-01-29'),('2018-02-05'),('2018-02-12'),('2018-02-19'),('2018-02-26'),('2018-03-05'),('2018-03-12'),('2018-03-19'),('2018-03-26'),
+  ('2018-04-03'),('2018-04-09'),('2018-04-16'),('2018-04-23'),('2018-04-30'),('2018-05-07'),('2018-05-14'),('2018-05-22'),('2018-05-28'),
+  ('2018-06-04'),('2018-06-11'),('2018-06-18'),('2018-06-25'),('2018-07-02');
+INSERT INTO agenda (id,matiere,debut,fin,type,texte)
+  VALUES 
+         (1, 0, '2017-09-04 00:00:00', '2017-09-04 00:00:00', 1, '<div class="annonce">C''est la rentrée ! Bon courage pour cette nouvelle année&nbsp;!</div>'),
+         (2, 0, '2017-08-15 00:00:00', '2017-08-15 00:00:00', 7, '<p>Assomption</p>'),
+         (3, 0, '2017-11-01 00:00:00', '2017-11-01 00:00:00', 7, '<p>Toussaint</p>'),
+         (4, 0, '2017-11-11 00:00:00', '2017-11-11 00:00:00', 7, '<p>Armistice 1918</p>'),
+         (5, 0, '2017-12-25 00:00:00', '2017-12-25 00:00:00', 7, '<p>Noël</p>'),
+         (6, 0, '2018-01-01 00:00:00', '2018-01-01 00:00:00', 7, '<p>Jour de l''an</p>'),
+         (7, 0, '2018-04-02 00:00:00', '2018-04-02 00:00:00', 7, '<p>Pâques</p>'),
+         (8, 0, '2018-05-01 00:00:00', '2018-05-01 00:00:00', 7, '<p>Fête du travail</p>'),
+         (9, 0, '2018-05-08 00:00:00', '2018-05-08 00:00:00', 7, '<p>Armistice 1945</p>'),
+         (10, 0, '2018-05-10 00:00:00', '2018-05-10 00:00:00', 7, '<p>Ascension</p>'),
+         (11, 0, '2018-05-21 00:00:00', '2018-05-21 00:00:00', 7, '<p>Pentecôte</p>'),
+         (12, 0, '2018-07-14 00:00:00', '2018-07-14 00:00:00', 7, '<p>Fête Nationale</p>'),
+         (13, 0, '2017-07-06 00:00:00', '2017-09-03 00:00:00', 8, '<p>Vacances d''été</p>'),
+         (14, 0, '2017-10-22 00:00:00', '2017-11-05 00:00:00', 8, '<p>Vacances de la Toussaint</p>'),
+         (15, 0, '2017-12-24 00:00:00', '2018-01-07 00:00:00', 8, '<p>Vacances de Noël</p>'),
+         (16, 0, '2018-02-11 00:00:00', '2018-02-25 00:00:00', 8, '<p>Vacances d''hiver, zone A</p>'),
+         (17, 0, '2018-02-25 00:00:00', '2018-03-11 00:00:00', 8, '<p>Vacances d''hiver, zone B</p>'),
+         (18, 0, '2018-02-18 00:00:00', '2018-03-04 00:00:00', 8, '<p>Vacances d''hiver, zone C</p>'),
+         (19, 0, '2018-04-08 00:00:00', '2018-04-22 00:00:00', 8, '<p>Vacances de printemps, zone A</p>'),
+         (20, 0, '2018-04-22 00:00:00', '2018-05-06 00:00:00', 8, '<p>Vacances de printemps, zone B</p>'),
+         (21, 0, '2018-04-15 00:00:00', '2018-04-29 00:00:00', 8, '<p>Vacances de printemps, zone C</p>'),
+         (22, 0, '2018-07-09 00:00:00', '2018-08-31 00:00:00', 8, '<p>Vacances d''été</p>');
+UPDATE semaines SET colle = 1;
 
