game/modules_data/moder/new/editor.php
2022-06-07 00:30:34 +03:00

285 lines
12 KiB
PHP

<? if(isset($_POST['q_name']))
{
$qd = array();
/* 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;
}elseif($_POST['align4']==1)
{
$qd['align'] = 2;
}
$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'],':|:');
}
$i++;
}
$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'],':|:');
}
$i++;
}
$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'],':|:');
}
$i++;
}
$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'],':|:');
}
$i++;
}
mysql_query('INSERT INTO `quests` (`name`,`min_lvl`,`max_lvl`,`tr_date`,`act_date`,`win_date`,`lose_date`,`info`,`line`,`align`,`city`,`fast`) VALUES (
"'.mysql_real_escape_string($qd['name']).'","'.mysql_real_escape_string($qd['lvl'][0]).'","'.mysql_real_escape_string($qd['lvl'][1]).'",
"'.mysql_real_escape_string($qd['tr_date']).'","'.mysql_real_escape_string($qd['act_date']).'","'.mysql_real_escape_string($qd['win_date']).'",
"'.mysql_real_escape_string($qd['lose_date']).'","'.mysql_real_escape_string($qd['info']).'","'.mysql_real_escape_string($qd['line']).'",
"'.mysql_real_escape_string($qd['align']).'","'.mysql_real_escape_string($qd['city']).'","'.mysql_real_escape_string($qd['fast']).'")');
}
?>
<script>
function nqst(){ if(document.getElementById('addNewquest').style.display == ''){ document.getElementById('addNewquest').style.display = 'none'; }else{ document.getElementById('addNewquest').style.display = ''; } }
var adds = [0,0,0,0];
function addqact()
{
var 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;
}
function addqtr()
{
var 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;
}
function addqng()
{
var 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;
}
function addqnk()
{
var 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>
<!-- Copyright 2000-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved. -->
<title>Òåêñòîâîå ïîëå</title>
<table width="100%">
<tr>
<td align="center"><h3>Ðåäàêòîð çàäàíèé</h3></td>
<td width="150" align="right"><input type="button" value="&gt;" onclick="location='main.php?<? echo $zv; ?>';" />
<? if($u->info['admin']>0){ ?>
<input type="button" value="<? if($a==1){ echo 'PAL'; }else{ echo 'ARM'; } ?>" onclick="location='main.php?go=2&amp;<? echo $zv; ?>&amp;remod=<? echo $a; ?>';" />
<? } ?>
<? if($p['trPass']!=''){ ?>
<input type="button" value="X" title="Çàêðûòü äîñòóï" onclick="location='main.php?<? echo $zv.'&rnd='.$code; ?>&amp;exitMod=1';" />
<? } ?></td>
</tr>
<tr>
<td>
<form method="post" action="main.php?go=2&amp;<? echo $zv; ?>&amp;remod=<? echo $a; ?>">
<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#E1E1E1">
<!-- -->
<tr>
<td style="border-bottom:1px solid #CCCCCC;"><div align="left" style="margin-left:11px;">
<a href="javascript:void(0)" onclick="nqst()">Äîáàâèòü íîâîå çàäàíèå</a>
</div>
<div align="left"></div></td>
</tr>
<tr id="addNewquest" style="display:none;">
<td bgcolor="#DADADA" style="border-bottom:1px solid #CCCCCC;"><b>Ïàíåëü äîáàâëåíèÿ íîâûõ çàäàíèé:</b><br />
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="200" valign="top">Íàçâàíèå çàäàíèÿ</td>
<td><input name="q_name" id="q_name" value="" size="60" maxlength="50" /></td>
</tr>
<tr>
<td valign="top">Óðîâåíü çàäàíèÿ</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">Îïèñàíèå çàäàíèÿ</td>
<td><textarea name="q_info" id="q_info" style="width:90%" rows="7"></textarea></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#CBCBCB"><input name="q_line1" type="checkbox" id="checkbox3" value="1" />
Ëèíåéíîå çàäàíèå</td>
<td bgcolor="#CBCBCB"><input name="q_line2" id="q_line3" value="" size="5" maxlength="3" />
, id ëèíåéíîãî ñþæåòà</td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#CBCBCB"><input name="q_fast" type="checkbox" id="q_fast" value="1" />
Áûñòðîå çàäàíèå&nbsp;</td>
<td bgcolor="#CBCBCB"><input name="q_fast_city" id="q_fast_city" value="capitalcity" size="50" maxlength="50" />
, ãîðîä êîòîðûì îãðàíè÷åí êâåñò <small>(ñòåðåòü, åñëè íå îãðàíè÷åí)</small></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#CBCBCB">
<small>
<input name="q_align1" type="checkbox" id="q_align1" value="1" />
Ñâåò,
<input name="q_align2" type="checkbox" id="q_align2" value="1" />
Òüìà,<br />
<input name="q_align3" type="checkbox" id="q_align3" value="1" />
Íåéòðàë,
<input name="q_align4" type="checkbox" id="q_align4" value="1" />
Õàîñ
</small>
</td>
<td bgcolor="#CBCBCB"><input type="submit" value="Äîáàâèòü çàäàíèå" /></td>
</tr>
</table></td>
</tr>
<!-- -->
</table>
</form>
<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#E1E1E1">
<!-- -->
<?
if(isset($_GET['delq']))
{
mysql_query('UPDATE `quests` SET `delete` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($_GET['delq']).'" LIMIT 1');
}
$sp = mysql_query('SELECT * FROM `quests` WHERE `delete` = 0');
while($pl = mysql_fetch_array($sp))
{
?>
<tr>
<td style="border-bottom:1px solid #CCCCCC;" width="300"><div align="left" style="margin-left:11px;"><?=$pl['name']?></div>
<div align="left"></div></td>
<td width="75" bgcolor="#DADADA" style="border-bottom:1px solid #CCCCCC;"><div align="center"><a href="main.php?go=2&amp;delq=<? echo $pl['id'].'&'.$zv; ?>">óäàëèòü</a></div></td>
<td style="border-bottom:1px solid #CCCCCC;"><small><b>Îïèñàíèå:</b> <?=$pl['info']?></small></td>
</tr>
<? } ?>
<!-- -->
</table>
</td>
</tr>
</table>