Файл: vzabave/admin/rooms.php
Строк: 771
<?
require'../config.php';
$user['avr'] = 0;
$align='left';
$title='Управление комнатами';
head();
levels(7);
switch($mod){
default:
if (isset($_GET['del'])){
$db->sql_query("DELETE FROM `message` WHERE `rm` = '".check(intval($_GET['rm']))."'");
}
if (isset($_GET['del_all'])){
$db->sql_query("DELETE FROM `message`");
}
$romms = $db->sql_query("SELECT * FROM `rooms` ORDER BY `pos` ASC");
if ($db->sql_numrows($romms) > 0){
while ($room = $db->sql_fetchrow($romms)) {
$n++;
echo '<b>'.$n.'. </b> <a href="'.H.'room?rm='.$room['rm'].'"><b>'.$room['name'].'</b></a> [<a href="rooms?mod=up&rm='.$room['rm'].'">Вверх</a> | <a href="rooms?mod=down&rm='.$room['rm'].'">Вниз</a> | <a href="rooms?mod=edit&rm='.$room['rm'].'">Изм.</a> | <a href="rooms?mod=del&rm='.$room['rm'].'">Удалить</a> | <a href="rooms?del&rm='.$room['rm'].'">Очистить</a>]<br />';
++$i;}
}else{ echo 'Комнаты не созданны<br /><br />';}
echo '<br /><a href="rooms?mod=add">Добавить</a><br /><br />';
echo '<a href="rooms?del_all">Очистить все</a><br /><br />';
break;
case add:
if (empty($act)){
if ($ver!='wml')echo '<form action="rooms?mod='.$mod.'&act=add&'.SID.'" method="post">';
echo 'Название:<br/>';
if ($ver=='wml')echo '<input name="name" maxlength="50" title="Text"/><br/>';
else echo '<input type="text" name="name" maxlength="50" title="Text"/><br/>';
if ($ver=='wml'){
echo '<u>Антимат</u>: <select name="antim">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
echo '<u>Антирекл</u>:
<select name="antir">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
/*echo '<u>За рекламу</u>:
<select name="pinban">
<option value="1">Банить</option>
<option value="0">Пинать</option>
</select><br />';*/
echo '<u>Антифлуд</u> <input name="flyd" size="3" value="5" maxlength="3" title="flyd" emptyok="true"/> сек.<br />';
echo '<br /><u>Сартир</u>:
<select name="sartir">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Интим</u>:
<select name="intim">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Инкогнито</u>:
<select name="inkog">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Уровень >=</u> <input name="level" size="3" value="0" maxlength="3" title="level" emptyok="true"/><br />';
echo '<br /><u>Система</u>:
<select name="system">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
echo '<u>Умник</u>:
<select name="umnik">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Барыга</u>:
<select name="baryga">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Шутник</u>:
<select name="shut">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Тупица</u>:
<select name="tupica">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Анекдот</u>:
<select name="anek">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Знаток</u>:
<select name="znatok">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Священник</u>:
<select name="svaisch">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
echo '<u>Флудер</u>:
<select name="flyder">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}else{
echo '<u>Антимат</u>:</b><br/><input type="radio" name="antim" value="1" checked/>Вкл <input type="radio" name="antim" value="0"/>Выкл<br />';
echo '<u>Антирекл</u>:</b><br/><input type="radio" name="antir" value="1" checked/>Вкл <input type="radio" name="antir" value="0"/>Выкл<br />';
/*echo '<u>За рекламу</u>:</b><br/><input type="radio" name="pinban" value="1" checked/>Банить <input type="radio" name="pinban" value="0"/>Пинать<br />';*/
echo '<u>Антифлуд</u> <input name="flyd" size="3" value="5" maxlength="3" title="flyd" emptyok="true"/> сек.<br />';
echo '<br /><u>Сартир</u>:</b><br/><input type="radio" name="sartir" value="1"/>Вкл <input type="radio" name="sartir" value="0" checked/>Выкл<br />';
echo '<u>Интим</u>:</b><br/><input type="radio" name="intim" value="1"/>Вкл <input type="radio" name="intim" value="0" checked/>Выкл<br />';
echo '<u>Инкогнито</u>:</b><br/><input type="radio" name="inkog" value="1"/>Вкл <input type="radio" name="inkog" value="0" checked/>Выкл<br />';
echo '<u>Уровень >=</u> <input name="level" size="3" value="0" maxlength="3" title="level" emptyok="true"/><br />';
echo '<br /><u>Система</u>:</b><br/><input type="radio" name="system" value="1" checked/>Вкл <input type="radio" name="system" value="0"/>Выкл<br />';
echo '<u>Умник</u>:</b><br/><input type="radio" name="umnik" value="1"/>Вкл <input type="radio" name="umnik" value="0" checked/>Выкл<br />';
echo '<u>Барыга</u>:</b><br/><input type="radio" name="baryga" value="1"/>Вкл <input type="radio" name="baryga" value="0" checked/>Выкл<br />';
echo '<u>Шутник</u>:</b><br/><input type="radio" name="shut" value="1"/>Вкл <input type="radio" name="shut" value="0" checked/>Выкл<br />';
echo '<u>Тупица</u>:</b><br/><input type="radio" name="tupica" value="1"/>Вкл <input type="radio" name="tupica" value="0" checked/>Выкл<br />';
echo '<u>Анекдот</u>:</b><br/><input type="radio" name="anek" value="1"/>Вкл <input type="radio" name="anek" value="0" checked/>Выкл<br />';
echo '<u>Знаток</u>:</b><br/><input type="radio" name="znatok" value="1"/>Вкл <input type="radio" name="znatok" value="0" checked/>Выкл<br />';
echo '<u>Священник</u>:</b><br/><input type="radio" name="svaisch" value="1"/>Вкл <input type="radio" name="svaisch" value="0" checked/>Выкл<br />';
echo '<u>Флудер</u>:</b><br/><input type="radio" name="flyder" value="1"/>Вкл <input type="radio" name="flyder" value="0" checked/>Выкл<br />';
echo '<u>Бармен</u>:</b><br/><input type="radio" name="bot_bartender" value="1"/>Вкл <input type="radio" name="bot_bartender" value="0" checked/>Выкл<br />';
}
if ($ver=='wml'){
echo '<br /><anchor title="go">Добавить<go href="rooms?mod='.$mod.'&act=add&'.SID.'" method="post">';
echo '<postfield name="name" value="$name$ref"/>
<postfield name="antim" value="$antim"/>
<postfield name="umnik" value="$umnik"/>
<postfield name="shut" value="$shut"/>
<postfield name="anek" value="$anek"/>
<postfield name="tupica" value="$tupica"/>
<postfield name="svaisch" value="$svaisch"/>
<postfield name="system" value="$system"/>
<postfield name="baryga" value="$baryga"/>
<postfield name="znatok" value="$znatok"/>
<postfield name="flyder" value="$flyder"/>
<postfield name="flyd" value="$flyd"/>
<postfield name="antir" value="$antir"/>
<postfield name="pinban" value="$pinban"/>
<postfield name="sartir" value="$sartir"/>
<postfield name="intim" value="$intim"/>
<postfield name="level" value="$level"/>
<postfield name="inkog" value="$inkog"/>
</go></anchor>';
echo '<br/><br />';
}else{
echo '<br /><input type="submit" class="ibutton" value="Добавить"/></form><br /><br />';
}
}else{
$name = check($_POST['name']);
$antim = check($_POST['antim']);
$umnik = check($_POST['umnik']);
$shut = check($_POST['shut']);
$anek = check($_POST['anek']);
$tupica = check($_POST['tupica']);
$svaisch = check($_POST['svaisch']);
$system = check($_POST['system']);
$baryga = check($_POST['baryga']);
$znatok = check($_POST['znatok']);
$flyder = check($_POST['flyder']);
$flyd = check($_POST['flyd']);
$antir = check($_POST['antir']);
$pinban = check($_POST['pinban']);
$sartir = check($_POST['sartir']);
$intim = check($_POST['intim']);
$level = check($_POST['level']);
$inkog = check($_POST['inkog']);
if ($db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `rooms` WHERE `name` = '".$name."' LIMIT 1"), 0)>0)
{echo 'Такая комната уже есть<br />';
}else{
$pos = ($db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `rooms`"),0)+1);
$db->sql_query ("INSERT INTO rooms (name,topic,pos,antim,umnik,shut,anek,tupica,svaisch,system,baryga,znatok,flyder,flyd,antir,pinban,sartir,intim,level,inkog,bot_bartender) VALUES ('$name','$name','$pos','$antim','$umnik','$shut','$anek','$tupica','$svaisch','$system','$baryga','$znatok','$flyder','$flyd','$antir','$pinban','$sartir','$intim','$level','$inkog', '".(int)$_POST['bot_bartender']."')");
header ('Location: rooms?'.SID); exit;
}
}
break;
case del:
if ($_GET['rm']){
$db->sql_query("DELETE FROM `rooms` WHERE rm='".intval($_GET['rm'])."' LIMIT 1");
header ('Location: rooms?'.SID); exit;
}else{
echo 'Вы не выбрали комнату<br />';
}
break;
case edit:
if (empty($act)){
$room = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `rm` = '".intval($_GET['rm'])."'"));
if ($ver!='wml')echo '<form action="rooms?mod='.$mod.'&act=act&rm='.$_GET['rm'].'&'.SID.'" method="post">';
echo 'Название:<br/>';
if ($ver=='wml')echo '<input name="name" value="'.$room['name'].'" maxlength="50" title="Text"/><br/>';
else echo '<input type="text" name="name" value="'.$room['name'].'" maxlength="50" title="Text"/><br/>';
if ($ver=='wml'){
if ($room['antim']==1){
echo '<u>Антимат</u>: <select name="antim">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Антимат</u>: <select name="antim">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['antir']==1){
echo '<u>Антирекл</u>:
<select name="antir">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Антирекл</u>:
<select name="antir">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
/*if ($room['pinban']==1){
echo '<u>За рекламу</u>:
<select name="pinban">
<option value="1">Банить</option>
<option value="0">Пинать</option>
</select><br />';
}else{
echo '<u>За рекламу</u>:
<select name="pinban">
<option value="0">Пинать</option>
<option value="1">Банить</option>
</select><br />';
}*/
echo '<u>Антифлуд</u> <input name="flyd" size="3" value="'.$room['flyd'].'" maxlength="3" title="flyd" emptyok="true"/> сек.<br />';
if ($room['sartir']==1){
echo '<br /><u>Сартир</u>:
<select name="sartir">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<br /><u>Сартир</u>:
<select name="sartir">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['intim']==1){
echo '<u>Интим</u>:
<select name="intim">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Интим</u>:
<select name="intim">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['inkog']==1){
echo '<u>Инкогнито</u>:
<select name="inkog">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Инкогнито</u>:
<select name="inkog">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
echo '<u>Уровень >=</u> <input name="level" size="3" value="'.$room['intim'].'" maxlength="3" title="level" emptyok="true"/><br />';
if ($room['system']==1){
echo '<br /><u>Система</u>:
<select name="system">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<br /><u>Система</u>:
<select name="system">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['umnik']==1){
echo '<u>Умник</u>:
<select name="umnik">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Умник</u>:
<select name="umnik">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['baryga']==1){
echo '<u>Барыга</u>:
<select name="baryga">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Барыга</u>:
<select name="baryga">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['shut']==1){
echo '<u>Шутник</u>:
<select name="shut">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Шутник</u>:
<select name="shut">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['tupica']==1){
echo '<u>Тупица</u>:
<select name="tupica">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Тупица</u>:
<select name="tupica">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['anek']==1){
echo '<u>Анекдот</u>:
<select name="anek">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Анекдот</u>:
<select name="anek">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['znatok']==1){
echo '<u>Знаток</u>:
<select name="znatok">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Знаток</u>:
<select name="znatok">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['svaisch']==1){
echo '<u>Священник</u>:
<select name="svaisch">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Священник</u>:
<select name="svaisch">
<option value="0">Выкл</option>
<option value="1">Вкл</option>
</select><br />';
}
if ($room['flyder']==1){
echo '<u>Флудер</u>:
<select name="flyder">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}else{
echo '<u>Флудер</u>:
<select name="flyder">
<option value="1">Вкл</option>
<option value="0">Выкл</option>
</select><br />';
}
}else{
if ($room['antim']==1){
echo '<u>Антимат</u>:</b><br/><input type="radio" name="antim" value="1" checked/>Вкл <input type="radio" name="antim" value="0"/>Выкл<br />';
}else{
echo '<u>Антимат</u>:</b><br/><input type="radio" name="antim" value="1"/>Вкл <input type="radio" name="antim" value="0" checked/>Выкл<br />';
}
if ($room['antir']==1){
echo '<u>Антирекл</u>:</b><br/><input type="radio" name="antir" value="1" checked/>Вкл <input type="radio" name="antir" value="0"/>Выкл<br />';
}else{
echo '<u>Антирекл</u>:</b><br/><input type="radio" name="antir" value="1"/>Вкл <input type="radio" name="antir" value="0" checked/>Выкл<br />';
}
/*if ($room['pinban']==1){
echo '<u>За рекламу</u>:</b><br/><input type="radio" name="pinban" value="1" checked/>Банить <input type="radio" name="pinban" value="0"/>Пинать<br />';
}else{
echo '<u>За рекламу</u>:</b><br/><input type="radio" name="pinban" value="1"/>Банить <input type="radio" name="pinban" value="0" checked/>Пинать<br />';
}*/
echo '<u>Антифлуд</u> <input name="flyd" size="3" value="'.$room['flyd'].'" maxlength="3" title="flyd" emptyok="true"/> сек.<br />';
if ($room['sartir']==1){
echo '<br /><u>Сартир</u>:</b><br/><input type="radio" name="sartir" value="1" checked/>Вкл <input type="radio" name="sartir" value="0"/>Выкл<br />';
}else{
echo '<br /><u>Сартир</u>:</b><br/><input type="radio" name="sartir" value="1"/>Вкл <input type="radio" name="sartir" value="0" checked/>Выкл<br />';
}
if ($room['intim']==1){
echo '<u>Интим</u>:</b><br/><input type="radio" name="intim" value="1" checked/>Вкл <input type="radio" name="intim" value="0"/>Выкл<br />';
}else{
echo '<u>Интим</u>:</b><br/><input type="radio" name="intim" value="1"/>Вкл <input type="radio" name="intim" value="0" checked/>Выкл<br />';
}
if ($room['inkog']==1){
echo '<u>Инкогнито</u>:</b><br/><input type="radio" name="inkog" value="1" checked/>Вкл <input type="radio" name="inkog" value="0"/>Выкл<br />';
}else{
echo '<u>Инкогнито</u>:</b><br/><input type="radio" name="inkog" value="1"/>Вкл <input type="radio" name="inkog" value="0" checked/>Выкл<br />';
}
echo '<u>Уровень >=</u> <input name="level" size="3" value="'.$room['level'].'" maxlength="3" title="level" emptyok="true"/><br />';
if ($room['system']==1){
echo '<br /><u>Система</u>:</b><br/><input type="radio" name="system" value="1" checked/>Вкл <input type="radio" name="system" value="0"/>Выкл<br />';
}else{
echo '<br /><u>Система</u>:</b><br/><input type="radio" name="system" value="1"/>Вкл <input type="radio" name="system" value="0" checked/>Выкл<br />';
}
if ($room['umnik']==1){
echo '<u>Умник</u>:</b><br/><input type="radio" name="umnik" value="1" checked/>Вкл <input type="radio" name="umnik" value="0"/>Выкл<br />';
}else{
echo '<u>Умник</u>:</b><br/><input type="radio" name="umnik" value="1"/>Вкл <input type="radio" name="umnik" value="0" checked/>Выкл<br />';
}
if ($room['baryga']==1){
echo '<u>Барыга</u>:</b><br/><input type="radio" name="baryga" value="1" checked/>Вкл <input type="radio" name="baryga" value="0"/>Выкл<br />';
}else{
echo '<u>Барыга</u>:</b><br/><input type="radio" name="baryga" value="1"/>Вкл <input type="radio" name="baryga" value="0" checked/>Выкл<br />';
}
if ($room['shut']==1){
echo '<u>Шутник</u>:</b><br/><input type="radio" name="shut" value="1" checked/>Вкл <input type="radio" name="shut" value="0"/>Выкл<br />';
}else{
echo '<u>Шутник</u>:</b><br/><input type="radio" name="shut" value="1"/>Вкл <input type="radio" name="shut" value="0" checked/>Выкл<br />';
}
if ($room['tupica']==1){
echo '<u>Тупица</u>:</b><br/><input type="radio" name="tupica" value="1" checked/>Вкл <input type="radio" name="tupica" value="0"/>Выкл<br />';
}else{
echo '<u>Тупица</u>:</b><br/><input type="radio" name="tupica" value="1"/>Вкл <input type="radio" name="tupica" value="0" checked/>Выкл<br />';
}
if ($room['anek']==1){
echo '<u>Анекдот</u>:</b><br/><input type="radio" name="anek" value="1" checked/>Вкл <input type="radio" name="anek" value="0"/>Выкл<br />';
}else{
echo '<u>Анекдот</u>:</b><br/><input type="radio" name="anek" value="1">Вкл <input type="radio" name="anek" value="0" checked/>Выкл<br />';
}
if ($room['znatok']==1){
echo '<u>Знаток</u>:</b><br/><input type="radio" name="znatok" value="1" checked/>Вкл <input type="radio" name="znatok" value="0"/>Выкл<br />';
}else{
echo '<u>Знаток</u>:</b><br/><input type="radio" name="znatok" value="1"/>Вкл <input type="radio" name="znatok" value="0" checked/>Выкл<br />';
}
if ($room['svaisch']==1){
echo '<u>Священник</u>:</b><br/><input type="radio" name="svaisch" value="1" checked/>Вкл <input type="radio" name="svaisch" value="0"/>Выкл<br />';
}else{
echo '<u>Священник</u>:</b><br/><input type="radio" name="svaisch" value="1"/>Вкл <input type="radio" name="svaisch" value="0" checked/>Выкл<br />';
}
if ($room['flyder']==1){
echo '<u>Флудер</u>:</b><br/><input type="radio" name="flyder" value="1" checked/>Вкл <input type="radio" name="flyder" value="0"/>Выкл<br />';
}else{
echo '<u>Флудер</u>:</b><br/><input type="radio" name="flyder" value="1"/>Вкл <input type="radio" name="flyder" value="0" checked/>Выкл<br />';
}
echo '<u>Бармен</u>:</b><br/><input type="radio" name="bot_bartender" value="1" '.($room['bot_bartender']==1 ? 'checked' : '').'/>Вкл <input type="radio" name="bot_bartender" value="0" '.($room['bot_bartender']==0 ? 'checked' : '').'/>Выкл<br />';
}
if ($ver=='wml'){
echo '<br /><anchor title="go">Добавить<go href="rooms?mod='.$mod.'&act=act&rm='.$_GET['rm'].'&'.SID.'" method="post">';
echo '<postfield name="name" value="$name$ref"/>
<postfield name="antim" value="$antim"/>
<postfield name="umnik" value="$umnik"/>
<postfield name="shut" value="$shut"/>
<postfield name="anek" value="$anek"/>
<postfield name="tupica" value="$tupica"/>
<postfield name="svaisch" value="$svaisch"/>
<postfield name="system" value="$system"/>
<postfield name="baryga" value="$baryga"/>
<postfield name="znatok" value="$znatok"/>
<postfield name="flyder" value="$flyder"/>
<postfield name="flyd" value="$flyd"/>
<postfield name="antir" value="$antir"/>
<postfield name="pinban" value="$pinban"/>
<postfield name="sartir" value="$sartir"/>
<postfield name="intim" value="$intim"/>
<postfield name="level" value="$level"/>
<postfield name="inkog" value="$inkog"/>
</go></anchor>';
echo '<br/><br />';
}else{
echo '<br /><input type="submit" class="ibutton" value="Добавить"/></form><br /><br />';
}
}else{
$name = check($_POST['name']);
$antim = check($_POST['antim']);
$umnik = check($_POST['umnik']);
$shut = check($_POST['shut']);
$anek = check($_POST['anek']);
$tupica = check($_POST['tupica']);
$svaisch = check($_POST['svaisch']);
$system = check($_POST['system']);
$baryga = check($_POST['baryga']);
$znatok = check($_POST['znatok']);
$flyder = check($_POST['flyder']);
$flyd = check($_POST['flyd']);
$antir = check($_POST['antir']);
$pinban = check($_POST['pinban']);
$sartir = check($_POST['sartir']);
$intim = check($_POST['intim']);
$level = check($_POST['level']);
$inkog = check($_POST['inkog']);
if ($db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `rooms` WHERE `name` = '".$name."' and `rm` != '".intval($_GET['rm'])."' LIMIT 1"), 0)>0)
{
echo 'Такая комната уже есть<br />';
}else{
$db->sql_query("UPDATE `rooms` SET `name` = '$name', `antim` = '$antim', `umnik` = '$umnik', `shut` = '$shut', `anek` = '$anek', `tupica` = '$tupica', `svaisch` = '$svaisch', `system` = '$system', `baryga` = '$baryga', `znatok` = '$znatok', `flyder` = '$flyder', `flyd` = '$flyd', `antir` = '$antir', `pinban` = '$pinban', `sartir` = '$sartir', `intim` = '$intim', `level` = '$level', `inkog` = '$inkog', bot_bartender = '".(int)$_POST['bot_bartender']."' WHERE `rm` = '".intval($_GET['rm'])."'");
header ('Location: rooms?'.SID); exit;
}
}
break;
case down:
if ($_GET['rm']){
$room = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `rm` = '".intval($_GET['rm'])."'"));
$room2 = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `pos` > '".intval($room['pos'])."' ORDER BY `pos` ASC"));
$db->sql_query("UPDATE `rooms` SET `pos` = '".$room2['pos']."' WHERE `rm` = '".intval($_GET['rm'])."'");
$db->sql_query("UPDATE `rooms` SET `pos` = '".$room['pos']."' WHERE `rm` = '".intval($room2['rm'])."'");
header ('Location: rooms?'.SID); exit;
}else{
echo 'Вы не выбрали комнату<br />';
}
break;
case up:
if ($_GET['rm']){
$room = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `rm` = '".intval($_GET['rm'])."'"));
$room2 = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `pos` < '".intval($room['pos'])."' ORDER BY `pos` DESC"));
$db->sql_query("UPDATE `rooms` SET `pos` = '".$room2['pos']."' WHERE `rm` = '".intval($_GET['rm'])."'");
$db->sql_query("UPDATE `rooms` SET `pos` = '".$room['pos']."' WHERE `rm` = '".intval($room2['rm'])."'");
header ('Location: rooms?'.SID); exit;
}else{
echo 'Вы не выбрали комнату<br />';
}
break;
case view:
if ($_GET['rm']){
$room = $db->sql_fetchrow($db->sql_query("SELECT * FROM `rooms` WHERE `rm` = '".intval($_GET['rm'])."'"));
echo 'Комната: <b>'.$room['name'].'</b><br />';
if ($room['antim']==1)echo 'Антимат: <b>Включен</b><br />';
else echo 'Антимат: <b>Выключен</b><br />';
echo 'Бот: ';
if ($room['bot']==0) echo '<b>Нет</b>';
else if ($room['bot']==3) echo '<b>Умник</b>';
echo '<br />';
}else{
echo 'Вы не выбрали комнату<br />';
}
break;
}
if ($mod)echo gb.'<a href="rooms">Управление комтами</a>'.div;
echo gb.'<a href="index">В админку</a><br />'.div;
echo gb.'<a href="'.H.'enter">Прихожая</a>'.div;
foot();
?>