-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgallery.php
42 lines (34 loc) · 1.05 KB
/
gallery.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
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/gallery.css">
<title>Farm Management System - Gallery</title>
</head>
<body>
<?php include "sections/_topnav.php" ?>
<h2 id="gallerytext">Gallery</h2>
<div class="Imgcontainer">
<div class="gallery-container">
<?php
$uploadFolder = 'uploads';
$uploadPath = __DIR__ . '/' . $uploadFolder;
$files = glob($uploadPath . '/*.{jpg,jpeg,png,gif}', GLOB_BRACE);
if ($files) {
foreach ($files as $file) {
$filename = basename($file);
echo '<div class="gallery-item">';
echo '<img src="' . $uploadFolder . '/' . $filename . '" alt="' . $filename . '">';
echo '</div>';
}
} else {
echo "No images found.";
}
?>
</div>
</div>
<script src="js/home.js"></script>
</body>
</html>