Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/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");
	include("./conn.php");
	$acc_code="";
	$_SESSION["data"]="";
	if (isset($_GET["logout"]))
	{
		if (isset($_COOKIE["acc_code"]))
		{
			$acc_code=$_COOKIE["acc_code"];
		}
		setcookie("allowaccess", "", 1, "/", "", true, false);
		setcookie("acc_code", "", 1, "/", "", true, false);
		if ($acc_code!="")
		{
			$lgncrd=mysqli_query($db, "DELETE FROM `autologin` WHERE `code` = '".$acc_code."' LIMIT 1;");
		}
		session_unset();
		session_destroy();
		usleep(250000);
		header("location: /");
	}
	$un="";
	$ps="";
	$lgn="";
	$pollans="";
	$acc=0;
	if (isset($_COOKIE["acc_code"]))
	{
		$acc_code=$_COOKIE["acc_code"];
		$lgncr=mysqli_query($db, "SELECT * FROM `autologin` WHERE `code`='".$acc_code."' LIMIT 1");
		while ($res=mysqli_fetch_row($lgncr))
		{
			$idcookie=$res[0];
			$exp=$res[1];
			$code=$res[2];
			$un=$res[3];
			$ps=$res[4];
			$lgncru=mysqli_query($db, "UPDATE `autologin` SET `ts` = '".time()."' WHERE `i` = '".$idcookie."';");
			setcookie("acc_code", "".$acc_code."", time() + 90*24*3600, "/", "", true, false);
		}
		$deltime=time() - 90*24*3600;
		$lgncrd=mysqli_query($db, "DELETE FROM `autologin` WHERE `ts` < '".$deltime."';");
	}
	if ($un!="")
	{
		include("./login.php");
	}
	else if (isset($_POST["un"]))
	{
		$un=$_POST["un"];
		$ps=$_POST["ps"];
		$remme=$_POST["remme"];
		if ($remme==1)
		{
			$tmi=time();
			$acc_code=sha1("".$un."".$ps."".$tmi."");
			$remsql=mysqli_query($db, "INSERT INTO `autologin` (`i`, `ts`, `code`, `un`, `ps`) VALUES (NULL, '".$tmi."', '".$acc_code."', '".$un."', '".$ps."');");
			setcookie("acc_code", "".$acc_code."", time() + 90*24*3600, "/", "", true, false);
		}
		include("./login.php");
	}
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<meta charset="utf-8" />
		<title>Електронна система на СУ &quot;Васил Левски&quot; - Троян</title>
		<link rel="shortcut icon" type="image/png" href="/assets/images/site/enter.png" />
		<link rel="shortcut icon" type="image/png" href="https://enter.vlevski.eu/assets/images/site/enter.png" />
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
		<link rel="stylesheet" href="/assets/css/select2.min.css" />
		<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/form.min.js"></script>
		<script src="/assets/js/select.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>
		<script src="/assets/js/jquery.dataTables.min.js"></script>
		<script src="/assets/js/dataTables.bootstrap4.min.js"></script>
		<script src="/assets/fa6/js/all.min.js" defer></script>
		<script>
			chng=1;
			remmed=0;
			function ext()
			{
				Website2APK.exitApp();
			}
			function spoll()
			{
				$("#mwpoll").modal("show");	
			}
			function remmef()
			{
				if (remmed==0)
				{
					remmed=1;
					$("#remmei").html("<i class=\"far fa-check-square\">&nbsp;</i>");
				}
				else
				{
					remmed=0;
					$("#remmei").html("<i class=\"far fa-square\">&nbsp;</i>");					
				}
				$("#remme").val(remmed);
			}
			function chngrem()
			{
				if (chng==1)
				{
					$("#rmt").removeClass("fa-check-square");
					$("#rmt").addClass("fa-square");
					chng=0;
				}
				else
				{
					$("#rmt").removeClass("fa-square");
					$("#rmt").addClass("fa-check-square");
					chng=1;
				}
			}
			function sndpll()
			{
				chk1=$("#q1").val();
				chk2=$("#q2").val();
				chk3=$("#q3").val();
				chk4=$("#q4").val();
				chk5=$("#q5").val();
				chk6=$("#q6").val();
				chk7=$("#q7").val();
				if ((chk1=="") || (chk2=="") || (chk3=="") || (chk4=="") || (chk5=="") || (chk6=="") || (chk7==""))
				{
					$("#mwe").modal("show");
				}
				else
				{
					$.ajax({url: "./snddata.php", type: "POST", data:{"un": "<?php print("".$un.""); ?>", "pa": ""+chk1+"|NEW|"+chk2+"|NEW|"+chk3+"|NEW|"+chk4+"|NEW|"+chk5+"|NEW|"+chk6+"|NEW|"+chk7+""}, success: function(data) { if (data=="OK") { chngpll(); } } });
				}
			}
			function clpll()
			{
				$("#mwpoll").modal("hide");
			}
			function chngpll()
			{
				$("#mw").modal("hide");
				$("#mwb3").css("visibility", "hidden");
				$("#mwp3").css("background-color", "#009900");
				$("#mwp3").html("<i class=\"fas fa-check-circle\"></i> ПОПЪЛНЕНА");
			}
			$("input#un").keydown(function(event)
			{
				if (event.keyCode !== 8 && event.keyCode !== 0 && event.keyCode < 48 || event.keyCode > 57)
				{
					event.preventDefault();
				}
			});
			$(document).ready(function()
			{
				$("#ttbl").DataTable({ "order": [[ 0, "desc" ]], searching: false, paging: false, info: false });
				$("#srch").on("keyup", function()
				{
					var value=$(this).val().toLowerCase();
					$("#stbl tr").filter(function()
					{
						$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
					}).css("display", "none");
				});
			});
		</script>
		<style>
			html, body
			{
				background-color: #112233;
			}
			a, div, input
			{
				font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
			}
			a.dropdown-item
			{
				color: #DDDDDD!important;
			}
			a.dropdown-item:hover
			{
				color: #FFFFFF!important;
				background-color: transparent!important;
			}
			.dropdown .dropdown-menu
			{
				-webkit-transition: all 0.5s;
				-moz-transition: all 0.5s;
				-ms-transition: all 0.5s;
				-o-transition: all 0.5s;
				transition: all 0.5s;
				max-height: 0;
				display: block;
				overflow: hidden;
				opacity: 0;
			}
			.dropdown.show .dropdown-menu
			{
				max-height: 300px;
				opacity: 1;
			}
			.modal
			{
				overflow-y: auto;
			}
			::-webkit-scrollbar
			{
				width: 10px;
			}
			::-webkit-scrollbar-track
			{
				background-color: #116633;
			}
			::-webkit-scrollbar-thumb
			{
				background-color: #BBBB33;
				border-radius: 5px;
			}
		</style>
	</head>
	<body>
		<script>
			if (typeof(Website2APK)!="undefined")
			{
				document.write("<div style=\"position: fixed; top: 0px; right: 0px; width: 40px; height: 45px; z-index: 9999;\">");
				document.write("<button type=\"button\" style=\"position: relative; top: 0px; left: 0px; width: 40px; height: 45px; margin: 0px; padding: 0px; line-height: 35px; border-radius: 5px; font-size: 35px; background-color: #EE1133; color: #DDDDDD;\" onclick=\"ext(); return true;\">");
				document.write("&times;");
				document.write("</button>");
				document.write("</div>");
			}
		</script>
		<?php
			if ($_SESSION["data"]=="")
			{
		?>
		<div style="margin-top: 5px;" class="container-fluid">
			<div class="row">
				<div class="col-12-none col-md-12-none col-sm-12-none col-xs-12-none col-lg-4 col-xl-4">
					&nbsp;
				</div>
				<div class="col-12 col-md-12 col-sm-12 col-xs-12 col-lg-4 col-xl-4">
					<div style="postion: relative; width: 100%; color: #DDDDDD; font-weight: bold; font-size: 20px; margin-top: 0px; text-align: center;">
						Електронна система
						<br />на СУ &quot;Васил Левски&quot; - Троян
						<br /><img src="/assets/images/site/enter.png" style="width: 160px; border: none;" alt="Електронна система" />
						<form action="/" method="POST">
							<table style="postion: relative; margin: 0 auto; width: 320px; color: #DDDDDD; border: none;">
								<tr>
									<td style="width: 30px; margin-top: 10px; font-size: 28px;">
										<i class="fas fa-user">&nbsp;</i>
									</td>
									<td style="width: 290px;">
										<input name="un" id="un" placeholder="Потребител" class="form-control-lg form-control" min="1000000000" max="9999999999" inputmode="decimal" pattern="\\d*" onKeyPress="if(this.value.length==10) return false;" style="background-color: #CCCCCC;" type="number" value="" />
									</td>
								</tr>
								<tr>
									<td style="width: 30px; font-size: 5px;">
										&nbsp;
									</td>
									<td style="width: 290px;">
									</td>
								</tr>
								<tr>
									<td style="width: 30px; margin-top: 10px; font-size: 28px;">
										<i class="fas fa-lock">&nbsp;</i>
									</td>
									<td style="width: 290px;">
										<input name="ps" placeholder="Парола" class="form-control-lg form-control" style="background-color: #CCCCCC;" type="password" value="" />
									</td>
								</tr>
								<tr>
									<td id="remmei" onclick="remmef(); return true;" style="width: 30px; margin-top: 10px; font-size: 28px; cursor: pointer;">
										<i class="far fa-square">&nbsp;</i>
									</td>
									<td style="width: 290px; text-align: left;">
										<a href="javascript: void();" onclick="remmef(); return true;" onmouseover="this.style.textDecoration='none'; return true;" onmouseout="this.style.textDecoration='none'; return true;" style="color: #DDDDDD;">&nbsp;Запомни ме на устройството</a>
										<input id="remme" name="remme" type="hidden" value="" />
									</td>
								</tr>
								<tr>
									<td style="width: 30px; font-size: 5px;">
										&nbsp;
									</td>
									<td style="width: 290px;">
									</td>
								</tr>
								<tr>
									<td colspan="2" style="width: 320px; padding-top: 10px;">
										<input class="form-control-lg form-control btn-dark" type="submit" value="Вход" />
									</td>
								</tr>
							</table>
						</form>
						<br />
						<br />
						<a href="/s/" style="font-size: 20px; color: #DDDD00;">СЪСТЕЗАНИЯ<br />ЗА ПАТРОННИЯ<br />ПРАЗНИК</a>
						<br />
						<br />
						<br /><a href="/terms/" style="font-size: 20px; color: #DDDDDD;">Декларация за поверителност</a>
						<br />
						<br /><a href="https://play.google.com/store/apps/details?id=com.vlevskieu.enter" target="_blank"><img src="/assets/images/site/appbg.png" style="width: 160px; border: none;" alt="Enter VL" /></a>
					</div>
				</div>
				<div class="col-12-none col-md-12-none col-sm-12-none col-xs-12-none col-lg-4 col-xl-4">
					&nbsp;
				</div>
			</div>
		</div>
		<?php
			}
			else if ($_SESSION["data"]=="LGN")
			{
				if ($_SESSION["stts"]=="s")
				{
					include("./menus.php");
		?>
		<div class="modal fade" id="mwschk" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwschk" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">
							<?php
								$klp=$_SESSION["kl"];
								$klp=str_replace("01",". а", $klp);
								$klp=str_replace("02",". б", $klp);
								$klp=str_replace("03",". в", $klp);
								$klp=str_replace("04",". г", $klp);
							?>
							Програма на <?php print("".$klp.""); ?> клас
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<img src="/show-schedule.php?y=2022-2023&s=2&t=c&d=<?php print("".$_SESSION["kl"].""); ?>&ct=<?php print("".time().""); ?>" style="width: 96%; margin-left: 2%; border: none; border-radius: 3px;" alt="Програма на <?php print("".$klp.""); ?> клас" />
					</div>
					<div class="modal-footer">
						<a style="width: 260px;" href="/down-schedule.php?y=2022-2023&s=2&t=c&d=<?php print("".$_SESSION["kl"].""); ?>&ct=<?php print("".time().""); ?>" class="btn btn-primary" download="Програма на <?php print("".$klp.""); ?> клас.pdf"><i class="fas fa-cloud-download-alt"></i> Изтеглете програмата</a>
					</div>
				</div>
			</div>
		</div>
		<div style="margin-top: 75px;" class="container-fluid">
			<div class="row">
				<div class="col-12" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<i class="fab fa-windows"></i> MS Teams профил
				</div>
			</div>
			<div class="row">
				<div class="col-12-none col-sm-12-none col-md-6 col-lg-4 col-xl-4">
					&nbsp;
				</div>
				<div class="col-12 col-sm-12 col-md-6 col-lg-4 col-xl-4">
					<div style="postion: relative; width: 100%; color: #DDDDDD; font-weight: bold; font-size: 20px; margin-top: 0px; text-align: center;">
						<br />потребител:
						<br /><b><?php print("".$_SESSION["mu"].""); ?></b>
						<br />
						<br />временна парола:
						<br /><b><?php print("".$_SESSION["mp"].""); ?></b>
					</div>
				</div>
				<div class="col-12-none col-sm-12-none col-md-6 col-lg-4 col-xl-4">
					&nbsp;
				</div>
			</div>
		</div>
		<?php
				}
				else
				{
					include("./menut.php");
		?>
		<div class="modal fade" id="mw" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mw" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="mwt">
							Данни, подадени от <?php print("".$_SESSION["tname"].""); ?>
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<strong>Уважаеми колеги,
						<br />
						<br />Моля, попълнете данни за квалификационни кредити
						<br />
						</strong>
						<strong>1. Пълното име на завършеното от Вас висше учебно заведение:</strong>
						<br />
						<input type="text" id="q1" name="q1" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
						<strong>2. Населеното място на завършеното от Вас висше учебно заведение:</strong>
						<br />
						<input type="text" id="q2" name="q2" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
						<strong>3. Вашата образователна степен е:</strong>
						<br />
						<select id="q3" name="q3" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;">
							<option value="">Моля изберете</option>
							<option value="Бакалавър">Бакалавър</option>
							<option value="Магистър">Магистър</option>
						</select>
						<hr />
						<strong>4. Името на Вашата специалност:</strong>
						<br />
						<input type="text" id="q4" name="q4" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
						<strong>5. Серия на дипломата Ви (поставете тире, ако няма):</strong>
						<br />
						<input type="text" id="q5" name="q5" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
						<strong>6. Номер на дипломата Ви:</strong>
						<br />
						<input type="text" id="q6" name="q6" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
						<strong>7. Година на издаване на дипломата Ви:</strong>
						<br />
						<input type="text" id="q7" name="q7" value="" class="form-control-lg form-control" style="background-color: #CCCCCC; height: 50px;" />
						<hr />
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" onclick="sndpll(); return true;"><i class="fas fa-file-export"></i> Изпрати</button>
					</div>
				</div>
			</div>
		</div>
		<div class="modal fade" id="mwe" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwe" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="margin-top: 110px; width: 95%;">
				<div class="modal-content" style="background-color: #FFFF44;">
					<div class="modal-header">
						<h5 class="modal-title" id="mwet">
							Не сте попълнили всички данни.
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						Не сте попълнили всички данни. Моля направете корекция и тогава изпратете данните!
					</div>
				</div>
			</div>
		</div>
		<div class="modal fade" id="mwps" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mw" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="mwpst">
							Гласуване на съвет от <?php print("".$_SESSION["tname"].""); ?>
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<iframe id="psif" name="psif" src="about:blank" style="position: relative; top:0px; left: 1%; width: 98%; min-height: 600px; height: 95%; border: none;"></iframe>
					</div>
				</div>
			</div>
		</div>
		<?php
			if ($_SESSION["acc"]==9)
			{
		?>		
		<div class="modal fade" id="mwfire" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mw" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="mwfiret">
							Пожаро-известителна система
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<iframe id="fireif" name="fireif" src="/fire/" style="position: relative; top:0px; left: 1%; width: 98%; min-height: 600px; height: 95%; border: none;"></iframe>
					</div>
				</div>
			</div>
		</div>
		<?php
			}
			if ($_SESSION["kl"]!="")
			{
		?>
		<div class="modal fade" id="mwschk" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwschk" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">
							<?php
								$klp=$_SESSION["kl"];
								$klp=str_replace("01",". а", $klp);
								$klp=str_replace("02",". б", $klp);
								$klp=str_replace("03",". в", $klp);
								$klp=str_replace("04",". г", $klp);
							?>
							Програма на <?php print("".$klp.""); ?> клас
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<img src="/show-schedule.php?y=2022-2023&s=2&t=c&d=<?php print("".$_SESSION["kl"].""); ?>&ct=<?php print("".time().""); ?>" style="width: 96%; margin-left: 2%; border: none; border-radius: 3px;" alt="Програма на <?php print("".$klp.""); ?> клас" />
					</div>
					<div class="modal-footer">
						<a style="width: 260px;" href="/down-schedule.php?y=2022-2023&s=2&t=c&d=<?php print("".$_SESSION["kl"].""); ?>&ct=<?php print("".time().""); ?>" class="btn btn-primary" download="Програма на <?php print("".$klp.""); ?> клас.pdf"><i class="fas fa-cloud-download-alt"></i> Изтеглете програмата</a>
					</div>
				</div>
			</div>
		</div>
		<?php
			}
		?>
		<div class="modal fade" id="mwscht" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwscht" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">
							Програма на <?php print("".$_SESSION["tname"].""); ?>
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<img src="/show-schedule.php?y=2022-2023&s=2&t=t&ct=<?php print("".time().""); ?>" style="width: 96%; margin-left: 2%; border: none; border-radius: 3px;" alt="Програма на <?php print("".$_SESSION["tname"].""); ?>" />
					</div>
					<div class="modal-footer">
						<a style="width: 260px;" href="/down-schedule.php?y=2022-2023&s=2&t=t&ct=<?php print("".time().""); ?>" class="btn btn-primary" download="Програма на <?php print("".$_SESSION["tname"].""); ?>.pdf"><i class="fas fa-cloud-download-alt"></i> Изтеглете програмата</a>
					</div>
				</div>
			</div>
		</div>
		<div class="modal fade" id="mwpoll" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwpoll" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 95%;">
				<div class="modal-content" style="background-color: #334455;">
					<div class="modal-header">
						<h5 class="modal-title" style="color: #DDDDDD; font-weight: bold; font-size: 30px;">
							<i class="far fa-question-circle"></i> Анкета №10
						</h5>
						<button type="button" class="close" data-dismiss="modal" aria-label="Затвори">
							<span aria-hidden="true" style="color: #DDDDDD; font-size: 30px;">&times;</span>
						</button>
					</div>
					<div class="modal-body">
						<div class="container-fluid">
							<div class="row">
								<div class="col-12 col-sm-12 col-md-6 col-lg-4 col-xl-4" style="margin-bottom: 20px;">
									<div style="margin: 0px auto; padding: 0px; width: 322px; max-width: 322px; min-width: 322px; border: 1px dashed #CCCCCC; border-radius: 0px 15px 0px 15px;">
										<div style="position: relative; top: 0px; left: 0px; width: 320px; height: 180px; border-radius: 0px 15px 0px 0px; overflow: hidden; background-size: 320px 180px; background-image: url('/assets/images/polls/students.jpg'); background-repeat: no-repeat; background-position: top left;">
											<div id="mwp3" style="position: relative; top: 140px; left: 0px; width: 320px; height: 40px; overflow: hidden; color: #DDDDDD; font-size: 25px; text-align: center; 
												<?php
													$pollans="not_done";
													$pollansq=mysqli_query($db, "SELECT * FROM `pollsans` WHERE `u`='".$_SESSION["un"]."' AND `pi`='10' LIMIT 1");
													while ($pollres=mysqli_fetch_row($pollansq))
													{
														$pollans="done";
													}
													if ($pollans=="done")
													{
														print("background-color: #009900;\"><i class=\"fas fa-check-circle\"></i> ПОПЪЛНЕНА");
													}
													else
													{
														print("background-color: #990000;\"><i class=\"fas fa-exclamation-circle\"></i> НЕПОПЪЛНЕНА");
													}
												?>
											</div>
										</div>
										<div style="position: relative; top: 0px; left: 5px; width: 310px; height: 25px; font-size: 20px; font-weight: bold; color: #DDDDDD; text-align: right;">
											Данни за кредити
										</div>
										<div style="position: relative; top: 0px; left: 5px; width: 310px; font-size: 15px; font-weight: bold; font-style: italic; color: #DDDDDD; text-align: justify; text-indent: 10px;">
											Данни за квалификационни кредити
										</div>
										<a id="mwb3" href="javascript:void(0);" onclick="clpll(); return true;"data-toggle="modal" data-target="#mw" class="btn btn-warning" style="width: 150px; margin-left: 165px; margin-top: 5px; margin-bottom: 5px;<?php if ($pollans=="done") { print(" visibility: hidden;"); } ?>"><i class="fas fa-tasks"></i> Попълнете</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="container-fluid" style="margin-top: 75px;">
			<div class="row">
				<div class="col-12 col-sm-12 col-md-5 col-lg-5 col-xl-5" style="font-size: 30px; font-weight: bold; color: #DDDDDD;">
					<i class="fas fa-calendar-alt"></i> Седмични задачи
				</div>
				<div class="col-12 col-sm-12 col-md-5 col-lg-5 col-xl-5" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<input style="color: #CCCCCC; background-color: #112233; font-size: 30px;" class="form-control form-control-lg" id="srch" type="text" placeholder="Въведете тук за бързо търсене" />
				</div>
				<div class="col-12 col-sm-12 col-md-2 col-lg-2 col-xl-2 d-none d-sm-none d-md-block" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
				</div>
			</div>
			<div class="row">
				<div class="col-12" style="overflow-x: auto;">
					<table id="ttbl" style="width: 1250px; min-width: 1250px; max-width: 1250px; margin: 0 auto;" class="table table-bordered table-striped table-dark">
						<thead>
							<tr>
								<th style="vertical-align: middle; text-align: center; max-width: 225px; min-width: 225px; width: 225px; font-size: 23px;">Дата<br />ден от седмицата</th>
								<th style="vertical-align: middle; text-align: center; max-width: 500px; min-width: 500px; width: 500px; font-size: 23px;">Задача</th>
								<th style="vertical-align: middle; text-align: center; max-width: 400px; min-width: 400px; width: 400px; font-size: 23px;">Отговорници</th>
								<th style="vertical-align: middle; text-align: center; max-width: 125px; min-width: 125px; width: 125px; font-size: 23px;">Краен<br />срок</th>
							</tr>
						</thead>
						<tbody id="stbl">
							<?php
								$oldn=0;
								$dq=mysqli_query($db, "SELECT * FROM `docsz` WHERE `m`>'0' ORDER BY `n` DESC, `m` DESC;");
								while($res=mysqli_fetch_row($dq))
								{
									$yin=0;
									$d=explode("__", $res[5]);
									$n=$d[2];
									$dt=$d[3];
									$kdt="".$d[5]."<br />".$d[6];
									$kdtd=explode(".", $d[5]);
									$kdtt=explode(":", $d[6]);
									$kdts=mktime($kdtt[0], $kdtt[1], 0, $kdtd[1], $kdtd[0], $kdtd[2]);
									$kdct=time();
									$shat=explode("tending", $d[4]);
									$nt=count($shat);
									$nt-=2;
									$nm="";
									for ($i=0; $i<=$nt; $i++)
									{
										$ct=$shat[$i];
										$ct=str_replace("tstart", "", $ct);
										$ctq=mysqli_query($db, "SELECT `n1`, `n3` FROM `stuff` WHERE `sha`='".$ct."' LIMIT 1;");
										while($rest=mysqli_fetch_row($ctq))
										{
											$nmt1=mb_substr($rest[0], 0, 1, "UTF-8");											
											$nmt3=$rest[1];
											$nmt="".$nmt1.". ".$nmt3."";
											$nmtc="".$rest[0]." ".$nmt3."";
											if ($_SESSION["tname"]==$nmtc)
											{
												$yin=1;
											}
											if ($nm=="")
											{
												$nm="".$nmt."";
											}
											else
											{
												$nm="".$nm.", ".$nmt."";
											}
										}
									}
									$st=$d[7];
									$cr=$d[8];
									$dte=explode(".", $dt);
									$dtw=mktime(1, 1, 1, $dte[1], $dte[0], $dte[2]);
									$wd=date("w", $dtw);
									if ($wd==1)
									{
										$wdt="понеделник";
									}
									else if ($wd==2)
									{
										$wdt="вторник";
									}
									else if ($wd==3)
									{
										$wdt="сряда";
									}
									else if ($wd==4)
									{
										$wdt="четвъртък";
									}
									else if ($wd==5)
									{
										$wdt="петък";
									}
									else if ($wd==6)
									{
										$wdt="събота";
									}
									else
									{
										$wdt="неделя";
									}
									if ($n!=$oldn)
									{
										if ($st=="А")
										{
											if ($kdct<$kdts)
											{
												print("<tr>");
											}
											else
											{
												print("<tr style=\"background-color: #EE1133;\">");
											}
											print("<td style=\"font-size: 24px; font-weight: bold; text-align: center;\">".$dt."<br />".$wdt."");
											if ($yin==1)
											{
												print("<br /><i class=\"fas fa-warning\"></i>");
											}
											print("</td>");
											print("<td style=\"font-size: 24px; font-weight: bold;\">".$cr."</td>");
											print("<td style=\"font-size: 24px; font-weight: bold;\">".$nm."</td>");
											print("<td style=\"font-size: 24px; font-weight: bold; text-align: center;\">".$kdt."</td>");
											print("</tr>");
										}
									}
									$oldn=$n;
								}
							?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<?php
				}
			}
			else
			{
				setcookie("allowaccess", "", 1, "/", "", true, false);
				setcookie("acc_code", "", 1, "/", "", true, false);
				session_unset();
				session_destroy();
		?>
		<div style="margin-top: 50px;" class="container">
			<div class="row">
				<div class="col-12 col-md-12 col-sm-12 col-xs-12 col-lg-4 col-xl-4">
					&nbsp;
				</div>
				<div class="col-12 col-md-12 col-sm-12 col-xs-12 col-lg-4 col-xl-4">
					<div style="postion: relative; width: 100%; color: #DDDDDD; font-weight: bold; font-size: 20px; margin-top: 0px; text-align: center;">
						Електронна система
						<br />на СУ &quot;Васил Левски&quot; - Троян
						<br /><img src="/assets/images/site/enter.png" style="width: 200px; border: none;" alt="Електронна система" />
						<br />
						<br />ГРЕШНО ИМЕ ИЛИ ПАРОЛА!
						<br />
						<table style="postion: relative; margin: 0 auto; width: 320px; color: #DDDDDD; border: none;">
							<tr>
								<td style="width: 320px; padding-top: 10px;">
									<input class="form-control-lg form-control btn-danger" type="button" onclick="window.open('/','_self'); return true;" value="ОПИТАЙ ПАК" />
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="col-12 col-md-12 col-sm-12 col-xs-12 col-lg-4 col-xl-4">
					&nbsp;
				</div>
			</div>
		</div>
		<?php
			}
		?>
	</body>
</html>