-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_show_episodes.php
394 lines (251 loc) · 11.7 KB
/
all_show_episodes.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
<?php
ob_start();
include('includes/db.php');
session_start();
if (empty($_COOKIE['remember_me'])) {
if (empty($_SESSION['user_id'])) {
header('location:login.php');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include_once("includes/head.php"); ?>
<title>All Show Episodes</title>
</head>
<body class="page-body" data-url="http://neon.dev">
<div class="page-container">
<!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->
<!-- leftbar starts -->
<?php include_once("includes/left-bar.php"); ?>
<!-- leftbar ends -->
<div class="main-content">
<div class="row">
<!-- header starts-->
<?php include_once("includes/header.php"); ?>
<!-- header ends -->
</div>
<hr />
<ol class="breadcrumb bc-3">
<li>
<a href="index.html"><i class="fa-home"></i>Home</a>
</li>
<li>
<a href="#">DJ Sets</a>
</li>
<li class="active">
<strong>All DJ Sets</strong>
</li>
</ol>
<h2>All DJ Sets</h2>
<?php
if (isset($_GET["status"])) {
if ($_GET["status"] == "edit_succ") {
?>
<br>
<div class="alert alert-success alert-dismissible" role="alert">
<strong>Congrats!</strong> Successfully Updated
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
} else if ($_GET["status"] == "edit_fail") {
?>
<br>
<div class="alert alert-success alert-danger" role="alert">
<strong>Congrats!</strong> Something Went Wrong, Update Failed
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if ($_GET["status"] == "del_succ") {
?>
<br>
<div class="alert alert-success alert-dismissible" role="alert">
<strong>Congrats!</strong> Successfully Deleted
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if ($_GET["status"] == "del_fail") {
?>
<br>
<div class="alert alert-success alert-danger" role="alert">
<strong>Congrats!</strong> Something Went Wrong, Deltetion Failed
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
}
?>
<br />
<script type="text/javascript">
jQuery(document).ready(function($) {
var $table1 = jQuery('#table-2');
// Initialize DataTable
$table1.DataTable({
"aLengthMenu": [
[10, 25, 50, -1],
[10, 25, 50, "All"]
],
"bStateSave": true,
responsive: true
});
// Initalize Select Dropdown after DataTables is created
$table1.closest('.dataTables_wrapper').find('select').select2({
minimumResultsForSearch: -1
});
});
</script>
<!-- <h3>Table without DataTable Header</h3> -->
<table class="table table-bordered datatable wrap" id="table-2">
<thead>
<tr>
<th>Id</th>
<th>Created By</th>
<th>Show Name</th>
<th>DJ Sets</th>
<th>Show Episode Number</th>
<th>Episode Name</th>
<th>Main Host</th>
<th>Co-Host</th>
<th>Guests</th>
<th>Produced By</th>
<th>Status</th>
<th>Notes</th>
<th>Tags</th>
<th>URL YT</th>
<th>URL SC</th>
<th>Plateform</th>
<th>Created at</th>
<th>Updated By</th>
<th>Updated at</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$query = $conn->prepare(
"SELECT show_episodes.*, show_names.show_name as show_name, users.name Creator, a.name Modifier
FROM show_episodes
JOIN show_names
On show_episodes.show_name=show_names.id
JOIN users
ON show_episodes.created_by=users.id
JOIN users a
ON show_episodes.updated_by=a.id
ORDER BY show_episodes.created_by asc
"
);
$query->execute();
while ($result = $query->fetch(PDO::FETCH_ASSOC)) {
$show_episode_id = $result["id"];
$query_show_djs = $conn->prepare("SELECT * FROM show_episode_djs where show_episode_id='$show_episode_id'");
$query_show_djs->execute();
$ind = 0;
while ($result_show_djs = $query_show_djs->fetch(PDO::FETCH_ASSOC)) {
$dj_set_id = $result_show_djs["dj_set_id"];
$query_dj_set_names = $conn->prepare("SELECT * FROM dj_sets where id='$dj_set_id'");
$query_dj_set_names->execute();
while ($result_dj_set_names = $query_dj_set_names->fetch(PDO::FETCH_ASSOC)) {
$dj_set_names_arr[$ind++] = $result_dj_set_names["set_name"];
}
}
?>
<tr>
<td><?php echo $i++; ?></td>
<td><?php echo ucwords($result["Creator"]); ?></td>
<td><?php echo ucwords($result["show_name"]); ?></td>
<td><?php
// var_dump($song_name_arr);
foreach ($dj_set_names_arr as $key => $set_name) {
# code...
echo ucwords($set_name) . "<br><hr>";
}
?></td>
<td><?php echo "000" . $result["show_episode_number"]; ?></td>
<td><?php echo ucwords($result["episode_name"]); ?></td>
<td><?php echo $result["main_host"]; ?></td>
<td><?php echo $result["co_host"]; ?></td>
<td><?php echo $result["guests"]; ?></td>
<td><?php echo $result["produced_by"]; ?></td>
<td><?php echo ucwords($result["status"]); ?></td>
<td><?php echo ucfirst($result["notes"]); ?></td>
<td><?php echo ucwords($result["tags"]); ?></td>
<td><?php echo $result["url_yt"]; ?></td>
<td><?php echo $result["url_sc"]; ?></td>
<td><?php echo $result["plateform"]; ?></td>
<td><?php echo $result["created"]; ?></td>
<td><?php echo ucwords($result["Modifier"]); ?></td>
<td><?php echo $result["updated"]; ?></td>
<?php
// if (isset($_GET["access"])) {
?>
<!-- <td> -->
<!-- <a href="delete_dj sets.php?id=<?php //echo $result["id"]
?>" class="btn btn-danger btn-sm btn-icon icon-left">
<i class="entypo-cancel"></i>
Delete
</a> -->
<!-- </td> -->
<?php
// } else {
?>
<td>
<a href="edit_show_episodes.php?show_episode_id=<?php echo $result["id"]?>" class="btn btn-default btn-sm btn-icon icon-left">
<i class="entypo-pencil"></i>
Edit
</a>
<a href="delete_show_episodes.php?id=<?php //echo $result["id"]
?>" class="btn btn-danger btn-sm btn-icon icon-left">
<i class="entypo-cancel"></i>
Delete
</a>
</td>
<?php
// }
?>
</tr>
</tr>
<?php
}
?>
</tbody>
</table>
<br />
<br />
<!-- Footer starts -->
<?php include_once("includes/footer.php"); ?>
<!-- Footer end -->
</div>
</div>
<!-- Imported styles on this page -->
<link rel="stylesheet" href="assets/js/datatables/datatables.css">
<link rel="stylesheet" href="assets/js/select2/select2-bootstrap.css">
<link rel="stylesheet" href="assets/js/select2/select2.css">
<!-- Bottom scripts (common) -->
<script src="assets/js/gsap/TweenMax.min.js"></script>
<script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/joinable.js"></script>
<script src="assets/js/resizeable.js"></script>
<script src="assets/js/neon-api.js"></script>
<!-- Imported scripts on this page -->
<script src="assets/js/datatables/datatables.js"></script>
<script src="assets/js/select2/select2.min.js"></script>
<script src="assets/js/neon-chat.js"></script>
<!-- JavaScripts initializations and stuff -->
<script src="assets/js/neon-custom.js"></script>
<!-- Demo Settings -->
<script src="assets/js/neon-demo.js"></script>
</body>
</html>