forked from The-Creatives-Inc/creatives-inc-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathartist.php
216 lines (183 loc) · 7.15 KB
/
artist.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
<?php
session_start(); // Session starts here.
$_SESSION["page"] = "artist.php";
?>
<!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">
<!-- 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>
a{
color: white;
}
a:hover{
color: #DF9322;
text-decoration: none;
}
body{
background: #000000;
color: white;
font-family: 'Montserrat', sans-serif;
}
.main-nav{
position: sticky;
top: 0;
z-index: 1;
background-color: rgba(0,0,0,0.8);
margin-bottom: 70px;
}
.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);
}
hr.new1 {
border-top: 3px solid white;
margin: 0px;
width: 100%;
}
.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);
}
img{
border: 5px solid white;
border-radius: 20px;
box-shadow: 5px 5px 5px #DF9322;
-moz-box-shadow: 5px 5px 5px #DF9322;
-webkit-box-shadow: 5px 5px 5px #DF9322;
-khtml-box-shadow: 5px 5px 5px ;
}
.nopadding{
margin-bottom: 30px;
}
.grow img{
transition: 1s ease;
}
.grow img:hover{
-webkit-transform: scale(1.2);
-ms-transform: scale(1.2);
transform: scale(1.2);
transition: 1s ease;
}
#current{
color: #DF9322;
}
</style>
<title>Artist</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" id='current'>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' href='logout.php'>SIGN OUT</a>");
} else {
echo ('<a class="nav-link" href="login.php">SIGN IN</a>');
}
?>
</nav>
<hr class="new1">
</div>
<?php
require_once('configuration.php');
//$query = "SELECT signature_name, `image`, link, field_name, artworkID FROM artist INNER JOIN users ON users.userID = artist.artistID
//INNER JOIN field ON field.fieldID = users.fieldID INNER JOIN artwork ON artwork.artistID = artist.artistID INNER JOIN link ON link.linkID = artwork.artworkID";
$query = "SELECT artistID, signature_name, `image`, field_name FROM artist INNER JOIN users ON users.userID = artist.artistID
INNER JOIN field ON field.fieldID = users.fieldID";
$result = $conn->query($query);
if($result->num_rows > 0){
$options = mysqli_fetch_all($result, MYSQLI_ASSOC);
}
?>
<?php
for ($x = 0; $x < count($options); $x++){
?>
<div class="container nopadding">
<div class="row">
<div class="col-md-3">
<div class="grow">
<a href="individualartist.php?aid=<?= $options[$x]['artistID']; ?>">
<?php
if(!$options[$x]['image']){
echo '<img src="artists/profile.png" class="rounded float-left" style="height: 200px; width: 200px"';
} else{
echo '<img src="'.$options[$x]['image'].'" class="rounded float-left" style="height: 200px; width: 200px">';
}
?>
</a>
</div>
</div>
<div class="col-md-3">
<a href="individualartist.php?aid=<?= $options[$x]['artistID']; ?>">
<p><?= $options[$x]['signature_name']; ?><br> Category: <?= $options[$x]['field_name']; ?></p>
</a>
</div>
<?php
$aid= $options[$x]['artistID'];
$query1 = "SELECT artworkID, link FROM artwork INNER JOIN link ON link.linkID = artwork.artworkID
INNER JOIN artist ON artwork.artistID = artist.artistID WHERE artist.artistID='$aid' LIMIT 3";
$result1 = $conn->query($query1);
if($result1->num_rows > 0){
$options1 = mysqli_fetch_all($result1, MYSQLI_ASSOC);
}
for ($y = 0; $y < count($options); $y++){
?>
<div class="grow col-md-2">
<a href="individualartwork.php?uid=<?= $options1[$y]['artworkID'];?>"><img src="<?= $options1[$y]['link']; ?>" style="height: 150px; width: 150px"></a>
</div>
<?php } ?>
</div>
</div>
<?php
}
?>
<!-- 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>
</body>
</html>