<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnSiteData.Asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#include file="Fckeditor/Fckeditor.Asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<script language="javascript">
<!--
function setpic(){
    var arr = showModalDialog("eWebEditor/customDialog/img.htm", "", "dialogWidth:30em; dialogHeight:26em; status:0;help=no");
    if (arr ==null){
        alert("系统提示：当前没有上传图片，界面预览图为空，用户可以重新上传图片！");
    }
    if (arr !=null){
        editForm.SiteLogo.value=arr;
    }
}

function Mappic(){
    var arr = showModalDialog("eWebEditor/customDialog/img.htm", "", "dialogWidth:30em; dialogHeight:26em; status:0;help=no");
    if (arr ==null){
        alert("系统提示：当前没有上传图片，界面预览图为空，用户可以重新上传图片！");
    }
    if (arr !=null){
        editForm.Map.value=arr;
    }
}
//-->
</script>
<%
If InStr(CompanyAdminPurview, "|1,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
Select Case request.QueryString("Action")
    Case "Save"
        SaveSiteInfo
    Case "SaveConst"
        SaveConstInfo
    Case Else
        ViewSiteInfo
End Select
%>
<br />
<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: 350" 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: 350" value="<%=SiteUrl%>">
        <font color="red">*</font></td>
    </tr>
        <tr>
      <td align="right" class="forumRow">网站ICP备案号：</td>
      <td class="forumRowHighlight"><input name="IcpNumber" type="text" id="IcpNumber" style="width: 180" value="<%=IcpNumber%>"></td>
    </tr>
    <!--<tr>
      <td align="right" class="forumRow">首页视频地址：</td>
      <td class="forumRowHighlight"><input name="Video" type="text" id="Video" style="width: 450" value="<%=Video%>">
        <br />
        视频格式支持：Mp3/Avi/Wmv/Asf/Mov/Rm/Ra/Ram/Rmvb/Swf</td>
    </tr>-->
    <tr>
      <td align="right" class="forumRow">访客留言设置：</td>
      <td class="forumRowHighlight"><input name="MesViewFlag" type="checkbox" id="MesViewFlag" value="1" <%if MesViewFlag then response.write ("checked")%>>
        无须审核</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">首页Logo设置：</td>
      <td class="forumRowHighlight"><input name="SiteLogo" type="text" id="SiteLogo" style="width: 380" value="<%=SiteLogo%>"> <input type="button" value="上传图片" onClick="setpic();"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">网站统计代码：</td>
      <td class="forumRowHighlight"><textarea name="Stats" rows="5" id="Stats" style="width: 410"><%=Stats%></textarea><font color="red" valign="middle" >&nbsp;&nbsp;推荐 【<a href="http://tongji.baidu.com/" target="_blank" >百度统计</a>】 和 【<a href="http://www.51.la/" target="_blank">我要啦统计</a>】&nbsp;&nbsp;</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">Keywords优化：</td>
      <td class="forumRowHighlight"><textarea name="Keywords" rows="4"  id="Keywords" style="width: 450"><%=Keywords%></textarea> <font color="red">网站关键词</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">Description优化：</td>
      <td class="forumRowHighlight"><textarea name="Descriptions" rows="4" id="Descriptions" style="width: 450"><%=Descriptions%></textarea> <font color="red">网站描述</font></td>
    </tr>
        <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【企业联系方式设置】</th>
    </tr>
    <tr>
      <td align="right" class="forumRow">公司名称：</td>
      <td class="forumRowHighlight"><input name="ComName" type="text" id="ComName" style="width: 350" 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: 350" value="<%=Address%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">邮政编码：</td>
      <td class="forumRowHighlight"><input name="ZipCode" type="text" id="ZipCode" style="width: 180" value="<%=ZipCode%>" maxlength="6">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">联 系 人：</td>
      <td class="forumRowHighlight"><input name="Contacts" type="text" id="Contacts" style="width: 180" value="<%=Contacts%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">联系电话：</td>
      <td class="forumRowHighlight"><input name="Telephone" type="text" id="Telephone" style="width: 180" value="<%=Telephone%>">
        <font color="red">*//注：多个用"|"分隔</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">移动电话：</td>
      <td class="forumRowHighlight"><input name="Mobile" type="text" id="Mobile" style="width: 180" value="<%=Mobile%>">
        <font color="red">*</font></td>
    </tr>
        <tr>
      <td align="right" class="forumRow">传真号码：</td>
      <td class="forumRowHighlight"><input name="Fax" type="text" id="Fax" style="width: 180" value="<%=Fax%>">
        <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">客 服 QQ：</td>
      <td class="forumRowHighlight"><input name="Qq" type="text" id="Qq" style="width: 180" value="<%=Qq%>">
        <font color="red">*//注：多个用"|"分隔</font></td>
    </tr>
        <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【附加联系方式设置-根据需求填写 非必填】</th>
    </tr>
        <tr>
      <td width="20%" align="right" class="forumRow">客服 MSN：</td>
      <td width="80%" class="forumRowHighlight"><input name="Msn" type="text" id="Msn" style="width: 180" value="<%=Msn%>">
        </td>
    </tr>
    <tr>
      <td align="right" class="forumRow">公交线路：</td>
      <td class="forumRowHighlight"><input name="Bus" type="text" id="Bus" style="width: 350" value="<%=Bus%>">
        </td>
    </tr>
    <tr>
      <td align="right" class="forumRow">地铁线路：</td>
      <td class="forumRowHighlight"><input name="Subway" type="text" id="Subway" style="width: 350" value="<%=Subway%>">
        </td>
    </tr>
    <tr>
      <td align="right" class="forumRow">驾车线路：</td>
      <td class="forumRowHighlight"><input name="Drive" type="text" id="Drive" style="width: 350" value="<%=Drive%>">
        </td>
    </tr>
    <tr>
      <td align="right" class="forumRow">公司地址（地图上传）：</td>
      <td class="forumRowHighlight"><input name="Map" type="text" id="Map" style="width: 450" value="<%=Map%>"> <input type="button" value="上传图片" onClick="Mappic();"></td>
    </tr>
        <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【首页企业简介设置】</th>
    </tr>
    <tr>
      <td align="right" class="forumRow">首页公司简介：</td>
      <td class="forumRowHighlight"><%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350"
oFCKeditor.Value = SiteDetail
oFCKeditor.Create "SiteDetail"
%></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 />
<br />
<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("ZipCode")))<6 Then
        response.Write "<script language='JavaScript'>alert('请详细填写邮政编码并保持至少在6个字符以上！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("Telephone")))<11 Then
        response.Write "<script language='JavaScript'>alert('请详细填写联系电话并保持至少在11个字符以上！');" & "history.back()" & "</script>"
        response.End
    End If
	    If Len(Trim(request.Form("Mobile")))<11 Then
        response.Write "<script language='JavaScript'>alert('请详细填写联系手机并保持至少在11个字符以上！');" & "history.back()" & "</script>"
        response.End
    End If
	    If Len(Trim(request.Form("Qq")))<3 Then
        response.Write "<script language='JavaScript'>alert('请正确填写在线QQ号码！');" & "history.back()" & "</script>"
        response.End
    End If
	    If Len(Trim(request.Form("Contacts")))<2 Then
        response.Write "<script language='JavaScript'>alert('请详细填联系人并保持至少在两个汉字以上！');" & "history.back()" & "</script>"
        response.End
    End If
    If Len(Trim(request.Form("Fax")))<11 Then
        response.Write "<script language='JavaScript'>alert('请详细填写传真号码并保持至少在11个字符以上！');" & "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
	If Len(Trim(request.Form("Stats")))>1000 Then
        response.Write "<script language='JavaScript'>alert('请详细填写统计代码并保持在1000个字符以内！');" & "history.back()" & "</script>"
        response.End
    End If
    Call SiteInfo()
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select top 1 * from Shenbi_Site"
    rs.Open sql, conn, 1, 3
    rs("SiteTitle") = Trim(Request.Form("SiteTitle"))
    rs("SiteUrl") = Trim(Request.Form("SiteUrl"))
    rs("ComName") = Trim(Request.Form("ComName"))
    rs("Address") = Trim(Request.Form("Address"))
    rs("ZipCode") = Trim(Request.Form("ZipCode"))
    rs("Telephone") = Trim(Request.Form("Telephone"))
	rs("Mobile") = Trim(Request.Form("Mobile"))
    rs("Contacts") = Trim(Request.Form("Contacts"))
    rs("Fax") = Trim(Request.Form("Fax"))
    rs("Email") = Trim(Request.Form("Email"))
	rs("Qq") = Trim(Request.Form("Qq"))
	rs("Msn") = Trim(Request.Form("Msn"))
	rs("Bus") = Trim(Request.Form("Bus"))
	rs("Subway") = Trim(Request.Form("Subway"))
	rs("Drive") = Trim(Request.Form("Drive"))
	rs("Map") = Trim(Request.Form("Map"))
    rs("Keywords") = Trim(Request.Form("Keywords"))
    rs("Descriptions") = Trim(Request.Form("Descriptions"))
	rs("Stats") = Trim(Request.Form("Stats"))
    rs("IcpNumber") = Trim(Request.Form("IcpNumber"))
    rs("Video") = Trim(Request.Form("Video"))
    rs("SiteLogo") = Trim(Request.Form("SiteLogo"))
    rs("SiteDetail") = Trim(Request.Form("SiteDetail"))
    If Request.Form("MesViewFlag") = 1 Then
        rs("MesViewFlag") = Request.Form("MesViewFlag")
        Conn.Execute "alter table Shenbi_Message alter column ViewFlag bit default 1"
    Else
        rs("MesViewFlag") = 0
        Conn.Execute "alter table Shenbi_Message alter column ViewFlag bit default 0"
    End If
    rs.update
    rs.Close
    Set rs = Nothing
    response.Write "<script language='javascript'>alert('系统主参数设置成功！');location.replace('MainSite.Asp');</script>"
End Function

Function ViewSiteInfo()
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select top 1 * from Shenbi_Site"
    rs.Open sql, conn, 1, 1
    If rs.bof And rs.EOF Then
        response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>数据库记录读取错误！</font></div>")
        response.End
    Else
        SiteTitle = rs("SiteTitle")
        SiteUrl = rs("SiteUrl")
        ComName = rs("ComName")
        Address = rs("Address")
        ZipCode = rs("ZipCode")
        Telephone = rs("Telephone")
		Mobile = rs("Mobile")
        Contacts = rs("Contacts")
        Fax = rs("Fax")
        Email = rs("Email")
		Qq = rs("Qq")
	    Msn = rs("Msn")
	    Bus = rs("Bus")
	    Subway = rs("Subway")
	    Drive = rs("Drive")
	    Map = rs("Map")
        Keywords = rs("Keywords")
        Descriptions = rs("Descriptions")
		Stats = rs("Stats")
        IcpNumber = rs("IcpNumber")
        MesViewFlag = rs("MesViewFlag")
        Video = rs("Video")
        SiteLogo = rs("SiteLogo")
        SiteDetail = rs("SiteDetail")
        rs.Close
        Set rs = Nothing
    End If
End Function

%>