Файл: public_html/modules/dungeon/dungeon.php
Строк: 145
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Подземелья";
include_once ($root.'/core/head.php');
?>
<style>
.ramk {
border: 1px solid #fff;
background-color: #343434;
border-radius: 3px;
margin-bottom: 5px;
}
.dungeon-1 {
display: block;
background: url(/images/dungeons/1.png) no-repeat center right;
padding: 12px;
color: #F6C67E;
text-decoration: none;
border-top: 0px solid #A35F44;
}
.dungeon-2 {
display: block;
background: url(/images/dungeons/2.png) no-repeat center right;
padding: 12px;
color: #F6C67E;
text-decoration: none;
border-top: 0px solid #A35F44;
}
.dungeon-3 {
display: block;
background: url(/images/dungeons/3.png) no-repeat center right;
padding: 12px;
color: #F6C67E;
text-decoration: none;
border-top: 0px solid #A35F44;
}
.dungeon-4 {
display: block;
background: url(/images/dungeons/4.png) no-repeat center right;
padding: 12px;
color: #F6C67E;
text-decoration: none;
border-top: 0px solid #A35F44;
}
</style>
<?
$id = fl($_GET['id']);
$dungeon = $db->query("SELECT * FROM `dungeons` WHERE `id` = '".$id."'");
if($dungeon->num_rows == 0) redirect('/dungeon');
$dungeon = $dungeon->fetch_object();
isDungeon();
if(isset($_GET['start']))
{
if($u['level'] < $dungeon->level) redirect('/dungeon');
$isLeader = $db->query("SELECT * FROM `dungeon_battles` WHERE `leader` = '".$u['id']."'")->num_rows;
$isBtl = $db->query("SELECT * FROM `dungeon_players` WHERE `user` = '".$u['id']."'")->num_rows;
if($isLeader > 0) redirect('/dungeon', 'Вы уже в подземелье!');
if($isBtl > 0) redirect('/dungeon', 'Вы уже в подземелье!');
if($u['dungeon_count'] <= 0) redirect('/dungeon', 'Исчерпан лимит походов в подземелье!');
$db->query("INSERT INTO `dungeon_battles` (`dungeon`,`leader`,`stage`,`status`) VALUES ('".$id."', '".$u['id']."', '1', 'prepare')");
$lastID = $db->insert_id;
$db->query("INSERT INTO `dungeon_players` (`battle`,`user`,`health`) VALUES ('".$lastID."', '".$u['id']."', '".get_health($u['id'])."')");
redirect('/dungeon/battle/'.$lastID);
}
echo '<div class = "ramk"><a class="dungeon-'.$dungeon->id.'" href="/dungeon/info/'.$dungeon->id.'">
<font color="white">'.$dungeon->name.' ['.$dungeon->level.' ур.]</font><br>
<font color="white"><small>
<img src="/images/ic-experience-flat.png" width="16" height="16"> '.$dungeon->exp.'
<img src="/images/ic-gem.png" width="16" height="16"> '.$dungeon->gems.'
<img src="/images/silver.png" width="16" height="16"> '.$dungeon->silver.'
</small>
</font>
</a></div>';
echo ' <div class="b">
'.($u['level'] >= $dungeon->level ? '<a href="/dungeon/info/'.$id.'/start" class = "clicker ">Начать</a>' : '').'
'.($u['level'] >= $dungeon->level ? '<a href="/dungeon/info/'.$id.'/list" class = "clicker gold">Вступить в подземелье</a>' : '').'
</div>';
$items = $db->query("SELECT * FROM `subject` WHERE `id` IN (".$dungeon->items.")");
echo '<div class="notice_container"><div class = "gborder notice_alert alert-success">Выпадаемые предметы</br>';
while($it = $items->fetch_object())
{
echo '<img width="48px" src="'.$it->images.'" title="Сторона" alt="Сторона"> ';
}
echo '</div></div>';
include_once ($root.'/core/foot.php');