-
Notifications
You must be signed in to change notification settings - Fork 3
/
Manage Playlists.php
107 lines (93 loc) · 2.89 KB
/
Manage Playlists.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
<?php
require("methods.php");
session_start();
if (!isset($_SESSION['username'])) {
$username = "Test Username";
} else {
$username = $_SESSION['username'];
}
$db_playlists = connectPlaylists();
$playlists = getManagePlaylistButtons($db_playlists, "test");
$db_playlists->close();
$body = <<<BODY
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Codystar' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Lobster Two' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Marvel' rel='stylesheet'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
function addPlaylist(){
var name = prompt("Enter Playlist Name");
$.ajax({
url: 'ajaxAddPlaylist.php',
type: 'post',
data: { name: '' + name},
success: function(data){
window.location.href = 'Edit Playlist.php?playlistName=' + name;
}
});
}
function ajaxRemove(name){
$.ajax({
url: 'ajaxRemovePlaylist.php',
type: 'post',
data: { name: '' + name},
success: function(data){
window.location.href = 'Manage Playlists.php';
}
});
}
</script>
</head>
<body>
<section class="container topnav">
<center>
<a class="icon" style="position: fixed; left: 0;"><i class="fa fa-user-circle-o" style="color: black;">
<section class="container topnavtext">
$username
</section>
</i></a>
<a class="icon" href="Login.php" style="position: fixed; right: 0;"><i class="fa fa-sign-out">
<section class="container topnavtext">
Logout
</section>
</i></a>
</center>
</section>
<section class="container header">
<h1>JUKEBOX</h1>
<h2>Playlist</h2>
</section>
<section class="container list item-list">
<ul>
$playlists
</ul>
</section>
<section class="container header">
<a class="icon" onclick="addPlaylist()"><i class="fa fa-plus-square-o" onclick=addSong() style="font-size: 50px; padding-bottom: 100px;"></i>
</a>
</section>
<section class="container list item-list">
<ul>
<li>
<a class='icon-button'>
</a>
<a class='item' href='Liked Songs.php'>Liked Songs<i class='fa fa-angle-right'></i>
</a>
</li>
</ul>
</section>
<section class="container nav">
<center>
<a class="icon" href="Home.php"><i class="fa fa-home" ></i></a>
<a class="icon" href="Manage Playlists.php"><i class="fa fa-list" style="color: #FFFFFF;"></i></a>
<a class="icon" href="Currently Playing.php"><i class="fa fa-play"></i></a>
</center>
</section>
</body>
BODY;
echo genPage("Playlists", $body);
?>