Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashy commencing #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AddPlaylist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
require("methods.php");
$db = connect();
if ($_GET["playlistName"]){
createPlaylist($db, $_GET["playlistName"]);
}
header("Location: EditPlaylist.php?playlistName=".$_GET["playlistName"]);
$db->close();
?>
148 changes: 38 additions & 110 deletions Create Playlist.html
Original file line number Diff line number Diff line change
@@ -1,111 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
$( "#sortable-1" ).sortable();
$( "#addNew" ).sortable();
});
</script>
<script>
var songCount = 0;
function addNewSong() {
songCount = songCount + 1;
var currCount = songCount;
var icon = document.createElement('i');
icon.className ="fa fa-reorder";
icon.style = "color:white; font-size: 18px; padding-right:5px";
icon.id = "icon" + currCount;
var box = document.createElement('div');
var listItem = document.createElement('li');

box.className = "regbox";
box.style = "font-size: 16px;";

var node = document.createTextNode("Song Title " + currCount + " - Artist Name");

box.appendChild(node);
listItem.id = "song" + currCount
var close = document.createElement('i');
close.className = "fa fa-close";
close.style="font-size: 15px;float: right;";
close.id = "delete";
close.onclick = function() {removeSong(currCount)};

box.appendChild(close);
listItem.appendChild(icon);
listItem.appendChild(box);
var element = document.getElementById("addNew");
element.appendChild(listItem);
}

function removeSong(songCount) {
var parent = document.getElementById("addNew");

var child = document.getElementById("song"+ songCount);
var iconChild = document.getElementById("icon"+ songCount);

parent.removeChild(child);
parent.removeChild(iconChild);
}

function removePlaylist() {
if (confirm("Are you sure you want to delete this playlist?")) {
window.location.href = "Home.html"
//will remove all instances of playlist
}
}
</script>
</head>

<body>
<h1>JUKEBOX</h1>
<h2>Create Playlist</h2>

<center style="font-family: arial;color: white;font-size=20px;">
<form action="/action_page.php">
<label> Name:</label>
<input type="text" style="width: 98%; line-height: 50px; width:38%; margin-right: 5%;" placeholder="Enter Playlist Name...">
<!--
<a href="#"><i class="fa fa-trash-o" onclick="removePlaylist()" style="font-size: 35px; vertical-align: middle;"></i></a>
-->
</form>
</center>

<center style="font-family: arial;color: white;font-size=20px;">
<div>
<form action="/action_page.php">
<label> URL:</label>
<input type="text" style="line-height: 50px;width:40%;" placeholder="Enter YouTube Link...">
<a href="#"><i class="fa fa-plus-square-o" onclick="addNewSong()" style="font-size: 35px; vertical-align: middle;"></i></a>
</form>
</div>

</center>

<center class="center-container" style="padding-top: 10px; padding-bottom: 10px;">
<ul id="addNew">
</ul>
</center>

<div class="nav">
<center style="background-color: #141f1f; padding-bottom: 10px; padding-top: 10px;">
<a href="Playlists.html"><i class="fa fa-check-circle-o" style="font-size: 40px; "></i></a>
<a href="Playlists.html"><i class="fa fa-times-circle-o" style="font-size: 40px; padding-left:20px"></i></a>
</center>

<center>
<a class="a icon" href="Home.html"><i class="fa fa-home" style="font-size: 50px; padding: 15px;"></i></a>
<a class="a icon" href="Playlists.html"><i class="fa fa-music" style="font-size: 50px; padding: 15px; color: #4656ea"></i></a>
<a class="a icon" href="Currently Playing.html"><i class="fa fa-volume-up" style="font-size: 50px; padding: 15px;"></i></a>
</center>
</div>
</body>
<!DOCTYPE html>
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<section class="container header">
<h1>JUKEBOX</h1>
<h2>Create Playlist</h2>
</section>

