Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/_old_files/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/_old_files/spravka.php

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?><!DOCTYPE html>
<html lang="bg">
	<head>
		<style>
			@font-face
			{
				font-family:	mf;
				src:			url("/font/calibri.woff");
			}
			@font-face
			{
				font-family:	im;
				src:			url("/font/impact.ttf");
			}
			body, div, span, font
			{
				font-family:	mf;
			}
			@media print
			{
				#dc
				{
					page-break-after: always;
				}
			}
			th, td
			{
				border: 1px solid #000000;
			}
		</style>
	</head>
	<body>
	<table>
		<thead>
			<th>Име, презиме и фамилия на ученика</th>
			<th>клас</th>
			<th>паралелка</th>
			<th>пол</th>
			<th>рождена дата мм/гггг</th>
			<th>училищна подготовка</th>
			<th>СОП</th>
		</thead>
		<tbody>
	<?php
		$i=1;
		include("./conn.php");
		$cards=mysqli_query($db, "SELECT * FROM `students` WHERE `a`='1' ORDER BY `n1` ASC, `n2` ASC, `n3` ASC");
		while ($sc=mysqli_fetch_row($cards))
		{
			$egn=$sc[6];
			$egnchck=substr($egn, 0, 2);
			$egnpol=substr($egn, 8, 1);
			if (($egnpol==0) || ($egnpol==2) || ($egnpol==4) || ($egnpol==6) || ($egnpol==8))
			{
				$sex=2;
			}
			else
			{
				$sex=1;
			}
			$rkl=$sc[8];
			$kl=str_replace("а", "", $rkl);
			$kl=str_replace("б", "", $kl);
			$kl=str_replace("в", "", $kl);
			$kl=str_replace("г", "", $kl);
			$p=str_replace("0", "", $rkl);
			$p=str_replace("1", "", $p);
			$p=str_replace("2", "", $p);
			$p=str_replace("3", "", $p);
			$p=str_replace("4", "", $p);
			$p=str_replace("5", "", $p);
			$p=str_replace("6", "", $p);
			$p=str_replace("7", "", $p);
			$p=str_replace("8", "", $p);
			$p=str_replace("9", "", $p);
			$egnrm=substr($egn, 2, 2);
			$egnrm-=40;
			if ($egnrm<10)
			{
				$egnrm="0".$egnrm;
			}
			if (($p=="а") || ($p=="б"))
			{
				$oc=3;
			}
			else
			{
				$oc=4;
			}			
			if ($egnchck=="05")
			{
				print("<tr>");
				print("<td>".$sc[3]." ".$sc[4]." ".$sc[5]."</td><td>".$kl."</td><td>".$p."</td><td>".$sex."</td><td>".$egnrm."/2005</td><td>".$oc."</td><td>&nbsp;</td>");
				print("</tr>");
			}
		}
	?>
			<tbody>
		</table>
	</body>
</html>