Файл: my/search.php
Строк: 166
<?
define('ROOT','../');
require_once (ROOT.'system/power.php');
if ($aut) {
///Главная
$diz -> head('Поиск');
$diz -> title('Поиск');
if (!isset($_POST['submit'])) {
$d = 1;
$day = '<option desabled>'.language('День').'</option>';
while ($d <= 31) {
$day .= '<option value="'.$d.'">'.$d.'</option>';
++$d;
}
$m = 1;
$month = '<option desabled>'.language('Месяц').'</option>';
while ($m <= 12) {
$month .= '<option value="'.$m.'">'.$func->mes($m,2).'</option>';
++$m;
}
$y=date('Y')-1;
$year = '<option desabled>'.language('Год').'</option>';
while ($y >=1960) {
$year .= '<option value="'.$y.'">'.$y.'</option>';
$y--;
}
echo '<div class="fon">
<form action="search.php" method="POST">
'.language('Логин').':<br/><input type="text" name="login" maxlength="40"/><br/>
'.language('Имя').':<br/><input type="text" name="name" maxlength="40"/><br/>
'.language('Фамилия').':<br/><input type="text" name="fam" maxlength="40"/><br/>
'.language('В сети').': <input type="checkbox" name="online" value="1" checked/><br/>
'.language('Пол').':<br/><select name="sex">
<option value="m">'.language('Мужской').'</option>
<option value="w">'.language('Женский').'</option></select><br/>
'.language('Дата рождения').':<br/>
<div class="date">
<select name="day">'.$day.'</select>
<select name="month">'.$month.'</select>
<select name="year">'.$year.'</select></div>';
if($nastr['geopos']==1)echo '<br/>'.language('Город').':<br/><input type="text" name="city" maxlength="40"/>';
echo '<br/><input type="submit" name="submit" value="'.language('Найти').'"/></form></div>';
}else {
$login = shit($_POST['login']);
$name = shit($_POST['name']);
$fam = shit($_POST['fam']);
$city=shit($_POST['city']);
$online=abs(intval($_POST['online']));
$sex = (isset($_POST['sex']) && ($_POST['sex'] == 'm' or $_POST['sex'] == 'w')) ? trim($_POST['sex']) : 'm';
$day = (!empty($_POST['day']) && $_POST['day'] > 0 && $_POST['day'] < 32) ? intval(abs((int)$_POST['day'])) : null;
$month = (!empty($_POST['month']) && $_POST['month'] > 0 && $_POST['month'] <= 12) ? intval(abs((int)$_POST['month'])) : null;
$year = (!empty($_POST['year']) && $_POST['year'] >= 1960 && $_POST['year'] <= date('Y')-1) ? intval(abs((int)$_POST['year'])) : null;
$sq=null;
if(mb_strlen($func->delprobel($login))>1)$zap_name='and `login`="'.$login.'"';
if(mb_strlen($func->delprobel($name))>1)$zap_name='and `name`="'.$name.'"';
if(mb_strlen($func->delprobel($fam))>1)$zap_fam='and `fami`="'.$fam.'"';
if($day>0)$zap_day='and `day`="'.$day.'"';
if($month>0)$zap_month='and `month`="'.$month.'"';
if($year>0)$zap_year='and `year`="'.$year.'"';
if($nastr['geopos']==1){if(mb_strlen($func->delprobel($city))>1 and $func->cityname($city)>0)$zap_city='and `city`="'.$func->cityname($city).'"';}
if($online>0)$online='and `id` in (select `id` from `online`)'; else $online='and `id` not in (select `id` from `online`)';
$count = $db -> dbcount('COUNT(`id`)','users','`sex`="'.$sex.'" '.$zap_name.' '.$zap_fam.' '.$zap_day.' '.$zap_month.' '.$zap_year.' '.$zap_city.' '.$online.'');
if($count>0){
$sql = $db -> query('SELECT `id` FROM `users` where `sex`="'.$sex.'" '.$zap_name.' '.$zap_fam.' '.$zap_day.' '.$zap_month.' '.$zap_year.' '.$zap_city.' '.$online.' ORDER BY `id`');
while ($users = $sql -> fetch_assoc()) {
echo '<div class="menu"><a href="/id'.$users['id'].'" class="menutuch"/>
<table border="0" width="100%"><tr valign="top">
<td height="0" width="26">'.$fuser->avatar($users['id'],36,36,1).'</td>
<td>'. $fuser -> famname($users['id'],0).'<br/>
'. $fuser -> online($users['id']).'
</td></tr></table></a></div>';
}
}else echo '<div class="fon">'.language('Поиск не дал результатов').'.</div>';
echo '<div class="levo"><a href="?" class="levo_tuch">'.$diz -> icon('back.png').' '.language('Назад').'</a></div>';
}
echo '<div class="levo"><a href="./" class="levo_tuch">'.$diz -> icon('back.png').' '.language('Мой кабинет').'</a></div>';
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> icon('home.png').' '.language('На главную').'</a></div>';
#####Копирайт#######
$diz -> out($msg);
} else header('location: /aut.php');
?>