Your IP : 216.73.216.48


Current Path : /hdd/hdd11/www/vlevski/enter/c/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/c/1index.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");
	$lgn="";
	if (isset($_GET["logout"]))
	{
		$oldtime=time()-(60*60*24*7);
		setcookie("lgn", "", $oldtime, "/");
		setcookie("us", "", $oldtime, "/");
		unset($_COOKIE["lgn"]);
		unset($_COOKIE["us"]);
	}
	
	if (isset($_POST["dscr"]))
	{
		$us=$_POST["us"];
		$dscr=$_POST["dscr"];
		if (!empty($_FILES["upf"]))
		{
			$t=time();
			$array = explode('.', $_FILES['upf']['name']);
			$extension = end($array);
			move_uploaded_file($_FILES["upf"]["tmp_name"], "/hdd/hdd11/www/vlevski/enter/c/up/".$us."-".$t.".".$extension."");
		}
		$dfhsfs90fsh0f9sd0hfs90fsd90fsd = mysqli_connect('localhost', 'c', 'C0nt3st!', 'c');
		$db=$dfhsfs90fsh0f9sd0hfs90fsd90fsd;
		@mysqli_set_charset($db, 'utf8');
		$lradio=mysqli_query($db, "INSERT INTO `c` (`i`, `s`, `f`, `t`) VALUES (NULL, '".$us."', '".$us."-".$t.".".$extension."', '".$dscr."')");
	}
	if (isset($_POST["ps"]))
	{
		$ps=$_POST["ps"];
		$ps="S-SUVLTR-".$ps;
		$ps=str_replace("S-SUVLTR-S-SUVLTR-", "S-SUVLTR-", $ps);
		$us=$ps;
		setcookie("us", "".$ps."", time() + 3600, "/");
		$dgfosdgsdfogfsdovdhs890vdhs0vds = mysqli_connect('localhost', 'enter', '3nt3R!', 'enter');
		$db=$dgfosdgsdfogfsdovdhs890vdhs0vds;
		@mysqli_set_charset($db, 'utf8');
		$isStudent=0;
		$isstud=mysqli_query($db, "SELECT * FROM `students` WHERE `id`='".$ps."' LIMIT 1");
		while ($pstud=mysqli_fetch_row($isstud))
			{
				$isStudent++;
			}
		if ($isStudent==1)
		{
			$lgn="lgn";
			setcookie("lgn", "lgn", time() + 3600, "/");
			setcookie("us", "".$ps."", time() + 3600, "/");
		}
		else
		{
			$lgn="not";
		}
	}
	if (isset($_COOKIE["lgn"]))
	{
		$lgn=$_COOKIE["lgn"];
		setcookie("lgn", "lgn", time() + 3600, "/");
	}
	if (isset($_COOKIE["us"]))
	{
		$us=$_COOKIE["us"];
		setcookie("us", "".$us."", time() + 3600, "/");
	}
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<title>Качване на проект</title>
		<meta charset="utf-8" />
		<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>
			@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
			{
				border: 1px #000000 solid;
				margin: 0;
				padding: 0;
				text-align: center;
			}
			#tbl
			{
				border: none;
			}
		</style>
	</head>
	<body>
		<div style="position: relative; top: 50px; margin: 0 auto; width: 450px; max-width: 450px; overflow: hidden; text-align: center; background: transparent;">
		<?php
			if ($lgn=="")
				{
		?>
			<form action="./" method="POST">
				Въведете кода от Вашата карта-пропуск
				<br />
				<input name="ps" placeholder="Код" class="form-control-lg form-control" type="password" value="" />
				<br />
				<input class="form-control-lg form-control btn-primary" type="submit" value="Вход" />
			</form>
		<?php
				}
			else if ($lgn=="lgn")
				{
		?>
			<input class="form-control-lg form-control btn-danger" type="button" style="position: fixed; top: 50px; right: 5px; width: 150px; height: 50px;" onclick="window.open('./?logout', '_self'); return true;" value="Изход" />
			<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 checkSubmit()
				{
					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> Не сте избрали файл!</div>";
						err++;
					}
					if (err==0)
					{
						document.getElementById("frm").submit();
					}
				}
			</script>
			<br />Изберете файл
			<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;" 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 />
			<select name="dscr" class="form-control" id="dscr" />
				<option value="">Моля, изберете</option>
				<option value="i">Информационни технологии</option>
				<option value="l">Чужди езици</option>
			</select>
			<br />
			<input type="hidden" name="us" value="<?php print("".$us.""); ?>">
			<input class="form-control-lg form-control btn-primary" type="button" onclick="checkSubmit(); 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: 15vw;">
							N
						</th>
						<th style="width: 55vw;">
							Файл
						</th>
						<th style="width: 30vw;">
							Състезание
						</th>
					</tr>
				</thead>
				<tbody>
					<?php
						$dsahdiasiodsanioasdndioadnasoisad = mysqli_connect('localhost', 'c', 'C0nt3st!', 'c');
						$dbn=$dsahdiasiodsanioasdndioadnasoisad;
						@mysqli_set_charset($dbn, 'utf8');
						$lradio=mysqli_query($dbn, "SELECT * FROM `c` WHERE `s`='".$us."' ORDER BY `i` DESC");
						while ($plradio=mysqli_fetch_row($lradio))
							{
								$ct=$plradio[3];
								if ($ct=="i")
								{
									$prct="Информационни технологии";
								}
								else
								{
									$prct="Чужди езици";
								}
								print("<tr><td>".$plradio[0]."</td><td>".$plradio[2]."</td><td style=\"font-size: 40px;\">".$prct."</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>