Файл: index.php
Строк: 437
<?php
include 'system/core.php';
include 'system/header.php';
switch($_GET['m'])
{
default:
///////////Главная//////////////
echo "<a href='/'><div class='logos'><img src='/images/logos.gif' alt='$k_new_fav'width='160' hight='100'title='scriptwm.ru' /></div> </a>";
////////////////////////////////////////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl">';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '<img src="/images/r.png" alt="*"> <a href="bl?bl=rek">Купить рекламу</a></br>';
$cache = H.'/sys/cache/ads.php';
$bot = (preg_match('#Google-Bot/([0-9]+.[0-9]+)#i', $_SERVER['HTTP_USER_AGENT']) or preg_match('#Yandex-Bot/([0-9]+.[0-9]+)#i', $_SERVER['HTTP_USER_AGENT']) ? true : false);
if (file_exists($cache) and (time() - filemtime($cache) < 43200))
$ads = json_decode(file_get_contents($cache));
else {
$ads = file_get_contents('http://dcms-fiera.ru/ads/ads.php?key=7e5a3daa084f226a8ce2d59531ebe37b&version=2');
$fp = fopen($cache, 'w');
fwrite($fp, $ads);
fclose($fp);
$ads = json_decode($ads);
}
if (is_array($ads[0]))
$ads = $ads[ rand( 0, count ($ads) - 1 ) ];
$name = explode ('|', $ads[1]);
$name = $name[ rand(0, count($name) - 1) ];
echo '<img src="/images/r.png" alt="*"> <a href="http://'.($bot ? $ads[2] : 'dcms-fiera.ru/ads/ads.php?out=236&id='.$ads[0]).'" target="_blank">'.$name.'</a>';
echo '</div>';
echo '</div>';
include 'system/nvg.php';
/////////////////////////////////////////////////
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
$forum_t = mysql_result(mysql_query('select count(`id`) from `forum_t`'),0);
$forum_post = mysql_result(mysql_query('select count(`id`) from `forum_m`'),0);
$forum_news = mysql_result(mysql_query('select count(`id`) from `forum_t` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$forum_news2 = mysql_result(mysql_query('select count(`id`) from `forum_m` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$files = mysql_result(mysql_query('select count(`id`) from `zc_f` where `status` = "0"'),0);
$files_new = mysql_result(mysql_query('select count(`id`) from `zc_f` where `status` = "0" and `time` > "'.(time()-((60*60)*24)).'"'),0);
$news = mysql_query('select * from `news` order by `time` desc limit 1');
echo '<a href="news/"><div class="tegi"><font color="white"><b> Новости ресурса </b></font></div></a>';
while($news2 = mysql_fetch_array($news))
{
echo '<div class="news"><div class="newss">';
echo '<div class="name">'.$news2['name'].'</div>';
echo smiles(bbcode($news2['text'])).'<br>
Добавил: '.ustatus($news2['author']).' <a href="/us'.$news2['author'].'">'.uname($news2['author']).'</a> '.uaccess($news2['author']).' ('.times($news2['time']).')<br>
<span><a href="/news/com'.$news2['id'].'">Комментарии</a> ('.mysql_result(mysql_query('select count(`id`) from `news_com` where `news` = "'.$news2['id'].'"'),0).')</span>';
}
echo '</div>';
/* $day = mysql_query("SELECT * FROM `user` WHERE `day` = '".date('d')."' and `m` = '".date('m')."' ORDER BY `id` DESC limit 10 ");
echo '<div class="inter"><center><b>Именинники сайта</b></br>';
while($day2 = mysql_fetch_assoc($day))
{
echo ''.ustatus($day2['id']).' <a href="/us'.$day2['id'].'">'.uname($day2['id']).'</a> '.uaccess($day2['id']).', ';
}
echo'</center></br></div>';
echo '<div class="men"><img src="/images/obj.png" alt="*"> <a href="ob/"> Обьявления по сайту </a> ('.mysql_result(mysql_query('select count(`id`) from `ob`'),0).')</div>';
echo '';*/
echo ' <a href="forum/"><div class="tegi"><b> Форум мастеров ('.$forum_t.'/'.$forum_post.') (<font color="green"><b>+'.$forum_news.'</b></b></font>/<font color="red"><b>+'.$forum_news2.'</b></font>)</div></a>';
$last = mysql_query('select * from `forum_t` order by `ltime` desc limit 5');
while($last2 = mysql_fetch_array($last))
{
echo '<div class="poste">';
$last_m = mysql_result(mysql_query('select count(`id`) from `forum_m` where `t` = "'.$last2['id'].'"'),0);
if($last2['check'] == 0)
{
if($last2['status'] == 0) echo '<img src="/modules/forum/images/the.png"/> '; else echo '<img src="/modules/forum/images/closed.png"/> ';
}
else
{
echo '<img src="/modules/forum/images/check.png"/> ';
}
if($user['id']) $on_page = $user['on_page']; else $on_page = 10;
echo '<a href="/forum/t'.$last2['id'].'">'.$last2['name'].'</a> ('.$last_m.') <a href="forum/t'.$last2['id'].'/p'.ceil(($last_m+1)/$on_page).'">>></a><br>';
echo '</div>';
}
/////Счетчики//////
$users = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user`"), 0);
$pc = mysql_result(mysql_query('select count(`id`) from `pc_code` where `status` = "0"'),0);
$pc_new = mysql_result(mysql_query('select count(`id`) from `pc_code` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$users_new = mysql_result(mysql_query('select count(`id`) from `user` where `registration` > "'.(time()-((60*60)*24)).'"'),0);
$news = mysql_result(mysql_query('select count(`id`) from `news`'),0);
$users_online = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user` WHERE `online`>'".(time()-3600)."'"), 0);
/////Счетчики//////
echo '<div class="menu">';
if(mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0) != 0) $files_new = '/<font color="red"><b>+'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0).'</b></font>';
echo '<a href="zc/"><div class="tegi"><font color="white"><b>Загруз-центр</b> ('.$files.'<b>'.$files_new.'</font></b>)</div></a>';
if(mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0) != 0) $files_new = '/<font color="red"><b>+'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0).'</b></font>';
if(mysql_result(mysql_query('select count(`id`) from `zc_f`'),0) != 0)
{
$zc = mysql_query('select * from `zc_f` where `status` = "0" order by `time` desc limit 4');
while($zc2 = mysql_fetch_array($zc))
{
echo '<div class="post2"><img src="/images/box.png"/> <a href="/zc/f'.$zc2['id'].'">'.$zc2['name'].'</a> ('.round(filesize('modules/zc/files/'.$zc2['file'].'')/1024).' кб)</div>';
}
}
else
{
echo '<div class="err">Еще нет.</div>';
}
//echo '<a href="pc/"><div class="tegi"> Полезные коды ('.$pc.'/<font color="green"><b>+'.$pc_new.'</font></b>)</div></a>';///
?>
<script type="text/javascript">
function locs(){
document.location.href="";
}
setTimeout("locs()", 300000);
</script>
<?
////
// <a href="javascript:void(0)" onClick="javascript:window.open('http://web-first-step.ru/Pages/Vsplivaushee_okno.html', 'okno', 'width=400,height=300,status=no,toolbar=no, menubar=no,scrollbars=yes,resizable=yes');">
//Открыть "Мое всплывающее окно"</a>
//
echo '<a href="/m"><div class="tegi">
<font color="white"><b>Магазин ('.mysql_result(mysql_query('select count(`id`) from `m_tovar` '),0).')</b></font>
</div></a>';
$magaz = mysql_query('select * from `m_tovar` order by `time` desc limit 3');
while($a = mysql_fetch_array($magaz))
{
/* Делаем лимит слов к описанию */
$text = ''.$a['opis'].'';
$array = explode(" ", $text);
$text_num = array_slice($array, 0, 20);
$text_v = implode(" ", $text_num);
if(count($array) > 3) {
$text_v .= '...';
}
/* Делаем лимит слов к описанию */
echo '</div><div class="post2">
<img src="/modules/m/files/'.$a['scrin'].'" alt="*" class="image" align="left" style="margin: 1px 8px 0px 0px;"/>
<a href="/m/tovar'.$a['id'].'">'.$a['name'].'</a> <small>(<font color="green"><b>'.$a['rub'].'р.</b></font>)
</small><br/>'.$text_v.'<br>';
echo '<img src="/images/new.png" class="ico" alt="N"/> <a href="/">
<img src="/images/dollar.png" class="ico" alt="*"/></a>
<a href="/"><img src="/images/cart.png" class="ico" alt="*"/></a></div>';
}
echo '<div class="tegi"><font color="white"><b>прочее</font></b></b></div>';
echo '<a href="birga/"><div class="men">Биржа труда</div></a>';
echo '<a href="ced/"><div class="men">Нечесть интернета</div></a>';
echo '<a href="servis/"><div class="men">Сервисы</div></a>';
echo '<a href="adm.php"><div class="men">Список администрации</div></a>';
echo '<div class="tegi"><font color="white"><b>Меню пользователя </font></b></div>';
if(!$user['id']) echo '<div class="men"><span><a href="?m=auth">Авторизация</a><br /><a href="?m=registration">Регистрация</a><br /><a href="?m=password">Восстановление пароля</a></span></div></div>';
if($user['id'])echo '
<a href="cab/"><div class="men"><img src="/images/acn.gif"/> Личный кабинет </div></a>
<a href="bl/"><div class="men"><img src="/images/coins.png"/> Моя панель </div></a>
<a href="?m=exit"><div class="men"><img src="/images/out.png"/> Выход</div></a>';
echo '</b></b><div class="blk"><span style="color: #fff;">Онлайн: <a href="/online.php" style="color:white;">'.$users_online.'</a> из <a href="/users.php" style="color:white;">'.$users.'</a></span><br />';
////
echo '<b>Последний: </b>';
$last = mysql_query("SELECT * FROM `user` ORDER BY `registration` DESC LIMIT 1");
while($last2 = mysql_fetch_assoc($last))
{
echo ustatus($last2['id']).' <a href="/us'.$last2['id'].'"><span style="color: #fff;">'.$last2['login'].'</span> '.uaccess($last2['id']).'</a>';
}
echo '</br>';
///////
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime
[0];
$tstart = $mtime;
//в footer
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime
[0];
$tend = $mtime;
$totaltime = round(($tend -
$tstart)*1000, 2);
$mem = round
(memory_get_usage
() / 1024, 2);
echo' © otvetwm.ru ™ - 2014</div>';
echo '</div>';
///////////
//echo '</div></div><div class="end">';
//echo '<a href="javascript:window.scrollTo(0, 0);"><img src="/images/ups.png" align="left" vspace="1" border="0" alt=""></a>';
//echo '<center><font color="white"><b>otvetwm.ru</b></font><br><small>Все права защищены</small></center>';
//echo '</div></div></div></div>';
//echo '</body></html>';
///////////
break;
case 'guest':
if($user['id'])
{
header('Location: /index.php'); exit;
}
echo '<div class="podverh">';
echo '<div class="uv"><div class="sm"></div><div class="sm"></div><div class="co"><b>Ограничения по сайту</b></div></div>';
echo '</div>';
echo '<div class="start">';
echo '<div class="s"><div class="ss"><span><a href="?m=registration">Регестрация</a></span></div></div>';
echo '<div class="post1"><b>Сайт закрыт от гостей</b></div>';
include 'system/footer.php';
break;
case 'auth':
if($user['id'])
{
header('Location: /index.php'); exit;
}
echo '<div class="tegi">Авторизация</div></div>';
echo ' <div class="start">';
echo '<div class="post1"><span><a href="?m=password">Забыли пароль?</a></span></div>';
if(isset($_GET['process']))
{
$type = TextGuard($_POST['type']);
$login = TextGuard($login);
$password = TextGuard($password);
$captcha = TextGuard($_POST['captcha']);
if(empty($captcha) or !is_numeric($captcha)) $err[] = 'Введите проверочный код.';
if($captcha != $_SESSION['control']) $err[] = 'Вы ввели неверный код с картинки.';
if($type == 1)
{
if(empty($login)) $err[] = 'Вы не ввели логин';
}
elseif($type == 2)
{
if(empty($login) or !is_numeric($login)) $err[] = 'Введите ID.';
}
if(empty($password)) $err[] = 'Вы не ввели пароль';
if($type == 1)
{
$dbinfo = mysql_fetch_array(mysql_query("SELECT `login`,`password` FROM `user` WHERE `login` = '".$login."' and `password`='".$password."' LIMIT 1"));
}
elseif($type == 2)
{
$dbinfo = mysql_fetch_array(mysql_query("SELECT `id`,`password`,`login` FROM `user` WHERE `id` = '".$login."' and `password`='".$password."' LIMIT 1"));
}
if(!empty($login) && !empty($password)) if($dbinfo==0) $err[] = 'Введенные данные не верны ';
if(!$err)
{
mysql_query("INSERT INTO `logs`(`who`,`time`,`vh`,`ip`,`ua`)VALUES('".$dbinfo['login']."','".time()."','1','".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."')");
setcookie('ulogin', $dbinfo['login'], time()+86400*365, '/');
setcookie('upassword', $password, time()+86400*365, '/');
header('Location: /index.php');
}
else
{
echo '<div class="err">';
mysql_query("INSERT INTO `logs`(`who`,`time`,`vh`,`ip`,`ua`)VALUES('".$login."','".time()."','0','".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."')");
foreach($err as $err_info)
{
echo $err_info.'<br>';
}
echo '</div>';
}
}
echo '<div class="glav"><form action="?m=auth&process" method="post">
Ваш <select name="type"><option value="1">Ник</option><option value="2">ID</option></select><br>
<input name="login" value="'.$login.'"/><br>Пароль:<br><input type="password" name="password" value="'.$password.'"/><br>
Код <img src="/captcha.php" alt="'.$code.'"/>:<br><input name="captcha"/><br>
<input type="submit" value="Вход"/>
</form></div></div>';
echo '<div class="levo"><img src="/images/homepage.gif"/> <a href="/index.php">На главную</a></div></div>';
/////Счетчики//////
$users = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user`"), 0);
$pc = mysql_result(mysql_query('select count(`id`) from `pc_code` where `status` = "0"'),0);
$pc_new = mysql_result(mysql_query('select count(`id`) from `pc_code` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$users_new = mysql_result(mysql_query('select count(`id`) from `user` where `registration` > "'.(time()-((60*60)*24)).'"'),0);
$news = mysql_result(mysql_query('select count(`id`) from `news`'),0);
$users_online = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user` WHERE `online`>'".(time()-3600)."'"), 0);
/////Счетчики//////
echo '</b></b><div class="blk"><span style="color: #fff;">Онлайн: <a href="/online.php" style="color:white;">'.$users_online.'</a> из <a href="/users.php" style="color:white;">'.$users.'</a></span><br />';
////
echo '<b>Последний: </b><span style="color: #fff;">';
$last = mysql_query("SELECT * FROM `user` ORDER BY `registration` DESC LIMIT 1");
while($last2 = mysql_fetch_assoc($last))
{
echo ustatus($last2['id']).' <a href="/us'.$last2['id'].'">'.uname($last2['id']).' '.uaccess($last2['id']).'</span></a>';
}
echo '</br>';
///////
echo' <a href="/"> © otvetwm.ru ™ - 2014</a> </div>';
include 'system/footer.php';
break;
case 'exit':
if(!$user['id'])
{
header('Location: /?m=auth'); exit;
}
setcookie('ulogin', $login, time()-86400*365, '/');
setcookie('upassword', $password, time()-86400*365, '/');
header('Location: /index.php');
break;
case 'registration':
if($user['id'])
{
header('Location: /index.php'); exit;
}
echo '<div class="tegi">Регистрация</div></div>';
echo '</div>';
echo ' <div class="start">';
echo '<div class="post1"><span><a href="?m=auth">Авторизация</a></span></div>';
if(isset($_GET['process'])){
$login = TextGuard($_POST['login']);
$password = TextGuard($_POST['password']);
$dei = TextGuard($_POST['dei']);
$password2 = TextGuard($_POST['password2']);
$sex = TextGuard($_POST['sex']);
$secret_word = TextGuard($_POST['secret_word']);
if(empty($login)){ echo '<div class="err">Вы не ввели логин</div>';
}else{
$dbinfo = mysql_fetch_array(mysql_query("SELECT `login` FROM `user` WHERE `login` = '".$login."' LIMIT 1"));
if(!empty($login))if($dbinfo!=0){ echo '<div class="err">Такой логин уже существует</div>';
}else{
if(!preg_match('|^[a-z0-9-]+$|i', $login)){ echo '<div class="err">В логине присутствуют запрещенные символы</div>';
}else{
if(strlen($login) <2 or strlen($login)>20){ echo '<div class="err">Логин слишком длинный или короткий</div>';
}else{
if(empty($password)){ echo '<div class="err">Вы не ввели пароль</div>';
}else{
if(!preg_match('|^[a-z0-9-]+$|i', $password)){ echo '<div class="err">В пароле присутствуют запрещенные символы</div>';
}else{
if(strlen($password) <2 or strlen($password)>50){ echo '<div class="err">Пароль слишком длинный или короткий</div>';
}else{
if(empty($password2)){ echo '<div class="err">Вы не ввели повторный пароль</div>';
}else{
if(empty($secret_word)){ echo '<div class="err">Вы не ввели секретное слово</div>';
}else{
if(!preg_match('|^[a-zа-Я0-9-]+$|i', $password)){ echo '<div class="err">В секретном слове присутствуют запрещенные символы</div>';
}else{
if(strlen($secret_word) <2 or strlen($secret_word)>50){ echo '<div class="err">Секретное слово слишком длинное или короткое</div>';
}else{
mysql_query("INSERT INTO `user`(
`login`,
`password`,
`dei`,
`registration`,
`secret_word`,
`rating`,
`ip`,
`ua`,
`sex`,
`on_page`
)VALUES(
'".$login."',
'".$password."',
'".$dei."',
'".time()."',
'".$secret_word."',
'0',
'".$_SERVER['REMOTE_ADDR']."',
'".$_SERVER['HTTP_USER_AGENT']."',
'".$sex."',
'10'
)");
$reg_id = mysql_insert_id();
mysql_query("INSERT INTO `reg`(
`who`,
`ok`
)VALUES(
'".$reg_id."',
'0'
)");
mysql_query("INSERT INTO `gradient`(
`id`,
`who`,
`start`,
`end`
)VALUES(
'".$reg_id."',
'".$reg_id."',
'0',
'0'
)");
$regaa = mysql_query("SELECT * FROM `user` WHERE `status` > '2'");
while($regaa2 = mysql_fetch_assoc($regaa)){
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`
)VALUES(
'".$regaa2['id']."',
'3',
'произошла новая регистрация [url=/admin?m=reg]подтвердить[/url]',
'".time()."',
'0'
)");
}
setcookie('ulogin', $login, time()+86400*365, '/');
setcookie('upassword', $password, time()+86400*365, '/');
echo '<div class="msg">Вы <u>успешно</u> зарегистрировались!<br>Ваш логин: <u>'.$login.'</u> | Ваш пароль: <u>'.$password.'</u></div>';
}}}}}}}}}}}}
echo '<div class="glav"><form action="?m=registration&process" method="post">
*Ваш логин:<br><input name="login" value="'.$login.'"/><br>
*Ваш пароль:<br><input name="password" value="'.$password.'"/><br>
*Повторить пароль:<br><input name="password2" value="'.$password2.'"/><br>
Ваш пол:<br>
<input type="radio" name="sex" value="1" checked="checked" /> Муж
<input type="radio" name="sex" value="2" /> Жен<br/>
Секретное слово:<br><input name="secret_word" value="'.$secret_word.'"/><br>
<input type="submit" value="Регистрация"/></form></div></div>';
echo '<div class="levo"><img src="/images/homepage.gif"/> <a href="/index.php">На главную</a></div></div>';
/////Счетчики//////
$users = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user`"), 0);
$pc = mysql_result(mysql_query('select count(`id`) from `pc_code` where `status` = "0"'),0);
$pc_new = mysql_result(mysql_query('select count(`id`) from `pc_code` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$users_new = mysql_result(mysql_query('select count(`id`) from `user` where `registration` > "'.(time()-((60*60)*24)).'"'),0);
$news = mysql_result(mysql_query('select count(`id`) from `news`'),0);
$users_online = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user` WHERE `online`>'".(time()-3600)."'"), 0);
/////Счетчики//////
echo '</b></b><div class="blk"><span style="color: #fff;">Онлайн: <a href="/online.php" style="color:white;">'.$users_online.'</a> из <a href="/users.php" style="color:white;">'.$users.'</a></span><br />';
////
echo '<b>Последний: </b><span style="color: #fff;">';
$last = mysql_query("SELECT * FROM `user` ORDER BY `registration` DESC LIMIT 1");
while($last2 = mysql_fetch_assoc($last))
{
echo ustatus($last2['id']).' <a href="/us'.$last2['id'].'">'.uname($last2['id']).' '.uaccess($last2['id']).'</span></a>';
}
echo '</br>';
///////
echo' <a href="/"> © otvetwm.ru ™ - 2014</a> </div>';
include 'system/footer.php';
break;
case 'password':
if($user['id']){
header('Location: /index.php'); exit;
}
echo '<div class="podverh">';
echo '<div class="uv"><div class="sm"></div><div class="sm"></div><div class="co">Восстановление пароля</div></div>';
echo '</div>';
echo ' <div class="start">';
echo '<div class="s"><div class="ss"><span><a href="?m=auth">Авторизация</a></span></div></div>';
if(isset($_GET['process'])){
$login = TextGuard($_POST['login']);
$secret_word = TextGuard($_POST['secret_word']);
if(empty($login)) $err[] = 'Вы не ввели логин';
if(empty($secret_word)) $err[] = 'Вы не ввели секретное слово';
$dbinfo = mysql_fetch_array(mysql_query("SELECT `login`,`secret_word`,`password` FROM `user` WHERE `login` = '".$login."' and `secret_word`='".$secret_word."' LIMIT 1"));
if(!empty($login) && !empty($secret_word)) if($dbinfo==0) $err[] = 'Введенные данные не верны';
if(!$err){
echo '<div class="msg"><u>Успешно</u><b>Ваш пароль: <u>'.$dbinfo['password'].'</u></b></div>';
}else{
echo '<div class="err">';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</div>';
}}
echo '<div class="glav"><form action="?m=password&process" method="post">
Логин:<br><input name="login" value="'.$login.'"/><br>
Секретное слово:<br><input name="secret_word" value="'.$secret_word.'"/><br>
<input type="submit" value="Напомнить"/>
</form></div></div>';
/////Счетчики//////
$users = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user`"), 0);
$pc = mysql_result(mysql_query('select count(`id`) from `pc_code` where `status` = "0"'),0);
$pc_new = mysql_result(mysql_query('select count(`id`) from `pc_code` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$users_new = mysql_result(mysql_query('select count(`id`) from `user` where `registration` > "'.(time()-((60*60)*24)).'"'),0);
$news = mysql_result(mysql_query('select count(`id`) from `news`'),0);
$users_online = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user` WHERE `online`>'".(time()-3600)."'"), 0);
/////Счетчики//////
echo '</b></b><div class="blk"><span style="color: #fff;">Онлайн: <a href="/online.php" style="color:white;">'.$users_online.'</a> из <a href="/users.php" style="color:white;">'.$users.'</a></span><br />';
////
echo '<b>Последний: </b><span style="color: #fff;">';
$last = mysql_query("SELECT * FROM `user` ORDER BY `registration` DESC LIMIT 1");
while($last2 = mysql_fetch_assoc($last))
{
echo ustatus($last2['id']).' <a href="/us'.$last2['id'].'">'.uname($last2['id']).' '.uaccess($last2['id']).'</span></a>';
}
echo '</br>';
///////
echo' <a href="/"> © otvetwm.ru ™ - 2014</a> </div>';
include 'system/footer.php';
break;
}
?>