Your IP : 216.73.216.48


Current Path : /var/www/vlevski/enter/us/
Upload File :
Current File : //var/www/vlevski/enter/us/vs.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");
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<meta charset="utf-8" />
		<title>Справка за последната анкета</title>
		<style>
			td, th
			{
				border: 1px solid #000000;
				margin: 0;
				padding: 0;	
			}
		</style>
	</head>
	<body style="background-color: #CCCCCC;">
		<h1>Справка за последната анкета</h1>
		<table style="width: 100%; border: 1px solid #000000; margin: 0; padding: 0;">
			<thead>
				<th>Име, презиме, фамилия</th>
				<th>клас</th>
				<th>Гласувал</th>
			</thead>
			<tbody>
				<?php
					$i=0;
					$max=0;
					$lgn=mysqli_query($db, "SELECT * FROM `students` WHERE `s`='0' ORDER BY LENGTH(`k`) ASC, `k` ASC, `n1` ASC, `n2` ASC, `n3` ASC");
					while ($res=mysqli_fetch_row($lgn))
					{
						$max++;
						$tname="".$res[2]." ".$res[3]." ".$res[4]."";
						$psnd=mysqli_query($db, "SELECT * FROM `av` WHERE `e`='".$res[1]."' LIMIT 1");
						$st="no";
						while ($resp=mysqli_fetch_row($psnd))
						{
							$st="yes";
							$i++;
						}
						if ($st=="no")
						{
							print("<tr style=\"background-color: #CC0000; color: #DDDDDD;\"><td>".$tname."</td><td>".$res[5]."</td>");
							print("<td>НЕ</td>");
							print("</tr>");
						}
						else
						{
							print("<tr><td>".$tname."</td><td>".$res[5]."</td>");
							print("<td>ДА</td>");
							print("</tr>");
						}
					}
				?>
			</tbody>
		</table>
		<?php
			print("<h1>Брой гласували: ".$i." от общо ".$max."</h1>");
		?>
	</body>
</html>