From 512ab2080cebf645c0676c04140943067c2cd003 Mon Sep 17 00:00:00 2001 From: ZHANG David <david.zhang@etu.univ-amu.fr> Date: Thu, 30 Jan 2025 20:24:15 +0000 Subject: [PATCH] Delete prof_view_files.php --- prof_view_files.php | 77 --------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 prof_view_files.php diff --git a/prof_view_files.php b/prof_view_files.php deleted file mode 100644 index 5e9e25e..0000000 --- a/prof_view_files.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -include 'config.php'; -session_start(); - -if (!isset($_SESSION['user']) || $_SESSION['user']['role'] !== 'tutor') { - echo "<div class='container'><p class='error'>Access denied. Only tutors can view files.</p><a href='login.php'>Go back</a></div>"; - exit; -} - -$user = $_SESSION['user']; -$tutor_id = intval($user['id']); // Récupération de l'ID du professeur connecté - -// Récupérer uniquement les dépôts créés par ce professeur -$depots = $conn->query("SELECT * FROM depots WHERE tutor_id = $tutor_id"); - -?> -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>View Files</title> - <link rel="stylesheet" href="style.css"> -</head> -<body> - <?php include 'sidebar.php'; ?> - - <div class="main-content"> - <div class="attendance-page"> - <h1>View Files</h1> - <?php if ($depots->num_rows > 0): ?> - <?php while ($depot = $depots->fetch_assoc()): ?> - <h2><?= htmlspecialchars($depot['nom']) ?></h2> - <p><?= htmlspecialchars($depot['description']) ?></p> - <ul> - <?php - $depot_id = intval($depot['id']); - $files = $conn->query("SELECT * FROM fichiers WHERE depot_id = $depot_id"); - - if ($files->num_rows > 0): - ?> - <table border="1" cellpadding="10"> - <thead> - <tr> - <th>File Name</th> - <th>Sender</th> - <th>Upload Date</th> - <th>Download</th> - </tr> - </thead> - <tbody> - <?php while ($file = $files->fetch_assoc()): ?> - <tr> - <td><?= htmlspecialchars($file['nom_fichier']) ?></td> - <td><?= htmlspecialchars($file['expediteur']) ?></td> - <td><?= date('d-m-Y H:i', strtotime($file['date_upload'])) ?></td> - <td> - <a href="<?= htmlspecialchars($file['path_fichier']) ?>" download> - Download - </a> - </td> - </tr> - <?php endwhile; ?> - </tbody> - </table> - <?php else: ?> - <p>Pas de fichiers téléversés encore</p> - <?php endif; ?> - </ul> - <?php endwhile; ?> - <?php else: ?> - <p>No depots found.</p> - <?php endif; ?> - </div> - </div> -</body> -</html> -- GitLab