<?
echo '<link rel="stylesheet" type="text/css" href="style/main5.css"/>';
if(isset($_GET['reG']))
{
include_once 'inc/reg.php';
}
if(isset($_GET['auth']))
{
include_once 'inc/auth.php';
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `ip` = '".my_esc($_SERVER['REMOTE_ADDR'])."' LIMIT 1"),0)!=0  && $_SESSION['mult']==0)
{
$_SESSION['mult']=68758;
}
elseif(isset($_GET['pass']))
{
include_once 'inc/pass.php';
}
elseif(isset($_GET['autologin']))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `autologin` = '".hsc($_GET['autologin'])."'"),0)!=0)
{
$_SESSION['id_user']=mysql_result(mysql_query("SELECT `id` FROM `kolhoz_user` WHERE `autologin` = '".hsc($_GET['autologin'])."'"),0);
header("Location:?myfarm&autologin=".hsc($_GET['autologin']));
exit;
}
else err_game("<center>Автологин устарел!</center>");
}
echo "<div></div><div></div>";

echo "<div class='block event'><center><font color='DarkOrange'>Игроков онлайн:</font> <b><span class='title'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."'"), 0)."</b></span></center></div>";

echo "<div class='content'>";

echo "<div class='block'>";

echo '<center><font color="#115522" size="7">Д</font><font color="#5588DD" size="6">о</font><font color="#DD7788" size="5">б</font><font color="#EE33AA" size="5">р</font><font color="#DD99CC" size="5">о</font> <font color="#AA66DD" size="4">п</font><font color="#B2EC5D" size="4">о</font><font color="#7755EE" size="6">ж</font><font color="#448855" size="4">а</font><font color="#119966" size="6">л</font><font color="#AA5599" size="3">о</font><font color="#BB2288" size="4">в</font><font color="#7799DD" size="6">а</font><font color="#45CEA2" size="3">т</font><font color="#CC6688" size="7">ь</font><font color="#EEDDEE" size="6">!</font></center>';

$chas=date("H",time()); if($chas>24){$chas=round($chas-24);} if($chas<0){$chas=round($chas+24);} if($chas<=4 || $chas>=23){echo 'Сейчас в колхозе: <font color="#FF6633"><b>Ночь</b></font>';} if($chas>=5 && $chas<=10){echo 'Сейчас в колхозе: <font color="#FF6633"><b>Утро</b></font>';} if($chas>=11 && $chas<=17){echo 'Сейчас в колхозе: <font color="#FF6633"><b>День</b></font>';} if($chas>=18 && $chas<=22){echo 'Сейчас в колхозе: <font color="#FF6633"><b>Вечер</b></font>';}

$ka=rand(1,2);
$k=$ka;
if($k == 1){echo "<br/><center><img width='320' height='150' src='img/shop25.gif' alt='o'></center>";}
if($k == 2){echo "<br/><center><img width='320' height='150' src='img/neighbors.gif' alt='o'></center>";}

echo "<div class='small ptm'></div>";
echo "<div class='xr'></div>";
echo "<center><span class='title'>Нас уже <b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"), 0)."</b> игроков</span></center>";
echo "<div class='xr'></div>";
echo "<center>";
$vx=rand(1,5);
$k=$vx;
if($vx == 1){echo '<a href="?start_user"><img width="110" height="30" src="img/start/start.png" alt="o"></a>';}
if($vx == 2){echo '<a href="?start_user"><img width="110" height="30" src="img/start/start1.png" alt="o"></a>';}
if($vx == 3){echo '<a href="?start_user"><img width="110" height="30" src="img/start/start2.png" alt="o"></a>';}
if($vx == 4){echo '<a href="?start_user"><img width="110" height="30" src="img/start/start3.png" alt="o"></a>';}
if($vx == 5){echo '<a href="?start_user"><img width="110" height="30" src="img/start/start4.png" alt="o"></a>';}


$reg=rand(1,2);
$k=$reg;
if($reg == 1){echo '<a href="?reG"><img width="110" height="30" src="img/start/reg_2.png" alt="o"></a>';}
if($reg == 2){echo '<a href="?reG"><img width="110" height="30" src="img/start/reg.png" alt="o"></a>';}
echo "</center>";

echo "<div class='block event'><img src='img/zvezda/7.png' alt='o'/> <b><font color='orange'>Бонус за регистрацию</font><br/></b> <font color='violet'>1000000</font><img src='img/icons/ruby.png' alt='o'>, <font color='violet'>1000000000</font><img width='16' height='16' src='img/icons/money.png' alt='o'>, <font color='violet'>500</font><img width='16' height='16' src='img/icons/zkl.png' alt='o'>, <font color='violet'>100</font><img width='16' height='16' src='img/euro.png' alt='o'>, <font color='violet'>100</font><img src='img/icons/baks.png' alt='o'></div>";
include_once 'novij_god.php';








if(isset($_POST['nick']) && isset($_POST['password'])){
$auth_id = mysql_fetch_assoc(mysql_querll('SELECT `id`,`search_accelerator`,`autologin` FROM `kolhoz_user` WHERE `nick`="'.my_esc($_POST['nick']).'" AND `password`="'.md5(my_esc($_POST['password'])).'" LIMIT 1'));
if($auth_id['id']==''){
err_game("Неверный ник или пароль");
} else {
$_SESSION['id_user'] = $auth_id['id'];
$_SESSION['search_accelerator'] = $auth_id['search_accelerator'];
if(!empty($_GET['r'])){$_SESSION['refer'] = intval($_GET['r']);}
if($_POST['auth_auto']==1){setcookie('autologin',$auth_id['autologin'],$time+31536000);}
header('Location:?mylog');
exit;
}
}

?>
</div><center><div class="content">
<div class="block">




<form method="post"><ul>
<li>
<label>Ник в игре:<br>
<input type="text" value="" name="nick">
</label>
</li>
<li class="pt">
<label>Пароль: (<a href="?pass"><font color='#33FFCC'>Восстановить</font></a>)<br>
<input type="password" value="" name="password">
</label>
</li>
<input type="checkbox" name="auth_auto" value="1"> Сохранить сессию<br>
<input type="submit" value="Войти">
</li>
</ul>
</form>






<?
echo '<div class="blockings"><center><script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script><div class="yashare-auto-init" data-yashareL10n="ru" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir" data-yashareTheme="counter"></div>';

echo "<div class='block event'>";
echo "<center>© 2o13-2019 <font color='orangered'>$_SERVER[HTTP_HOST]</font></center>";
echo "</div>";
exit;
?>