コード例 #1
0
ファイル: fichier.php プロジェクト: inscriptionweb/Envoi
   This file is part of Envoi.

   Envoi is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   Envoi is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Envoi.  If not, see <http://www.gnu.org/licenses/>.

   (c) Christophe Jacquet, 2009-2011.
*/
session_start();
if (!isset($_SESSION["role"]) || $_SESSION["role"] != "PROF") {
    die("Vous devez être connecté.");
}
if (!isset($_GET["id"])) {
    die("Vous devez donner un identifiant.");
}
$id = $_GET["id"];
$req = "SELECT type, nom FROM fichierDonne WHERE idFichierDonne=" . $id;
$row = DB::request_one_row($req);
header("Content-type: " . $row->type);
header("Content-Disposition: inline; filename=\"" . $row->nom . "\"");
fileIdToPath($id, $fspath, $fsname);
readfile($fspath . $fsname);
コード例 #2
0
ファイル: voirrendu.php プロジェクト: inscriptionweb/Envoi
 }
 echo "</table>\n";
 echo "</form>\n";
 echo "</td></tr>\n";
 # Notifications
 echo "<tr><td><img src='img/icon_notification.png' alt='Notification'></td><td>Notifications</td>";
 if (is_null($notification)) {
     echo "<td><span class='state_off'>Désactivées</span> <a href='voirrendu.php?id={$idRendu}&amp;do=notifen'>⇒ Activer</a></td>";
 } else {
     echo "<td><span class='state_on'>Activées</span> vers&nbsp;: {$notification} <a href='voirrendu.php?id={$idRendu}&amp;do=notifdis'>⇒ Désactiver</a></td>";
 }
 echo "</tr>\n";
 echo "</table>\n";
 echo "<script>connectDialog(\$('#btn_add_file'), 'ajoutfichier.php?idRendu={$idRendu}');</script>";
 echo "<h2>Livraisons effectuées</h2>\n";
 $obj = DB::request_one_row("SELECT COUNT(DISTINCT login) nb FROM renduDonne WHERE idRendu=?", array($idRendu));
 echo "<p>{$obj->nb} groupes ont effectué une livraison.</p>";
 echo "<p><a href=\"ziprendu.php?id={$idRendu}\">⇒ Télécharger tous les fichiers livrés sous forme d'archive ZIP</a></p>";
 $res = DB::request("SELECT date, commentaire, login, idRenduDonne FROM renduDonne WHERE idRendu=? ORDER BY date", array($idRendu));
 echo "<table>\n";
 echo "<tr><th>Élèves</th><th>Date</th><th>Commentaire</th><th>Fichiers</th></tr>\n";
 $idCount = 0;
 while ($row = $res->fetch()) {
     $idRenduDonne = $row->idRenduDonne;
     echo "<tr><td>";
     // liste des élèves
     $res2 = DB::request("SELECT nom, prenom, email FROM participant WHERE idRenduDonne=?", array($idRenduDonne));
     while ($r = $res2->fetch()) {
         echo "<a href=\"mailto:" . $r->email . "\">" . htmlspecialchars($r->prenom) . " " . htmlspecialchars($r->nom) . "</a><br />";
     }
     echo "(" . $row->login . ")";