forked from The-Creatives-Inc/creatives-inc-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindividualartwork.php
396 lines (333 loc) · 13.9 KB
/
individualartwork.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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
<?php
session_start(); // Session starts here.
$uid = $_GET['uid'];
$_SESSION["page"] = "individualartwork.php?uid=".$uid;
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
::-webkit-scrollbar {
width: 15px;
margin: 5px;
}
/* Track */
::-webkit-scrollbar-track {
background: black;
/* border: 1px solid white; */
}
/* Handle */
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.9);
border-radius: 20px;
}
body{
background: #000000;
color: white;
font-family: 'Montserrat', sans-serif;
overflow: hidden;
}
.main-nav{
position: sticky;
top: 0;
z-index: 1;
background-color: rgba(0,0,0,0.8);
}
.nav {
padding: 1% 0;
border-radius: 0;
background-color: black;
color: white;
border-color: white;
font-family: 'Fira Sans', sans-serif;
justify-content: center;
background-color: rgba(0,0,0,0);
}
#current{
color: #DF9322;
}
hr.new1 {
border-top: 3px solid white;
margin: 0px;
width: 100%;
margin-bottom: 60px;
}
.nav a{
padding-bottom: 10px;
margin-left: 15px;
position: relative;
text-decoration: none;
color: white;
font-size: 1.1em;
}
.nav a::before{
content: '';
position: absolute;
width: 100%;
height: 2.2px;
border-radius: 40px;
background-color: white;
bottom: 0;
left: 0;
transform-origin: right;
transform: scaleX(0);
transition: transform .2s ease-in-out;
}
.nav a:hover::before {
transform-origin: left;
transform: scaleX(1);
}
.new1 {
border-top: 3px solid white;
margin-bottom: 60px;
}
img{
border: 2px solid white;
border-radius: 20px;
}
.nopadding{
margin-bottom: 30px;
}
.material-symbols-outlined {
color: #DF9322;
font-variation-settings:
'FILL' 10,
'wght' 900,
'GRAD' 0,
'opsz' 48
}
button{
margin-top: 5%;
background-color: white;
padding-left: 35%;
padding-right: 35%;
padding-top: 1%;
padding-bottom: 1%;
border-radius: 10px;
}
#popUpYes {
background-color: rgb(255, 255, 255);
color: #000000;
cursor: pointer;
transition: all 0.6s ease;
}
#popUpYes:hover {
background-color: rgb(0, 0, 0);
color: white;
}
#comments{
margin-top: 5px;
border-style: solid;
border-width: 1px;
border-radius: 30px;
border-color: white;
width: 80%;
padding: 2% 10%;
}
#commentname{
font-size: 2px;
}
#commenting{
font-size: 12px;
margin-top: 2%
}
.alignn{
justify-content: center;
text-align: center;
}
.material-symbols-outlined{
margin-bottom: 30px;
}
.single-comment{
margin-bottom: 30px;
}
div#comments {
overflow: auto;
height: 360px;
width: 80%;
}
.col-md-10, .col-md-2{
margin: 0;
padding: 0;
}
.col-md-10{
text-align: left;
}
p#name, p#commenting{
margin: 0;
}
span#name, span#date{
color: gray;
}
span#date{
margin-left: 130px;
}
#title{
color: #DF9322;
margin-bottom: 15px;
}
#title span.material-symbols-outlined{
margin-left: 30px;
font-size: 20px;
}
.heading{
margin-bottom: 30px;
margin-left: 10px;
}
.heading #signature{
font-size: 30px;
margin: auto 30px;
}
form #comment{
width: 80%;
}
</style>
<title>Individual Artwork</title>
</head>
<body>
<div class="main-nav">
<nav class="nav">
<a class="nav-link" href="index.php#arts">HOME</a>
<a class="nav-link" href="about.php">ABOUT</a>
<a class="nav-link" href="artist.php">ARTISTS</a>
<a class="nav-link" href="index.php#last-arrow">CONTACT</a>
<?php
if (!empty($_SESSION['userID']) && $_SESSION['isAdmin'] == 1) {
echo ("<a class='nav-link' href='adminverification.php'>ADMIN</a>");
}
?>
<?php
if (!empty($_SESSION['userID'])) {
echo ("<a class='nav-link' id='user' href='logout.php'>SIGN OUT</a>");
} else {
echo ('<a class="nav-link" id="user" href="login.php">SIGN IN</a>');
}
?>
</nav>
<hr class="new1">
</div>
<div class="container-fluid">
<?php
require_once('configuration.php');
$uid = $_GET['uid'];
// $q = "SELECT artwork.artworkID, signature_name, artworkTitle, commentMessage, users.image, link, artworkDescription, numLikes FROM users INNER JOIN artist ON artist.artistID = users.userID INNER JOIN artwork ON artist.artistID = artwork.artistID INNER JOIN link ON linkID = artwork.artworkID LEFT JOIN `artworkLikes` ON artwork.artworkID= artworklikes.artworkID LEFT JOIN comment ON artwork.artworkID = comment.artworkID WHERE artwork.artworkID =1;";
$q = "SELECT * FROM users INNER JOIN artist ON artist.artistID = users.userID inner join artwork ON artwork.artistID = users.userID inner join link ON linkID = artwork.artworkID left JOIN `artworklikes` ON artwork.artworkID = artworklikes.artworkID WHERE artwork.artworkID ='$uid';";
$result = $conn->query($q);
if($result->num_rows > 0){
$options = mysqli_fetch_assoc($result);
}
$_SESSION['artworkID'] = $options['artworkID'];
?>
<div class="row">
<div class="col-md-6 alignn">
<h1 id='title'>
<span><?= $options['artworkTitle']; ?></span>
<a href="like.php"><span id="like-btn" class="material-symbols-outlined">
favorite <span id="numOfLikes"><?= $options['numLikes']; ?></span>
</span></a>
</h1>
<img src="<?= $options['link']; ?>" style="height: 400px; width: 500px;">
<div style="margin-top: 5%; text-align:center;">
<p>
<?= $options['artworkDescription']; ?>
</p>
</div>
</div>
<div class="col-md-6 alignn">
<div class="row heading">
<div>
<?php
if(!$options['image']){
echo '<img src="artists/profile.png" class="rounded-circle" style="height: 100px; width:100px" alt="Cinque Terre">';
} else{
echo '<img src="'.$options['image'].'" class="rounded-circle" style="height: 100px; width:100px" alt="Cinque Terre">';
}
?>
<span id='signature'><?= $options['signature_name']; ?></span>
<span class="material-symbols-outlined">verified</span>
</div>
</div>
<!-- All comments -->
<div id="comments">
<div class="material-symbols-outlined" style="text-align: center;">forum</div>
<?php
require_once('configuration.php');
$query = "SELECT commentMessage, datePosted, email, `image` FROM comment INNER JOIN users ON comment.userID = users.userID WHERE comment.artworkID='$uid'";
$result = $conn->query($query);
if($result->num_rows > 0){
$options = mysqli_fetch_all($result, MYSQLI_ASSOC);
for ($x = 0; $x < count($options); $x++){
?>
<div class="row single-comment">
<div class="main-comment">
<div class="row">
<div class='col-md-2'>
<?php
if(!$options[$x]['image']){
echo '<img src="artists/profile.png" class="rounded-circle" style="height: 100px; width:100px" alt="Cinque Terre">';
} else{
echo '<img src="'.$options[$x]['image'].'" class="rounded-circle" style="height: 50px; width:50px" alt="Cinque Terre">';
}
?>
</div>
<div class='col-md-10'>
<span id='name' style="font-size: 15px;"><?= $options[$x]['email'] ?></span>
<span id='date' style="font-size: 15px;"><?= $options[$x]['datePosted'] ?></span>
<p id="commenting"><?= $options[$x]['commentMessage'] ?></p>
</div>
</div>
<hr style='background-color: gray; width: 470px;'>
</div>
</div>
<?php }} ?>
<?php
if (!empty($_SESSION['wcomment'])) {
echo ("<p style='color: red; text-align: center;'>".$_SESSION['wcomment']."</p>");
unset($_SESSION['wcomment']);
}
if (!empty($_SESSION['comment'])) {
echo ("<p style='color: green; text-align: center;'>".$_SESSION['comment']."</p>");
unset($_SESSION['comment']);
}
?>
<form action="comment_proc.php" method='POST'>
<input type="text" placeholder='comment' name='comment' id='comment'>
<input type="text" value='<?= $uid ?>' name='uid' hidden>
<input type="submit" name='comment-submit' id='submit'>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="container nopadding">
<div class="row">
<div class="col-md-3">
<img src="images/i2.jpg" class="rounded-circle" style="height: 100px; width:20%" alt="Cinque Terre">
</div>
<div class="col-md-3">
The Creator <br> The CMaster
</div>
</div>
</div> -->
</div>
</body>
</html>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script
</body>
</html>