93 lines
5.3 KiB
PHP
93 lines
5.3 KiB
PHP
|
|
<?
|
||
|
|
if(!defined('GAME')){
|
||
|
|
die();
|
||
|
|
}
|
||
|
|
|
||
|
|
die('Îøèáêà, ñìîòðè ôàéë');
|
||
|
|
|
||
|
|
$dungeon_id = isset($_GET['dungeon_id']) ? intval($_GET['dungeon_id']) : '';
|
||
|
|
|
||
|
|
$dungeon_params = mysql_fetch_assoc(mysql_query("SELECT * FROM `dungeon_room` WHERE `id`='".$dungeon_id."'"));
|
||
|
|
if($_POST['id']){
|
||
|
|
$mysql_query = '';
|
||
|
|
if($dungeon_id){
|
||
|
|
$mysql_query .= "UPDATE `dungeon_room` SET ";
|
||
|
|
$mysql_query .= "`id`='".$_POST['id']."',";
|
||
|
|
$mysql_query .= "`dungeon_id`='".$_POST['dungeon_id']."',";
|
||
|
|
$mysql_query .= "`dungeon_name`='".$_POST['dungeon_name']."' ";
|
||
|
|
$mysql_query .= "`dungeon_room`='".$_POST['dungeon_room']."' ";
|
||
|
|
$mysql_query .= "`dungeon_tag`='".$_POST['dungeon_tag']."' ";
|
||
|
|
$mysql_query .= "`city`='".$_POST['city']."' ";
|
||
|
|
$mysql_query .= "`shop`='".$_POST['shop']."' ";
|
||
|
|
$mysql_query .= "`roomLeave`='".$_POST['roomLeave']."' ";
|
||
|
|
$mysql_query .= "`active`='".$_POST['active']."' ";
|
||
|
|
$mysql_query .= "`quest`='".$_POST['quest']."' ";
|
||
|
|
$mysql_query .= "WHERE `id`='".$dungeon_id."'";
|
||
|
|
}else{
|
||
|
|
$mysql_query .= "INSERT INTO `dungeon_room` ";
|
||
|
|
$mysql_query .= "(`id`,`dungeon_id`,`dungeon_name`,`dungeon_room`,`dungeon_tag`,`shop`,`roomLeave`,`active`,`quest`,`city`)";
|
||
|
|
$mysql_query .= " VALUES ";
|
||
|
|
$mysql_query .= "('".$_POST['id']."','".$_POST['dungeon_id']."','".$_POST['dungeon_name']."','".$_POST['dungeon_room']."','".$_POST['dungeon_tag']."','".$_POST['shop']."','".$_POST['roomLeave']."','".$_POST['active']."','".$_POST['quest']."','".$_POST['city']."');";
|
||
|
|
}
|
||
|
|
mysql_query($mysql_query);
|
||
|
|
die("<script>window.location = 'index.php?mod=dungeon_list';</script>");
|
||
|
|
}
|
||
|
|
?><script src="https://<? echo $c['img']; ?>/js/jx/jquery.js" type="text/javascript"></script>
|
||
|
|
<div align="left">
|
||
|
|
<h3 style="text-align:left;"><?php echo $dungeon_params['id'] ? 'Èçìåíèòü' : 'Äîáàâèòü'; ?> ïåùåðó</h3>
|
||
|
|
</div>
|
||
|
|
<form method="post" action="">
|
||
|
|
<table border="0" cellpadding="0" cellspacing="1">
|
||
|
|
<tbody>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>ID ïîäçåìåëüÿ: </td>
|
||
|
|
<td><input name="dungeon_id" type="text" value="<?php echo $dungeon_params['dungeon_id']; ?>" size="5" maxlength="255"></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>Íàçâàíèå ïåùåðû: </td>
|
||
|
|
<td><input name="dungeon_name" type="text" value="<?php echo $dungeon_params['dungeon_name']; ?>" size="30" maxlength="255"></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>Ãîðîä: </td>
|
||
|
|
<td><input name="city" type="text" value="<?php echo $dungeon_params['city']; ?>" size="30" maxlength="255"></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>Òýã: </td>
|
||
|
|
<td><input name="dungeon_tag" type="text" value="<?php echo $dungeon_params['dungeon_tag']; ?>" size="30" maxlength="255"></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>ID ëîêàöèè (âõîä â ïîäçåìåëüå): </td>
|
||
|
|
<? if($dungeon_params['id'] != 0) $room = mysql_fetch_assoc(mysql_query("SELECT id,name FROM `room` WHERE `id`='".$dungeon_params['id']."'")); else $room['name']=''; ?>
|
||
|
|
<td><input name="id" type="text" value="<?php echo $dungeon_params['id']; ?>" size="5" maxlength="255"><i style="font-size:11px;color: brown;"> <?=$room['name']?></i></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td><font color="red">*</font>ID ëîêàöèè (ïîäçåìåëüå): </td>
|
||
|
|
<? if($dungeon_params['dungeon_room'] != 0) $room = mysql_fetch_assoc(mysql_query("SELECT id,name FROM `room` WHERE `id`='".$dungeon_params['dungeon_room']."'")); else $room['name']=''; ?>
|
||
|
|
<td><input name="dungeon_room" type="text" value="<?php echo $dungeon_params['dungeon_room']; ?>" size="5" maxlength="255"><i style="font-size:11px;color: brown;"> <?=$room['name']?></i></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>ID Ðûöàðñêîãî ìàãàçèíà: </td>
|
||
|
|
<? if($dungeon_params['shop'] != 0) $room = mysql_fetch_assoc(mysql_query("SELECT id,name FROM `room` WHERE `id`='".$dungeon_params['shop']."'")); else $room['name']=''; ?>
|
||
|
|
<td><input name="shop" type="text" value="<?php echo $dungeon_params['shop']; ?>" size="5" maxlength="255"><i style="font-size:11px;color: brown;"> <?=$room['name']?></i></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>ID êîìíàòû äëÿ âûõîäà: </td>
|
||
|
|
<? if($dungeon_params['roomLeave'] != 0) $room = mysql_fetch_assoc(mysql_query("SELECT id,name FROM `room` WHERE `id`='".$dungeon_params['roomLeave']."'")); else $room['name']=''; ?>
|
||
|
|
<td><input name="roomLeave" type="text" value="<?php echo $dungeon_params['roomLeave']; ?>" size="5" maxlength="255"></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>Àêòèâíà: </td>
|
||
|
|
<td><select name="active"><option <? if($dungeon_params['active']=='1') echo' selected="selected" '; ?>value="1">Äà</option><option <? if($dungeon_params['active']!='1') echo' selected="selected" ';?>value="0">Íåò</option></select></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>Âêëþ÷åíû êâåñòû: </td>
|
||
|
|
<td><select name="quest"><option <? if($dungeon_params['quest']=='1') echo' selected="selected" '; ?>value="1">Äà</option><option <? if($dungeon_params['quest']!='1') echo' selected="selected" ';?>value="0">Íåò</option></select></td>
|
||
|
|
</tr>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
<p></p>
|
||
|
|
<input name="submit" type="submit" value="Ñîõðàíèòü" style="width: 150px"/>
|
||
|
|
<input name="cancel" type="submit" onclick="document.location='index.php?mod=dungeon_list'; return false;" value="Îòìåíà" />
|
||
|
|
<p><font color="red">*</font> - Îáÿçàòåëüíûå ïîëÿ </p>
|
||
|
|
</form>
|