Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/edu/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/edu/indexo.php

<?php
	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($_POST["ps"]))
	{
		$ps=$_POST["ps"];
		$ct=$_POST["ct"];
		$ps="".$ct."-VL1920-".$ps;
		$ps=str_replace("S-VL1920-S-VL1920-", "S-VL1920-", $ps);
		$ps=str_replace("T-VL1920-T-VL1920-", "T-VL1920-", $ps);
		$us=$ps;
		$dgfosdgsdfogfsdovdhs890vdhs0vds = mysqli_connect('localhost', 'enter', '3nt3R!', 'enter');
		$db=$dgfosdgsdfogfsdovdhs890vdhs0vds;
		@mysqli_set_charset($db, 'utf8');
		$isStudent=0;
		if ($ct=="S")
		{
			$isstud=mysqli_query($db, "SELECT * FROM `students` WHERE `id`='".$ps."' LIMIT 1");
		}
		else
		{
			$isstud=mysqli_query($db, "SELECT * FROM `stuff` WHERE `id`='".$ps."' LIMIT 1");
		}
		while ($pstud=mysqli_fetch_row($isstud))
			{
				$nm=$pstud[2];
				$eg=$pstud[5];
				$isStudent++;
			}
		if ($isStudent==1)
		{
			$lgn="lgn";
		}
		else
		{
			$lgn="not";
		}
	}
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<title>Достъп до edu.mon.bg</title>
		<meta charset="utf-8" />
		<link rel="stylesheet" href="./assets/css/bootstrap.min.css" />
		<script src="./assets/js/jquery.min.js"></script>
		<script src="./assets/js/bootstrap.min.js"></script>
		<?php
		if ($lgn=="")
		{
		?>
		<script src="https://www.google.com/recaptcha/api.js?hl=bg" async defer></script>
		<script>
			function recaptchaValidation()
			{
				$("#sbmt").prop("disabled", false);
			}
		</script>
		<?php
		}
		?>
		<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;
			}
			a
			{
				color: #FF0000;
				text-decoration: none;
			}
		</style>
	</head>
	<body>
		<div style="position: relative; top: 50px; margin: 0 auto; width: 500px; max-width: 500px; overflow: hidden; text-align: center; background: transparent;">
		<?php
			if ($lgn=="")
			{
		?>
			<form action="./" method="POST">
				<h1>
					Достъп до edu.mon.bg
				</h1>
				<br /><a href="./instructions.pdf" target="_blank">Инструкция за работа</a>
				<br />
				Въведете цифрите от кода на Вашата карта-пропуск
				<br />
				<input name="ps" placeholder="Код" style="text-align: center;" class="form-control-lg form-control" maxlength="10" type="password" value="" />
				<br />
				<br /><select class="form-control" name="ct">
						<option value="S">Моля, изберете профил...</option>
						<option value="S">Ученик</option>
						<option value="T">Учител</option>
					</select>
				<br />
				<div style="position: relative; left: 90px;" class="g-recaptcha" data-size="normal" data-callback="recaptchaValidation" data-sitekey="6LdXDgsUAAAAAIlRfSl55Z4XlTo9cx9p57uhChvZ"></div>
				<br />
				<input id="sbmt" disabled="true" class="form-control-lg form-control btn-primary" type="submit" value="Вход" />
			</form>
		<?php
			}
			else if ($lgn=="lgn")
			{
		?>
			<h1>
				Достъп до edu.mon.bg
			</h1>
			<h1>
				Здравейте, <?php print("".$nm.""); ?>.
			</h1>
		<?php
				$acc=mysqli_query($db, "SELECT * FROM `edu` WHERE `egn`='".$eg."' LIMIT 1");
				$isus=0;
				while ($accd=mysqli_fetch_row($acc))
				{
					$id=$accd[0];
					$u=$accd[2];
					$p=$accd[3];
					$isus++;
				}
				if ($isus==0)
				{
					print("<br /><br />Нямате профил.<br />Свържете се с директора на училището,<br />за да се направи корекция!");
				}
				else
				{
					$accup=mysqli_query($db, "UPDATE `edu` SET `a` = '1' WHERE `i` = ".$id."");
					print("<br /><br />Потребител:<br /><b>".$u."@edu.mon.bg</b><br /><br />Парола:<br /><b>".$p."</b><br /><br /><input class=\"form-control-lg form-control btn-warning\" type=\"button\" value=\"Към сайта на MS Teams\" onclick=\"window.open('https://teams.microsoft.com/','_blank');\" />(отваря се в нов таб)");
				}
			}
			else
			{
		?>
			ГРЕШЕН КОД!<br />
			<input class="form-control-lg form-control btn-danger" type="button" value="ОПИТАЙ ПАК" onclick="window.open('./','_self');" />
		<?php
			}
		?>
		</div>
	</body>
</html>