2023-01-28 02:24:37 +00:00
< ? php
2022-06-06 21:30:34 +00:00
2023-12-08 15:56:55 +00:00
use Core\Db ;
use Moderation\ { AdmFactory , Announcement , Moderator , ModFactory , UserRegistrationList };
2022-06-06 21:30:34 +00:00
2023-12-05 01:01:04 +00:00
/** @var User $u */
if ( ! defined ( 'GAME' )) {
die ();
2022-06-06 21:30:34 +00:00
}
2023-12-05 01:01:04 +00:00
$m = new Moderator ( $u -> info [ 'id' ]);
2022-06-06 21:30:34 +00:00
2023-12-08 16:14:29 +00:00
if ( ! $m -> isModerator ) {
return ;
}
2023-12-05 01:01:04 +00:00
$rang = 'Модератор' ;
2022-06-06 21:30:34 +00:00
2023-01-28 02:24:37 +00:00
if ( isset ( $_GET [ 'remod' ])) {
if ( $_GET [ 'remod' ] == 1 ) {
$_SESSION [ 'remod' ] = 3 ;
} else {
$_SESSION [ 'remod' ] = 1 ;
}
2022-06-06 21:30:34 +00:00
}
$merror = '' ;
2023-12-05 01:01:04 +00:00
$uer = '' ;
if ( ! empty ( $_POST [ 'logingo' ])) {
$moderation = new ModFactory (
2023-12-08 11:39:20 +00:00
strip_tags ( $_POST [ 'logingo' ]),
2023-12-05 01:01:04 +00:00
empty ( $_POST [ 'modReason' ]) ? '' : $_POST [ 'modReason' ],
$u -> info [ 'room' ],
);
2023-12-08 11:39:20 +00:00
$administration = new AdmFactory (
strip_tags ( $_POST [ 'logingo' ])
);
2023-12-05 01:01:04 +00:00
if ( ! empty ( $_POST [ 'silence' ]) && ! empty ( $_POST [ 'time' ])) {
$moderation -> silence ( $_POST [ 'time' ]);
} elseif ( ! empty ( $_POST [ 'unsilence' ])) {
$moderation -> unsilence ();
} elseif ( ! empty ( $_POST [ 'prison' ]) && ! empty ( $_POST [ 'time' ])) {
$moderation -> prison ( $_POST [ 'time' ]);
} elseif ( ! empty ( $_POST [ 'unprison' ])) {
$moderation -> unprison ();
} elseif ( ! empty ( $_POST [ 'depersonalize' ]) && ! empty ( $_POST [ 'time' ])) {
$moderation -> depersonalize ( $_POST [ 'time' ]);
} elseif ( ! empty ( $_POST [ 'undepersonalize' ])) {
$moderation -> undepersonalize ();
} elseif ( ! empty ( $_POST [ 'ban' ])) {
$moderation -> ban ();
} elseif ( ! empty ( $_POST [ 'unban' ])) {
$moderation -> unban ();
2023-12-08 11:39:20 +00:00
} elseif ( ! empty ( $_POST [ 'addmoderator' ])) {
$administration -> addmoderator ();
} elseif ( ! empty ( $_POST [ 'deletemoderator' ])) {
$administration -> removemoderator ();
} elseif ( ! empty ( $_POST [ 'changegender' ])) {
$administration -> changegender ();
} elseif ( ! empty ( $_POST [ 'changelogin' ]) && ! empty ( $_POST [ 'newLogin' ])) {
$administration -> changelogin ( $_POST [ 'newLogin' ]);
} elseif ( ! empty ( $_POST [ 'giveitem' ]) && ! empty ( $_POST [ 'itemId' ])) {
$administration -> additem (( int ) $_POST [ 'itemId' ]);
} elseif ( ! empty ( $_POST [ 'kickfrombattle' ])) {
$administration -> kickfrombattle ();
} elseif ( ! empty ( $_POST [ 'toggleinvisibility' ])) {
$administration -> toggleinvisibility ();
2023-12-05 01:01:04 +00:00
}
2023-12-08 11:39:20 +00:00
if ( ! empty ( $moderation -> status )) {
$uer = $moderation -> status ;
} elseif ( ! empty ( $administration -> status )) {
$uer = $administration -> status ;
}
2023-12-05 01:01:04 +00:00
}
2023-12-08 11:39:20 +00:00
if ( ! empty ( $_POST [ 'marrypartner1' ]) && ! empty ( $_POST [ 'marrypartner2' ])) {
if ( ! empty ( $_POST [ 'marry' ])) {
$uer = 'marry: Not available' ;
} elseif ( ! empty ( $_POST [ 'unmarry' ])) {
$uer = 'unmarry: Not available' ;
}
}
2023-12-08 13:20:27 +00:00
echo '<script src="/js/jquery.js"></script>' ;
2022-06-06 21:30:34 +00:00
2023-12-05 01:01:04 +00:00
$go = 0 ;
if ( isset ( $_GET [ 'go' ])) {
$go = round ( $_GET [ 'go' ]);
}
2023-01-28 02:24:37 +00:00
2023-12-05 01:01:04 +00:00
if ( $go == 3 && $u -> info [ 'admin' ] > 0 ) {
?>
2023-12-08 15:56:55 +00:00
< table style = " width: 100% " >
2023-12-05 01:01:04 +00:00
< tr >
2023-12-08 15:56:55 +00:00
< td style = " text-align: center; " >< h3 > Редактирование обучающих квестов </ h3 ></ td >
< td style = " text-align: right; width: 150px; " >
2023-12-08 16:14:29 +00:00
< input type = " button " value = " > " onclick = " location='main.php?moderation'; " />
< input type = " button " value = " Вернуться " onclick = " location='main.php?moderation&go=3'; " />
2023-12-05 01:01:04 +00:00
</ td >
</ tr >
< tr >
2023-12-08 15:56:55 +00:00
< td >< ? = empty ( $merror ) ? '' : " <span style='color: red;'> $merror </span> " ?>
2023-12-05 01:01:04 +00:00
< ? php
$sx = [ 'Мужской' , 'Женский' , 'Общий' ];
if ( isset ( $_GET [ 'eq' ])) {
2023-12-08 15:56:55 +00:00
$pl = Db :: getRow ( 'select * from an_quest where id = ?' , [( int ) $_GET [ 'eq' ]]);
2023-12-05 01:01:04 +00:00
if ( isset ( $pl [ 'id' ])) {
if ( isset ( $_POST [ 'pl_name' ])) {
$pl [ 'name' ] = $_POST [ 'pl_name' ];
$pl [ 'sex' ] = $_POST [ 'pl_sex' ];
$pl [ 'ico_bot' ] = $_POST [ 'pl_ico_bot' ];
$pl [ 'name_bot' ] = $_POST [ 'pl_name_bot' ];
$pl [ 'info' ] = $_POST [ 'pl_info' ];
$pl [ 'act' ] = $_POST [ 'pl_act' ];
$pl [ 'next' ] = $_POST [ 'pl_next' ];
$pl [ 'win' ] = $_POST [ 'pl_win' ];
$pl [ 'data' ] = $_POST [ 'pl_data' ];
$pl [ 'room' ] = $_POST [ 'pl_room' ];
$pl [ 'module' ] = $_POST [ 'pl_module' ];
2023-12-08 15:56:55 +00:00
Db :: sql ( ' update an_quest set
name = ? ,
sex = ? ,
ico_bot = ? ,
name_bot = ? ,
info = ? ,
act = ? ,
next = ? ,
win = ? ,
data = ? ,
room = ? ,
module = ?
where id = ? ' ,
[
$pl [ 'name' ],
$pl [ 'sex' ],
$pl [ 'ico_bot' ],
$pl [ 'name_bot' ],
$pl [ 'info' ],
$pl [ 'act' ],
$pl [ 'next' ],
$pl [ 'win' ],
$pl [ 'data' ],
$pl [ 'room' ],
$pl [ 'module' ],
$pl [ 'id' ],
]);
$pl = Db :: getRow ( 'select * from an_quest where id = ?' , [( int ) $_GET [ 'eq' ]]);
2023-01-28 02:24:37 +00:00
}
?>
2023-12-08 16:14:29 +00:00
< form method = " post " action = " /main.php?moderation&go=3&eq=<?= $pl['id'] ?> " >
2023-12-05 01:01:04 +00:00
#id: <?= $pl['id'] ?><br/>
2023-12-08 15:56:55 +00:00
< label >
Название квеста :
< input style = " width:200px; " name = " pl_name " type = " text " value = " <?= $pl['name'] ?> " >
</ label >< br />
2023-12-05 01:01:04 +00:00
< hr />
2023-12-08 15:56:55 +00:00
< label >
Пол : < input style = " width:20px; " name = " pl_sex " type = " text " value = " <?= $pl['sex'] ?> " >
</ label >< br />
< label >
Картинка бота : < input style = " width:216px; " name = " pl_ico_bot " type = " text " value = " <?= $pl['ico_bot'] ?> " >
</ label >< br />
< label >
Имя бота : < input style = " width:253px; " name = " pl_name_bot " type = " text " value = " <?= $pl['name_bot'] ?> " >
</ label >
2023-12-05 01:01:04 +00:00
< hr />
< br />
2023-12-08 15:56:55 +00:00
< label >
Информация :< br />< textarea style = " width:330px; " name = " pl_info " >< ? = $pl [ 'info' ] ?> </textarea>
</ label >< br />
< label >
Действие : < input style = " width:255px; " name = " pl_act " type = " text " value = " <?= $pl['act'] ?> " >
</ label >< br />
< label >
Следующий квест : < input style = " width:200px; " name = " pl_next " type = " text " value = " <?= $pl['next'] ?> " >
</ label >< br />
< label >
Награда : < input style = " width:200px; " name = " pl_win " type = " text " value = " <?= $pl['win'] ?> " > ( опыт | кр | екр | предметы )
</ label >< br />
< label >
Дата : < input style = " width:200px; " name = " pl_data " type = " text " value = " <?= $pl['data'] ?> " >
</ label >< br />
2023-12-05 01:01:04 +00:00
< hr />
2023-12-08 15:56:55 +00:00
< label >
Комната ( требует ) : < input name = " pl_room " type = " text " value = " <?= $pl['room'] ?> " >
</ label >< br />
< label >
Модуль , действие ( требует ) : < input name = " pl_module " type = " text " value = " <?= $pl['module'] ?> " >
</ label >
2023-12-05 01:01:04 +00:00
< hr />
2023-12-08 15:56:55 +00:00
< input type = " submit " value = " Сохранить квест " >
2023-12-05 01:01:04 +00:00
</ form >
< ? php
2023-01-28 02:24:37 +00:00
} else {
2023-12-08 15:56:55 +00:00
echo '<div style="text-align: center">Квест не найден.</div>>' ;
2023-01-28 02:24:37 +00:00
}
2023-12-05 01:01:04 +00:00
} else {
2023-12-08 16:14:29 +00:00
echo '<a href="/main.php?moderation&go=3&add=1">Добавить новый квест</a><hr>' ;
2023-12-05 01:01:04 +00:00
if ( isset ( $_GET [ 'del' ])) {
2023-12-08 15:56:55 +00:00
Db :: sql ( 'delete from an_quest where id = ?' , [( int ) $_GET [ 'del' ]]);
2023-12-05 01:01:04 +00:00
} elseif ( isset ( $_GET [ 'add' ])) {
2023-12-08 15:56:55 +00:00
Db :: sql ( 'insert into an_quest (id) values (default)' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
foreach ( Db :: getRows ( 'select id, name, sex from an_quest' ) as [ 'id' => $qid , 'name' => $qname , 'sex' => $qsex ]) {
$qsex = $sx [ $qsex ];
echo <<< HTML
< div >
< span style = " width:50px;display:inline-block; " > $qid </ span >
< span style = " width:250px;display:inline-block; font-weight: bold; " > $qname ( $qsex ) </ span >
2023-12-08 16:14:29 +00:00
< a href = " /main.php?moderation&go=3&eq= $qid " > Изменить </ a >
< a href = " /main.php?moderation&go=3&del= $qid " > Удалить </ a >
2023-12-08 15:56:55 +00:00
</ div >
< hr >
HTML ;
2023-01-28 02:24:37 +00:00
}
}
2023-12-05 01:01:04 +00:00
?>
</ td >
</ tr >
</ table >
< ? php
} elseif ( $go == 2 && $u -> info [ 'admin' ] > 0 ) {
if ( isset ( $_POST [ 'q_name' ])) {
$qd = [];
/* Array ([ q_act_atr_1 ] => 0 [ q_act_val_1 ] => [ q_tr_atr_1 ] => 0 [ q_tr_val_1 ] => [ q_ng_atr_1 ] => 0 [ q_ng_val_1 ] => [ q_nk_atr_NaN ] => 0
[ q_nk_val_NaN ] => [ q_info ] => test описание [ q_line1 ] => 1 [ q_line2 ] => 1 [ q_fast ] => 1 [ q_fast_city ] => capitalcity [ q_align1 ] => 1 [ q_align2 ] => 1 [ q_align3 ] => 1 ) */
$qd [ 'name' ] = $_POST [ 'q_name' ];
$qd [ 'lvl' ] = explode ( '-' , $_POST [ 'q_lvl' ]);
$qd [ 'info' ] = $_POST [ 'q_info' ];
if ( $_POST [ 'q_line1' ] == 1 ) {
$qd [ 'line' ] = $_POST [ 'q_line2' ];
}
if ( $_POST [ 'q_fast' ] == 1 ) {
$qd [ 'city' ] = $_POST [ 'q_fast_city' ];
$gd [ 'fast' ] = 1 ;
}
if ( $_POST [ 'align1' ] == 1 ) {
$qd [ 'align' ] = 1 ;
} elseif ( $_POST [ 'align2' ] == 1 ) {
$qd [ 'align' ] = 3 ;
} elseif ( $_POST [ 'align3' ] == 1 ) {
$qd [ 'align' ] = 7 ;
2023-12-08 15:56:55 +00:00
$i = 1 ;
while ( $i != - 1 ) {
if ( isset ( $_POST [ 'q_act_atr_' . $i ])) {
if ( $_POST [ 'q_act_val_' . $i ] != '' ) {
$qd [ 'act_date' ] .= $_POST [ 'q_act_atr_' . $i ] . ':=:' . $_POST [ 'q_act_val_' . $i ] . ':|:' ;
}
} else {
$i = - 2 ;
$qd [ 'act_date' ] = trim ( $qd [ 'act_date' ], ':|:' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$i ++ ;
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$i = 1 ;
while ( $i != - 1 ) {
if ( isset ( $_POST [ 'q_tr_atr_' . $i ])) {
if ( $_POST [ 'q_tr_val_' . $i ] != '' ) {
$qd [ 'tr_date' ] .= $_POST [ 'q_tr_atr_' . $i ] . ':=:' . $_POST [ 'q_tr_val_' . $i ] . ':|:' ;
}
} else {
$i = - 2 ;
$qd [ 'tr_date' ] = trim ( $qd [ 'tr_date' ], ':|:' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$i ++ ;
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
$i = 1 ;
while ( $i != - 1 ) {
if ( isset ( $_POST [ 'q_ng_atr_' . $i ])) {
if ( $_POST [ 'q_ng_val_' . $i ] != '' ) {
$qd [ 'win_date' ] .= $_POST [ 'q_ng_atr_' . $i ] . ':=:' . $_POST [ 'q_ng_val_' . $i ] . ':|:' ;
}
} else {
$i = - 2 ;
$qd [ 'win_date' ] = trim ( $qd [ 'win_date' ], ':|:' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$i ++ ;
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
$i = 1 ;
while ( $i != - 1 ) {
if ( isset ( $_POST [ 'q_nk_atr_' . $i ])) {
if ( $_POST [ 'q_nk_val_' . $i ] != '' ) {
$qd [ 'lose_date' ] .= $_POST [ 'q_nk_atr_' . $i ] . ':=:' . $_POST [ 'q_nk_val_' . $i ] . ':|:' ;
}
} else {
$i = - 2 ;
$qd [ 'lose_date' ] = trim ( $qd [ 'lose_date' ], ':|:' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$i ++ ;
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
Db :: sql (
'insert into quests (name, min_lvl, max_lvl, tr_date, act_date, win_date, lose_date, info, line, align, fast) values (?,?,?,?,?,?,?,?,?,?,?)' ,
[
$qd [ 'name' ],
$qd [ 'lvl' ][ 0 ],
$qd [ 'lvl' ][ 1 ],
$qd [ 'tr_date' ],
$qd [ 'act_date' ],
$qd [ 'win_date' ],
$qd [ 'lose_date' ],
$qd [ 'info' ],
$qd [ 'line' ],
$qd [ 'align' ],
$qd [ 'fast' ],
]
);
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
?>
< script >
function nqst () {
const x = document . getElementById ( 'addNewquest' );
x . style . display = x . style . display === 'none' ? '' : 'none' ;
2023-12-05 01:01:04 +00:00
}
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
const adds = [ 0 , 0 , 0 , 0 ];
function addqact () {
const dd = document . getElementById ( 'qact' );
adds [ 0 ] ++ ;
dd . innerHTML = 'Атрибут: <select name="q_act_atr_' + adds [ 0 ] + '" id="q_act_atr_' + adds [ 0 ] + '">' +
'<option value="0"></option>' +
'<option value="go_loc">перейти в локацию</option>' +
'<option value="go_mod">перейти в модуль</option>' +
'<option value="on_itm">одеть предмет</option>' +
'<option value="un_itm">снять предмет</option>' +
'<option value="use_itm">использовать предмет</option>' +
'<option value="useon_itm">использовать предмет на</option>' +
'<option value="dlg_nps">поговорить с NPS</option>' +
'<option value="tk_itm">получить предмет</option>' +
'<option value="del_itm">выкинуть предмет</option>' +
'<option value="buy_itm">купить предмет</option>' +
'<option value="kill_bot">убить монстра</option>' +
'<option value="kill_you">убить клона</option>' +
'<option value="kill_user">убить игрока</option>' +
'<option value="all_stats">раставить статы</option>' +
'<option value="all_skills">раставить умения</option>' +
'<option value="all_navik">расставить навыки</option>' +
'<option value="min_online">пробыть минут в онлайне</option>' +
'<option value="min_btl">провести боев</option>' +
'<option value="min_winbtl">провести боев (побед)</option>' +
'<option value="tk_znak">получить значок</option>' +
'<option value="end_quests">завершить квест</option>' +
'<option value="end_qtime">время выполнения квеста (в минутах)</option>' +
'</select>, значение: <input style="width:100px" name="q_act_val_' + adds [ 0 ] + '" value=""><br>' + dd . innerHTML ;
}
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
function addqtr () {
const dd = document . getElementById ( 'qtr' );
adds [ 1 ] ++ ;
dd . innerHTML = 'Атрибут: <select name="q_tr_atr_' + adds [ 1 ] + '" id="q_tr_atr_' + adds [ 1 ] + '">' +
'<option value="0"></option>' +
'<option value="tr_endq">Завершить квесты</option>' +
'<option value="tr_botitm">Из монстров падают предметы (в пещерах)</option>' +
'<option value="tr_winitm">После победы падают предметы</option>' +
'<option value="tr_zdr">Задержка между выполнением (в часах)</option>' +
'<option value="tr_tm1">Переодичность квеста (начало)</option>' +
'<option value="tr_tm2">Переодичность квеста (конец)</option>' +
'<option value="tr_raz">Сколько раз можно проходить квест</option>' +
'<option value="tr_raz2">Сколько попыток пройти квест</option>' +
'<option value="tr_dn">Нахождение в пещере</option>' +
'<option value="tr_x">Нахождение в координате X</option>' +
'<option value="tr_y">Нахождение в координате Y</option>' +
'</select>, значение: <input style="width:100px" name="q_tr_val_' + adds [ 1 ] + '" value=""><br>' + dd . innerHTML ;
}
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
function addqng () {
const dd = document . getElementById ( 'qng' );
adds [ 2 ] ++ ;
dd . innerHTML = 'Атрибут: <select name="q_ng_atr_' + adds [ 2 ] + '" id="q_ng_atr_' + adds [ 2 ] + '">' +
'<option value="0"></option>' +
'<option value="add_cr">Добавить Кредиты</option>' +
'<option value="add_ecr">Добавить Екредиты</option>' +
'<option value="add_itm">Добавить предмет</option>' +
'<option value="add_eff">Добавить эффект</option>' +
'<option value="add_rep">Добавить репутации</option>' +
'<option value="add_exp">Добавить опыта</option>' +
'</select>, значение: <input style="width:100px" name="q_ng_val_' + adds [ 2 ] + '" value=""><br>' + dd . innerHTML ;
}
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
function addqnk () {
const dd = document . getElementById ( 'qnk' );
adds [ 3 ] ++ ;
dd . innerHTML = 'Атрибут: <select name="q_nk_atr_' + adds [ 3 ] + '" id="q_nk_atr_' + adds [ 3 ] + '">' +
'<option value="0"></option>' +
'<option value="lst_eff">Добавить эффект</option>' +
'</select>, значение: <input style="width:100px" name="q_nk_val_' + adds [ 3 ] + '" value=""><br>' + dd . innerHTML ;
}
</ script >
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
< title > Текстовое поле </ title >
< table width = " 100% " >
< tr >
< td align = " center " >< h3 > Редактор заданий </ h3 ></ td >
< td width = " 150 " align = " right " >
2023-12-08 16:14:29 +00:00
< input type = " button " class = " btn btn-success " value = " Вернуться " onclick = " location='/main.php?moderation'; " />
2023-12-08 15:56:55 +00:00
</ td >
</ tr >
< tr >
< td >
2023-12-05 01:01:04 +00:00
< table width = " 100% " border = " 0 " cellpadding = " 5 " cellspacing = " 0 " bgcolor = " #E1E1E1 " >
<!-- -->
< tr >
< td style = " border-bottom:1px solid #CCCCCC; " >
2023-12-08 15:56:55 +00:00
< div style = " margin-left:11px; " >
2023-12-05 01:01:04 +00:00
< a href = " javascript:void(0) " onclick = " nqst() " > Добавить новое задание </ a >
</ div >
2023-12-08 15:56:55 +00:00
< div ></ div >
2023-12-05 01:01:04 +00:00
</ td >
</ tr >
< tr id = " addNewquest " style = " display:none; " >
2023-12-08 15:56:55 +00:00
< td style = " border-bottom:1px solid #CCCCCC; background-color: #dadada; " >
< b > Панель добавления новых заданий :</ b >< br >
2023-12-08 16:14:29 +00:00
< form method = " post " action = " /main.php?moderation&go=2 " >
2023-12-08 15:56:55 +00:00
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 5 " >
< tr >
< td width = " 200 " valign = " top " >< label for = " q_name " > Название задания </ label ></ td >
< td >< input name = " q_name " id = " q_name " value = " " size = " 60 " maxlength = " 50 " />
</ td >
</ tr >
< tr >
< td valign = " top " >< label for = " q_lvl " > Уровень задания </ label ></ td >
< td >< input name = " q_lvl " id = " q_lvl " value = " 0-21 " size = " 10 " maxlength = " 5 " /></ td >
</ tr >
< tr >
< td valign = " top " > Действия </ td >
< td valign = " top " id = " qact " >< a href = " javascript:void(0) " onclick = " addqact() " >< small > [ + ] добавить </ small ></ a ></ td >
</ tr >
< tr >
< td valign = " top " > Условия </ td >
< td valign = " top " id = " qtr " >< a href = " javascript:void(0) " onclick = " addqtr() " >< small > [ + ] добавить </ small ></ a ></ td >
</ tr >
< tr >
< td valign = " top " > Награда </ td >
< td valign = " top " id = " qng " >< a href = " javascript:void(0) " onclick = " addqng() " >< small > [ + ] добавить </ small ></ a ></ td >
</ tr >
< tr >
< td valign = " top " > Неудача </ td >
< td valign = " top " id = " qnk " >< a href = " javascript:void(0) " onclick = " addqnk() " >< small > [ + ] добавить </ small ></ a ></ td >
</ tr >
< tr >
< td valign = " top " >< label for = " q_info " > Описание задания </ label ></ td >
< td >< textarea name = " q_info " id = " q_info " style = " width:90% " rows = " 7 " ></ textarea ></ td >
</ tr >
< tr style = " background-color: #cbcbcb " >
< td align = " center " valign = " top " >
< label >< input name = " q_line1 " type = " checkbox " id = " checkbox3 " value = " 1 " />
Линейное задание </ label >
</ td >
< td bgcolor = " #CBCBCB " >
< label >< input name = " q_line2 " id = " q_line3 " value = " " size = " 5 " maxlength = " 3 " />
, id линейного сюжета </ label >
</ td >
</ tr >
< tr style = " background-color: #cbcbcb " >
< td align = " center " valign = " top " >
< label >< input name = " q_fast " type = " checkbox " id = " q_fast " value = " 1 " />
Быстрое задание </ label >
</ td >
< td >
< label >< input name = " q_fast_city " id = " q_fast_city " value = " capitalcity " size = " 50 " maxlength = " 50 " >
, город которым ограничен квест < small > ( стереть , если не ограничен ) </ small >< label >
</ td >
</ tr >
< tr style = " background-color: #cbcbcb " >
< td align = " center " valign = " top " >
< small >
< label >
< input name = " q_align1 " type = " checkbox " id = " q_align1 " value = " 1 " > Свет ,
</ label >
< label >
< input name = " q_align2 " type = " checkbox " id = " q_align2 " value = " 1 " /> Тьма ,
</ label >< br >
< label >
< input name = " q_align3 " type = " checkbox " id = " q_align3 " value = " 1 " /> Нейтрал ,
</ label >
</ small >
</ td >
< td >
< input type = " submit " value = " Добавить задание " />
</ td >
</ tr >
</ table >
</ form >
2023-12-05 01:01:04 +00:00
</ td >
</ tr >
<!-- -->
</ table >
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
< table width = " 100% " border = " 0 " cellpadding = " 5 " cellspacing = " 0 " bgcolor = " #E1E1E1 " >
<!-- -->
< ? php
if ( isset ( $_GET [ 'delq' ])) {
Db :: sql ( 'delete from quests where id = ?' , [ $_GET [ 'delq' ]]);
}
$ql = Db :: getRows ( 'select id, name, info from quests' );
foreach ( $ql as $quest ) : ?>
< tr >
< td style = " border-bottom:1px solid #CCCCCC; width: 300px; " >
< div style = " margin-left:11px; " >< ? = $quest [ 'name' ] ?> </div>
< div ></ div >
</ td >
< td style = " border-bottom:1px solid #CCCCCC; background-color: #dadada; width: 75px; " >
< div style = " text-align: center; " >
2023-12-08 16:14:29 +00:00
< a href = " /main.php?moderation&go=2&delq=<?= $quest['id'] ?> " > удалить </ a >
2023-12-08 15:56:55 +00:00
</ div >
</ td >
< td style = " border-bottom:1px solid #CCCCCC; " >
< small >< b > Описание :</ b > < ? = $quest [ 'info' ] ?> </small>
</ td >
</ tr >
< ? php endforeach ; ?>
<!-- -->
</ table >
</ td >
2023-12-05 01:01:04 +00:00
</ tr >
</ table >
< ? php
2023-12-08 15:56:55 +00:00
} else {
?>
< style >
. modpow {
background - color : #ddd5bf;
2023-12-05 01:01:04 +00:00
}
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
. mt {
background - color : #b1a993;
padding : 5 px 10 px ;
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
. md {
padding : 10 px ;
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
</ style >
< script >
function openMod ( title , dat ) {
const d = document . getElementById ( 'useMagic' );
if ( d ) {
document . getElementById ( 'modtitle' ) . innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">' + title + '</td><td width="30" valign="top"><div align="right"><a title="Закрыть окно" onClick="closeMod(); return false;" href="#">x</a></div></td></tr></table>' ;
document . getElementById ( 'moddata' ) . innerHTML = dat ;
d . style . display = '' ;
top . chat . inObj = top . frames [ 'main' ] . document . getElementById ( 'logingo' );
top . frames [ 'main' ] . document . getElementById ( 'logingo' ) . focus ();
}
2023-12-05 01:01:04 +00:00
}
2023-12-08 15:56:55 +00:00
function closeMod () {
const d = document . getElementById ( 'useMagic' );
if ( d ) {
document . getElementById ( 'modtitle' ) . innerHTML = '' ;
document . getElementById ( 'moddata' ) . innerHTML = '' ;
d . style . display = 'none' ;
}
}
</ script >
< div id = " useMagic "
style = " display:none; position:absolute; border:solid 1px #776f59; left: 50px; top: 186px; "
class = " modpow " >
< div class = " mt " id = " modtitle " ></ div >
< div class = " md " id = " moddata " ></ div >
</ div >
< div style = " display: grid; grid-template-columns: auto 150px; " >
< div style = " text-align: center; " >
2023-12-08 16:15:50 +00:00
< ? php ?>
< h3 > Модераторская </ h3 >
< ? php ?>
2023-12-08 15:56:55 +00:00
</ div >
< div style = " text-align: right; " >
< input type = " button " class = " btn btn-danger " value = " Вернуться " onclick = " location='main.php'; " >
</ div >
</ div >
2023-12-05 01:01:04 +00:00
2023-12-08 16:14:29 +00:00
< form action = " /main.php?moderation&rnd=<?= PassGen::intCode() ?> " method = " post " name = " F1 " id = " F1 " >
2023-12-08 15:56:55 +00:00
< ? php
$uer = '' ;
//используем заклятия
if ( isset ( $_GET [ 'usemod' ])) {
if ( isset ( $_POST [ 'usevampir' ])) {
require_once ( 'moder/usevampir.php' );
} elseif ( isset ( $_POST [ 'teleport' ])) {
require_once ( 'moder/teleport.php' );
} elseif ( isset ( $_POST [ 'teleport-cometome' ])) {
require_once ( 'moder/teleport-cometome.php' );
} elseif ( isset ( $_POST [ 'usemarry' ])) {
require_once ( 'moder/usemarry.php' );
} elseif ( isset ( $_POST [ 'useunmarry' ])) {
require_once ( 'moder/useunmarry.php' );
} elseif ( isset ( $_POST [ 'useuntravm' ])) {
require_once ( 'moder/useuntravm.php' );
} elseif ( isset ( $_POST [ 'useatack' ])) {
require_once ( 'moder/useatack.php' );
}
}
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
echo '<span style="color: red; ">' . $uer . '</span>' ;
//Темная склонка, кусается сука!)
?>
< br />
< ? php if ( $m -> isModerator ) : ?>
< div style = " padding:10px; margin:5px; border-bottom:1px solid #cac9c7; " >
< h4 > Наложить / Снять наказание </ h4 >
< form method = " post " id = " moderation " >
< label for = " logingo " > Логин персонажа :</ label >
< input type = " text " id = " logingo " name = " logingo " >
< label for = " modReason " > Причина действия ( где применимо ) :</ label >
< input type = " text " id = " modReason " name = " modReason " >
</ form >
2023-12-05 01:01:04 +00:00
< div >
2023-12-08 15:56:55 +00:00
< label > Время в минутах : < input type = " number " min = " 1 " name = " time " form = " moderation " ></ label >
< input type = " submit " name = " silence " value = " Молчанка в чате " form = " moderation " >
< input type = " submit " name = " unsilence " value = " ❌ Снять молчанку " form = " moderation " >< br >
< label > Количество дней : < input type = " number " min = " 1 " name = " time " form = " moderation " ></ label >
< input type = " submit " name = " prison " value = " Посадить в тюрьму " form = " moderation " >
< input type = " submit " name = " unprison " value = " ❌ Выпустить из тюрьмы " form = " moderation " >< br >
< label > Количество дней : < input type = " number " min = " 1 " name = " time " form = " moderation " ></ label >
< input type = " submit " name = " depersonalize " value = " Скрыть профиль " form = " moderation " >
< input type = " submit " name = " undepersonalize " value = " ❌ Раскрыть профиль " form = " moderation " >< br >
< form method = " post " >
< label for = " marrypartner1 " > Партнёр 1 </ label >
< input type = " text " id = " marrypartner1 " name = " logingo " >
< label for = " marrypartner2 " > Партнёр 2 </ label >
< input type = " text " id = " marrypartner2 " name = " logingo2 " >
< input type = " submit " name = " marry " value = " 💘 Свадьба! " >
< input type = " submit " name = " unmarry " value = " 💔 Развод! " >
</ form >
< ? php if ( $m -> canBlockUsers ) : ?>
< div style = " background-color: lightcoral; margin: 5px 1px; border: 1px dashed crimson; " >
< input type = " submit " name = " ban " value = " 🔒 ️Заблокировать> " form = " moderation " >
< input type = " submit " name = " unban " value = " 🔓 Разблокировать " form = " moderation " >
</ div >
< ? php endif ; ?>
2023-12-05 01:01:04 +00:00
</ div >
2023-12-08 15:56:55 +00:00
< ? php if ( $m -> isAdmin ) : ?>
< div >
2023-12-08 16:14:29 +00:00
< a href = " /main.php?moderation&go=2 " > Редактировать квесты , задания и обучающие программы </ a >< br >
< a href = " /main.php?moderation&go=3 " > Редактировать квесты для Нубозавров </ a >< br >
< a href = " /main.php?moderation&go=1 " > Редактировать возможности подчиненных </ a >< br >
2023-12-08 15:56:55 +00:00
</ div >
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
< input type = " submit " name = " addmoderator " value = " Назначить модератором> " form = " moderation " >
< input type = " submit " name = " deletemoderator " value = " ❌ Убрать из модераторов " form = " moderation " >
< input type = " submit " name = " kickfrombattle " value = " ⚔️ Вытащить из боя> " form = " moderation " >
< input type = " submit " name = " changegender " value = " 👨🏻🤝👩🏻 Сменить пол " form = " moderation " >< br >
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
< label for = " newLogin " > Новый логин :</ label > < input type = " text " id = " newLogin " name = " newLogin " >
< input type = " submit " name = " changelogin " value = " 📝 Сменить логин " >< br >
2023-12-05 01:01:04 +00:00
2023-12-08 15:56:55 +00:00
< label for = " itemId " > ID предмета :</ label > < input type = " number " id = " itemId " name = " itemId " min = " 1 " >
< input type = " submit " name = " giveitem " value = " 🎁 Подарить предмет " >< br >
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
< button disabled > Добавить опыта </ button > < i style = " color: grey " >- очень сломанная херня .</ i >
< ? php endif ; ?>
</ div >
< ? php endif ;
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
if ( $m -> isAdmin ) {
/** Мегафон только для администраторов. */
Announcement :: init ();
2023-01-28 02:24:37 +00:00
2023-12-08 15:55:27 +00:00
/** Регистрации персонажей только для администраторов. */
UserRegistrationList :: get ();
2023-01-28 02:24:37 +00:00
2023-12-08 15:56:55 +00:00
/** Лог действий модераторов только для администраторов. */
$dsee = [];
if ( ! isset ( $_POST [ 'smod1' ])) {
$_POST [ 'smod1' ] = date ( 'd.m.Y' );
2023-01-28 02:24:37 +00:00
}
2023-12-08 15:56:55 +00:00
$dsee [ 'date' ] = explode ( '.' , $_POST [ 'smod1' ]);
$dsee [ 'date' ] = $dsee [ 'date' ][ 2 ] . '-' . $dsee [ 'date' ][ 1 ] . '-' . $dsee [ 'date' ][ 0 ];
$dsee [ 't1' ] = strtotime ( $dsee [ 'date' ] . ' 00:00:00' );
$dsee [ 't2' ] = strtotime ( $dsee [ 'date' ] . ' 23:59:59' );
$dsee [ 'date' ] = date ( 'd.m.Y' , $dsee [ 't1' ]);
?>
< div style = " padding:0 10px 5px 10px; margin:5px; border-bottom:1px solid #cac9c7; " >
< h4 > Показать лог действий модераторов </ h4 >
< label >
Показать действия за
< input name = " smod1 " type = " text " id = " smod1 " value = " <?= $_POST['smod1'] ?> " size = " 11 " maxlength = " 10 " >
</ label >
< label >
Логин модератора
< input name = " smod2 " type = " text " id = " smod2 " value = " <?= $_POST['smod2'] ?> " size = " 30 " maxlength = " 30 " >
</ label >
< input type = " submit " name = " delosee3 " id = " delosee3 " class = " btn " value = " Поиск " />
</ div >
< ? php
if ( isset ( $_POST [ 'delosee3' ])) {
foreach ( Db :: getRows ( 'select uid, time, text from users_delo where login = ? and time between ? and ?' , [ $_POST [ 'smod2' ], $dsee [ 't1' ], $dsee [ 't2' ]]) as $log ) {
$date = date ( 'd.m.Y H:i:s' , $log [ 'time' ]);
$login = User :: getLogin ( $log [ 'uid' ]);
echo <<< HTML
< div style = " padding:0 10px 5px 10px; margin:5px; border-bottom:1px solid #cac9c7; " >
< div style = " display:inline-block;width:150px;color:green " > $date </ div >
{ $log [ 'text' ]} персонажу $login
</ div >
HTML ;
}
2023-12-08 13:20:27 +00:00
}
2023-12-08 16:14:29 +00:00
2023-12-08 15:56:55 +00:00
} ?>
</ form >
< ? php
}
2022-06-06 21:30:34 +00:00
}