-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewplaylist.php
69 lines (56 loc) · 1.56 KB
/
viewplaylist.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
<?php
session_start();
// include('header.php');
$id = $_GET['id'];
$user_id = $_SESSION['user_id'];
// echo $id;
?>
<div class="col-md-2">
</div>
<div class="col-md-8">
<a href="/add_pl_track.php?id=<?php echo $_GET['id'];?>">
<button type="submit" class="btn btn-default">Add Tracks</button></a>
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>Track Name</th>
</tr>
</thead>
<tbody>
<?php
include "config.php";
$title='View Playlist';
include('header.php');
function list_tracks() {
$output = "";
$x=1;
$result = mysql_query("SELECT * FROM playlist_track WHERE play_id = '".$_GET['id']."'");
while ($row = mysql_fetch_array($result)){
$result1 = mysql_query("SELECT * FROM track WHERE id = '".$row['track_id']."'");
$row1 = mysql_fetch_array($result1);
$output .= '
<tr>
<td>' . $row1['name'] . '</td>
<td><audio controls preload="none" onloadeddata="myFunction()" >
<source src="tracks/'.$row1['path'].'" type="audio/mp3">
</audio>
<script>
function myFunction() {
alert("The video is now playing");
}
function pausefunc() {
alert("The video ispaused");
}
</script></td>
<td><a href="/delete_track.php?id='.$row['track_id'].'&plid='.$_GET['id'].'">
<button type="submit" class="btn btn-default">Delete</button></a></td>
';
$output.= '</tr>';
}
return $output;
}
echo list_tracks();
?>
</tbody>
</table>
<?php include('footer.php'); ?>