-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (30 loc) · 1.16 KB
/
index.php
File metadata and controls
39 lines (30 loc) · 1.16 KB
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
<?php
include "./functions.php";
$pdo = pdo_connect_mysql();
$stmt = $pdo->query("SELECT * FROM images ORDER BY uploaded_date desc");
$images = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<?= template_header('Gallary') ?>
<div class="content home">
<p>Welcome to the gallery page! You can view the list of uploaded images below.</p>
<a href="upload.php" class="upload-image">Upload Image</a>
<div class="images">
<?php foreach($images as $image): ?>
<?php if(file_exists($image['filepath'])): ?>
<a href="#">
<img
src="<?= $image['filepath'] ?>"
alt="<?= $image['description'] ?>"
data-id="<?= $image['id'] ?>"
data-title="<?= $image['title'] ?>"
width="300"
height="200"
>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="image-popup"></div>
</div>
<script src="app.js"></script>
<?= template_footer() ?>