-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
258 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.add:hover{ | ||
background: rgba(0, 215, 0, 0.5); | ||
transition: background 1s; | ||
} | ||
.delete:hover{ | ||
background: rgba(215, 0, 0, 0.5); | ||
transition: background 1s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function laduj(tryb){ | ||
var xmlhttp = new XMLHttpRequest(); | ||
var szukaj = document.getElementById("szukajka").value; | ||
xmlhttp.open("GET", "sprawdzaniePiosController.php?Tryb=" + tryb + "&szukaj=" + szukaj, true); | ||
xmlhttp.send(); | ||
xmlhttp.onreadystatechange = function(){ | ||
if(this.readyState == 4 && this.status == 200){ | ||
document.getElementById("info").innerHTML = this.responseText; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
session_start(); | ||
?> | ||
<!DOCTYPE html> | ||
<html lang="pl"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Strona główna</title> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css"> | ||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/skeleton.css"> | ||
<link rel="stylesheet" href="css/index.css"> | ||
<link rel="stylesheet" href="css/panelAdmin.css"> | ||
<link rel="stylesheet" href="css/loader.css"> | ||
<link rel="stylesheet" href="css/snackbar.css"> | ||
<link rel="stylesheet" href="css/musicList.css"> | ||
<link rel="stylesheet" href="css/sprawdzaniePios.css"> | ||
<script src="js/jquery-3.1.1.min.js"></script> | ||
<script src="js/loginModalClosing.js"></script> | ||
<script src="js/loader.js"></script> | ||
<script src="js/snackbar.js"></script> | ||
<script src="js/sprawdzaniePiosController.js"></script> | ||
</head> | ||
<body onload="timeOut();"> | ||
<div class="container"> | ||
<div id="loader"></div> | ||
<div class="row" id="header"> | ||
<div class="twelve columns"><a href="index.php" class="noLink"><h1>Radio MIX</h1></a></div> | ||
</div> | ||
<div class="row" id="content" style="margin-top: 4%;"> | ||
<div class="twelve columns"> | ||
<?php | ||
if(!isset($_SESSION['AdminLogin'])){ | ||
//Wyświetlanie panelu logowania | ||
?> | ||
<div id="LoginPopup"> | ||
<div id="imgUP"> | ||
<img src="images/user.ico" id="loginImg"/> | ||
</div> | ||
<div id="contentForm" style="margin-top: 5%;padding-bottom: 6%;" > | ||
<form action="zaloguj.php" method="post"> | ||
<span><b>Login:</b></span><br> | ||
<input type="text" name="login" placeholder="Wpisz login" required/> <br> | ||
<span><b>Hasło:</b></span><br> | ||
<input type="password" name="haslo" placeholder="Wpisz hasło" required/> <br> | ||
<input type="submit" class="button-primary" name="Zaloguj" value="Zaloguj"/> | ||
</form> | ||
</div> | ||
</div> | ||
<script>openModal();</script> | ||
<?php | ||
} else { | ||
include"sprawdzaniePiosCon.php"; | ||
} | ||
?> | ||
</div> | ||
</div> | ||
</div> | ||
<footer id="footer"> | ||
Kamil Langer © kamillanger4@gmail.com | ||
</footer> | ||
<div id="snackbar"><span id="tekst"></span></div> | ||
<?php | ||
if(isset($_SESSION['zbanowano'])){ | ||
?><script>openSnackbarBAN();</script><?php | ||
} else if(isset($_SESSION['dodano'])){ | ||
?><script>openSnackbarDM();</script><?php | ||
} else if(isset($_SESSION['odrzucono'])) { | ||
?><script>openSnackbarOdrzucono();</script><?php | ||
} | ||
unset($_SESSION['zbanowano']); | ||
unset($_SESSION['dodano']); | ||
unset($_SESSION['odrzucono']); | ||
?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="row"> | ||
<input type="text" id="szukajka" name="search" placeholder="Wpisz numer ID propozycji"> | ||
<button onclick="laduj('szukajka')">Szukaj</button> | ||
</div> | ||
<div class="row" style="text-align: center;"> | ||
<script>laduj("ostatni");</script> | ||
<div id="info" style="font-size: 20px;"> | ||
ID propozycji:<span id="ID"></span><br> | ||
Autor:<span id="Autor"></span><br> | ||
Tytuł:<span id="Tytul"></span><br> | ||
Link:<span id="Link"></span><br> | ||
Status:<span id="Status"></span><br> | ||
IP:<span id="IP"></span><br> | ||
</div> | ||
<div id="controls"> | ||
<button onclick="laduj('ban')">BAN</button> | ||
<button class="add" onclick="laduj('przyjeta')">Dodaj do bazy</button> | ||
<button class="delete" onclick="laduj('odrzucona')">Usuń propozycje</button><br> | ||
<a href="panelAdmin.php">Wróć</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?php | ||
session_start(); | ||
require_once "connect.php"; | ||
@$polaczenie = new mysqli($host, $db_user, $db_password, $db_name); | ||
@$polaczenie->set_charset("utf8"); | ||
@$polaczenie->query("SET CHARACTER_SET utf8_polish_ci"); | ||
if($polaczenie->connect_errno!=0){ | ||
echo "Error: ".$polaczenie->connect_errno; | ||
} else { | ||
$tryb = $_REQUEST['Tryb']; | ||
if($tryb == "ostatni"){ | ||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `Status`='0'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$_SESSION['IDpios'] = $wiersz['ID']; | ||
echo "ID propozycji:".$wiersz['ID'].'<br>'; | ||
echo "Autor: <span id='autor'>".$wiersz['Autor'].'</span><br>'; | ||
echo "Tytuł: <span id='tytul'>".$wiersz['Tytul'].'</span><br>'; | ||
echo 'Link: <a href="'.$wiersz['Link'].'">'.$wiersz['Link'].'</a><br>'; | ||
echo 'Status: oczekuje <br>'; | ||
echo 'IP: <span id="ip">'.$wiersz['IP'].'</span><br>'; | ||
} else if($tryb == "ban"){ | ||
$ID = $_SESSION['IDpios']; | ||
$login = $_SESSION['login']; | ||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `ID`='{$ID}'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$IP = $wiersz['IP']; | ||
$Data = date("Y.m.d H:i:s"); | ||
$info = "Ban IP: ".$IP; | ||
mysqli_query($polaczenie, "UPDATE `waszeprop` SET `Status`='2' WHERE `ID`='{$ID}'"); | ||
mysqli_query($polaczenie, "INSERT INTO `ban`(`IP`, `Data`) VALUES ('{$IP}','{$Data}')"); | ||
$IP = $_SERVER['REMOTE_ADDR']; | ||
mysqli_query($polaczenie, "INSERT INTO `logi`(`IP`, `Login`, `Data`,`Czynnosc`) VALUES ('{$IP}','{$login}','{$Data}','{$info}')"); | ||
|
||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `Status`='0'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$_SESSION['IDpios'] = $wiersz['ID']; | ||
echo "ID propozycji:".$wiersz['ID'].'<br>'; | ||
echo "Autor: <span id='autor'>".$wiersz['Autor'].'</span><br>'; | ||
echo "Tytuł: <span id='tytul'>".$wiersz['Tytul'].'</span><br>'; | ||
echo 'Link: <a href="'.$wiersz['Link'].'">'.$wiersz['Link'].'</a><br>'; | ||
echo 'Status: oczekuje <br>'; | ||
echo 'IP: <span id="ip">'.$wiersz['IP'].'</span><br>'; | ||
$_SESSION['zbanowano'] = 1; | ||
} else if($tryb == "przyjeta") { | ||
$ID = $_SESSION['IDpios']; | ||
$login = $_SESSION['login']; | ||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `ID`='{$ID}'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$IP = $wiersz['IP']; | ||
$Autor = $wiersz['Autor']; | ||
$Tytul = $wiersz['Tytul']; | ||
$Kategoria = ""; | ||
$Data = date("Y.m.d H:i:s"); | ||
$info = "Przyjęto piosenke ID: ".$ID; | ||
mysqli_query($polaczenie, "UPDATE `waszeprop` SET `Status`='1' WHERE `ID`='{$ID}'"); | ||
mysqli_query($polaczenie, "INSERT INTO `logi`(`IP`, `Login`, `Data`,`Czynnosc`) VALUES ('{$IP}','{$login}','{$Data}','{$info}')"); | ||
mysqli_query($polaczenie, "INSERT INTO `muzyka` (`Autor`,`Tytul`,`Kategoria`,`Pkt`,`PktMiech`) VALUES ('{$Autor}','{$Tytul}','{$Kategoria}','0','0');"); | ||
|
||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `Status`='0'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$_SESSION['IDpios'] = $wiersz['ID']; | ||
echo "ID propozycji:".$wiersz['ID'].'<br>'; | ||
echo "Autor: <span id='autor'>".$wiersz['Autor'].'</span><br>'; | ||
echo "Tytuł: <span id='tytul'>".$wiersz['Tytul'].'</span><br>'; | ||
echo 'Link: <a href="'.$wiersz['Link'].'">'.$wiersz['Link'].'</a><br>'; | ||
echo 'Status: oczekuje <br>'; | ||
echo 'IP: <span id="ip">'.$wiersz['IP'].'</span><br>'; | ||
$_SESSION['dodano'] = 1; | ||
} else if($tryb == "odrzucona") { | ||
$ID = $_SESSION['IDpios']; | ||
$login = $_SESSION['login']; | ||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `ID`='{$ID}'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$IP = $wiersz['IP']; | ||
$Data = date("Y.m.d H:i:s"); | ||
$info = "Odrzucono piosenke ID: ".$ID; | ||
mysqli_query($polaczenie, "UPDATE `waszeprop` SET `Status`='3' WHERE `ID`='{$ID}'"); | ||
mysqli_query($polaczenie, "INSERT INTO `logi`(`IP`, `Login`, `Data`,`Czynnosc`) VALUES ('{$IP}','{$login}','{$Data}','{$info}')"); | ||
|
||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `Status`='0'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$_SESSION['IDpios'] = $wiersz['ID']; | ||
echo "ID propozycji:".$wiersz['ID'].'<br>'; | ||
echo "Autor: <span id='autor'>".$wiersz['Autor'].'</span><br>'; | ||
echo "Tytuł: <span id='tytul'>".$wiersz['Tytul'].'</span><br>'; | ||
echo 'Link: <a href="'.$wiersz['Link'].'">'.$wiersz['Link'].'</a><br>'; | ||
echo 'Status: oczekuje <br>'; | ||
echo 'IP: <span id="ip">'.$wiersz['IP'].'</span><br>'; | ||
$_SESSION['odrzucono'] = 1; | ||
} else if($tryb == "szukajka") { | ||
$ID = $_REQUEST['szukaj']; | ||
$rezultat = $polaczenie->query("SELECT * FROM `waszeprop` WHERE `ID`='{$ID}'"); | ||
$wiersz = $rezultat->fetch_array(); | ||
$_SESSION['IDpios'] = $wiersz['ID']; | ||
echo "ID propozycji:".$wiersz['ID'].'<br>'; | ||
echo "Autor: <span id='autor'>".$wiersz['Autor'].'</span><br>'; | ||
echo "Tytuł: <span id='tytul'>".$wiersz['Tytul'].'</span><br>'; | ||
echo 'Link: <a href="'.$wiersz['Link'].'">'.$wiersz['Link'].'</a><br>'; | ||
echo 'Status: oczekuje <br>'; | ||
echo 'IP: <span id="ip">'.$wiersz['IP'].'</span><br>'; | ||
} | ||
} | ||
?> |