-
Notifications
You must be signed in to change notification settings - Fork 6
/
photos.php
87 lines (73 loc) · 2.78 KB
/
photos.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
include "includes/_process_include.php";
include "includes/_header.php";
include "includes/_login_check.php";
$gallery = htmlspecialchars(trim($_GET['gallery']));
$photosObj = new Photos();
$result = $photosObj->getAllGalleryPhotos($gallery);
?>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Photos</h1>
</div>
<?php
if($_SESSION['type'] == "admin") {
?>
<form action="image_upload.php" method="post" enctype="multipart/form-data">
<div><strong>Only Jpeg allowed</strong></div>
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<input type="file" name="image" class="form-control" placeholder="Upload photo" accept="image/jpeg">
<input type="hidden" name="galleryName" value="<?= $gallery ?>">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Upload</button>
</span>
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
</form>
<?php } ?>
<hr >
<?php
if(!empty($result)) {
foreach($result as $photo) {
?>
<div class="col-lg-3 col-md-4 col-xs-6 thumb">
<?php
if($_SESSION['type'] == "admin") {
?>
<!-- Dropdown action -->
<div class="btn-group">
<button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:void(0)" data-galleryname="<?=$gallery?>" data-photoname="<?=$photo?>" id="deletePhotobtn">Delete Photo</a></li>
</ul>
</div> <!-- End Dropdown action -->
<?php } ?>
<a class="thumbnail" href="javascript:void(0)" id="popImage" data-imgsrc="<?=Gallery_Folder.$gallery."/".$photo?>">
<img class="img-responsive" src="<?=Gallery_Folder.$gallery."/".$photo?>" alt="">
</a>
</div>
<?php
}
} else{
echo '<div class="col-lg-3"><p class="alert alert-info">No Photos Found</p></div>';
}
?>
</div> <!-- End row -->
<div id="imagemodal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<img src="" id="imagepreview" class="img-responsive" >
</div>
</div>
</div>
</div>
<?php
include "includes/_footer.php";
?>