-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgalerii.php
162 lines (135 loc) · 4.54 KB
/
galerii.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
<?php
require_once "usesession.php";
//require_once "fnc_user.php";
require_once "../../../conf.php";
function db_info_grab(){
$notice = 0;
$conn = new mysqli($GLOBALS["server_host"], $GLOBALS["server_user_name"], $GLOBALS["server_password"], $GLOBALS["database"]);
$stmt = $conn -> prepare("SELECT vr21_photos.vr21_photos_id, vr21_photos.vr21_photos_filename, vr21_photos.vr21_photos_alttext, vr21_users.vr21_users_firstname,
vr21_users.vr21_users_lastname FROM vr21_photos JOIN vr21_users ON vr21_photos.vr21_photos_userid = vr21_users.vr21_users_id WHERE vr21_photos.vr21_photos_privacy <= 3
AND vr21_photos.vr21_photos_deleted IS NULL GROUP BY vr21_photos.vr21_photos_id");
echo $conn -> error;
//$stmt -> bind_param("i", 3);
$stmt -> bind_result($photo_id, $photo_filename, $photo_alt_text, $first_name, $last_name);
$stmt -> execute();
while ($stmt -> fetch()) {
echo '<div class="klassinimi">';
echo '<img src= ../upload_photos_normal/'.$photo_filename.' alt='.$photo_alt_text.' class="thumb" data-fn='.$photo_filename.' data-id='.$photo_id.'>';
echo '<div class ="nimi">'.$first_name.' '.$last_name.'</div>';
echo '</div>'."\n";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="modal.js"> defer </script>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/modal.css">
<style>
h1{
font-size:2.5em;
color: gray;
}
/* gridi variant leitud quackit.comist ja modifitseeritud */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
grid-gap: 10px 10px;
align-items: flex;
padding:10px;
}
.grid img {
border: 1px solid #ccc;
max-width: 100%;
}
/* Ülemine menüü riba*/
.nav_riba {
background-color: #333;
width: auto;
display: flex;
justify-content: center;
}
.nav_riba a {
color: #f2f2f2;
padding: 14px 16px;
text-decoration: none;
font-size: 20px;
}
.nav_riba a:hover {
background-color: rgb(155, 122, 122);
color: black;
}
.nimi{
font-size:20px;
border-color: red;
}
body{
background-color: #f0f0f0;
}
</style>
</head>
<body >
<h1> Galerii </h1>
<div class="nav_riba">
<a class="active" href="home.php">Pealehele</a>
<a href="page_add_news.php">Lisa uudiseid</a>
<a href="upload_photo.php">Lae pilt!</a>
</div>
<div id="gallery">
<!--Modaalaken fotogalerii jaoks-->
<div id="modalarea" class="modalarea">
<!--sulgemisnupp-->
<span id="modalclose" class="modalclose">×</span>
<!--pildikoht-->
<div class="modalhorizontal">
<div class="modalvertical">
<p id="modalcaption"></p>
<img id="modalimg" src="../images/empty.png" alt="galeriipilt">
<br>
<div id="rating" class="modalRating">
<label><input id="rate1" name="rating" type="radio" value="1">1</label>
<label><input id="rate2" name="rating" type="radio" value="2">2</label>
<label><input id="rate3" name="rating" type="radio" value="3">3</label>
<label><input id="rate4" name="rating" type="radio" value="4">4</label>
<label><input id="rate5" name="rating" type="radio" value="5">5</label>
<button id="storeRating">Salvesta hinnang!</button>
<br>
<p id="avgRating"></p>
</div>
</div>
</div>
</div> <!--Modaalaken fotogalerii jaoks-->
<div id="modalarea" class="modalarea">
<!--sulgemisnupp-->
<span id="modalclose" class="modalclose">×</span>
<!--pildikoht-->
<div class="modalhorizontal">
<div class="modalvertical">
<p id="modalcaption"></p>
<img id="modalimg" src="../images/empty.png" alt="galeriipilt">
<br>
<div id="rating" class="modalRating">
<label><input id="rate1" name="rating" type="radio" value="1">1</label>
<label><input id="rate2" name="rating" type="radio" value="2">2</label>
<label><input id="rate3" name="rating" type="radio" value="3">3</label>
<label><input id="rate4" name="rating" type="radio" value="4">4</label>
<label><input id="rate5" name="rating" type="radio" value="5">5</label>
<button id="storeRating">Salvesta hinnang!</button>
<br>
<p id="avgRating"></p>
</div>
</div>
</div>
</div>
<main class="grid">
<?php
db_info_grab()
?>
<div>
</main>
</body>
</html>