Вход Регистрация
Файл: html/admin/battle/index.php
Строк: 224
<?php
require_once '../../system/func.php';
require_once 
'../../system/header.php';
if (!
$user OR $user['access'] < 3) {
    
?><script>showContent("/");</script><?php
    
exit(0);
}
if (isset(
$_GET['end_battle']) && $_GET['end_battle'] > && isset($_GET['end_flag']) && $_GET['end_flag'] == 1) {
    
$mc->query("DELETE FROM `battle` WHERE `battle_id` = '" $_GET['end_battle'] . "'");
}
if (isset(
$_GET['end_battle']) && $_GET['end_battle'] > && !isset($_GET['end_flag'])) {
    
message_yn(
            
"Ты точно хочешь завершить этот бой ?""/admin/battle/index.php?end_battle=" $_GET['end_battle'] . "&end_flag=1""/admin/battle/index.php?end_battle=" $_GET['end_battle'] . "&end_flag=0""Да я смелый""Не хочу пиздюлей"
    
);
}

if (isset(
$_GET['this_battle'])) {
    
$this_resBattle $mc->query("SELECT * FROM `battle` WHERE `Mid`='" $user['id'] . "' AND `player_activ`='1' AND `end_battle`='0'");
    if (
$this_resBattle->num_rows 0) {
        
$this_Battle $this_resBattle->fetch_array(MYSQLI_ASSOC);
        
$_GET['view_battle'] = $this_Battle['battle_id'];
    }
}
if (!isset(
$_GET['view_battle'])) {
    
$resDBattle $mc->query("SELECT `battle_id`,`Pname`,`Pnamevs`,`Pvsname`,`battle_start_time`,`level` FROM `battle` WHERE `Pnamevs` !='' && `type_battle` > '0' ORDER BY `battle_start_time` DESC");
    if (
$resDBattle->num_rows 0) {
        
?>
        <center>
            <div style="padding-bottom: 3px;">
                - Дуэли - 
            </div>
        </center>
        <?php
        $BattleDAll 
$resDBattle->fetch_all(MYSQLI_ASSOC);
        foreach (
$BattleDAll as $value) {
            
?>
            <table style="width: 98%;margin: auto;">
                <tr>
                    <td onclick="showContent('/admin/battle/index.php?view_battle=<?= $value['battle_id']; ?>')" style="max-width: 100%" class="clanturblock">
                        <?= $value['Pname']; ?>[<?= $value['level']; ?>]<br>
                        <?= $value['Pnamevs'] . " " . ($value['Pvsname'] != "" " vs " $value['Pvsname'] : ""); ?><br>
                        <?= date("d:m H:i:s"$value['battle_start_time']); ?>
                    </td>
                    <td onclick="showContent('/admin/battle/index.php?end_battle=<?= $value['battle_id']; ?>')" style="width: 20%" onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''">
                        <img src="../../img/button/btnno.png" alt="delete" style="width: 100%">
                    </td>
                </tr>
            </table>
            <?php
        
}
    }
    
$resHBattle $mc->query("SELECT `battle_id`,`Pname`,`Pnamevs`,`Pvsname`,`battle_start_time`,`level` FROM `battle` WHERE `Pnamevs` !='' && `type_battle` = '0' ORDER BY `battle_start_time` DESC");
    if (
$resHBattle->num_rows 0) {
        
?>
        <center>
            <div style="padding-bottom: 3px;">
                - Охоты - 
            </div>
        </center>
        <?php
        $BattleHAll 
$resHBattle->fetch_all(MYSQLI_ASSOC);
        foreach (
$BattleHAll as $value) {
            
?>
            <table style="width: 98%;margin: auto;">
                <tr>
                    <td onclick="showContent('/admin/battle/index.php?view_battle=<?= $value['battle_id']; ?>')" style="max-width: 100%" class="clanturblock">
                        <?= $value['Pname']; ?>[<?= $value['level']; ?>]<br>
                        <?= $value['Pnamevs'] . " " . ($value['Pvsname'] != "" " vs " $value['Pvsname'] : ""); ?><br>
                        <?= date("d:m H:i:s"$value['battle_start_time']); ?>
                    </td>
                    <td onclick="showContent('/admin/battle/index.php?end_battle=<?= $value['battle_id']; ?>')" style="width: 20%" onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''">
                        <img src="../../img/button/btnno.png" alt="delete" style="width: 100%">
                    </td>
                </tr>
            </table>
            <?php
        
}
    }
    
$footval 'adminadmin';
} else if (isset(
$_GET['view_battle']) && $_GET['view_battle'] > 0) {
    
$resThisBattle $mc->query("SELECT * FROM `battle` WHERE `battle_id` ='" $_GET['view_battle'] . "'");
    if (
$resThisBattle->num_rows 0) {
        
$arrIco = [];
        
$arrIco[0] = "<img src='/img/icon/icoevil.png' width='19'>";
        
$arrIco[1] = "<img src='/img/icon/icoevil.png' width='19'>";
        
$arrIco[2] = "<img src='/img/icon/icogood.png' width='19'>";
        
$arrIco[3] = "<img src='/img/icon/icogood.png' width='19'>";
        
$BattleThisAll $resThisBattle->fetch_all(MYSQLI_ASSOC);
        foreach (
$BattleThisAll as $value) {
            if (
$value['Pnamevs'] != "") {
                
?>
                <center>
                    <div style="padding-bottom: 3px;">
                        - <?= $value['Pnamevs'] . " " . ($value['Pvsname'] != "" " vs " $value['Pvsname'] : ""); ?><img onclick="showContent('/admin/battle/index.php?end_battle=<?= $value['battle_id']; ?>')" src="../../img/button/btnno.png" alt="delete" onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''"> - <br>
                        <?= date("d:m H:i:s"$value['battle_start_time']); ?>
                    </div>
                </center>
                <?php
            
}
        }
        foreach (
$BattleThisAll as $value) {
            
$icons "";

            if (
$value['Ptype'] == 0) {
                
$icons $arrIco[$value['Pico']];
            } else if (
$value['Ptype'] == 1) {
                
$icons '<img src="/img/icon/mob/' $value['Pico'] . '.png" width="19">';
            }
            
?>
            <br>
            <div style="max-width: 100%;margin: 0;padding: 0;padding-bottom: 4px;" class="clanturblock" >
                <div style="padding-bottom: 3px;">
                    &nbsp;
                    <?= $icons $value['Pname']; ?>[<?= $value['level']; ?>]
                </div>
                <table style="width: 98%;margin: auto;border-style: solid;border-width: 2px;border-radius: 4px;border-color: #000000;">
                    <tr>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/hp.png" alt="fhp"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/health.png" alt="hp"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/toch.png" alt="toch"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/shit.png" alt="blok"></td>
                    </tr>
                    <tr>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Pflife']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Plife']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Ptochnost']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Pblock']; ?></td>
                    </tr>
                    <tr>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/power.jpg" alt="uron"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/bron.png" alt="bronia"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/kd.png" alt="oglushenie"></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><img src="../../images/icons/img235.png" alt="uvorot"></td>
                    </tr>
                    <tr>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Puron']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Pbronia']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Poglushenie']; ?></td>
                        <td style="width: 25%;text-align: center;background-color: khaki;"><?= $value['Puvorot']; ?></td>
                    </tr>
                </table>
                <?php if ($value['shops_ids'] != "") { ?>
                    <details>
                        <summary style='text-align: left;padding-left: 10px;font-size: 22px;'>Список вещей</summary>
                        <?php
                        $this_shops_arr 
json_decode($value['shops_ids']);
                        for (
$i 0$i count($this_shops_arr); $i++) {
                            
?>
                            <div onclick="showContent('/admin/shop.php?shop=edit&id=<?= $this_shops_arr[$i][1]; ?>')"  style="width: 90%;margin: auto;padding: 4px;" class="clanturblock" >
                                <?= ($i 1) . "." $this_shops_arr[$i][0]; ?>
                            </div>
                            <?php
                        
}
                        
?>
                    </details>
                <?php ?>
            </div>
            <?php
        
}
    }
    
$footval 'adminbattle';
}
?>


<?php
require_once '../../system/foot/foot.php';
?>
Онлайн: 0
Реклама