<?
require_once ('system/func.php');
$title = 'Сражения';
require_once ('system/header.php');
auth(); // Закроем от гостей
echo "<div class='block center'><img src='/images/other/fights.jpg' width='100%'></div>";
echo "<div class='block2'>";
echo "<li><a href='/drakon/'>".ico('icons','drakon.png')."<b>Король Драконов</b> ";
$batlle = mysql_query("SELECT * FROM `drakon` ORDER BY `id` DESC LIMIT 1");
$batlle = mysql_fetch_array($batlle);
$batlle_user = mysql_query("SELECT * FROM `drakon_users` WHERE `id_user` = '$myID' AND `id_batlle` = '$batlle[id]' ORDER BY `id` DESC LIMIT 1");
$batlle_user = mysql_fetch_array($batlle_user);
$batlle2 = mysql_query("SELECT * FROM `drakon` WHERE `id` = '".($batlle['id']-1)."' and `start` = '3' ORDER BY `id` DESC LIMIT 1");
$batlle2 = mysql_fetch_array($batlle2);
$batlle_user2 = mysql_query("SELECT * FROM `drakon_users` WHERE `id_user` = '$myID' AND `id_batlle` = '$batlle2[id]' ORDER BY `id` DESC LIMIT 1");
$batlle_user2 = mysql_fetch_array($batlle_user2);
if($batlle['last'] < time()+60*3 and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}elseif($batlle_user and $batlle['last'] < time() and $batlle['start'] == 1){
echo "<font color='green'>(+)</font>";
}elseif(!$batlle_user and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}elseif(!$batlle_user and $batlle_user2['end'] == 0 and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}
echo "</a></li>";
$data_1 = strtotime("10:00");
$data_2 = strtotime("15:00");
$data_3 = strtotime("20:00");
echo "</div>";echo "<div class='block2'><li><a href='/mertvec/'>".ico('icons','mertvec.png')."<b>Долина мертвецов</b> ";
$batlle = mysql_query("SELECT * FROM `mertvec` ORDER BY `id` DESC LIMIT 1");
$batlle = mysql_fetch_array($batlle);
$batlle_user = mysql_query("SELECT * FROM `mertvec_users` WHERE `id_user` = '$myID' AND `id_batlle` = '$batlle[id]' ORDER BY `id` DESC LIMIT 1");
$batlle_user = mysql_fetch_array($batlle_user);
$batlle2 = mysql_query("SELECT * FROM `mertvec` WHERE `id` = '".($batlle['id']-1)."' and `start` = '3' ORDER BY `id` DESC LIMIT 1");
$batlle2 = mysql_fetch_array($batlle2);
$batlle_user2 = mysql_query("SELECT * FROM `mertvec_users` WHERE `id_user` = '$myID' AND `id_batlle` = '$batlle2[id]' ORDER BY `id` DESC LIMIT 1");
$batlle_user2 = mysql_fetch_array($batlle_user2);
if($batlle['last'] < time()+60*3 and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}elseif($batlle_user and $batlle['last'] < time() and $batlle['start'] == 1){
echo "<font color='green'>(+)</font>";
}elseif(!$batlle_user and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}elseif(!$batlle_user and $batlle_user2['end'] == 0 and $batlle['start'] == 0){
echo "<font color='green'>(+)</font>";
}
echo "</a></li></div>";
?>
<div class="block2"><li><a href="/alduin/"><img src="/images/icons/mertvec.png" width="20px" alt="*"> Алдуин</a></li></div><?
require_once ('system/footer.php');