-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
55 lines (47 loc) · 1.72 KB
/
admin.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
<?php
require 'includes/header.php';
require 'includes/dbhandler.php';
?>
<main>
<link rel="stylesheet" href="css/profile.css">
<script>
function triggered() {
document.querySelector("#gallery-image").click();
}
function preview(e) {
if (e.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
document.querySelector('#gallery-display').setAttribute('src', e.target.result);
}
reader.readAsDataURL(e.files[0]);
}
}
</script>
<?php
if(isset($_SESSION['uid'])){
?>
<div class="h-50 center-me text-center">
<div class="my-auto">
<form action="includes/gallery-helper.php" method="POST" enctype="multipart/form-data">
<div class="form-group">
<img src="images/default.jpeg" alt="pic" onclick="triggered();" id="gallery-display">
<input type="text" name="title" class="form-control" placeholder="title">
<input type="file" name="gallery-image" id="gallery-image" onchange="preview(this)" class="form-control"
style="display: none;">
</div>
<div class="form-group">
<textarea name="descript" id="descript" cols="30" rows="10" placeholder="Description"
style="text-align: center"></textarea>
</div>
<div class="form-group">
<button type="submit" name="gallery-submit"
class="btn btn-outline-success btn-lg btn-block">upload</button>
</div>
</form>
</div>
</div>
<?php
}
?>
</main>