Файл: social12/chat/fight.php
Строк: 68
<?php
require '../sid.php';
require '../config.php';
$link = connect_db();
list($user, $id, $ps) = check_login($link);
include '../head.php';
include '../navigator.php';
$open = mysql_fetch_array(mysql_query("SELECT `open_chat` FROM `setting` WHERE `ids` = '1'"));
if ($open[0] == 0) {
   err('Чат закрыт Администратором!');
   include '../foot.php';
   exit();
}
$rm = my_int($_GET['rm']);
$empty = mysql_query("SELECT `id` FROM `rooms` WHERE `id` = '$rm' LIMIT 1");
if (mysql_num_rows($empty) == FALSE) {
    header('Location: ../index.php?' . $ref);
    die();
}
$mod = isset($_GET['mod']) ? $_GET['mod'] : NULL;
switch($_GET['mod']) {
    default:
    echo $div_title . 'Бойцовский клуб' . $div_end . $div_left . '
    » <a href="fight.php?mod=hands_feet&rm='.$rm.'">Удары руками и ногами</a><br/>
    » <a href="fight.php?mod=weapons&rm='.$rm.'">Удары оружием</a><br/>
    » <a href="fight.php?mod=shop_weapons&rm='.$rm.'">Покупка оружия</a>' . $div_end;
    break;
    case hands_feet:
    echo $div_title . 'Удары руками и ногами' . $div_end . $div_left;
    $file = file('../upload/bk/hands_feet.dat');
    $count = count($file);
    $n = new navigator($count, 5, 'fight.php?mod=hands_feet&rm='.$rm.'&');
    for($i = $n->start; $i < $n->end; $i++) {
        $ex = explode('|::|', $file[$i]);
        echo '
        Команда: !' . $ex[0] . '[ник]<br/>
        Сила удара до: ' . $ex[1] . $block;
    }
    echo $div_end . '« <a href="fight.php?rm='.$rm.'">Назад</a><br/>';
    break;
    case weapons:
    echo $div_title . 'Удары оружием' . $div_end . $div_left;
    $file = file('../upload/bk/weapons.dat');
    $count = count($file);
    $n = new navigator($count, 5, 'trainers.php?mod=weapons&rm='.$rm.'&');
    for($i = $n->start; $i < $n->end; $i++) {
        $ex = explode('|::|', $file[$i]);
        echo '
        Команда: !' . $ex[0] . '[ник]<br/>
        Сила удара до: ' . $ex[1] . $block;
    }
    echo $div_end . '« <a href="fight.php?rm='.$rm.'">Назад</a><br/>';
    break;
    case shop_weapons:
    echo $div_title . 'Покупка оружия' . $div_end . $div_left;
    $file = file('../upload/bk/weapons.dat');
    $count = count($file);
    $n = new navigator($count, 5, 'fight.php?mod=shop_weapons&rm='.$rm.'&');
    for($i = $n->start; $i < $n->end; $i++) {
        $ex = explode('|::|', $file[$i]);
        echo '
        Команда: !' . $ex[0] . '<br/>
        Прибавит к силе до: ' . $ex[1] . '<br/>
        Цена: ' . $ex[2] . $block;
    }
    echo $div_end . '« <a href="fight.php?rm='.$rm.'">Назад</a><br/>';
    break;
}
echo '« <a href="room.php?rm='.$rm.'">В комнату</a><br/>';
include '../foot.php';
?>