<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="" %>
<%@ page import="tot.global.ConfigModule" %>
<%@ include file="../inc/common.jsp"%>
<%@ include file="session.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<title>修改配置信息</title>
<link href="style/global.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 14px;
}
-->
</style>
<script src="js/common.js"></script>
</head>
<body>
<%@ include file="top.jsp"%>
<%
String act=RequestUtil.getString(request,"act");
if(act!=null && act.equals("do")){	
	ConfigModule cfg=new ConfigModule();
	cfg.updateConfig(request);
	out.print("<p align=\"center\">成功修改系统配置信息!<br /><a href=\"config.jsp\">返回</a></p>");		
	Sysconfig.load();
}else{
	
%>
<br />
<form id="addGroup" name="addGroup" method="post" action="?act=do" style="margin:0px; padding:0px;">
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
  <tr>
    <td height="25" colspan="2" bgcolor="#3872b2"><div align="center" class="style1">配置参数</div></td>
    </tr>
</table>
<div>
  <div align="center" style="line-height:22px;">数据库参数</div>
</div>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
  <tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">数据库类型：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="database_type" type="text" id="database_type" maxlength="250" value="<%=Sysconfig.getDatabaseType()%>" style="width:200px; border:1px solid #666666;" /><br />
	  仅当你的数据库不支持回滚的时候，设置为2
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">使用数据源：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="use_datasource" type="text" id="use_datasource" maxlength="250" value="<%=Sysconfig.isUseDataSource()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">数据源地址：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="datasource_name" type="text" id="datasource_name" maxlength="250" value="<%=Sysconfig.getDataSourceName()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">驱动类：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="driver_class_name" type="text" id="driver_class_name" maxlength="250" value="<%=Sysconfig.getDriverClassName()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">数据库URL：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="database_url" type="text" id="database_url" maxlength="250" value="<%=Sysconfig.getDatabaseURL()%>" style="width:300px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">用户名：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="database_user" type="text" id="database_user" maxlength="250" value="<%=Sysconfig.getDatabaseUser()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">密码：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="database_password" type="text" id="database_password" maxlength="250" value="<%=Sysconfig.getDatabasePassword()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">最大连接数：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="max_connection" type="text" id="max_connection" maxlength="250" value="<%=Sysconfig.getMaxConnection()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">连接等待时间：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="max_time_to_wait" type="text" id="max_time_to_wait" maxlength="250" value="<%=Sysconfig.getMaxTimeToWait()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#FDFDFD"><div align="right">刷新间隔时间：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="minutes_between_refresh" type="text" id="minutes_between_refresh" maxlength="250" value="<%=Sysconfig.getMinutesBetweenRefresh()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
  </tr>  
</table>
<!--网站配置-->

<div></div>
<!--索引配置-->

<div>
  <div align="center" style="line-height:22px;">索引配置</div>
</div>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">索引文件保存路径：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="indexdir" type="text" id="indexdir" maxlength="250" value="<%=Sysconfig.getIndexDir()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
</tr> 
<tr>
    <td bgcolor="#FDFDFD"><div align="right">索引分析类：</div></td>
    <td bgcolor="#FDFDFD"><div align="left">
      <input name="lucene_analyzer_implementation" type="text" id="lucene_analyzer_implementation" maxlength="250" value="<%=Sysconfig.getLuceneAnalyzerClassName()%>" style="width:300px; border:1px solid #666666;" />
    </div></td>
</tr>  
</table>

<!--时区配置-->

<div>
  <div align="center" style="line-height:22px;">时区配置</div>
</div>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">时区：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="server_hour_offset" type="text" id="server_hour_offset" maxlength="250" value="<%=Sysconfig.getServerHourOffset()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
</tr> 
</table>

<!--锁定IP-->

<div>
  <div align="center" style="line-height:22px;">锁定IP</div>
</div>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">IP列表：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">      
      <textarea name="blocked_ip" cols="45" rows="5"><%=Sysconfig.getBlockedIPs()%></textarea>
      <br />
    多个以;分隔</div></td>
  </tr>
</table>
<!--管理帐号-->

<div>
  <div align="center" style="line-height:22px;">管理帐号</div>
</div>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border">
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">用户名：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="username" type="text" id="username" maxlength="250" value="<%=Sysconfig.getUserName()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
</tr> 
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">密 码：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="password" type="text" id="password" maxlength="250" value="<%=Sysconfig.getPassword()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
</tr>
<tr>
    <td width="31%" bgcolor="#FDFDFD"><div align="right">网站域名(Url)：</div></td>
    <td width="69%" bgcolor="#FDFDFD"><div align="left">
      <input name="siteurl" type="text" id="siteurl" maxlength="250" value="<%=Sysconfig.getSiteUrl()%>" style="width:200px; border:1px solid #666666;" />
    </div></td>
</tr>
</table>
<table width="98%" height="25" border="0" align="center" cellpadding="2" cellspacing="0" class="black_border" style="display:block">
<tr>
    <td colspan="2" bgcolor="#FDFDFD"><div align="center">
      <input type="submit" name="Submit" value="确 定" />
      
        <input type="reset" name="Submit2" value="取 消" />
    </div></td>
    </tr>
</table>
</form>
<%
}
%>
</body>
</html>
