Файл: clan/settings.php
Строк: 39
<?
require_once '../core/system.php';
require_once 'sys.php';
echo only_reg();
if($user['clan_id'] == 0 || $user['clan_prava'] != 4) {
header("Location: /clan/");
exit();
}
$row = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$user['clan_id']."'"));
$header = 'Настройки';
$c2 = ($row['2_invite'] == 1) ? 'checked' : NULL;
$c3 = ($row['3_invite'] == 1) ? 'checked' : NULL;
require_once '../core/head.php';
$error = NULL;
if(isset($_POST['prava'])) {
$c2 = (int) $_POST['2'];
$c3 = (int) $_POST['3'];
mysql_query("UPDATE `clans` SET `3_invite` = '$c3', `2_invite` = '$c2' WHERE `id` = '".$user['clan_id']."'");
header("Location: /clan/settings.php");
exit();
}
if($error) {
echo '<div class="player" style="color: red">
'.$error.'
</div>';
}
echo '<div class="player>
<div class="mini-line"></div>
Настройки доступа:<br />
<form class="player" method="post" action="">
Принимать/исключать могут:<br />
<input type="checkbox" name="2" value="1" '.$c2.'> офицеры<br />
<input type="checkbox" name="3" value="1" '.$c3.'> генералы<br />
<span class="btn"><span class="end"><input class="label" type="submit" name="prava" value="Отправить">Изменить</span></span>
</form>
<div class="dot-line"></div>
</div>';
require_once '../core/foot.php';