View file sad/index.php

File size: 4.61Kb
<?php
/**********************************
*	@year: 2018				      *
*	@author: Klubv	              *
*   @icq: 611940693			      *
*	@link: http://baz23.ru        *
**********************************/
define('GAME_CMS', 1);

include ('system/head.php');



$reklama = mysql_query("select * from `reklama` order by `mesto` limit 5");

if (mysql_num_rows($reklama) != 0) {

echo '<div class="mybar">Реклама:</div><div class="menu">';

while ($rekl = mysql_fetch_assoc($reklama)) {

echo '- <a href="'.ROOT.'/str/redirect.php?url='.$rekl['url'].'">'.(empty($rekl['color']) ? null : '<span style="color:'.$rekl['color'].'">') . utf($rekl['name']) . (empty($rekl['color']) ? null : '</span>').'</a><br/>';

}

echo '</div>';

}



echo '<div class="mybar">Авторизация</div>';


if (isset($active) == false) {

isset($_GET['ref']) ? $_SESSION['ref'] = win($_GET['ref']) : false;

////////////////////


$error = '';



if (isset($_REQUEST['login']) && isset($_REQUEST['pass'])){

if (empty($_REQUEST['login'])) {

$error.= 'Заполните поле логин!<br/>';

}

elseif (mb_strlen($_REQUEST['login']) < 3 or mb_strlen($_REQUEST['login']) > 15) {

$error.= 'Логин должен содержать от 3 до 15 символов!<br/>';

}

elseif (!mysql_num_rows(mysql_query("select (`login`) from `users` where `login`='".utf($_REQUEST['login'])."' limit 1"))) {

$error.= 'Пользователь с логином '.utf($_REQUEST['login']).' ненайден!<br/>';

}

elseif (empty($_REQUEST['pass'])) {

$error.= 'Заполните поле пароль!<br/>';

}

elseif (mb_strlen($_REQUEST['pass']) < 3 or mb_strlen($_REQUEST['pass']) > 15) {

$error.= 'Пароль должен содержать от 3 до 15 символов!<br/>';

}

elseif (mysql_num_rows(mysql_query("select * from `users` where `login`='".utf($_REQUEST['login'])."' and `pass`<>'".utf(md5(md5($_REQUEST['pass'])))."' limit 1"))) {

$error.= 'Пароль введен не верно!<br/>';

}

if ($error) {

echo '<div class="error"><center>'.$error.'</center></div>';

mysql_query("insert into `auth_err` set `time`='".time()."', `pass`='".win($_REQUEST['pass'])."', `log`='".win($_REQUEST['login'])."'");

} else {

$_SESSION['login'] = utf($_REQUEST['login']);

$_SESSION['pass'] = utf(md5(md5($_REQUEST['pass'])));

mysql_query("update `users` set `lasttime`='".time()."', `ip`='".utf($_SERVER['REMOTE_ADDR'])."', `ua`='".$_ua."' where `login`='".win($_REQUEST['login'])."'");

mysql_query("insert into `auth` set `time`='".time()."', `ip`='".utf($_SERVER['REMOTE_ADDR'])."', `ua`='".$_ua."', `log`='".win($_REQUEST['login'])."'");

echo'<meta http-equiv="Refresh" content="0; url='.ROOT.'/cpanel.php?act=enter"/>';



}

}

echo'<form name="/" action="" method="post">

<div class="menu">Логин:<br/><input type="text" name="login" maxlength="15"/><br/>

Пароль:<br/><input type="password" name="pass" maxlength="15"/><br/>

<input type="submit" value="Авторизация"/></div></form>';


//////////////////


echo'<div class="menu"><img src="img/reg.png" width="16" height="16" class="left" /> <a href="'.ROOT.'/str/reg.php">Регистрация</a></div>';
echo'<div class="menu"><img src="img/mail.png" width="16" height="16" class="left" /> <a href="'.ROOT.'/str/forgot.php">Забыли пароль?</a></div>';
///////
echo '<div class="mybar">Новости</div>';
	

$sql = mysql_query("select * from `news` where `news`='' order by `id` desc limit 1");



if (mysql_num_rows($sql) == 0) {

echo '<div class="error"><center>Новостей еще нет!</center></div>';

} else {



while ($row = mysql_fetch_assoc($sql)) {



echo'<div class="menu">

<img src="'.ROOT.'/img/news.png" width="16" height="16" class="left" /> <b>'.utf($row['name']).'</b> ('.date('d.m H:i', $row['date']).') '.($row['date'] > time() - 86400 ? '(<span style="color:red">New!</span>)' : null).' ';

echo'<br/>'.nl2br(bb(smiles(utf($row['text'])))).'<br/> </div>';			

}			


}




///////////////////////////////////////////////////////////		

echo '<div class="mybar">Статистика</div>';


echo '<div class="tfoot"><i>

- Пользователей: <b>'.val($count_users, 1).'</b> <br/>
- Введено: <b>'.val($max_in, 1).'</b> руб. <br/>
- Выплачено: <b>'.val($max_out, 1).'</b> руб.<br/></i>
</div>';

echo '<div class="mybar">Реклама</div>';

echo '<div class="tfoot">
<script language="JavaScript" charset="UTF-8" src="http://z1330.takru.com/in.php?id=1333148"></script>


</div>';

//////////////////////////////////

} else {

echo'<meta http-equiv="Refresh" content="0; url='.ROOT.'/cpanel.php"/>';

}



include ('system/foot.php');

?>