-
Notifications
You must be signed in to change notification settings - Fork 0
/
P2.php
267 lines (238 loc) · 9.08 KB
/
P2.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<title>SYN | Gallery</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="pstyle.css">
<link rel="stylesheet" type="text/css" href="pstyle1.css">
<script>
function openModal() {
document.getElementById("myModal").style.display = "block";
}
function closeModal() {
document.getElementById("myModal").style.display = "none";
}
function myFunction(imgs) {
var expandImg = document.getElementById("expandedImg");
expandImg.src = imgs.src;
expandImg.parentElement.style.display = "block";
}
// Get the elements with class="column"
var elements = document.getElementsByClassName("column");
// Declare a loop variable
var i;
// Full-width images
function one() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "100%"; // IE10
elements[i].style.flex = "100%";
}
}
// Two images side by side
function two() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "50%"; // IE10
elements[i].style.flex = "50%";
}
}
// Four images side by side
function four() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "25%"; // IE10
elements[i].style.flex = "25%";
}
}
// Add active class to the current button (highlight it)
var header = document.getElementById("myHeader");
var btns = header.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
</script>
</head>
<body>
<div id="logowe">
<a href="index.html"><img src="pl1.png" alt="Logo" style="max-width: 100%"></a>
</div>
<br>
<div class="scroll">
<div class="box bpi1">
<p class="capi">Media</p>
<img src="pi1.jpg" class="galimg" onclick="openModal();myFunction(this);" alt="1">
<div class="box bpi2">
<p class="capi">Mumbai</p>
<img src="pi3.jpg" class="galimg" onclick="openModal();myFunction(this);" alt="2">
<div class="box bpi2">
<p class="capi">Kota</p>
<img src="pi2.jpg" class="galimg" onclick="openModal();myFunction(this);" alt="3">
<div class="box bpi2">
<p class="capi">Jodhpur</p>
<img src="pi3.jpg" class="galimg" onclick="openModal();myFunction(this);" alt="3">
<div class="box bpi2">
<p class="capi">Ujjain</p>
<img src="pi1.jpg" class="galimg" onclick="openModal();myFunction(this);" alt="3">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="myModal" class="modal">
<span class="close cursor" onclick="closeModal()">×</span>
<div class="modal-content" id="scroll1">
<div>
<img id="expandedImg" style="width:100%">
<!-- Photo Grid -->
<div class="header" id="myHeader">
<button class="btn" onclick="one()">1</button>
<button class="btn active" onclick="two()">2</button>
<button class="btn" onclick="four()">4</button>
</div>
<div class="row">
<div class="column">
<?php
function OpenCon()
{
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "1";
$db = "w";
$conn = new mysqli($dbhost, $dbuser, $dbpass,$db);
return $conn;
}
function CloseCon($conn)
{
$conn -> close();
}
$conn = OpenCon();
if($conn === false)
{
die("ERROR: Could not connect. " . $conn->connect_error);
}
$sql4 = "SELECT Distinct Image FROM Gallery";
$result = $conn->query($sql4);
if ($result->num_rows> 0)
{
while($row = $result->fetch_assoc())
{
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['Image'] ).'"style="width:100%">';
echo '<br>'
?>
<?php
}
}
?>
</div>
<div class="column">
<?php
$sql4 = "SELECT Distinct Image FROM Gallery2";
$result = $conn->query($sql4);
if ($result->num_rows> 0)
{
while($row = $result->fetch_assoc())
{
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['Image'] ).'"style="width:100%">';
echo '<br>'
?>
<?php
}
}
CloseCon($conn);
?>
</div>
<div class="column">
<?php
$sql4 = "SELECT Distinct Image FROM Gallery";
$result = $conn->query($sql4);
if ($result->num_rows> 0)
{
while($row = $result->fetch_assoc())
{
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['Image'] ).'"style="width:100%">';
echo '<br>'
?>
<?php
}
}
CloseCon($conn);
?>
</div>
<div class="column">
<?php
$sql4 = "SELECT Distinct Image FROM Gallery2";
$result = $conn->query($sql4);
if ($result->num_rows> 0)
{
while($row = $result->fetch_assoc())
{
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['Image'] ).'"style="width:100%">';
echo '<br>'
?>
<?php
}
}
CloseCon($conn);
?>
</div>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-inverse navbar-fixed-bottom">
<div id="sec1">
<div id="sec11">
<div>
<a href="P61.html" class="navmar3"><span class="glyphicon glyphicon-phone"><p class="nsi"> Contact us</p></a>
</div>
<div>
<a href="P71.html" class="navmar3"><span class="glyphicon glyphicon-book"><p class="nsi"> Legal</p> </a>
</div>
</div >
<div id="sec12">
<div id="sec121" class="nav navbar-nav">
<a href="P33.html" ><span><i class="fa fa-inr" id="gnm"></i></span></a><br>
<a href="P33.html" ><p class="nsi1">DONATE</p></a>
</div>
<div id="sec121" class="nav navbar-nav">
<a href="P41.html" ><span class="glyphicon glyphicon-calendar"></span></a><br>
<a href="P41.html" ><p class="nsi1">EVENTS</p></a>
</div>
<div id="sec121" class="nav navbar-nav">
<a href="index.html" ><span class="glyphicon glyphicon-home"></span></a><br>
<a href="index.html" ><p class="nsi1">HOME</p></a>
</div>
<div id="sec121" class="nav navbar-nav ">
<a href="P8.html" ><span class="glyphicon glyphicon-heart"></span></a><br>
<a href="P8.html" ><p class="nsi1">ABOUT US</p></a>
</div>
<div id="sec121" class="nav navbar-nav">
<a href="P2.html" ><span class="glyphicon glyphicon-picture"></span></a><br>
<a href="P2.html" ><p class="nsi1">GALLERY</p></a>
</div>
</div>
<div id="sec13">
<div>
<p id="npad">Connect On-</p>
</div>
<div class="sec131">
<a href="https://www.facebook.com/" target="_blank" alt="FB"><img src="pic1.png" style="max-width: 100%"></a>
</div>
<div class="sec131">
<a href="https://www.instagram.com/?hl=en" target="_blank" alt="insta"><img src="pic3.png" style="max-width: 100%"></a>
</div>
<div class="sec131">
<a href="https://twitter.com/login?lang=en" target="_blank" alt="twitter"><img src="pic2.png" style="max-width: 100%"></a>
</div>
</div>
</div>
</nav>
</body>
</html>