-
Notifications
You must be signed in to change notification settings - Fork 6
/
gallery.php
99 lines (89 loc) · 3.34 KB
/
gallery.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
88
89
90
91
92
93
94
95
96
97
98
99
<?php
include "includes/_process_include.php";
include "includes/_header.php";
include "includes/_login_check.php";
$galleryObj = new Gallery();
$result = $galleryObj->getAllGallery();
?>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Galleries</h1>
</div>
<?php
if($_SESSION['type'] == "admin") {
?>
<div class="row">
<div class="col-lg-4">
<div class="input-group">
<input type="text" id="galleryName" class="form-control" placeholder="Add Gallery">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="addGallerybtn">Add</button>
</span>
<div id="loader"></div>
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
<?php } ?>
<br />
<div id="galleriesList" >
<?php
if(!empty($result)) {
foreach($result as $gallery) {
?>
<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="" data-name="<?=$gallery?>" data-toggle="modal" data-target="#myModal" data-name="<?=$gallery?>" id="editGallerybtn">Edit Name</a></li>
<li><a href="" data-galleryname="<?=$gallery?>" id="deleteGallerybtn">Delete Gallery</a></li>
</ul>
</div> <!-- End Dropdown action -->
<?php } ?>
<a class="thumbnail" href="<?=Photos_Page_Link?>?gallery=<?=$gallery?>">
<img class="img-responsive" src="default-thumbnail.jpg" alt="">
<p><?=$gallery?></p>
</a>
</div>
<?php
}
} else{
echo '<div class="col-lg-3"><p class="alert alert-info">No Galleries Found</p></div>';
}
?>
</div>
</div> <!-- End row -->
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Edit Gallery Name</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="input-group">
<input type="text" id="newGalleryName" class="form-control" placeholder="Add Gallery">
<input type="hidden" id="oldGalleryName" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="editGalleryModalBtn">Edit</button>
</span>
<div id="loader"></div>
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
</div>
</div>
</div>
</div>
<?php
include "includes/_footer.php";
?>