<!--#include file="../../Inc/Cls_Main.Asp"-->
<!--#include file="../inc/Cls_Admin.Asp"-->
<!--#include file="../inc/Cls_MapPath.Asp"-->
<!--#include file="../Admin_Check.Asp"-->
<%
Dim CmsAdmin
'=============================================================================
Set CmsAdmin = New Cls_Admin
CmsAdmin.SetAdminTitle = CmsSiteName
CmsAdmin.SetBodyCssName = "mainbody"
CmsAdmin.SetAdminPath = CmsAdminMapPath
CmsAdmin.LoadHead()
'=============================================================================
Dim Action
'=============================================================================
Action = Easp.Get("action")
Select Case Action
    Case "savemain"
        Call SaveMain()
    Case Else
        Call PageLoad()
End Select
CmsAdmin.LoadFooter()
Set CmsAdmin = Nothing

Sub PageLoad()
    ChkSysAdminLevel "sys_config", "show"
    '=====================================================================
%>
<script src="<%=CmsAdminMapPath%>js/check/setting.check.js"></script>
<form name="myform" id="myform" method="post" action="?action=savemain">
  <div class="navigation">控制面板 &gt; 系统参数设置</div>
  <div id="contentTab">
    <div class="content-tab">
      <ul class="tab_nav">
        <li><a onclick="tabs(this);" class="selected" href="javascript:void(0);">网站基本信息</a></li>
        <li><a onclick="tabs(this);" href="javascript:void(0);">网站SEO设置</a></li>
        <li><a onclick="tabs(this);" href="javascript:void(0);">公司信息设置</a></li>
        <li><a onclick="tabs(this);" href="javascript:void(0);">上传设置</a></li>
      </ul>
    </div>
    <div class="tab_con" style="display: block;">
      <table class="form_table">
        <col width="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 网站名称： </th>
            <td class="td2"><input type="text" name="SiteName" id="SiteName" class="txtInput w350" autocomplete="off" datatype="*6-150" nullmsg="网站名称必须填写" errormsg="至少6个字符,最多150个字符!" value="<%=CmsSiteName%>" />
              <span class="Validform_checktip">*</span></td>
          </tr>
          <tr>
            <th> 网站标题： </th>
            <td class="td2"><input type="text" name="SiteTitle" id="SiteTitle" class="txtInput w350" autocomplete="off" datatype="*6-150" nullmsg="网站标题必须填写" errormsg="至少6个字符,最多150个字符!" value="<%=CmsSiteTitle%>" />
              <span class="Validform_checktip">*</span></td>
          </tr>
          <tr>
            <th> 网站LOGO： </th>
            <td class="td2"><input type="text" name="SiteLogo" id="SiteLogo" class="txtInput w350 left" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsSiteLogo%>" />
              <a href="javascript:;" class="files">
              <input type="file" id="FileUpload" name="FileUpload" onchange="Upload('../', 'UpFile', 10000, 1, 'SiteLogo', 'FileUpload');" />
              </a> <span class="uploading">正在上传，请稍候...</span>　
              <input type="button" class="btnSearch" value="从已上传中选择" onclick="ShowWin('SiteLogo', '从已上传中选择', '../Admin_File.Asp?action=sf&ChannelId=10000&ReturnId=SiteLogo', SetDialog.PublicWidth, SetDialog.PublicHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 网站主域名： </th>
            <td class="td2"><input type="text" name="SiteUrl" id="SiteUrl" class="txtInput w350" autocomplete="off" datatype="url1" nullmsg="网站主域名必须填写" errormsg="URL必须以:http//开头.不能以：/结尾,最多100个字符!" value="<%=CmsSiteUrl%>" />
              <span class="Validform_checktip">*以"http://"开头,不要以/结尾</span></td>
          </tr>
          <tr>
            <th>是否生成手机页面： </th>
            <td class="td2"><span>
              <input type="radio" name="IsCreateWap" value="1" id="IsCreateWap001"<%=Easp.IIF(CmsIsCreateWap = 1," checked=""checked""","")%> />
              <label for="IsCreateWap001">是</label>
              <input type="radio" name="IsCreateWap" value="0" id="IsCreateWap002"<%=Easp.IIF(CmsIsCreateWap = 0," checked=""checked""","")%> />
              <label for="IsCreateWap002">否</label>
              </span><span class="Validform_checktip">*</span></td>
          </tr>
          <tr>
            <th>后台弹出层样式： </th>
            <td class="td2"><select name="DialogSkin" id="DialogSkin" datatype="*">
                <option value="default"<%=Easp.IIF(CmsDialogSkin = Trim("default")," selected=""selected""","")%>>默认(default)</option>
                <option value="aero"<%=Easp.IIF(CmsDialogSkin = Trim("aero")," selected=""selected""","")%>>aero</option>
                <option value="black"<%=Easp.IIF(CmsDialogSkin = Trim("black")," selected=""selected""","")%>>black</option>
                <option value="blue"<%=Easp.IIF(CmsDialogSkin = Trim("blue")," selected=""selected""","")%>>blue</option>
                <option value="green"<%=Easp.IIF(CmsDialogSkin = Trim("green")," selected=""selected""","")%>>green</option>
              </select>
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 系统模板目录： </th>
            <td class="td2"><input type="text" name="Templates" id="Templates" class="txtInput w150" autocomplete="off" datatype="path1" nullmsg="系统模板目录必须填写" errormsg="*,必须以:/ 开头和结尾,如：/zjjcms/,最多50个字符!" value="<%=CmsTemplates%>" />
              <span class="Validform_checktip">*,必须以:/ 开头和结尾,如：/zjjcms/</span></td>
          </tr>
          <tr>
            <th> 模板皮肤目录： </th>
            <td class="td2"><input type="text" name="TempSkin" id="TempSkin" class="txtInput w150" autocomplete="off" datatype="path2" nullmsg="模板皮肤目录必须填写" errormsg="*,不能已：/开头,必须以:/ 结尾,如：default/!" value="<%=CmsTempSkin%>" />
              <span class="Validform_checktip">*,不能已：/开头,必须以:/ 结尾,如：default/</span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="tab_con">
      <table class="form_table">
        <col width="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 网站关键词(SEO)： </th>
            <td class="td2"><textarea name="SiteKey" id="SiteKey" class="w550" datatype="*0-300" nullmsg="最多300个字符!" errormsg="最多300个字符!"><%=CmsSiteKey%></textarea>
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 网站描述(SEO)： </th>
            <td class="td2"><textarea name="SiteDesc" id="SiteDesc" class="w550" datatype="*0-300" nullmsg="最多300个字符!" errormsg="最多300个字符!"><%=CmsSiteDesc%></textarea>
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 网站版权信息： </th>
            <td class="td2"><textarea name="SiteCopy" id="SiteCopy" class="w550" datatype="*0-500" nullmsg="最多500个字符,支持HTML格式!" errormsg="最多500个字符,支持HTML格式!"><%=CmsSiteCopy%></textarea>
              <span class="Validform_checktip">支持HTML格式</span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="tab_con">
      <table class="form_table">
        <col width="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 公司名称： </th>
            <td class="td2"><input type="text" name="CompName" id="CompName" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompName%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 公司传真： </th>
            <td class="td2"><input type="text" name="CompFax" id="CompFax" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompFax%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 公司电话： </th>
            <td class="td2"><input type="text" name="CompPhone" id="CompPhone" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompPhone%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 公司地址： </th>
            <td class="td2"><input type="text" name="CompAddress" id="CompAddress" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompAddress%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 公司邮箱： </th>
            <td class="td2"><input type="text" name="CompEmail" id="CompEmail" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompEmail%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 地址邮编： </th>
            <td class="td2"><input type="text" name="CompZcode" id="CompZcode" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompZcode%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 服务ＱＱ： </th>
            <td class="td2"><input type="text" name="CompQQ" id="CompQQ" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompQQ%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 服务热线： </th>
            <td class="td2"><input type="text" name="CompTel" id="CompTel" class="txtInput w350" autocomplete="off" datatype="*0-150" errormsg="最多150个字符!" value="<%=CmsCompTel%>" />
              <span class="Validform_checktip"></span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="tab_con">
      <table class="form_table">
        <col width="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 上传文件目录： </th>
            <td class="td2"><input type="text" name="UpLoadFile" id="UpLoadFile" class="txtInput w100" autocomplete="off" datatype="path1" nullmsg="上传文件目录必须填写" errormsg="*,必须以/开头和结尾,如：/UpFile/,最多50个字符!" value="<%=CmsUpLoadFile%>" />
              <span class="Validform_checktip">*上传图片与附件的目录，必须以/开头和结尾</span></td>
          </tr>
          <tr>
            <th> 上传图片类型： </th>
            <td class="td2"><input type="text" name="UpImagesType" id="UpImagesType" class="txtInput w350" autocomplete="off" datatype="*3-50" nullmsg="以英文的逗号分隔开，如：gif|jpg|jpeg|bmp|png" errormsg="最多50个字符!" value="<%=CmsUpImagesType%>" />
              <span class="Validform_checktip">以英文的逗号分隔开，如：gif|jpg|jpeg|bmp|png</span></td>
          </tr>
          <tr>
            <th> 附件图片上传大小： </th>
            <td class="td2"><input type="text" name="UpImagesSize" id="UpImagesSize" class="txtInput w100" autocomplete="off" datatype="size" nullmsg="如：500KB,10MB，超过设置的文件大小不予上传" errormsg="至少1个字符，最多4个字符以KB或MB结尾!" value="<%=CmsUpImagesSize%>" />
              <span class="Validform_checktip">如：500KB,10MB，超过设置的文件大小不予上传</span></td>
          </tr>
          <tr>
            <th> 上传Flash类型： </th>
            <td class="td2"><input type="text" name="UpFlashType" id="UpFlashType" class="txtInput w350" autocomplete="off" datatype="*3-50" nullmsg="以英文的逗号分隔开，如：swf" errormsg="最多50个字符!" value="<%=CmsUpFlashType%>" />
              <span class="Validform_checktip">以英文的逗号分隔开，如：swf</span></td>
          </tr>
          <tr>
            <th> 附件Flash上传大小： </th>
            <td class="td2"><input type="text" name="UpFlashSize" id="UpFlashSize" class="txtInput w100" autocomplete="off" datatype="size" nullmsg="如：500KB,10MB，超过设置的文件大小不予上传" errormsg="至少1个字符，最多4个字符以KB或MB结尾!" value="<%=CmsUpFlashSize%>" />
              <span class="Validform_checktip">如：500KB,10MB，超过设置的文件大小不予上传</span></td>
          </tr>
          <tr>
            <th> 上传媒体类型： </th>
            <td class="td2"><input type="text" name="UpMediaType" id="UpMediaType" class="txtInput w350" autocomplete="off" datatype="*3-50" nullmsg="以英文的逗号分隔开，如：rm|flv|avi|mp3" errormsg="最多50个字符!" value="<%=CmsUpMediaType%>" />
              <span class="Validform_checktip">以英文的逗号分隔开，如：rm|flv|avi|mp3</span></td>
          </tr>
          <tr>
            <th> 附件媒体上传大小： </th>
            <td class="td2"><input type="text" name="UpMediaSize" id="UpMediaSize" class="txtInput w100" autocomplete="off" datatype="size" nullmsg="如：500KB,10MB，超过设置的文件大小不予上传" errormsg="至少1个字符，最多4个字符以KB或MB结尾!" value="<%=CmsUpMediaSize%>" />
              <span class="Validform_checktip">如：500KB,10MB，超过设置的文件大小不予上传</span></td>
          </tr>
          <tr>
            <th> 上传文件类型： </th>
            <td class="td2"><input type="text" name="UpFileType" id="UpFileType" class="txtInput w350" autocomplete="off" datatype="*3-50" nullmsg="以英文的逗号分隔开，如：rar|zip|pdf|doc|xls|ppt|chm|7z" errormsg="最多50个字符!" value="<%=CmsUpFileType%>" />
              <span class="Validform_checktip">以英文的逗号分隔开，如：rar|zip|pdf|doc|xls|ppt|chm|7z</span></td>
          </tr>
          <tr>
            <th> 附件文件上传大小： </th>
            <td class="td2"><input type="text" name="UpFileSize" id="UpFileSize" class="txtInput w100" autocomplete="off" datatype="size" nullmsg="如：500KB,10MB，超过设置的文件大小不予上传" errormsg="至少1个字符，最多4个字符以KB或MB结尾!" value="<%=CmsUpFileSize%>" />
              <span class="Validform_checktip">如：500KB,10MB，超过设置的文件大小不予上传</span></td>
          </tr>
          <tr>
            <th> 上传广告类型： </th>
            <td class="td2"><input type="text" name="UpAdType" id="UpAdType" class="txtInput w350" autocomplete="off" datatype="*3-50" nullmsg="以英文的逗号分隔开，如：gif|jpg|jpeg|bmp|png|swf" errormsg="最多50个字符!" value="<%=CmsUpAdType%>" />
              <span class="Validform_checktip">以英文的逗号分隔开，如：gif|jpg|jpeg|bmp|png|swf</span></td>
          </tr>
          <tr>
            <th> 附件广告上传大小： </th>
            <td class="td2"><input type="text" name="UpAdSize" id="UpAdSize" class="txtInput w100" autocomplete="off" datatype="size" nullmsg="如：500KB,10MB，超过设置的文件大小不予上传" errormsg="至少1个字符，最多4个字符以KB或MB结尾!" value="<%=CmsUpAdSize%>" />
              <span class="Validform_checktip">如：500KB,10MB，超过设置的文件大小不予上传</span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="foot_btn_box">
      <input type="submit" class="btnSubmit" value="提交保存" />
      &nbsp;
      <input name="重置" type="reset" class="btnSubmit" value="重 置" />
    </div>
  </div>
