<?
require_once '../core/system.php';
require_once 'sys.php';
echo only_reg();
if($user['clan_id'] == 0 || $user['clan_prava'] < 3) {
    header("Location: /clan/");
    exit();
}
$header = 'Герб клана';
require_once '../core/head.php';
$error = NULL;

if(isset($_POST['id'])) {
    $id = (int) $_POST['id'];
    if($id > 1 || $id < 18) {
        mysql_query("UPDATE `clans` SET `gerb` = '$id' WHERE `id` = '".$user['clan_id']."'");
        header("Location: /clan/");
        exit();
    }
    
}

if($error) {
    echo '<div class="player" style="color: red">
    '.$error.'
    </div>';
}

echo '<div class="player>
<div class="mini-line"></div>
<form class="player" method="post" action="">
Выбрать клановый герб:<br />';
for($i = 1; $i < 19; $i++) {
        echo '<input type="radio" name="id" value="'.$i.'" /> 
        <img src="/images/icon/clan/gerb/'.$i.'.png" /><br/>'; 
}
echo '<span class="btn"><span class="end"><input class="label" type="submit" value="Изменить">Изменить</span></span>
</form>
<div class="dot-line"></div>
</div>';

require_once '../core/foot.php';