Файл: titwar.ru/index.php
Строк: 172
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
$title = 'Main page';
include './system/h.php';
if($user) {
if($mail > 0) {
?>
<div class='list'>
<li><a href='/mail/'>New mail</a></li>
</div>
<?
}
?>
<div class='content' align=' '><span style='text-shadow:none;'></span><img src='/images/logo.png' alt='' width='100%'/></div>
<div class='line'></div>
<div class='list'>
<li><a href='/arena/' style='display: block;' class='menu_link'><img src='/images/icon/arena.png' alt='*'/> Arena <?=($user['arena_pobed'] > 0 ? '<font color='#30c030'><span class="chet">(+)</font>':'')?></span></a></li>
<?
if($user['level'] > 0) {
?>
<li><a href='/duel/' style='display: block;' class='menu_link'><img src='/images/icon/league.png' alt='*'/> Duels <?=($user['duel_fights'] > 0 ? '<font color='#30c030'><span class="chet">(+)</font>':'')?></span></a></li>
<?
}
if($user['level'] > 0) {
?>
<li><a href='/coliseum/' style='display: block;' class='menu_link'><img src='/images/icon/coliseum.png' alt='*'/> Coliseum</a></li>
<?
}
$undying = mysql_query('SELECT * FROM `undying` WHERE `start` = "0" LIMIT 1');
$undying = mysql_fetch_array($undying);
?>
<li><a href='/undying/' class='menu_link'><img src='/images/icon/bar.png' alt='*'/> Valey of the Immortals <span class="chet">
<?
if($undying) {
$undying_time = round(($undying['time'] - time()) / 3600);
if($undying_time > 1) {
?>
<font color='#909090'>Time left to the next battle: <?=$undying_time?> hour<?=($undying_time > 1 ? 'а':'а')?></font>
<?
}
else
{
?>
<font color='#909090'>(<?=_time(($undying['time'] - time()))?>)</span></font>
<?
}
}
?>
</a></li>
<?
$cave = mysql_query('SELECT * FROM `cave` WHERE `user` = "'.$user['id'].'"');
$cave = mysql_fetch_array($cave);
?>
<li class='no_b'><a href='/cave/' class='menu_link'><img src='/images/icon/cave.png' alt='*'/> Cave <?=(($cave['dawn'] == 0 OR $cave['dawn'] == 1 && $cave['time'] <= time() OR $cave['dawn'] == 1 && $cave['gather'] == 1 && $cave['time'] <= time()) ? '<font color="#30c030">(+)</font>':'')?></a></li>
<div class='line'></div>
<div class='list'>
<li><a href='/auction.php' style='display: block;' class='menu_link'><img src='/images/res/7.png' height='12'/> Resources auction</a></li>
<li><a href='/trade/exchange' style='display: block;' class='menu_link'><img src='/images/icon/gold.png' alt='*'/> Exchange</a></l
<li><a href='/shop/' style='display: block;' class='menu_link'><img src='/images/icon/equip.png' alt='*'/> Equipment shop</a></li>
<?
if($user['level'] > 0) {
?>
<li><a href='/farm/' style='display: block;' class='menu_link'><img src='/images/icon/farm.png' alt='*'/> Farm
<?
$farm = mysql_query('SELECT * FROM `farm` WHERE `user` = "'.$user['id'].'"');
$farm = mysql_fetch_array($farm);
if(!$farm OR $farm['h'] == 0 && $farm['time'] == 0 OR $farm['h'] > 0 && $farm['time'] <= time()) {
?>
<font color='#30c030'><span class="chet">(+)</font></span>
<?
}
}
?>
</a></li>
<li><a href='/smith/' style='display: block;' class='menu_link'><img src='/images/icon/smith.png' alt='*'/> Blacksmith</a></li>
<li class='no_b'><a href='/lab/' style='display: block;' class='menu_link'><img src='/images/icon/lab.png' alt='*'/> Laboratory</a></li>
</div>
<div class='line'></div>
<div class='list'>
<li><a href='/clans/' style='display: block;' class='menu_link'><img src='/images/icon/clan.png' alt='*'/> Clans</a></li>
<li class='no_b'><a href='/rating/' style='display: block;' class='menu_link'><img src='/images/icon/user.png' alt='*'/> Rating</a></li>
</div>
<?
if(isSet($_GET['exit'])) {
setCookie('id', '');
setCookie('password', '');
header('location: /');
}
}
else
{
$login = _string($_POST['login']);
$login = strToLower($login);
$password = _string($_POST['password']);
if($login && $password) {
$q = mysql_query('SELECT * FROM `users` WHERE `login` = "'.$login.'" AND `password` = "'.$password.'" LIMIT 1');
$user = mysql_fetch_array($q);
if($user) {
setCookie('id', $user['id'], time() + 86400, '/');
setCookie('password', $password, time() + 86400, '/');
header('location: /');
}
}
$ref = _string(_num($_GET['ref']));
?>
<div class='content'><span style='text-shadow:none;'><img src='/images/logo.png' alt='' width='100%'/></div>
<div class='line'></div>
<div class='list'><center>
<li><a href='/start/'>Start the game</a></li>
</div></center><br>
<center>
<form action='/' method='post'>
Login<br/> <input name='login'/><br/>
Password<br/><input name='password'/><br/>
<input type='submit' class='ent' value='Log in'/>
</center></form>
<?
}
include './system/f.php';
?>