<section class="container list form-list">
<form action="AddPlaylist.php" method="GET">
<ul>
<li>
<label>Party Name:</label>
<input type="text" name="playlistName" value="Enter Playlist Name">
</li>
<li>
<input type="submit" value="Create Playlist">
</li>
</form>
</section>

<section class="container nav">
<center>
<a class="icon" href="Home.html"><i class="fa fa-home" style="font-size: 50px; padding: 15px;"></i></a>
<a class="icon" href="Playlists.php"><i class="fa fa-music" style="font-size: 50px; padding: 15px;"></i></a>
<a class="icon" href="CurrentlyPlaying.php"><i class="fa fa-volume-up" style="font-size: 50px; padding: 15px;"></i></a>
</center>
</section>
</body>

</html>
107 changes: 107 additions & 0 deletions Create Playlist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
$( "#sortable-1" ).sortable();
$( "#addNew" ).sortable();
});
</script>
<script>
var songCount = 0;
function addNewSong() {
songCount = songCount + 1;
var currCount = songCount;
var icon = document.createElement('i');
icon.className ="fa fa-reorder";
icon.style = "color:white; font-size: 18px; padding-right:5px";
icon.id = "icon" + currCount;

var box = document.createElement('div');
var listItem = document.createElement('li');

box.className = "regbox";
var node = document.createTextNode("Song" + currCount);
box.appendChild(node);
listItem.id = "song" + currCount
var close = document.createElement('i');
close.className = "fa fa-close";
close.style="font-size: 15px;float: right;";
close.id = "delete";
close.onclick = function() {removeSong(currCount)};

box.appendChild(close);
listItem.appendChild(icon);
listItem.appendChild(box);
var element = document.getElementById("addNew");
element.appendChild(listItem);
}

function removeSong(songCount) {
var parent = document.getElementById("addNew");

var child = document.getElementById("song"+ songCount);
var iconChild = document.getElementById("icon"+ songCount);

parent.removeChild(child);
parent.removeChild(iconChild);
}

function removePlaylist() {
if (confirm("Are you sure you want to delete this playlist?")) {
window.location.href = "Home.html"
//will remove all instances of playlist
}
}
</script>
</head>

<body>
<h1>JUKEBOX</h1>
<h2>Create Playlist</h2>

<center style="font-family: arial;color: white;font-size=20px;">Name:
<div class="regbox" style="line-height: 50px; width:38%;">
<form action="/action_page.php">
<input type="text" style="width: 98%;" value="Enter Playlist Name">
</form>
</div>
<!-- Update onclick function -->
<a href="#"><i class="fa fa-trash-o" onclick="removePlaylist()" style="font-size: 35px; vertical-align: middle;"></i></a>
</center>

<center style="font-family: arial;color: white;font-size=20px;">URL:
<div class="regbox" style="line-height: 50px;width:40%;">
<form action="/action_page.php">
<input type="text" style="width: 98%;" value="Enter YouTube Link">
</form>
</div>
<a href="#"><i class="fa fa-plus-square-o" onclick="addNewSong()" style="font-size: 35px; vertical-align: middle;"></i></a>
</center>

<center class="center-container" style="padding-top: 10px; padding-bottom: 10px;">
<ul id="addNew">
</ul>
</center>

<section class="container nav">
<center style="background-color: #141f1f; padding-bottom: 10px; padding-top: 10px;">
<a href="Playlists.php"><i class="fa fa-check-circle-o" style="font-size: 40px; "></i></a>
<a href="Playlists.php"><i class="fa fa-times-circle-o" style="font-size: 40px; padding-left:20px"></i></a>
</center>

<center>
<a class="a icon" href="Home.html"><i class="fa fa-home" style="font-size: 50px; padding: 15px;"></i></a>
<a class="a icon" href="Playlists.php"><i class="fa fa-music" style="font-size: 50px; padding: 15px;"></i></a>
<a class="a icon" href="CurrentlyPlaying.php"><i class="fa fa-volume-up" style="font-size: 50px; padding: 15px;"></i></a>
</center>
</section>
</body>
</html>
Loading