-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.php
More file actions
207 lines (165 loc) · 4.13 KB
/
Copy pathcreate.php
File metadata and controls
207 lines (165 loc) · 4.13 KB
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
<?php
include 'php/logged.php';
include 'php/db.php';
error_reporting(-1);
?>
<div id="create">
<style>
li { cursor: pointer; }
li.current { font-weight: bold };
a {
text-decoration: none;
}
.pause {
font-size: 24px;
}
.player-header {
background: #fff;
font-family: 'Lato', sans-serif;
font-weight: 300;
color: #2d2d2d;
padding: 30px;
margin: 0 auto;
width: 90%;
}
.artwork {
max-width: 150px;
float: left;
margin-right: 30px;
}
h5 {
font-size: 24px;
margin: 0 0 10px 0;
}
header span {
display: block;
font-size: 18px;
margin-bottom: 10px;
}
.controls {
float: left;
margin-bottom: 0;
}
.controls a {
color: #606060;
transition: color .3s ease-out;
}
.controls a:hover {
color: #2d2d2d;
transition: color .3s ease-out;
}
.length {
float: right;
}
.double {
margin-left: -10px
}
.progress {
width: 70%;
height: 5px;
background: #606060;
clear: both;
position: relative;
bottom: 5px;
left: 30%;
}
.bar {
background: #bf5656;
height: 5px;
width: 80%;
}
.playlist {
margin-top: 20px;
font-size: 18px;
overflow: scrollbar;
}
.song {
text-overflow:ellipsis;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
}
.song:hover i {
opacity:1;
transition: opacity .2s ease-out;
}
.playlist i {
opacity: 0;
color: #bf5656;
transition: opacity .2s ease-out;
cursor: pointer;
}
.playlist span {
margin-right: 20px;
}
.playlist .duration {
float: right;
margin-right: 0;
}
.playlist .title {
width: 420px;
display:inline-block;
}
</style>
<?php
if( !isset($_GET['id']) )
{
echo ' <header class="player-header">
<img src="images/art.jpg" alt="" class="artwork">
<div class="track-details">
<h5>'.$_GET['name'].'</h5>
<span class="hashtag">'.$_GET['hashtag'].'</span>
<span>Author: '.$_SESSION['FirstName'].' '.$_SESSION['LastName'].'</span>
</div>
<span class="length">00:00:00</span>
<div class="progress">
<div class="bar"></div>
</div>
</header>';
echo '<form>
<input type="hidden" id="playlist_name" value="'.$_GET['name'].'">
<ul id="sortable2"><li id="nothing" class="ui-state-default">Drop Songs Here</li></ul>
<input type="button" id="CreatePlaylistButton" onClick="createPlaylist();" value="Save">
</form>
</div>';
}
else
{
$id = $_SESSION['id'];
$playlist_id = $_GET['id'];
$data = mysql_query("SELECT * from user_playlist WHERE id = '$playlist_id' AND userid = '$id' ");
$info = mysql_fetch_array( $data );
$data = mysql_query("SELECT FirstName, LastName from user_login WHERE id = '$id' ");
$user = mysql_fetch_array( $data );
$name = $info['name'];
echo ' <header class="player-header">
<img src="images/art.jpg" alt="" class="artwork">
<div class="track-details">
<h5>'.$name.'</h5>
<span class="hashtag">'.urldecode($info['hashtag']).'<span>
<span>Author: '.$user['FirstName'].' '.$user['LastName'].'</span>
<span>Last Updated: '.time_elapsed_string($info['updated']).'</span>
</div>
<span class="length">'.gmdate("H:i:s", $info['playtime']).'</span>
<div class="progress">
<div class="bar"></div>
</div>
</header>';
echo ' <form>
<input type="hidden" value="'.$name.'" id="playlist_name" ReadOnly = "True" placeholder="Playlist Name">
<ul id="sortable2"> ';
$data = mysql_query("SELECT song_name, song_href, song_time from user_songs WHERE playlist_id = '$playlist_id' AND userid = '$id' ORDER BY pid ASC ");
while( $info = mysql_fetch_array( $data ) )
{
$song_href = $info['song_href'];
$song_name = $info['song_name'];
echo '<li class=""><div class="preview"><p><a duration='.$info['song_time'].' target="_blank" href="'.$song_href.'" >'.$song_name.'</a> </a></p></div>
<button class="fa fa-pencil fa-fw button-edit button-list"></button>
<button class="fa fa-trash-o fa-fw button-delete button-list" ></button>
<button class="fa fa-play fa-fw button-play button-list" onclick="playaudio(\''.urlencode($song_href).'\'); "></button></li>';
}
echo '</ul>
<input type="button" id="CreatePlaylistButton" onClick="createPlaylist();" value="Save">
</form> </div>';
}
?>