Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/mr/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/mr/index.php

<?php
	session_start();
	header("Cache-Control: no-cache, must-revalidate");
	header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
	date_default_timezone_set("Europe/Sofia");
	$un="";
	$ps="";
	$lgn="";
	if (isset($_POST["dscr"]))
	{
		$dscr=$_POST["dscr"];
		if (!empty($_FILES["upf"]))
		{
			$t=time();
			move_uploaded_file($_FILES["upf"]["tmp_name"], "/hdd/hdd11/lr/s".$t.".mp3");
		}
		$dfhsfs90fsh0f9sd0hfs90fsd90fsd = mysqli_connect('localhost', 'lr', 'L0c4lR4d10!', 'lr');
		$db=$dfhsfs90fsh0f9sd0hfs90fsd90fsd;
		@mysqli_set_charset($db, 'utf8');
		$lradio=mysqli_query($db, "INSERT INTO `mr` (`i`, `f`, `c`, `a`) VALUES (NULL, 's".$t.".mp3', '".$dscr."', '1')");		
	}
	if (isset($_POST["un"]))
	{
		$un=$_POST["un"];
		$ps=$_POST["ps"];
		$ps=sha1($ps);
		if ($un=="radio" && $ps=="c03a4de0f8c83161952f3e20a1eed54e4bb1186b")
		{
			$lgn="lgn";
			setcookie("lgn", "lgn", time() + 300, "/", "", true, false);
		}
		else
		{
			$lgn="not";
		}
	}
	if (isset($_COOKIE["lgn"]))
	{
		$lgn=$_COOKIE["lgn"];
		setcookie("lgn", "lgn", time() + 300, "/", "", true, false);
	}
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<title>Локално радио</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
		<link rel="stylesheet" href="./assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="./assets/css/datepicker.css" />
		<script src="./assets/js/jquery.min.js"></script>
		<script src="./assets/js/popper.min.js"></script>
		<script src="./assets/js/bootstrap.min.js"></script>
		<script src="./assets/js/bootstrap-datepicker.js"></script>
		<style>
			html, body
			{
				background-color: #112233;
			}
			@font-face
			{
				font-family: 'btn';
				src: url("./assets/fonts/segmdl2-webfont.woff2") format("woff2"), url("./assets/fonts/segmdl2-webfont.woff") format("woff");
				font-weight: normal;
				font-style: normal;
			}
			#tbl table, #tbl td, #tbl th, td, th
			{
				border: 1px #ffffff solid;
				color: #ffffff;
				margin: 0;
				padding: 0;
				text-align: center;
			}
			#tbl
			{
				border: none;
			}
		</style>
	</head>
	<body>
		<div style="position: relative; top: 50px; margin: 0 auto; width: 320px; max-width: 320px; overflow: hidden; text-align: center; background: transparent;">
		<?php
			if ($lgn=="")
				{
		?>
			<img src="/enter.png" style="width: 200px; border: none;" alt="Електронна система" />
			<form action="./" method="POST">
				<input name="un" placeholder="Потребител" class="form-control-lg form-control" style="background-color: #CCCCCC;" type="text" value="" />
				<br />
				<input name="ps" placeholder="Парола" class="form-control-lg form-control" style="background-color: #CCCCCC;" type="password" value="" />
				<br />
				<input class="form-control-lg form-control btn-dark" type="submit" value="Вход" />
			</form>
		<?php
				}
			else if ($lgn=="lgn")
				{
		?>
			<form id="frm" name="frm" action="./" enctype="multipart/form-data" method="POST">
			<iframe src="about:blank" name="exc" id="exc" style="position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; z-index: 9999; border: none;"></iframe>
			<div id="al" style="position: fixed; top: 0px; left: 0px; width: 100%; height: 60px; z-index: 9999;"></div>
			<script>
				function uploadUpdate()
				{
					var upl=document.getElementById("upf").value;
					upl=upl.replace("C:\\fakepath\\","");
					document.getElementById("chf").value=upl;
				}
				function checkPastDate()
				{
					var err=0;
					var cmnt=document.getElementById("dscr").value;
					var upl=document.getElementById("upf").value;
					if (cmnt=="")
					{
						document.getElementById("al").innerHTML="<div class=\"alert alert-danger alert-dismissable\"><a href=\"javascript: void()\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a><strong>Грешка!</strong> Не сте посочили описание!</div>";
						err++;
					}
					if (upl=="")
					{
						document.getElementById("al").innerHTML="<div class=\"alert alert-danger alert-dismissable\"><a href=\"javascript: void()\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a><strong>Грешка!</strong> Не сте избрали mp3 файл!</div>";
						err++;
					}
					if (err==0)
					{
						document.getElementById("frm").submit();
					}
				}
			</script>
			<br />Изберете mp3 файл
			<br />
			<div class="input-group">
			<label class="col-xs-6 col-md-4 form-control-lg form-control btn-primary">
				Избери... <input id="upf" name="upf" type="file" style="display: none;" accept=".mp3" onchange="uploadUpdate();" />
			</label>
			<input id="chf" class="col-xs-12 col-md-8 form-control-lg form-control" type="text" readonly="" />
			</div>
			<br />
			<br />Описание
			<br />
			<input type="text" name="dscr" class="form-control" id="dscr" />
			<br />
			<input class="form-control-lg form-control btn-primary" type="button" onclick="checkPastDate(); return true;" value="Задай" />
			</form>
			<br />
			<br />
			<br />
			<br /><center>Досегашни песни</center>
			<br />
			<br />
			</div>
			<div id="tbl" style="position: relative; clear: both; width: 95%; margin: 0 auto;">
			<table style="width: 100%; text-align: center;">
				<thead>
					<tr style="font-weight: bold;">
						<th style="width: 5vw;">
							N
						</th>
						<th style="width: 60vw;">
							Описание
						</th>
						<th style="width: 35vw;">
							Действия
						</th>
					</tr>
				</thead>
				<tbody>
					<?php
						$dfhsfs90fsh0f9sd0hfs90fsd90fsd = mysqli_connect('localhost', 'lr', 'L0c4lR4d10!', 'lr');
						$db=$dfhsfs90fsh0f9sd0hfs90fsd90fsd;
						@mysqli_set_charset($db, 'utf8');
						$lradio=mysqli_query($db, "SELECT * FROM `mr` ORDER BY `i` DESC");
						while ($plradio=mysqli_fetch_row($lradio))
							{
								print("<tr><td>".$plradio[0]."</td><td style=\"font-size: 40px;\">".$plradio[2]."</td><td><a id=\"pl".$plradio[0]."\" class=\"btn btn-primary\" style=\"font-family: 'btn'; font-size: 26vw; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; width: 35vw; height: 35vw; display: block;\" href=\"./start.php?i=".$plradio[0]."\" onclick=\"document.getElementById('st".$plradio[0]."').style.display='block'; this.style.display='none'; return true;\" target=\"exc\">&#xE768;</a><a id=\"st".$plradio[0]."\" class=\"btn btn-danger\" style=\"font-family: 'btn'; font-size: 26vw; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; width: 35vw; height: 35vw; display: none;\" href=\"./stop.php\" onclick=\"document.getElementById('pl".$plradio[0]."').style.display='block'; this.style.display='none'; return true;\" target=\"exc\">&#xE71A;</a></td></tr>");
							}
					?>
				</tbody>
			</table>
		<?php
				}
			else
				{
		?>
			ГРЕШНО ИМЕ ИЛИ ПАРОЛА!<br />
			<input class="form-control-lg form-control btn-danger" type="button" value="ОПИТАЙ ПАК" onclick="window.open('./','_self');" />
		<?php
				}
		?>
		</div>
	</body>
</html>