<%@ page contentType="text/html;charset=UTF-8" errorPage="../error.jsp"%>
<%@ page import="com.hongshee.ejforum.util.PageUtils"%>
<%@ page import="com.hongshee.ejforum.data.UserDAO.UserInfo"%>
<%@ page import="com.hongshee.ejforum.common.ForumSetting"%>
<%
	UserInfo userinfo = PageUtils.getAdminUser(request, response);
	if (userinfo == null) return;
	ForumSetting setting = ForumSetting.getInstance();
	String serverName = request.getServerName();
%>
<!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">
<LINK href="../style/admin.css" type=text/css rel=stylesheet>
<SCRIPT src="../../js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="../js/admin.js" type=text/javascript></SCRIPT>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A onclick="parent.location='../index.htm'; return false;" href="#">后台管理首页</A>&nbsp;&raquo;&nbsp;基本设置
 		  </TD></TR></TBODY></TABLE><BR>
      <FORM id=settings name=settings onSubmit="checkfields(this); return false;" action="../perform.jsp" method=post>
	  <INPUT type=hidden name="act" value="basic_baseinfo">
	  <A name=tb01></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>基本设置<A onClick="collapse_change('tb01','../images')" href="#">
		  <IMG id=menuimg_tb01 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb01>
        <TR>
          <TD class=altbg1 width="45%"><B>论坛名称:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_1") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="forumName" name="forumName"> </TD></TR>
		<tr>
			<td width="45%" class="altbg1" valign="top"><b>论坛 logo:</b><br/>
			<span class="smalltxt"><%= PageUtils.getString("baseinfo_2") %></span></td>
			<td class="altbg2"><input type="text" size="50" name="forumLogo"></td>
		</tr>			
        <TR>
          <TD class=altbg1 width="45%"><B>网站名称:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_3") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 name="website"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>网站 URL:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_4") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 name="siteUrl"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>页脚联系邮箱:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_5") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="footerMailAddr" name="footerMailAddr"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>网站备案信息代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_6") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 name="certCode"> </TD></TR>
		<tr><td width="45%" class="altbg1">
			<b>论坛日期格式:</b><br/>
			<span class="smalltxt"><%= PageUtils.getString("baseinfo_7") %></span></td>
			<td class="altbg2">
				<select name="dateFormat">
					<option value="yyyy-mm-dd">yyyy-mm-dd</option>
					<option value="yyyy/mm/dd">yyyy/mm/dd</option>
					<option value="dd-mm-yyyy">dd-mm-yyyy</option>
					<option value="dd/mm/yyyy">dd/mm/yyyy</option>
				</select>
			</td></tr>
        <TR>
          <TD class=altbg1 width="45%"><B>网站时差:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_8") %></SPAN></TD>
          <TD class=altbg2>
		  		<select name="timezone">
		  			<jsp:include page="../../include/timezone.html"/>
				</select>
		  </TD></TR>
		</TBODY></TABLE><BR>
      <A name=tb03></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>系统邮件设置<A onClick="collapse_change('tb03','../images')" href="#"><IMG 
            id=menuimg_tb03 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb03>
        <TR>
          <TD class=altbg1 width="45%"><B>管理员邮件地址:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_9") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="adminMailAddr" name="adminMailAddr"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>系统邮件地址:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_10") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="sysMailAddr" name="sysMailAddr"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>系统邮件用户名:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_11") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="sysMailUser" name="sysMailUser"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>系统邮件密码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_12") %></SPAN></TD>
          <TD class=altbg2><INPUT type="password" size=50 id="sysMailPasswd" name="sysMailPasswd"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>系统邮件发送服务器:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("baseinfo_13") %></SPAN></TD>
          <TD class=altbg2><INPUT type="text" size=50 id="sysSmtpHost" name="sysSmtpHost"></TD></TR>
        </TBODY></TABLE><BR>
      <CENTER><INPUT class=button type=submit value="提 交"></CENTER></FORM></TD></TR></TBODY></TABLE><BR><BR>
<script language="javascript">
function checkfields(theform) {
	if (trim($('forumName').value) == '') {
		alert('论坛名称不可以为空');
		$('forumName').focus();
	} else if(!isLegalEmail(trim($('adminMailAddr').value))) {
		alert('请输入有效的管理员邮件地址');
		$('adminMailAddr').focus();
	} else if(!isLegalEmail(trim($('sysMailAddr').value))) {
		alert('请输入有效的系统邮件地址');
		$('sysMailAddr').focus();
	} else if(trim($('sysMailUser').value) == '') {
		alert('请输入系统邮件用户名');
		$('sysMailUser').focus();
	} else if(trim($('sysSmtpHost').value) == '') {
		alert('请输入系统邮件发送服务器');
		$('sysSmtpHost').focus();
	} else {
		theform.submit();
	}
}
$('settings').forumName.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"forumName") %>";
$('settings').forumLogo.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"forumLogo") %>";
$('settings').website.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"website",serverName) %>";
$('settings').siteUrl.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"siteUrl","http://" + serverName) %>";
$('settings').footerMailAddr.value = 
	"<%= setting.getHTMLStr(ForumSetting.BASEINFO,"footerMailAddr",setting.getAdminMailAddr()) %>";
$('settings').certCode.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"certCode") %>";
$('settings').dateFormat.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"dateFormat") %>";
$('settings').timezone.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"timezone") %>";
$('settings').adminMailAddr.value = "<%= setting.getAdminMailAddr() %>";
$('settings').sysMailAddr.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"sysMailAddr") %>";
$('settings').sysMailUser.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"sysMailUser") %>";
$('settings').sysMailPasswd.value = 
	"<%= setting.getString(ForumSetting.BASEINFO,"sysMailPasswd").trim().length()==0?"":"      " %>";
$('settings').sysSmtpHost.value = "<%= setting.getHTMLStr(ForumSetting.BASEINFO,"sysSmtpHost") %>";
</script>	  
<%= PageUtils.getAdminFooter(request) %>
</BODY></HTML>
