-
Notifications
You must be signed in to change notification settings - Fork 2
/
repos.php
71 lines (56 loc) · 2.01 KB
/
repos.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
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
<!DOCTYPE html>
<html>
<title>GreenTech|Repository</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body,h1 {font-family: "Raleway", Arial, sans-serif}
h1 {letter-spacing: 6px}
.w3-row-padding img {margin-bottom: 5px}
</style>
<body>
<!-- !PAGE CONTENT! -->
<div class="w3-content" style="max-width:1500px">
<!-- Header -->
<header class="w3-panel w3-center w3-opacity" style="padding:5px 5px">
<h1 class="w3-xlarge">Diagnosis repository</h1>
<div class="w3-padding-32">
<div class="w3-bar w3-border">
<a href="/repos.php" class="w3-bar-item w3-button">Refresh</a>
</div>
</div>
</header>
<?php
$dir_path = "plantix/";
$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 name
?> <header class=" w3-center" style="padding:8px 8px;color: white">
<?
echo "File Name -> $files[$i]<br>";
// get file extension
$file = pathinfo($files[$i]);
$extension = $file['extension'];
//echo "File Extension-> $extension<br>";
// check file extension
if(in_array($extension, $extensions_array))
{
// show image
?> <header class="w3-panel w3-center" style="padding:8px 8px">
<?
echo "<img src='$dir_path$files[$i]?=filemtime($i)?>' style='width:500px;height:500px;'><br>";
}
}
}
}?>
</body>
</html>