<!--#include file="../Inc/Consts.inc" -->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/sharefunc.Asp" -->
<!--#include file="CheckAdmin.Asp"-->

<!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 rel="stylesheet" href="Images/Admin_style.css">
<script language="javascript" src="Images/Disp.js"></script>
<script src="../tqeditor/TQEditor.js" type="text/javascript"></script>
<script language=javascript>
ie = (document.all)? true:false
if (ie){
function ctlent(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.editForm.submit();}}
}
</script>
<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
If InStr(SsMasterPurview, "|1,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
if request.QueryString("Action")= "Save" then
        SaveSiteInfo
else
        ViewSiteInfo
end if

%>
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="editForm" method="post" action="?Action=Save">
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【系统主参数设置】</th>
    </tr>
    <tr>
      <td width="20%" align="right" class="forumRow">网站标题：</td>
      <td width="80%" class="forumRowHighlight"><input name="SiteTitle" type="text" id="SiteTitle" style="width: 280" value="<%=SiteTitle%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">公司网址：</td>
      <td class="forumRowHighlight"><input name="SiteUrl" type="text" id="SiteUrl" style="width: 280" value="<%=SiteUrl%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">公司名称：</td>
      <td class="forumRowHighlight"><input name="ComName" type="text" id="ComName" style="width: 280" value="<%=ComName%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">详细地址：</td>
      <td class="forumRowHighlight"><input name="Address" type="text" id="Address" style="width: 280" value="<%=Address%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">电子邮箱：</td>
      <td class="forumRowHighlight"><input name="Email" type="text" id="Email" style="width: 180" value="<%=Email%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">Keywords优化：</td>
      <td class="forumRowHighlight"><textarea name="Keywords" rows="4"  id="Keywords" style="width: 500"><%=Keywords%></textarea></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">Description优化：</td>
      <td class="forumRowHighlight"><textarea name="Descriptions" rows="4" id="Descriptions" style="width: 500"><%=Descriptions%></textarea></td>
    </tr>
    
   
    <tr>
      <td align="right" class="forumRow" height="42">首页Logo设置：</td>
      <td class="forumRowHighlight"><div style="float:left;width:270px;height:25px;line-height:25px;"><input name="SiteLogo" type="text" id="SiteLogo" style="width:200px;" value="<%=SiteLogo%>"><input type="checkbox" onClick="display('upload');" id="box"/><label for='box'>上传图片</label></div>
		<div id="upload" style="float:left;display:none;">			
		<iframe frameborder=0 width=290 height=25 scrolling=no src="Admin_upload.asp?action=logo"></iframe>
		</div></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">首页公司简介：</td>
      <td class="forumRowHighlight"><textarea id="content" rows="18" cols="100"  name="Comabout" wrap="virtual" onkeydown="ctlent()"><% = Comabout%></textarea>
<script type="text/javascript" defer> 
 new tqEditor('content', {toolbar:'full',advToolbarMode:true, uploadFieldName:'filedata',imageUploadUrl:'./upload.asp', imageFileTypes:'*.jpg;*.gif;*.png;*.jpeg',directInsertUploadImage:'true'}); 
</script></td>
    </tr>
     <tr>
      <td align="right" class="forumRow">底部信息：</td>
      <td class="forumRowHighlight">
      <textarea name="Copyright" cols="80" rows="6"><%=Copyright%></textarea>
      </td>
    </tr>
    <tr>
      <td align="right" class="forumRow">ICP备案号：</td>
      <td class="forumRowHighlight"><input name="ICP" type="text" id="ICP" style="width: 180" value="<%=ICP%>"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" value="保存主参数设置"></td>
    </tr>
  </form>
</table>
<br />
<%
Function SaveSiteInfo()
    If Len(Trim(request.Form("SiteTitle")))<4 Then
        response.Write "<script language='JavaScript'>alert('请详细填写您的网站标题并保持至少在两个汉字以上！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("SiteUrl")))<9 Then
        response.Write "<script language='JavaScript'>alert('请详细填写您的公司网址！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("ComName")))<4 Then
        response.Write "<script language='JavaScript'>alert('请详细填写您的公司名称并保持至少在两个汉字以上！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("Address")))<4 Then
        response.Write "<script language='JavaScript'>alert('请详细填写您的公司地址并保持至少在两个汉字以上！');" & "history.back()" & "</script>"
        response.End
    End If
   
    If Len(Trim(request.Form("Email")))<6 Then
        response.Write "<script language='JavaScript'>alert('请详细填写电子邮箱地址并保持至少在6个字符以上！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("Keywords")))>250 Then
        response.Write "<script language='JavaScript'>alert('请详细填写网站关键词并保持在250个字符以内！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("Descriptions")))>250 Then
        response.Write "<script language='JavaScript'>alert('请详细填写网站描述并保持在250个字符以内！');" & "history.back()" & "</script>"
        response.End
    End If
     Dim objDom,objnodes
	'创建DOM对象 
set objDom=server.CreateObject("MicroSoft.XMLDom") 
'取得xml数据 
objDom.load(Server.MapPath("../inc/sitedata.xml")) 
Set objNodes = objDom.selectSingleNode("siteinfo")
    objnodes.childNodes(0).Text = Trim(Request.Form("SiteTitle"))
   objnodes.childNodes(1).Text = Trim(Request.Form("SiteUrl"))
    objnodes.childNodes(2).Text = Trim(Request.Form("ComName"))
    objnodes.childNodes(3).Text = Trim(Request.Form("Address"))
    objnodes.childNodes(4).Text = Trim(Request.Form("Email"))
    objnodes.childNodes(5).Text = Trim(Request.Form("Keywords"))
    objnodes.childNodes(6).Text = Trim(Request.Form("Descriptions"))
    
    objnodes.childNodes(7).Text = Trim(Request.Form("SiteLogo"))
    objnodes.childNodes(8).Text = Trim(Request.Form("Comabout"))
	
    objnodes.childNodes(9).Text = Trim(Request.Form("Copyright"))
	objnodes.childNodes(10).Text = Trim(Request.Form("ICP"))
	objDom.save(Server.MapPath("../inc/sitedata.xml"))

    response.Write "<script language='javascript'>alert('系统主参数提交成功！');location.replace('siteconfig.Asp');</script>"
End Function
Function ViewSiteInfo()
    Dim objDom,objnodes,loadResult
	'创建DOM对象 
set objDom=server.CreateObject("MicroSoft.XMLDom") 
objDom.async = False
'取得xml数据 
loadResult=objDom.load(Server.MapPath("../inc/sitedata.xml")) 
If Not loadResult Then
             Response.Write ("加载XML文件出错!")
               Response.End
End If
set objnodes=objDom.SelectSingleNode("siteinfo")
if Not IsNull(objnodes) then
SiteTitle=objnodes.childNodes(0).text
SiteUrl=objNodes.childNodes(1).text
ComName=objNodes.childNodes(2).text
Address=objNodes.childNodes(3).text
Email=objNodes.childNodes(4).text
Keywords=objNodes.childNodes(5).text
Descriptions=objNodes.childNodes(6).text
SiteLogo=objNodes.childNodes(7).text
Comabout=objNodes.childNodes(8).text
Copyright=objNodes.childNodes(9).text
ICP=objNodes.childNodes(10).text
end if
End Function
%>