-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArt$Culture.php
More file actions
92 lines (80 loc) · 3.03 KB
/
Art$Culture.php
File metadata and controls
92 lines (80 loc) · 3.03 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php include('db.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<title>Art and Culture</title>
<link rel="stylesheet" href="./home.css">
</head>
<body style="background-color:#414a4c; color:white; text-align:center;">
<?php
include('navbar.php');
include('sidebar.php');
include('top.php');
?>
<div style="margin-left: 200px;">
<?php
$dir_path = "./uploads/Art&culture/";
$extensions_array = array('jpg', 'png', 'jpeg');
if (is_dir($dir_path)) {
$files = scandir($dir_path);
for ($i = 0; $i < count($files); $i++) {
if ($files[$i] != '.' && $files[$i] != '..') {
// get file extension
$file = pathinfo($files[$i]);
$extension = $file['extension'];
// check file extension
if (in_array($extension, $extensions_array)) {
// show image
// echo "<img src='$dir_path$files[$i]' style='width:200px;height:200px; margin-top:10px; margin-left:20px' >";
// echo "<img src='$dir_path$files[$i]' id='myImg' class='rounded float-start img1' style='margin-left:10px;margin-top:10px;width:250px; height:250px;' >";
echo "<a href='$dir_path$files[$i]' download><img src='$dir_path$files[$i]' id='myImg' title='click on me to download'/> </a>";
}
}
}
}
?>
</div>
<script>
async function downloadImage(imageSrc) {
const image = await fetch(imageSrc)
const imageBlog = await image.blob()
const imageURL = URL.createObjectURL(imageBlog)
const link = document.createElement('a')
link.href = imageURL
link.download = 'image file name here'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
</script>
<script>
backButton = document.getElementById("back");
nextButton = document.getElementById("next");
number = document.getElementById("number");
var i = 1;
function ready() {
backButton.disabled = true;
}
function next() {
i++;
if (i == 7) {
nextButton.disabled = true;
}
backButton.disabled = false;
number.innerHTML = i;
}
function back() {
i--;
if (i == 1) {
backButton.disabled = true;
}
nextButton.disabled = false;
number.innerHTML = i;
}
</script>
</body>
</html>