<?php 
defined('IN_HS') or exit('Access Denied');
include admintpl('header');
?>
<script language="javascript">

function changedataattr()
{
var attr = document.getElementById("dataattr").value;
if(attr == "mysql")
{
   document.getElementById("port").value="3306";
}else if(attr == "mssql")
{
   document.getElementById("port").value="1433";
}else{
   document.getElementById("port").value="请选择数据库类型";
}
}
</script>
<body>
<?=$menu?>

<form name="myform" method="post" action="?mod=<?=$mod?>&file=<?=$file?>&action=editserver&id=<?=$id?>">

<table cellpadding="2" cellspacing="1" class="tableborder" width="100%">

  <tbody>
    <th colspan=2>修改服务器</th>
  
    <tr>
      <td width="300" class='tablerow' style="text-align:right"><strong>服务器名：</strong></td>
      <td class='tablerow'><input name='servername' type='text' id='servername' size='40' maxlength='50' value='<?=$servername?>'><input name='oldname' type='hidden' value='<?=$servername?>'></td>
    </tr>
    <tr>
      <td class='tablerow' style="text-align:right"><strong>IP地址：</strong></td>
      <td class='tablerow'><input name='serverip' type='text' id='serverip' size='40' maxlength='50' value='<?=$serverip?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>登陆用户名：</strong></td>
      <td class='tablerow'><input name='loginname' type='text' id='loginname' size='40' maxlength='50' value='<?=$loginname?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>登陆密码：</strong></td>
      <td class='tablerow'><input name='loginpass' type='text' id='loginpass' size='40' maxlength='50' value='<?=$loginpass?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>数据库类型：</strong></td>
      <td class='tablerow'>
	  		<select name="dataattr" id="dataattr" onChange="changedataattr()">
			<option value=""> 请选择 </option>
			<option value="mysql" <?php if($dataattr=="mysql"){ ?> selected <?php } ?>> MYSQL </option>
			<option value="mssql" <?php if($dataattr=="mssql"){ ?> selected <?php } ?>>SQL SERVER</option>
		</select>	  </td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>连接端口：</strong></td>
      <td class='tablerow'><input name='port' type='text' id='port' size='40' maxlength='50' value='<?=$port?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>帐号数据库名：</strong></td>
      <td class='tablerow'><input name='dataacc' type='text' id='dataacc' size='40' maxlength='50' value='<?=$dataacc?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>角色数据库名：</strong></td>
      <td class='tablerow'><input name='datafso' type='text' id='datafso' size='40' maxlength='50' value='<?=$datafso?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>日志数据库名：</strong></td>
      <td class='tablerow'><input name='datalog' type='text' id='datalog' size='40' maxlength='50' value='<?=$datalog?>'></td>
    </tr>
	<tr>
      <td class='tablerow' style="text-align:right"><strong>是否开放激活：</strong></td>
      <td class='tablerow'>
	  		<select name="status" id="status">
			<option value=""> 请选择 </option>
			<option value="1" <?php if($status=="1"){ ?> selected <?php } ?>>是</option>
			<option value="0" <?php if($status=="0"){ ?> selected <?php } ?>>否</option>
		</select>	  </td>
    </tr>

	<tr>
      <td class='tablerow' style="text-align:right"><strong>是否开放转生：</strong></td>
      <td class='tablerow'>
	  		<select name="enablezs" id="enablezs">
			<option value="1" <?php if($enablezs=="1"){ ?> selected <?php } ?>>是</option>
			<option value="0" <?php if($enablezs=="0"){ ?> selected <?php } ?>>否</option>
		</select></td>
	</tr>

	<tr>
      <td class='tablerow' style="text-align:right"><strong>该区游戏公告：</strong><br>为了美观，限制输入80字</td>
      <td class='tablerow'><textarea name="gameamo" style="height:70px;width:270px"><?=$gameamo?></textarea></td>
    </tr>
</table>

<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
  <tr>
     <td width='30%'></td>
     <td><input type="submit" class="btn" name="dosubmit" value=" 确 定 "></td>
  </tr>
</table>
</form>
</body>
</html>