</form>
<%
End Sub

Sub SaveMain()
    ChkSysAdminLevel "sys_config", "edit"
    '=====================================================================
    Dim SiteName, SiteTitle, SiteUrl, SiteLogo, SiteKey, SiteDesc, SiteCopy
    Dim CompName, CompFax, CompPhone, CompAddress, CompEmail, CompZcode, CompQQ, CompTel
    Dim Templates, TempSkin, UpLoadFile
    Dim UpImagesType, UpImagesSize, UpFlashType, UpFlashSize
    Dim UpMediaType, UpMediaSize, UpFileType, UpFileSize, UpAdType, UpAdSize
    Dim IsCreateWap, DialogSkin
    '=====================================================================
    SiteName = Trim(Easp.Post("SiteName:s"))
    SiteTitle = Trim(Easp.Post("SiteTitle:s"))
    SiteUrl = Trim(Easp.Post("SiteUrl:s"))
    SiteLogo = Trim(Easp.Post("SiteLogo:s"))
    SiteKey = Trim(Easp.Post("SiteKey:s"))
    SiteDesc = Trim(Easp.Post("SiteDesc:s"))
    SiteCopy = Trim(Easp.Post("SiteCopy:s"))
    CompName = Trim(Easp.Post("CompName:s"))
    CompFax = Trim(Easp.Post("CompFax:s"))
    CompPhone = Trim(Easp.Post("CompPhone:s"))
    CompAddress = Trim(Easp.Post("CompAddress:s"))
    CompEmail = Trim(Easp.Post("CompEmail:s"))
    CompZcode = Trim(Easp.Post("CompZcode:s"))
    CompQQ = Trim(Easp.Post("CompQQ:s"))
    CompTel = Trim(Easp.Post("CompTel:s"))
    Templates = Trim(Easp.Post("Templates:s"))
    TempSkin = Trim(Easp.Post("TempSkin:s"))
    UpLoadFile = Trim(Easp.Post("UpLoadFile:s"))
    UpImagesType = Trim(Easp.Post("UpImagesType:s"))
    UpImagesSize = Trim(Easp.Post("UpImagesSize:s"))
    UpFlashType = Trim(Easp.Post("UpFlashType:s"))
    UpFlashSize = Trim(Easp.Post("UpFlashSize:s"))
    UpMediaType = Trim(Easp.Post("UpMediaType:s"))
    UpMediaSize = Trim(Easp.Post("UpMediaSize:s"))
    UpFileType = Trim(Easp.Post("UpFileType:s"))
    UpFileSize = Trim(Easp.Post("UpFileSize:s"))
    UpAdType = Trim(Easp.Post("UpAdType:s"))
    UpAdSize = Trim(Easp.Post("UpAdSize:s"))
    IsCreateWap = Easp.Post("IsCreateWap:n:0")
    DialogSkin = Trim(Easp.Post("DialogSkin:s"))
    '=====================================================================
    If Easp.IsN(SiteName) Then
        CmsAdmin.JscriptMsg "网站名称必须填写,不可为空！", "back", "Error", "null"
    End If
    If Easp.IsN(SiteTitle) Then
        CmsAdmin.JscriptMsg "网站标题必须填写,不可为空！", "back", "Error", "null"
    End If
    If Easp.IsN(SiteUrl) Then
        CmsAdmin.JscriptMsg "网站网址必须填写,不可为空！", "back", "Error", "null"
    End If
    If InStr(SiteUrl, "http://") = 0 Then
        CmsAdmin.JscriptMsg "网站网址必须以http://开头！", "back", "Error", "null"
    End If
    If Easp.IsN(DialogSkin) Then
        CmsAdmin.JscriptMsg "后台弹出层样式必须选择！", "back", "Error", "null"
    End If
    If Easp.IsN(Templates) Then
        CmsAdmin.JscriptMsg "系统模板目录必须填写,不建议修改默认目录！", "back", "Error", "null"
    End If
    If Easp.IsN(TempSkin) Then
        CmsAdmin.JscriptMsg "默认模板皮肤目录必须填写,如果没有其它皮肤不建议修改！", "back", "Error", "null"
    End If
    If Easp.IsN(UpLoadFile) Then
        CmsAdmin.JscriptMsg "上传文件目录必须填写,不建议修改默认目录！", "back", "Error", "null"
    End If
    '=====================================================================
    Dim List, ResultVal
    Easp.Use "list"
    Set List = Easp.List.New
    List("SiteName") = SiteName
    List("SiteTitle") = SiteTitle
    List("SiteUrl") = SiteUrl
    List("SiteLogo") = SiteLogo
    List("SiteKey") = SiteKey
    List("SiteDesc") = SiteDesc
    List("SiteCopy") = SiteCopy
    '=====================================================================
    List("CompName") = CompName
    List("CompFax") = CompFax
    List("CompPhone") = CompPhone
    List("CompAddress") = CompAddress
    List("CompEmail") = CompEmail
    List("CompZcode") = CompZcode
    List("CompQQ") = CompQQ
    List("CompTel") = CompTel
    '=====================================================================
    List("Templates") = Templates
    List("TempSkin") = TempSkin
    List("UpLoadFile") = UpLoadFile
    '=====================================================================
    List("UpImagesType") = UpImagesType
    List("UpImagesSize") = UpImagesSize
    List("UpFlashType") = UpFlashType
    List("UpFlashSize") = UpFlashSize
    List("UpMediaType") = UpMediaType
    List("UpMediaSize") = UpMediaSize
    List("UpFileType") = UpFileType
    List("UpFileSize") = UpFileSize
    List("UpAdType") = UpAdType
    List("UpAdSize") = UpAdSize
    '=====================================================================
    List("IsCreateWap") = IsCreateWap
    List("DialogSkin") = DialogSkin
    '=====================================================================
    ResultVal = Easp.db.UR(TablePrefix & "Config", " Id = 1 ", List.Hash)
    '=====================================================================
    Easp.RemoveApp "Sys_Config"
    Easp.C List
    If ResultVal <> 0 Then
        CmsAdmin.LoadCreateIndex()
        CmsAdmin.JscriptMsg "修改系统信息成功！", "Admin.Setting.Asp", "Success", "null"
    End If
    '=====================================================================
End Sub
%>
