<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
if session("type")="1" then
   response.Write("<script>alert('Sorry,普通管理员没有权限操作!'); location.href='cw_right.asp'</script>")
end if
%>
<!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=gb2312" />
<title>无标题文档</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function check(form)
{
  if(form.cf_name.value=="")
  {
    alert('网站名称不能为空！');
	form.cf_name.focus();
	return false
  }
  if(form.cf_host.value=="")
  {
    alert('网站域名不能为空！');
	form.cf_host.focus();
	return false
  }
  if(form.cf_root.value=="")
  {
     alert('网站安装目录不能为空！');
	 form.cf_root.focus();
	 return false
  }
  var sel=document.getElementsByName("isjmail")[0];
  var selvalue=sel.options[sel.options.selectedIndex].value
  if(selvalue==1)
  {
    if((form.cf_email.value=="")||(form.cf_smtp.value=="")||(form.cf_jmailUser.value=="")||(form.cf_jmailPass.value==""))
	{
	  alert('开启Jmail请填写SMTP服务器信息！');
	  form.cf_email.focus();
	  return false
	}	
  }
  return true
}
function data(s)
{
  if(s==0)
  {
    document.getElementById("da1").style.display="block";
	document.getElementById("da2").style.display="none";
	document.getElementById("da3").style.display="none";
	document.getElementById("da4").style.display="none";
	document.getElementById("da5").style.display="none";	
  }
  else
  {
    document.getElementById("da1").style.display="none";
	document.getElementById("da2").style.display="block";
	document.getElementById("da3").style.display="block";
	document.getElementById("da4").style.display="block";
	document.getElementById("da5").style.display="block";	
  }
}
</script>
</head>
<body id="page">
<h2 class="title">网站信息</h2>
<%
if request("submit")=1 then
if request("cf_host")="" or request("cf_name")="" or request("cf_root")="" then
response.Write("<script>alert(出错了!系统将自动返回');history.back();</script>")
response.End()
end if
filepath=server.mappath("../Inc/Config.asp")
Set fobj = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set fs = fobj.CreateTextFile(filepath,true)
fs.Write("<"&chr(37)&chr(10))
fs.Write("cf_name="&chr(34)&trim(request("cf_name"))&chr(34)&chr(10))
fs.Write("cf_host="&chr(34)&trim(request("cf_host"))&chr(34)&chr(10))
fs.Write("cf_root="&chr(34)&trim(request("cf_root"))&chr(34)&chr(10))
fs.Write("cf_title="&chr(34)&trim(request("cf_title"))&chr(34)&chr(10))
fs.Write("cf_key="&chr(34)&replace(trim(request("cf_key")),"，",",")&chr(34)&chr(10))
fs.Write("cf_desc="&chr(34)&replace(request("cf_desc"),"""","'")&chr(34)&chr(10))
fs.Write("cf_skin="&chr(34)&request("cf_skin")&"/"&chr(34)&chr(10))
fs.Write("cf_appid="&chr(34)&trim(request("cf_appid"))&chr(34)&chr(10))
fs.Write("cf_appkey="&chr(34)&trim(request("cf_appkey"))&chr(34)&chr(10))
fs.Write("info_pass="&trim(request("info_pass"))&chr(10))
fs.Write("job_pass="&trim(request("job_pass"))&chr(10))
fs.Write("shop_pass="&trim(request("shop_pass"))&chr(10))
fs.Write("hr_pass="&trim(request("hr_pass"))&chr(10))
fs.Write("bbs_pass="&trim(request("bbs_pass"))&chr(10))
fs.Write("reply_pass="&trim(request("reply_pass"))&chr(10))
fs.Write("comment_pass="&trim(request("comment_pass"))&chr(10))
fs.Write("cf_keyword="&chr(34)&trim(request("cf_keyword"))&chr(34)&chr(10))
fs.Write("cf_notice="&chr(34)&trim(request("cf_notice"))&chr(34)&chr(10))
fs.Write("isdata="&trim(request("isdata"))&chr(10))
fs.Write("cf_data="&chr(34)&trim(request("cf_data"))&chr(34)&chr(10))
fs.Write("sql_ip="&chr(34)&trim(request("sql_ip"))&chr(34)&chr(10))
fs.Write("sql_data="&chr(34)&trim(request("sql_data"))&chr(34)&chr(10))
fs.Write("sql_user="&chr(34)&trim(request("sql_user"))&chr(34)&chr(10))
fs.Write("sql_pass="&chr(34)&trim(request("sql_pass"))&chr(34)&chr(10))
fs.Write("isjmail="&request("isjmail")&chr(10))
fs.Write("cf_email="&chr(34)&trim(request("cf_email"))&chr(34)&chr(10))
fs.Write("cf_smtp="&chr(34)&trim(request("cf_smtp"))&chr(34)&chr(10))
fs.Write("cf_jmailUser="&chr(34)&trim(request("cf_jmailUser"))&chr(34)&chr(10))
fs.Write("cf_jmailPass="&chr(34)&trim(request("cf_jmailPass"))&chr(34)&chr(10))
fs.Write(chr(37)&">")
fs.close
set  fobj=nothing
set  fs=nothing

response.Write("<script>alert('操作成功!系统将自动返回');location.href='cw_web.asp';</script>")
response.End()

end if
%>
<table width="99%" border="0" align="center" class="line_table">
  <tr>
    <td height="20" >&nbsp;网站后台管理 &gt;&gt; <a href="cw_info.asp">系统设置</a></td>
  </tr>
</table>
<form id="form1" name="form1" method="post" action="cw_web.asp?submit=1" onsubmit="return check(this)">
      <table width="99%" border="0">
        <tr>
          <td width="14%" height="20" align="right">网站名称：</td>
          <td width="86%" ><input name="cf_name" type="text" id="cf_name" value="<%=cf_name%>" size="50" /></td>
        </tr>
        <tr>
          <td height="20" align="right">网站域名：</td>
          <td><input name="cf_host" type="text" id="cf_host" value="<%=cf_host%>" size="50" />
            *http://www.baidu.com</td>
        </tr>
        <tr>
          <td height="20" align="right">网站安装目录：</td>
          <td><input name="cf_root" type="text" id="cf_root" value="<%=cf_root%>" size="50" />
            */或/root/</td>
        </tr>
        <tr>
          <td height="20" align="right">首页标题：</td>
          <td><input name="cf_title" type="text" id="cf_title" value="<%=cf_title%>" size="50" /></td>
        </tr>
        <tr>
          <td height="20" align="right">首页关键词：</td>
          <td><input name="cf_key" type="text" id="cf_key" value="<%=cf_key%>" size="80" /></td>
        </tr>
        <tr>
          <td height="20" align="right">首页描述：</td>
          <td><textarea name="cf_desc" cols="80" rows="4" id="cf_desc"><%=cf_desc%></textarea></td>
        </tr>
        
        <tr>
          <td height="20" align="right">当前模板：</td>
		  <td>
		  <select name="cf_skin" id="cf_skin">
		  <%
		  paths="../skins/"
Set Fso=CreateObject("Scripting.Filesystemobject")
	Set FsoFolder=Fso.GetFolder(Server.mappath(paths))
	Set Fsocontent=FsoFolder.files
	For Each Fsocount In FsoFolder.Subfolders
%>
            <option value="<%=Fsocount.Name%>" <%if replace(cf_skin,"/","")=Fsocount.Name then%>selected="selected"<%end if%>><%=Fsocount.Name%></option>
			<%
Next
%>
          </select> 
		  Jmail
		  <select name="isjmail" id="isjmail">
		  <%if Cw_commons("Jmail.Message")=True Then%>
		    <option value="1" <%if isjmail=1 then%>selected="selected"<%end if%>>开启</option>
			<%End if%>
			<option value="0" <%if isjmail=0 then%>selected="selected"<%end if%>>关闭</option>
	      </select></td>
        </tr>
        <tr>
          <td height="20" align="right">Q Q 登录：</td>
          <td><input name="cf_appid" type="text" id="cf_appid" value="<%=cf_appid%>" size="20" maxlength="15" />
            AppID
            <input name="cf_appkey" type="text" id="cf_appkey" value="<%=cf_appkey%>" size="40" maxlength="50" />
            AppKey（<a href="http://connect.qq.com/intro/login/" target="_blank">点此申请</a>）</td>
        </tr>
        
        <tr>
          <td height="20" align="right">信息审核：</td>
          <td><select name="info_pass" id="info_pass">
            <option value="0" <%if info_pass=0 then%>selected="selected"<%end if%>>是</option>
            <option value="1" <%if info_pass=1 then%>selected="selected"<%end if%>>否</option>
          </select>
            分类
			<select name="job_pass" id="job_pass">
			<option value="0" <%if job_pass=0 then%>selected="selected"<%end if%>>是</option>
            <option value="1" <%if job_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
            招聘            
            <select name="shop_pass" id="shop_pass">
			<option value="0" <%if shop_pass=0 then%>selected="selected"<%end if%>>是</option>
            <option value="1" <%if shop_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
            商家
            <select name="hr_pass" id="hr_pass">
			<option value="0" <%if hr_pass=0 then%>selected="selected"<%end if%>>是</option>
            <option value="1" <%if hr_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
            简历	
		    <select name="bbs_pass" id="bbs_pass">
              <option value="0" <%if bbs_pass=0 then%>selected="selected"<%end if%>>是</option>
              <option value="1" <%if bbs_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
		    发帖
			<select name="reply_pass" id="reply_pass">
              <option value="0" <%if bbs_pass=0 then%>selected="selected"<%end if%>>是</option>
              <option value="1" <%if bbs_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
		    回帖
			<select name="comment_pass" id="comment_pass">
              <option value="0" <%if comment_pass=0 then%>selected="selected"<%end if%>>是</option>
              <option value="1" <%if comment_pass=1 then%>selected="selected"<%end if%>>否</option>
            </select>
		    评论		  </td>
        </tr>
        
        <tr>
          <td height="20" align="right">过滤词：</td>
          <td><textarea name="cf_keyword" cols="80" rows="4" id="cf_keyword"><%=cf_keyword%></textarea>
          *用豆号分隔</td>
        </tr>
        
        <tr>
          <td align="right">用户中心公告：</td>
          <td><input name="cf_notice" type="text" id="cf_notice" value="<%=cf_notice%>" size="80" /></td>
        </tr>
        <tr>
          <td height="20" align="right">数据库类型：</td>
          <td><input name="isdata" type="radio" value="0" <%if isdata=0 then%>checked="checked"<%end if%> onclick="data(0)" />
            Access
            <input name="isdata" type="radio" value="1" <%if isdata=1 then%>checked="checked"<%end if%> onclick="data(1)" />
            MsSql</td>
        </tr>
        <tr id="da1" <%if isdata=0 then%>style="display:block"<%else%>style="display:none"<%end if%>>
          <td width="14%" height="20" align="right">ACCESS：</td>
          <td width="86%"><input name="cf_data" type="text" id="cf_data" value="<%=cf_data%>" readonly="" />
          .mdb *谨慎更改 </td>
        </tr>
        <tr id="da2" <%if isdata=1 then%>style="display:block"<%else%>style="display:none"<%end if%>>
          <td width="14%" height="20" align="right">SQL服务器：</td>
          <td width="86%"><input name="sql_ip" type="text" id="sql_ip" value="<%=sql_ip%>" /></td>
        </tr>
        <tr id="da3" <%if isdata=1 then%>style="display:block"<%else%>style="display:none"<%end if%>>
          <td width="14%" height="20" align="right">SQL数据库名：</td>
          <td width="86%"><input name="sql_data" type="text" id="sql_data" value="<%=sql_data%>" /></td>
        </tr>
        <tr id="da4" <%if isdata=1 then%>style="display:block"<%else%>style="display:none"<%end if%>>
          <td width="14%" height="20" align="right">SQL用户帐号：</td>
          <td width="86%"><input name="sql_user" type="text" id="sql_user" value="<%=sql_user%>" /></td>
        </tr>
        <tr id="da5" <%if isdata=1 then%>style="display:block"<%else%>style="display:none"<%end if%>>
          <td width="14%" height="20" align="right">SQL用户密码：</td>
          <td width="86%"><input name="sql_pass" type="text" id="sql_pass" value="<%=sql_pass%>" /></td>
        </tr>
        <tr>
          <td align="right">服务邮箱：</td>
          <td><input name="cf_email" type="text" id="cf_email" value="<%=cf_email%>" />
            *开启Jmail必填，作为Jmail发件邮箱地址</td>
        </tr>
		<tr>
          <td align="right">邮箱SMTP：</td>
          <td><input name="cf_smtp" type="text" id="cf_smtp" value="<%=cf_smtp%>" />
          *开启Jmail必填，SMTP服务商地址</td>
        </tr>
		<tr>
          <td align="right">邮箱用户名：</td>
          <td><input name="cf_jmailUser" type="text" id="cf_jmailUser" value="<%=cf_jmailUser%>" />
          *开启Jmail必填</td>
        </tr>
		<tr>
          <td align="right">邮箱用户密码：</td>
          <td><input name="cf_jmailPass" type="password" id="cf_jmailPass" value="<%=cf_jmailPass%>" />
          *开启Jmail必填</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Submit" value="保存配置"  class="btn" /></td>
        </tr>
  </table>
</form>
</body>
</html>
