-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutines.php
35 lines (33 loc) · 1.26 KB
/
routines.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require 'db_connection.php';
$sql = "SELECT * FROM routines ORDER BY uploaded_at DESC";
$result = $conn->query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Routines</title>
</head>
<body>
<h1>Uploaded Routines</h1>
<ul>
<?php if ($result->num_rows > 0): ?>
<?php while ($row = $result->fetch_assoc()): ?>
<li>
<strong><?php echo htmlspecialchars($row['title']); ?></strong><br>
<!-- Updated View File Link -->
<a href="apexmodelschool/<?php echo htmlspecialchars($row['file_path']); ?>" target="_blank">View File</a>
<!-- Download File Link -->
<a href="download_file.php?id=<?php echo $row['id']; ?>">Download File</a><br>
<small>Uploaded at: <?php echo $row['uploaded_at']; ?> |
Downloads: <?php echo isset($row['downloads']) ? $row['downloads'] : 0; ?></small>
</li><br>
<?php endwhile; ?>
<?php else: ?>
<p>No routines uploaded yet.</p>
<?php endif; ?>
</ul>
</body>
</html>