<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

$set['title']='Перевод KБ'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut();


################## go поиск в базе ##################
$ank_nick=NULL;
if (isset($_SESSION['nick']))$nick=esc(stripcslashes(htmlspecialchars($_SESSION['nick'])));
if (isset($_POST['nick']))$nick=esc(stripcslashes(htmlspecialchars($_POST['nick'])));
$_SESSION['nick']=$nick;
$nick=ereg_replace("( ){1,}","",$nick);


if (isset($_GET['go']) && $nick!=NULL)
{
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `nick` like '%".mysql_escape_string($nick)."%'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

if ($k_post==0)
echo "Извините, по Вашему запросу ничего не найдено";



$q=mysql_query("SELECT * FROM `user` WHERE `nick` like '%".mysql_escape_string($nick)."%' ORDER BY date_last DESC LIMIT $start, $set[p_str]");
while ($ank = mysql_fetch_array($q))
{
if($num==1){ 
echo "<div class='rowdown'>"; 
$num=0;
}else{ 
echo "<div class='rowup'>"; 
$num=1;}

echo "".online($ank['id'])." \n";
echo "<a href='/info.php?id=$ank[id]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a>\n";
echo "".adm($ank['id'])." \n";

if ($ank['nick']!=NULL)echo ", <span class=\"ank_d\">$ank[nick]</span><br />\n";
echo "</div>\n";
}



if ($k_page>1)str("search.php?go&amp;",$k_page,$page); // Вывод страниц
include_once '../sys/inc/tfoot.php';
}

else

{          /////////// формы ввода критериев поиска             /////////// формы ввода критериев поиска

echo "<form method=\"post\" action=\"search.php?go\">";
echo "Ник получателя:<br/>";
echo "<input type=\"text\" name=\"nick\" value=\"$nick\"/><br />\r\n";
echo "<br />";

echo "<input type=\"submit\" value=\"Найти\" />";
echo "</form>\n";

include_once '../sys/inc/tfoot.php';}
?>