<? 
include './system/common.php';

include './system/functions.php';
include './system/user.php';
if($clan['id'] == 0 || $clan_memb['rank'] < 4){
header("Location: /");
exit;

}
$title = 'Эмблемы Клана'; 
include './system/h.php'; 
$error = NULL;

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

}

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

echo '<div class="content">
<div class="line"></div>
<form class="content" method="post" action="">
Выбрать клановый герб:<br /></div>';
for($i = 1; $i < 16; $i++) {
echo '<div class="content">';
echo '<input type="radio" name="id" value="'.$i.'" /> 
<img src="/images/icon/clan/gerb/'.$i.'.png" /><br/>'; 
echo '</div><div class="line"></div>';
}
echo '
<div class="content"/>
<input class="button" type="submit" value="Отправить">
</form>
<div class="line"></div>
</div>';

include './system/f.php';
?>