Your IP : 172.28.240.42


Current Path : /var/www/html/clients/pv.e-nk.ru/
Upload File :
Current File : /var/www/html/clients/pv.e-nk.ru/search.php

<?header ('content-type:text/html;charset=utf-8');?>
<?
include "config.php";
include "tologin.php";
include "func.php";
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<h1>Поиск</h1>
<style>
	td{
		padding:20px 5px 20px 5px;
	}
</style>
<?
$access = 0; // Default
$res = mysql_query("select * from `pv_users` where login='".$login."' LIMIT 1");
for ($i=0; $i<mysql_num_rows($res); $i++)
{
$userdata = mysql_fetch_array($res);
$access = $userdata['access'];
}
if($access == 0){
$useraccess = 0;
$dostup = 0;
} else {
$res = mysql_query("select * from `pv_access` where uid='".$access."' LIMIT 1");
$useraccess = mysql_fetch_array($res);
$dostup = $useraccess['access'];
}
if($useraccess == 0){
	echo "У Вас нет доступа к этой функции!";
	exit;
} else {
	if((!isset($_GET['s']))||(empty($_GET['s']))){
		$_GET['s']="";
		$poisk=strip_data($_GET['s']);
		echo "<form action='/search.php' method='get'><table width='90%'><tr><td width='80%'><input style='width: 100%;' name='s' value='".$poisk."' /></td><td width='20%'><button>Поиск</button></td></tr></table></form>";

		$res = mysql_query("SELECT * FROM `pv_veterans` WHERE 1 LIMIT 0, 100");
	} else {
		$_GET['s']=strip_data($_GET['s']);
		$poisk=strip_data($_GET['s']);
		echo "<form action='/search.php' method='get'><table width='90%'><tr><td width='80%'><input style='width: 100%;' name='s' value='".$poisk."' /></td><td width='20%'><button>Поиск</button></td></tr></table></form>";

		$res = mysql_query("SELECT * FROM `pv_veterans` WHERE MATCH (`f`,`i`,`o`,`adress`) AGAINST ('".$poisk."' IN BOOLEAN MODE) GROUP BY uid");
	}
	
	echo "<table border='2px' cellspacing='0'>";
	echo "<tr><th>ФИО</th><th>Дата рождения</th><th>Адрес проживания</th><th>Телефоны</th><th>Предприятие</th><th>Редактировать</th></tr>";
	for ($i=0; $i<mysql_num_rows($res); $i++)
	{
	$vet = mysql_fetch_array($res);
	echo "<tr><td>".$vet["f"]." ".$vet["i"]." ".$vet["o"]." <a href='/info.php?id=".$vet["uid"]."'><img src='/img/infofull.png' title='Полная доступная информация о ветеране'/></a> <a href='/printspv.php?id=".$vet["uid"]."'><img src='/img/print.png' title='Печать социального паспорта'/></a></td><td>".$vet["dr"]."</td><td>".$vet["adress"]."</td><td>".$vet["contact"]."</td><td>".nl2br($vet["pred"])."</td><td>
	<a href='/edit.php?id=".$vet["uid"]."'><img src='/img/info.png' title='Информация о ветеране'/></a>
	<a href='/fizur.php?id=".$vet["uid"]."'><img src='/img/urfiz.png' title='Юр. и физ. лиц закрепленные за ветераном'/></a>
	<a href='/ulgil.php?id=".$vet["uid"]."'><img src='/img/ulgil.png' title='Мероприятия по улучшению жилищных условий'/></a>
	<a href='/medsoc.php?id=".$vet["uid"]."'><img src='/img/medsoc.png' title='Медико-социальная помощь ветерану'/></a>
	<a href='/gizus.php?id=".$vet["uid"]."'><img src='/img/gizus.png' title='Жизнеустройство ветерана, и нуждаемость в посторонней помощи'/></a>
	<a href='/inoe.php?id=".$vet["uid"]."'><img src='/img/inoe.png' title='Иные нужды ветерана'/></a>
	<a href='/jelvet.php?id=".$vet["uid"]."'><img src='/img/jelvet.png' title='Пожелания ветерана'/></a>
	</td></tr>";
	}
	echo "</table>";
}