<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="admin_check.asp" -->
<!--#include file="admin.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>Flash网站后台管理</title><link rel="stylesheet" type="text/css" href="css/css.css"><link rel="stylesheet" type="text/css" href="<%=C_dir%>css/css/font-awesome.min.css"><link rel="stylesheet" type="text/css" href="css/sweetalert.css"><link rel="stylesheet" href="css/jquery.bigcolorpicker.css" type="text/css" /><script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script><script src="js/sweetalert.min.js"></script><script type="text/javascript" src="js/help.js"></script><script type="text/javascript" src="js/help2.js"></script><script type="text/javascript" src="js/show.js"></script><script type="text/javascript" src="js/show2.js"></script><script type="text/javascript" src="../upload/AienUpload/init.js"></script><script language="javascript">function submitonce(){var tempobj=document.getElementById("sub");tempobj.disabled=true;tempobj.value="应用中，请稍后...";};function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.Name != "chkAll")e.checked = form.chkAll.checked;}};function manySend(href){ var form = document.form1; form.action = href;form.submit(); } </script></head><body>
<!--#include file="left.asp" -->
<%
page=LCase(Request.QueryString("page"))
action=Request.QueryString("action")
if page="" then
page="index2.asp"
end if
select case page
case "index2.asp"
if request.Cookies("authorization")<>md5(request.servervariables("HTTP_HOST")) then
action=request.QueryString("action")
if action="authorization" then
getinfo=GetBody2(request.Form("A_domain")&"|"&request.Form("A_code"),"get_authorization")
select case getinfo
case ""
call box("连接到服务器失败！请重试","back","error")
case md5(request.servervariables("HTTP_HOST"))
conn.execute("update SL_config set C_domain='"&request.servervariables("HTTP_HOST")&"'")
response.Cookies("authorization")=md5(request.servervariables("HTTP_HOST"))
call WriteToTextFile("../data/admin.bas",GetBody2(C_domain,"admin"),"gb2312")  
call box("授权成功！感谢您的使用","page.asp?page=index2.asp","success")
case else
call box("授权失败！请检查授权码","back","error")
end select
end if
end if
Server.ScriptTimeout=99999999
if CA_a0<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=request.QueryString("action")
sql="select * from SL_config"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
title=rs("C_title")
C_logo=rs("C_logo")
C_wcode=rs("C_wcode")
C_version=rs("C_version")
rs.close
set rs=nothing
sql="select count(*) as G_all from SL_guestbook"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
G_all=rs("G_all")
rs.close
set rs=nothing
sql="select count(*) as G_shall from SL_guestbook where G_sh=0"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
G_shall=rs("G_shall")
rs.close
set rs=nothing
sql="select count(*) as N_shall from SL_news where N_sh=2"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
N_shall=rs("N_shall")
rs.close
set rs=nothing
%>
<div style="padding:20px">
<table width="100%">
<tr><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">网站信息 <span style="float:right; padding:7px; margin-right:30px;"> <b>手机端模板</b></span><span style="float:right; padding:7px;margin-right:45px;"> <b>电脑端模板</b></span></div>
<div class="content">
<div style="float:right"><a href="?page=template_list.asp"><img src="http://www.s-cms.cn/media/<%=C_template%>.jpg" width='100' height='100' style='width:100px; height:100px; border-radius:30%; overflow:hidden; border: #DDDDDD solid 2px;' alt="<img src='http://www.s-cms.cn/media/<%=C_template%>.jpg' width='400'>"/></a><a href="?page=wap_template.asp"><img src="http://www.s-cms.cn/media/<%=C_wap%>.jpg" width='100' height='100' style='width:100px; height:100px; border-radius:30%; overflow:hidden;border: #DDDDDD solid 2px;margin-left:20px;' alt="<img src='http://www.s-cms.cn/media/<%=C_wap%>.jpg' width='200'>"/></a></div>
网站名称：<%=title%><br>
网站留言：<a href="page.asp?page=book.asp">未审核（<font color="#FF0000"><%=G_shall%></font>）</a>/ 文章投稿：<a href="page.asp?page=news_list.asp">未审核（<font color="#FF0000"><%=N_shall%></font>）</a><br>
当前模板：电脑端（<a href="?page=template_list.asp"><%=C_template%></a>）/ 移动端（<a href="?page=wap_template.asp"><%=C_wap%></a>）<br>
访客统计：<%=C_code%> （第三方统计代码）
</div>
</td><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">系统信息</div>
<div class="content">
<div style="float:right"><img src="http://static.websiteonline.cn/website/qr/index.php?url=<%=D_domain%>" width="100" alt="<img src='http://static.websiteonline.cn/website/qr/index.php?url=<%=D_domain%>' width='200'>"/><img src="../<%=C_wcode%>"  width="100" alt="<img src='../<%=C_wcode%>' width='200'"/></div>
欢迎来到“<%=title%>”后台管理系统！<br>
网站域名：<%=D_domain%><br>
网址二维码/微信公众号二维码 →<br>
现在时间：<%=now()%>
</div>
</td></tr>
<tr><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">最新留言 <span style="float:right; padding:7px;"> + <a href="page.asp?page=book.asp">查看更多</a></span></div>
<div class="content" style="min-height:260px;">
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>标题</td><td>留言时间</td><td>审核</td><td>回复</td><td>删除</td></tr>"
sql="Select top 5 * from SL_guestbook order by G_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		G_title=rs("G_title")
		G_name=rs("G_name")
		G_phone=rs("G_phone")
		G_msg=rs("G_msg")
		G_email=rs("G_email")
		G_sh=rs("G_sh")
		if G_sh=0 then
		G_shinfo="<font color='#FF0000'>未审核</font>"
		else
		G_shinfo="<font color='#009900'>已审核</font>"
		end if
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input value='"&G_title&"'></td><td>"&rs("G_time")&"</td><td>"&G_shinfo&"</td><td><a href='page.asp?page=book_edit.asp&G_id="&rs("G_id")&"'class='edit'><i class='fa fa-edit'></i> 回复</a></td><td><a href='page.asp?page=book.asp&action=del&G_id="&rs("G_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
%>
</div>
</td><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">最新订单 <span style="float:right; padding:7px;"> + <a href="page.asp?page=order_list.asp">查看更多</a></span></div>
<div class="content" style="min-height:260px;">
<table width="100%" bgcolor="#eeeeee">
<tr bgcolor="#F7F7F7"><td>商品名称</td><td>状态</td><td>总价</td><td>会员</td><td>提交时间</td></tr>
<%
sql="select top 5 * from SL_orders,SL_product,SL_member where O_member=M_id and O_pid=P_id order by O_id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if rs("O_state")=0 then
		O_state="未付款"
		O_pay="未付款"
		end if
		if rs("O_state")=1 then
		O_state="已付款"
		O_pay="<a href='page.asp?page=sent.asp&O_id="&rs("O_id")&"'><img src='../images/sent.png'></a>"
		end if
		if rs("O_state")=2 then
		O_state="已发货"
		O_pay="已发货"
		end if
		if rs("O_state")=3 then
		O_state="已确认"
		O_pay="已确认"
		end if
		if rs("O_state")=4 then
		O_state="申请退款"
		O_pay="<a href='page.asp?page=tk.asp&O_id="&rs("O_id")&"'>处理退款</a>"
		end if
		if rs("O_state")=5 then
		O_state="已退款"
		O_pay="交易关闭"
		end if
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input value='"&left(rs("P_title"),26)&"' style='width:100px;'></td><td>"&O_state&"</td><td>"&FormatNumber(rs("O_num")*rs("O_price"),2,-1)&"元</td><td><a href='page.asp?page=member_add.asp&M_id="&rs("M_id")&"'>"&rs("M_login")&"</a></td><td>"&rs("O_time")&"</td></tr>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
</table>
</div>
</td></tr>
<tr><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">最新会员 <span style="float:right; padding:5px;"> + <a href="page.asp?page=member_list.asp">查看更多</a></span></div>
<div class="content" style="height:110px; overflow:hidden;">
<%
sql="select top 20 * from SL_member where not M_id=6 order by M_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if left(rs("M_pic"),4)<>"http" then
		M_pic=C_dir&"media/"&rs("M_pic")
		else
		M_pic=rs("M_pic")
		end if

		response.Write "<div style='width:90px;height:120px;padding:5px;float:left;background-color:#FFFFFF;line-height:200%;' align='center'><a href='page.asp?page=member_add.asp&M_id="&rs("M_id")&"'><img src='"&M_pic&"' width='60' height='60' style='width:60px; height:60px; border-radius:50%; overflow:hidden;'></a><br>"&rs("M_login")&"<br><div style='color:#999999;'>"&year(rs("M_regtime"))&"-"&month(rs("M_regtime"))&"-"&day(rs("M_regtime"))&"</div></div>"
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing
%>
</div>
</td><td width="50%">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">空间占用 [<span style="color:#FF0000; font-weight:bold;"><%Showspecialspaceinfo ("All")%></span>] <span style="float:right; padding:5px;"> + <a href="page.asp?page=space.asp">查看更多</a></span></div>
<div class="content" style="height:110px; overflow:hidden;">
<%
SysPath = Server.MapPath(C_dir)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set F = FSO.GetFolder(SysPath)
Set FC = F.SubFolders
		I = 1
		I2 = 1
For Each F In FC
response.Write "<div style='width:130px;float:left;background-color:#FFFFFF;line-height:150%;' align='center'><table width='100%'><tr><td width='40%'><img src='images/folder.png' height='30'></td><td align='left'>"&F.name&"<br><span style='color:#999999'>"&ShowSpaceInfo(F.size)&"</span></td></tr></table></div>"

I = I + 1
	If I2 < 10 Then
	I2 = I2 + 1
	Else
	I2 = 1
	End If
Next

Function ShowSpaceInfo(filesize)
size =filesize
showsize = size & "&nbsp;Byte"
If size > 1024 Then
   size = (size \ 1024)
   showsize = size & "&nbsp;KB"
End If
If size > 1024 Then
   size = (size / 1024)
   showsize = formatnumber(size,2,-1) & "&nbsp;MB"
End If
If size > 1024 Then
   size = (size / 1024)
   showsize = formatnumber(size,2,-1) & "&nbsp;GB"
End If
ShowSpaceInfo="<font face=verdana>" & showsize & "</font>"
End Function

Sub Showspecialspaceinfo(method)
	Dim FSO, d, FC, f1, size, showsize, drvpath
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	If method = "All" Then
		size = d.size
	ElseIf method = "Program" Then
		Set FC = d.Files
		For Each f1 In FC
			size = size + f1.size
		Next
	End If
	showsize = size & "&nbsp;Byte"
	If size > 1024 Then
	   size = (size \ 1024)
	   showsize = size & "&nbsp;KB"
	End If
	If size > 1024 Then
	   size = (size / 1024)
	   showsize = formatnumber(size,2,-1) & "&nbsp;MB"
	End If
	If size > 1024 Then
	   size = (size / 1024)
	   showsize = formatnumber(size,2,-1) & "&nbsp;GB"
	End If
	Response.Write "<font face=verdana>" & showsize & "</font>"
End Sub
Function Drawbar(drvpath)
	Dim FSO, drvpathroot, d, size, totalsize, barsize
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	totalsize = d.size
	Set d = FSO.GetFolder(Server.MapPath(C_dir & drvpath))
	size = d.size	
	barsize = CInt((size / totalsize) * 100)
	Drawbar = barsize
End Function
Function Drawspecialbar()
	Dim FSO, drvpathroot, d, FC, f1, size, totalsize, barsize
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	totalsize = d.size
	Set FC = d.Files
	For Each f1 In FC
		size = size + f1.size
	Next
	barsize = CInt((size / totalsize) * 100)
	Drawspecialbar = barsize
End Function
%>
</div>
</td></tr>
</table>
<div class="title2"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">快捷导航</div>
<div class="content2">
<table width="1000">
<tr><td width="5%"><div class="kj">基本设置</div></td><td colspan="4" align="center"><div class="kj">┌────────┬── 内容管理 ─┬───────┐&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td><td width="5%"><div class="kj">模板管理</div></td><td width="5%"><div class="kj">联系方式</div></td><td width="5%"><div class="kj">手机版本</div></td><td width="5%"><div class="kj">菜单管理</div></td><td width="5%"><div class="kj">账号管理</div></td><td width="5%"><div class="kj">网站安全</div></td></tr>
<tr>
  <td>└ <a href="page.asp?page=config.asp">基本设置</a></td>
  <td width="5%"><div class="kj">简介管理</div></td><td width="5%"><div class="kj">新闻管理</div></td><td width="5%"><div class="kj">产品管理</div></td><td width="5%"><div class="kj">万能表单</div></td>
  <td>└ <a href="page.asp?page=admin_list.asp">切换模板</a></td>
  <td>└ <a href="page.asp?page=book.asp">留言管理</a></td>
  <td>└ <a href="page.asp?page=wap_config.asp">基本设置</a></td>
  <td>└ <a href="page.asp?page=menu_list.asp">菜单列表</a></td>
  <td>└ <a href="page.asp?page=admin_list.asp">管理员列表</a></td>
  <td>└ <a href="page.asp?page=safe_config.asp">安全设置</a></td>
</tr>
<tr>
  <td>└ <a href="page.asp?page=index_config.asp">自定义设置</a></td>
  <td>└ <a href="page.asp?page=text_list.asp">简介列表</a></td><td>└ <a href="page.asp?page=news_list.asp">新闻列表</a></td><td>└ <a href="page.asp?page=product_list.asp">产品列表</a></td><td>└ <a href="page.asp?page=form_list.asp">表单列表</a></td>
  <td>└ <a href="page.asp?page=admin_list.asp">编辑模板</a></td>
  <td>└ <a href="page.asp?page=contact.asp">联系方式</a></td>
  <td>└ <a href="page.asp?page=wap_congfig2.asp">自定义设置</a></td>
  <td>└ <a href="page.asp?page=menu_add.asp">新增菜单</a></td>
  <td>└ <a href="page.asp?page=admin_add.asp">新增管理员</a></td>
  <td>└ <a href="page.asp?page=space.asp">空间占用</a></td>
</tr>
<tr>
  <td>└ <a href="page.asp?page=slide_list.asp">焦点图管理</a></td>
  <td>└ <a href="page.asp?page=text_add.asp">新增简介</a></td><td>└ <a href="page.asp?page=news_add.asp">新增新闻</a></td><td>└ <a href="page.asp?page=product_add.asp">新增产品</a></td><td>└ <a href="page.asp?page=form_add.asp">新增表单</a></td>
  <td>└ <a href="page.asp?page=menu_add.asp">生成静态</a></td>
  <td></td><td>└ <a href="page.asp?page=wap_slide.asp">焦点图设置</a></td><td></td>
  <td>└ <a href="page.asp?page=member_list.asp">会员管理</a></td>
  <td>└ <a href="page.asp?page=checkmm.asp">木马检测</a></td>
</tr>
<tr>
  <td>└ <a href="page.asp?page=link_list.asp">友情链接</a></td>
  <td></td><td>└ <a href="page.asp?page=nsort_list.asp">新闻分类</a></td><td>└ <a href="page.asp?page=psort_list.asp">产品分类</a></td><td>└ <a href="page.asp?page=content_add.asp">新增条目</a></td><td></td><td></td><td>└ <a href="page.asp?page=wap_template.asp">切换模板</a></td><td></td><td></td>
  <td>└ <a href="page.asp?page=backup.asp">数据备份</a></td>
</tr>
<tr><td></td><td></td><td>└ <a href="page.asp?page=nsort_add.asp">增加分类</a></td><td>└ <a href="page.asp?page=order_list.asp">订单管理</a></td><td>└ <a href="page.asp?page=tj_list.asp">查看统计</a></td><td></td><td><td></td><td></td><td></td><td>└ <a href="page.asp?page=file.asp">文件管理</a></td></tr>
</table>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
<%
if request.Cookies("authorization")<>md5(request.servervariables("HTTP_HOST")) then
%>
<a name="auth"></a>
<div class="title2"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;">授权信息（商业授权版无本栏信息）</div>
<div class="content2">
<form action="?action=authorization" method="post">
<table width="700">
<tr><td>当前版本</td><td>免费版 build<%=C_function_version%></td></tr>
<tr><td>授权码</td><td><input type="text" name="A_code" value="" class="input3" onfocus="this.className='input4'" onblur="this.className='input3'"/> </td></tr>
<tr><td>域名</td><td><input type="text" name="A_domain" value="<%=request.servervariables("HTTP_HOST")%>" class="input3" onfocus="this.className='input4'" onblur="this.className='input3'"/> *系统自动判断</td></tr>
<tr><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="授 权" /> <a href="http://www.s-cms.cn/usecode.asp">*如何获得授权码？</a></td></tr>
</table>
</form>
</div>
<%end if%>
</div>
<%case "config.asp"%>
<style>.site_up{background:#ff9900; color:#FFFFFF; border:#ff9900 solid 1px; font-size:14px; padding:2px 5px;-moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;text-decoration:none;}
.site_up:hover{background:#ffffff; color:#ff9900; border:#ff9900 solid 1px; padding:2px 5px;-moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;}</style>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <font color="#0066ff"><u>基本设置</u></font> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <a href="page.asp?page=slide_list.asp">焦点图管理</a> | <a href="page.asp?page=link_list.asp">友情链接</a> | <a href="page.asp?page=map.asp">网站地图</a>
</div>
<div class="content">
<h2>网站设置</h2><hr>
<%
action=Request.QueryString("action")
if action="edit" then
C_title=Request.Form("C_title")
C_foot=Request.Form("C_foot")
C_code=Request.Form("C_code")
C_fenxiang=Request.Form("C_fenxiang")
if left(Request.Form("C_logo"),5)="media" then
C_logo=Request.Form("C_logo")
else
C_logo="media/"&Request.Form("C_logo")
end if
C_logox=Request.Form("C_logox")
C_logoy=Request.Form("C_logoy")
if left(Request.Form("C_ico"),5)="media" then
C_ico=Request.Form("C_ico")
else
C_ico="media/"&Request.Form("C_ico")
end if
C_qq=Request.Form("C_qq")
if right(C_qq,1)="," then
C_qq=left(C_qq,len(C_qq)-1)
end if
if instr(C_qq,"|")<=0 then
call box("QQ客服格式设置错误！","back","error")
end if
C_qqon=Request.Form("C_qqon")
C_mobile=Request.Form("C_mobile")
C_keywords=Request.Form("C_keywords")
C_content=Request.Form("C_content")
C_alipayon=Request.Form("C_alipayon")
C_wxpayon=Request.Form("C_wxpayon")
C_bankon=Request.Form("C_bankon")
C_alipay=Request.Form("C_alipay")
C_alipayid=Request.Form("C_alipayid")
C_alipaykey=Request.Form("C_alipaykey")
C_html=Request.Form("C_html")
C_wtitle=Request.Form("C_wtitle")
C_wtoken=Request.Form("C_wtoken")
C_wcodeC=Request.Form("C_wcodeC")
C_email=Request.Form("C_email")
C_mpwd=Request.Form("C_mpwd")
C_qqid=Request.Form("C_qqid")
C_qqkey=Request.Form("C_qqkey")
C_wx_appid=Request.Form("C_wx_appid")
C_wx_mchid=Request.Form("C_wx_mchid")
C_wx_key=Request.Form("C_wx_key")
C_wx_appsecret=Request.Form("C_wx_appsecret")
C_ocode=Request.Form("C_ocode")
C_domain=Request.Form("C_domain")
if left(Request.Form("C_wcode"),5)="media" then
C_wcode=Request.Form("C_wcode")
else
C_wcode="media/"&Request.Form("C_wcode")
end if
C_close=Request.Form("C_close")
if C_title<>"" and C_foot<>"" and C_logo<>"" and C_keywords<>"" then
sql="Select * from SL_config"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("C_title")=C_title
		rs("C_foot")=C_foot
		rs("C_code")=C_code
		rs("C_fenxiang")=C_fenxiang
		rs("C_logo")=C_logo
		rs("C_logox")=C_logox
		rs("C_logoy")=C_logoy
		rs("C_ico")=C_ico
rs("C_qq")=C_qq
rs("C_qqon")=C_qqon
rs("C_mobile")=C_mobile
		rs("C_keywords")=C_keywords
		rs("C_content")=C_content
		rs("C_alipay")=C_alipay
		rs("C_alipayon")=C_alipayon
		rs("C_wxpayon")=C_wxpayon
		rs("C_bankon")=C_bankon
		rs("C_alipayid")=C_alipayid
		rs("C_alipaykey")=C_alipaykey
		rs("C_wtitle")=C_wtitle
		rs("C_wtoken")=C_wtoken
		rs("C_wcode")=C_wcode
		rs("C_wcodeC")=C_wcodeC
		rs("C_email")=C_email
		rs("C_mpwd")=C_mpwd
		rs("C_qqid")=C_qqid
		rs("C_wx_appid")=C_wx_appid
		rs("C_wx_mchid")=C_wx_mchid
		rs("C_wx_key")=C_wx_key
		rs("C_wx_appsecret")=C_wx_appsecret
		rs("C_qqkey")=C_qqkey
		rs("C_ocode")=C_ocode
		rs("C_html")=C_html
		rs("C_domain")=C_domain
		rs("C_close")=C_close
		rs.update
		rs.close
		end if
call box("修改网站设置成功!","page.asp?page=config.asp","success")
else
call box("请填全信息！","back","error")
end if
end if
sql="select * from SL_config"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		title=rs("C_title")
		foot=rs("C_foot")
		C_code=rs("C_code")
		C_fenxiang=rs("C_fenxiang")
		logo=rs("C_logo")
		C_logox=rs("C_logox")
		C_logoy=rs("C_logoy")
		C_ico=rs("C_ico")
		C_qq=rs("C_qq")
		C_qqon=rs("C_qqon")
		C_mobile=rs("C_mobile")
		C_keywords=rs("C_keywords")
		C_content=rs("C_content")
		C_alipayon=rs("C_alipayon")
		C_wxpayon=rs("C_wxpayon")
		C_bankon=rs("C_bankon")
		C_alipay=rs("C_alipay")
		C_alipayid=rs("C_alipayid")
		C_alipaykey=rs("C_alipaykey")
		C_wtitle=rs("C_wtitle")
		C_wtoken=rs("C_wtoken")
		C_wcode=rs("C_wcode")
		C_wcodeC=rs("C_wcodeC")
		C_email=rs("C_email")
		C_mpwd=rs("C_mpwd")
		C_qqid=rs("C_qqid")
		C_qqkey=rs("C_qqkey")
		C_ocode=rs("C_ocode")
		C_domain=rs("C_domain")
		C_close=rs("C_close")
		C_html=rs("C_html")
		C_wx_appid=rs("C_wx_appid")
		C_wx_mchid=rs("C_wx_mchid")
		C_wx_key=rs("C_wx_key")
		C_wx_appsecret=rs("C_wx_appsecret")
		end if
rs.close
set rs=nothing
%>
<form id="form" name="form1" method="post" action="page.asp?page=config.asp&action=edit" onsubmit="return check();">
<table width="100%">
<tr bgcolor="#EEEEEE">
    <td rowspan="3" scope="col" width="15%" align="center"><b>SEO设置</b></td>
    <td scope="col" width="15%">网站标题：</td>
    <td scope="col" width="70%"><%call input("C_title",title)%> <%call help("标题文字显示在网页上方，认真设置，对SEO关系最大")%></td>
  </tr>
<tr bgcolor="#EEEEEE"><td>网站关键词：</td><td><%call input("C_keywords",C_keywords)%>  <%call help("写几个最符合网站的关键词，注意词与词之间用半角逗号（,）隔开，对SEO优化有帮助")%></td></tr>
<tr bgcolor="#EEEEEE"><td>网站描述：</td><td><%call textarea("C_content",C_content)%>  <%call help("写一段描述你的网站的文字，不要超过100字，对SEO优化有帮助")%></td></tr>
<tr align="left" bgcolor="#F7F7F7">
    <td rowspan="6" align="center"><b>基本设置</b></td>
    <td width="15%">版权文字：</td><td><%call textarea("C_foot",C_foot)%> <%call help("显示在网站左下角/右下角的版权文字")%></td></td>
  </tr>
  <tr bgcolor="#F7F7F7"><td width="15%">网址跳转：</td><td><%call input("C_domain",C_domain)%> <%call help("设置后将自动与程序绑定此域名，留空则解绑")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">网站logo：</td><td><%call input("C_logo",C_logo)%> <%call uploadpic("C_logo")%> <%call help("使用背景透明的PNG格式显示效果更佳")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">logo x坐标：</td><td><%call input("C_logox",C_logox)%> <%call help("网站logo的x坐标，用于调整logo的左右位置")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">logo y坐标：</td><td><%call input("C_logoy",C_logoy)%> <%call help("网站logo的x坐标，用于调整logo的上下位置")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">网站ico文件：</td><td><%call input("C_ico",C_ico)%> <%call uploadpic("C_ico")%> <%call help("上传ico文件，显示在地址栏及标题栏的小图标")%></td></tr>
<tr align="left" bgcolor="#EEEEEE">
    <td rowspan="7" scope="col" width="15%" align="center"><b>辅助功能</b></td>
    <td width="15%">统计代码：</td><td><%call textarea("C_code",C_code)%> <%=C_code%> <%call help("用来统计每天的访客量，代码可以从CNZZ.com或者51.la等网站获取")%></td></td>
  </tr>
<tr bgcolor="#EEEEEE"><td width="15%">QQ客服：</td><td><%call textarea("C_QQ",C_QQ)%> <%call help("QQ号|职务,QQ号2|职务2")%></td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">开启QQ客服：</td><td> 
<%call radio("C_qqon",1,C_qqon)%>开启
<%call radio("C_qqon",0,C_qqon)%>关闭 
<%call help("开启则在网站右侧显示客服")%>
</td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">电话客服：</td><td><%call textarea("C_mobile",C_mobile)%> <%call help("电话号码之间使用|分开")%></td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">分享代码：</td><td><%call textarea("C_fenxiang",C_fenxiang)%> <%call help("可以将你的网站分享到QQ空间，人人网等社交网站，代码可以从百度分享/JiaThis等网站获取")%></td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">开启静态页面：</td><td>

<%call radio("C_html",1,C_html)%>开启
<%call radio("C_html",0,C_html)%>关闭
<%call help("开启静态页面后更有利于搜索引擎收录页面")%>
 </td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">临时关站：</td><td>
<%call radio("C_close",1,C_close)%>关站
<%call radio("C_close",0,C_close)%>开站
<%call help("可用此功能临时关闭网站")%> </td></tr>
<tr align="left" bgcolor="#F7F7F7">
    <td rowspan="8" scope="col" width="15%" align="center"><b>收款设置<br></b>（支持支付宝/微信/网银）</td>
    <td width="15%">支付宝账户：</td><td><%call input("C_alipay",C_alipay)%> <%call help("用于收款")%></td></td>
  </tr>
<tr bgcolor="#F7F7F7"><td width="15%">支付宝ID：</td><td><%call input("C_alipayid",C_alipayid)%> <%call help("用于支付宝付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">支付宝key：</td><td><%call password("C_alipaykey",C_alipaykey)%> <%call help("用于支付宝付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">微信APPID：</td><td><%call input("C_wx_appid",C_wx_appid)%> <%call help("用于微信付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">微信MCHID：</td><td><%call input("C_wx_mchid",C_wx_mchid)%> <%call help("用于微信付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">微信KEY：</td><td><%call password("C_wx_key",C_wx_key)%> <%call help("用于微信付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">微信APPSECRET：</td><td><%call password("C_wx_appsecret",C_wx_appsecret)%><%call help("用于微信付款接口")%></td></tr>
<tr bgcolor="#F7F7F7"><td width="15%">收款开关：</td><td>
<%call checkbox("C_alipayon","true",C_alipayon)%> 支付宝付款   
<%call checkbox("C_wxpayon","true",C_wxpayon)%> 微信付款   
<%call checkbox("C_bankon","true",C_bankon)%> 网银付款   
<a href="javascript:void(0);" onClick="swal('','选中则开启该支付方式');"><img src="img/q.png" alt="选中则开启该支付方式"></a></td></tr>
<tr align="left" bgcolor="#EEEEEE">
    <td rowspan="3" scope="col" width="15%" align="center"><b>微信公众号接入设置</b></td>
    <td width="15%">公众号名称：</td><td><%call input("C_wtitle",C_wtitle)%> <%call help("你的微信公众号的名称")%></td></td>
  </tr>
<tr bgcolor="#EEEEEE"><td width="15%">公众号Token：</td><td><%call input("C_wtoken",C_wtoken)%> <%call help("需与开发者中心填写的Token保持一致")%></td></tr>
<tr bgcolor="#EEEEEE"><td width="15%">公众号二维码：</td><td><%call input("C_wcode",C_wcode)%> <%call uploadpic("C_wcode")%> <%call help("显示在网站首页，利于宣传")%></td></tr>
<tr align="left" bgcolor="#F7F7F7">
    <td rowspan="2" scope="col" width="15%" align="center"><b>安全邮箱设置</b><br>（用于找回密码和发送通知邮件）</td>
    <td width="15%">电子邮箱：</td><td><%call input("C_email",C_email)%> <%call help("填写你的电子邮箱的地址，建议使用QQ或163邮箱")%></td></td>
  </tr>
<tr bgcolor="#F7F7F7"><td width="15%">邮箱密码：</td><td><%call password("C_mpwd",C_mpwd)%> <%call help("填写你的电子邮箱密码")%></td></tr>
<tr align="left" bgcolor="#EEEEEE">
    <td rowspan="2" scope="col" width="15%" align="center"><b>QQ登录接口设置</b></td>
    <td width="15%">QQ ID：</td><td><%call input("C_qqid",C_qqid)%> <%call help("请按照使用手册获取QQID后填写")%></td></td>
  </tr>
<tr bgcolor="#EEEEEE"><td width="15%">QQ KEY：</td><td><%call password("C_qqkey",C_qqkey)%> <%call help("请按照教程获取QQKEY后填写")%></td></tr>
<tr><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
<hr>
说明：本后台系统在谷歌浏览器下运行，显示效果更佳。
<div style='position:fixed; bottom:10px; left:50%; margin-left:-88px;z-index:1000;'>
<%
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.fileexists(server.mappath("../html/"&C_template&"/index_1.html"))=false and C_html=1 then
%>
<a href="page.asp?page=template_2html.asp"><div class="site_up">
您已开启网站静态，但是未生成静态文件。
</div>
</a>
<%
end if
Set fso = nothing
%>
</div>
</div>
<%case "index_config.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=request.QueryString("action")
if action="edit" then
config_data="<?xml version='1.0' encoding='utf-8'?><xml>"
Set xml=Server.CreateObject("Microsoft.XMLDOM")
xml.Async=False
xml.Load(Server.MapPath("../template/"&C_template&"/config.xml"))
nCntChd=xml.documentElement.ChildNodes.length-1

for i=0 to nCntChd
nCntAtr=xml.documentElement.ChildNodes.item(i).ChildNodes.length-1
config_data=config_data&"<page title='"&xml.documentElement.ChildNodes.item(i).Attributes.item(0).Text&"'>"
for j=0 to nCntAtr
config_data=config_data&"<tag><title>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</title><content><![CDATA["&Request.Form("C_"&i&j)&"]]></content><en><![CDATA["&Request.Form("E_"&i&j)&"]]></en><type>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</type><url><![CDATA["&Request.Form("U_"&i&j)&"]]></url></tag>"
next
config_data=config_data&"</page>"
next
Set xml=Nothing
config_data=config_data&"</xml>"
call WriteToTextFile ("../template/"&C_template&"/config.xml",config_data,"utf-8")
call box("保存成功!","page.asp?page=index_config.asp","success")
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <font color="#0066ff"><u>自定义设置</u></font> | <a href="page.asp?page=slide_list.asp">焦点图管理</a> | <a href="page.asp?page=link_list.asp">友情链接</a>  | <a href="page.asp?page=map.asp">网站地图</a></div>
<div class="content">
<h2>自定义设置</h2><hr>
<form name="form1" method="post" action="page.asp?page=index_config.asp&action=edit">
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td width='10%'>页面</td><td width='10%'>标签名称</td><td width='30%'>内容</td><td width='25%'>英文内容</td><td width='5%'>类型</td><td width='20%'>链接</td></tr>"
Set xml=Server.CreateObject("Microsoft.XMLDOM")
xml.Async=False
xml.Load(Server.MapPath("../template/"&C_template&"/config.xml"))
nCntChd=xml.documentElement.ChildNodes.length-1
for i=0 to nCntChd
nCntAtr=xml.documentElement.ChildNodes.item(i).ChildNodes.length-1
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#FFFFFF'><td rowspan='"&xml.documentElement.ChildNodes.item(i).ChildNodes.length&"' scope='col' bgcolor='#F7F7F7' align='center'><b>"&xml.documentElement.ChildNodes.item(i).Attributes.item(0).Text&"</b></td>"
for j=0 to nCntAtr
select case xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text
case "text"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><textarea name='C_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text)&"</textarea></td><td scope='col'><textarea name='E_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(2).Text)&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><textarea name='C_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text)&"</textarea></td><td><textarea name='E_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(2).Text)&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
end if

case "img"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' name='C_"&i&j&"' id='C_"&i&j&"' class='input3'> <input type='button' value='上传文件' onclick=""showUpload('C_"&i&j&"','C_"&i&j&"','../template/"&C_template&"/images',1,null,'','');"" /></td><td scope='col'><img src='../template/"&C_template&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' width='40' alt='<img src=../template/"&C_template&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&" width=400>'><input type='hidden' value='' name='E_"&i&j&"' id='E_"&i&j&"'></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' name='C_"&i&j&"' id='C_"&i&j&"' class='input3'> <input type='button' value='上传文件' onclick=""showUpload('C_"&i&j&"','C_"&i&j&"','../template/"&C_template&"/images',1,null,'','');"" /></td><td><img src='../template/"&C_template&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' width='50' alt='<img src=../template/"&C_template&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&" width=400>'><input type='hidden' value='' name='E_"&i&j&"' id='E_"&i&j&"'></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
end if


case "video"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><textarea name='C_"&j&"' cols='40' rows='3'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</textarea></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&j&"' id='U_"&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><textarea name='C_"&j&"' cols='40' rows='3'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&j&"' id='U_"&j&"' class='input3'></td></tr>"
end if
case "color"

if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td>"
%>
<input type="text" name="C_<%=j%>" id="U_color<%=j%>" value="<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>" class="input3" onfocus="this.className='input2'" onblur="this.className='input1'"/> <img src="img/rect.gif" border=0 style="cursor:pointer;background-Color:<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>;" id="4" title="选取颜色!" onClick="Getcolor(this.id,'U_color<%=j%>');">
<%
response.Write "</td><td scope='col'></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td>"
%>
<input type="text" name="C_<%=j%>" id="U_color<%=j%>" value="<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>" class="input3" onfocus="this.className='input2'" onblur="this.className='input1'"/> <img src="img/rect.gif" border=0 style="cursor:pointer;background-Color:<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>;" id="4" title="选取颜色!" onClick="Getcolor(this.id,'U_color<%=j%>');">
<%
response.Write "</td><td></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td></td></tr>"
end if
end select

next
next
Set xml=Nothing
%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td><td></td><td></td><td></td></tr>
</table>
</form>
</div>
</div>
<%case "slide_list.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
S_id=trim(Request("S_id"))
if action="edit" then
For Each x In Request.Form 
if split(x,"_")(0)="title" then
conn.execute ("update SL_slide set S_title='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if
Next 
call box("修改成功!","page.asp?page=slide_list.asp","success")
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <font color="#0066ff"><u>焦点图管理</u></font> | <a href="page.asp?page=link_list.asp">友情链接</a> | <a href="page.asp?page=map.asp">网站地图</a></div>
<div class="content">
<h2>焦点图列表</h2><hr>
<form name="form1" method="post">
<%
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_slide where S_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 
if shu>0 then 
call box("删除成功","page.asp?page=slide_list.asp","success")
else 
call box("删除失败!","back","error")
end if 
end if
if action="del" then
conn.Execute ("delete from SL_slide where S_id="&S_id)
call box("删除成功","page.asp?page=slide_list.asp","success")
end if
sql="select * from SL_slide order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>显示名称</td><td>缩图</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("S_id")&"'></td><td><input type='text' value='"&rs("S_title")&"' name='title_"&rs("S_id")&"' style='width:150px;'></td><td><img src='../"&rs("S_pic")&"' width='50' alt='<img src=../"&rs("S_pic")&" width=400>'></td><td><a href='page.asp?page=slide_add.asp&S_id="&rs("S_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=slide_list.asp&action=del&S_id="&rs("S_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=slide_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=slide_list.asp&action=edit')">
<input type="button" value="新增一个焦点图" onclick="document.location.href='page.asp?page=slide_add.asp'">
</form>
</div>
</div>
<%case "slide_add.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
%>
<%
action=Request.QueryString("action")
S_id=Request.QueryString("S_id")

if S_id<>"" then
aa="edit&S_id="&S_id
sql="Select * from SL_slide Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_title=rs("S_title")
		S_content=rs("S_content")
		S_pic=rs("S_pic")
		S_thumb=rs("S_thumb")
		S_link=rs("S_link")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then
S_title=Request.Form("S_title")
S_pic=Request.Form("S_pic")
S_thumb=Request.Form("S_thumb")
S_link=Request.Form("S_link")
S_content=Request.Form("S_content")

if left(S_pic,5)="media" then
S_pic=S_pic
end if

if left(S_pic,4)="http" then
S_pic=S_pic
end if

if left(S_pic,1)="2" then
S_pic="media/"&S_pic
end if

if left(S_thumb,5)="media" then
S_thumb=S_thumb
end if

if left(S_thumb,4)="http" then
S_thumb=S_thumb
end if

if left(S_thumb,1)="2" then
S_thumb="media/"&S_thumb
end if


if S_title<>"" and S_pic<>"" and S_content<>"" then
sql="Insert into SL_slide(S_title,S_pic,S_content,S_thumb,S_link) values('"&S_title&"','"&S_pic&"','"&S_content&"','"&S_thumb&"','"&S_link&"')"
conn.execute(sql)
call box("添加幻灯成功!","page.asp?page=slide_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

if action="edit" then
S_title=Request.Form("S_title")
S_pic=Request.Form("S_pic")
S_thumb=Request.Form("S_thumb")
S_link=Request.Form("S_link")
S_content=Request.Form("S_content")


if left(S_pic,5)="media" then
S_pic=S_pic
end if

if left(S_pic,4)="http" then
S_pic=S_pic
end if

if left(S_pic,1)="2" then
S_pic="media/"&S_pic
end if

if left(S_thumb,5)="media" then
S_thumb=S_thumb
end if

if left(S_thumb,4)="http" then
S_thumb=S_thumb
end if

if left(S_thumb,1)="2" then
S_thumb="media/"&S_thumb
end if

if S_title<>"" and S_pic<>"" and S_content<>"" then
sql="Select * from SL_slide Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("S_title")=S_title
		rs("S_pic")=S_pic
		rs("S_thumb")=S_thumb
		rs("S_link")=S_link
		rs("S_content")=S_content
		rs.update
		rs.close
		end if
call box("修改幻灯成功!","page.asp?page=slide_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <font color="#0066ff"><u>焦点图管理</u></font> | <a href="page.asp?page=link_list.asp">友情链接</a>  | <a href="page.asp?page=map.asp">网站地图</a></div>
<div class="content">
<h2>添加焦点图</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=slide_add.asp&action=<%=aa%>" onsubmit="return check();">
	<table width="100%">

<tr><td width="8%">幻灯标题：</td><td><%call input("S_title",S_title)%></td></tr>
<tr><td width="8%">文字描述：</td>
  <td><%call textarea("S_content",S_content)%></td>
</tr>
<tr><td width="8%">幻灯大图：</td><td><%call input("S_pic",S_pic)%> <%call uploadpic("S_pic")%></td></tr>
<tr><td width="8%">链接到：</td><td><%call input("S_link",S_link)%></td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>

</table>
</form>
</div>
</div>
<%case "link_list.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
L_id=trim(Request("L_id"))

if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_link set L_title='"&Request.Form(x)&"' where L_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="url" then
conn.execute ("update SL_link set L_url='"&Request.Form(x)&"' where L_id="&split(x,"_")(1))
end if

Next 
call box("修改成功!","page.asp?page=link_list.asp","success")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <a href="page.asp?page=slide_list.asp">焦点图管理</a> | <font color="#0066ff"><u>友情链接</u></font>  | <a href="page.asp?page=map.asp">网站地图</a></div>
<div class="content">
<h2>友链列表</h2><hr>
<form name="form1" method="post">
<%


id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_link where L_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=link_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

if action="del" then
conn.Execute ("delete from SL_link where L_id="&L_id)

call box("删除成功!","page.asp?page=link_list.asp","success")
end if


sql="select * from SL_link order by L_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>网站名称</td><td>网址</td><td>缩图</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("L_id")&"'></td><td><input type='text' value='"&rs("L_title")&"' name='title_"&rs("L_id")&"' style='width:150px;'></td><td><input type='text' value='"&rs("L_url")&"' name='url_"&rs("L_id")&"' style='width:150px;'></td><td><img src='../"&rs("L_pic")&"' width='50' alt='<img src=../"&rs("L_pic")&" width=200>'></td><td><a href='page.asp?page=link_add.asp&L_id="&rs("L_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=link_list.asp&action=del&L_id="&rs("L_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=link_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=link_list.asp&action=edit')">
<input type="button" value="新增一个友链" onclick="document.location.href='page.asp?page=link_add.asp'">
</form>
</div>
</div>
<%case "link_add.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
L_id=Request.QueryString("L_id")

if L_id<>"" then
aa="edit&L_id="&L_id
sql="Select * from SL_link Where L_id="&L_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		L_title=rs("L_title")
		L_url=rs("L_url")
		L_pic=rs("L_pic")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then
L_title=Request.Form("L_title")
L_pic=Request.Form("L_pic")
L_thumb=Request.Form("L_thumb")
L_url=Request.Form("L_url")

if left(L_pic,5)="media" then
L_pic=L_pic
end if

if left(L_pic,4)="http" then
L_pic=L_pic
end if

if left(L_pic,1)="2" then
L_pic="media/"&L_pic
end if

if left(L_thumb,5)="media" then
L_thumb=L_thumb
end if

if left(L_thumb,4)="http" then
L_thumb=L_thumb
end if

if left(L_thumb,1)="2" then
L_thumb="media/"&L_thumb
end if


if L_title<>"" and L_pic<>"" and L_url<>"" then
sql="Insert into SL_Link(L_title,L_pic,L_url) values('"&L_title&"','"&L_pic&"','"&L_url&"')"
conn.execute(sql)
call box("添加友链成功!","page.asp?page=Link_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

if action="edit" then
L_title=Request.Form("L_title")
L_pic=Request.Form("L_pic")
L_thumb=Request.Form("L_thumb")
L_url=Request.Form("L_url")


if left(L_pic,5)="media" then
L_pic=L_pic
end if

if left(L_pic,4)="http" then
L_pic=L_pic
end if

if left(L_pic,1)="2" then
L_pic="media/"&L_pic
end if

if left(L_thumb,5)="media" then
L_thumb=L_thumb
end if

if left(L_thumb,4)="http" then
L_thumb=L_thumb
end if

if left(L_thumb,1)="2" then
L_thumb="media/"&L_thumb
end if

if L_title<>"" and L_pic<>"" and L_url<>"" then
sql="Select * from SL_Link Where L_id="&L_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("L_title")=L_title
		rs("L_pic")=L_pic
		rs("L_url")=L_url
		rs.update
		rs.close
		end if
call box("修改友链成功!","page.asp?page=Link_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <a href="page.asp?page=slide_list.asp">焦点图管理</a> | <font color="#0066ff"><u>友情链接</u></font>  | <a href="page.asp?page=map.asp">网站地图</a></div>
<div class="content">
<h2>添加友链</h2><hr>
	<table width="100%">
<form id="form" name="form1" method="post" action="page.asp?page=Link_add.asp&action=<%=aa%>" onsubmit="return check();">
<tr><td width="8%">网站名称：</td><td><%call input("L_title",L_title)%></td></tr>
<tr><td width="8%">友链网址：</td>
  <td><%call textarea("L_url",L_url)%></td>
</tr>
<tr><td width="8%">网站LOGO：</td><td><%call input("L_pic",L_pic)%><%call uploadpic("L_pic")%></td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</form>
</table>
</div>
</div>

<%case "map.asp"%>
<%
if CA_a1<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
if action="creat" then
call WriteToTextFile("../sitemap.xml",request.form("sitemap"),"utf-8")  
call box("地图已生成 http://"&C_domain&C_dir&"sitemap.xml","page.asp?page=map.asp","success")
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站设置</b> >> <a href="page.asp?page=config.asp">基本设置</a> | <a href="page.asp?page=index_config.asp">自定义设置</a> | <a href="page.asp?page=slide_list.asp">焦点图管理</a> | <a href="page.asp?page=link_list.asp">友情链接</a>  | <font color="#0066ff"><u>网站地图</u></font></div>
<div class="content">
<h2>生成网站地图（SiteMap）</h2><hr>

<%
sitemap=sitemap&"<?xml version=""1.0"" encoding=""UTF-8""?>"&vbCr&"<urlset xmlns=""http://www.sitemaps.org/schemas/sitemap/0.9"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"">"&vbCr
sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"]]></loc><priority>1.00</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr

sql="select * from SL_text order by T_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=text&S_id="&rs("T_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/text_"&rs("T_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

sql="select * from SL_form order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=form&S_id="&rs("F_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/form_"&rs("F_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

sql="select * from SL_nsort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=news&S_id="&rs("S_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/news_"&rs("S_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

sql="select * from SL_news order by N_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=newsinfo&S_id="&rs("N_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/newsinfo_"&rs("N_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

sql="select * from SL_psort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=product&S_id="&rs("S_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/product_"&rs("S_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

sql="select * from SL_product order by P_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if C_html=0 then
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=productinfo&S_id="&rs("P_id")&"]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		else
		sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/productinfo_"&rs("P_id")&".html]]></loc><priority>0.5</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
		end if
		rs.movenext
		loop
	end if
	rs.close
set rs=nothing

if C_html=0 then
sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=contact]]></loc><priority>1.00</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"?type=guestbook]]></loc><priority>1.00</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
else
sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/contact_1.html]]></loc><priority>1.00</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
sitemap=sitemap&"<url><loc><![CDATA[http://"&C_domain&C_dir&"html/"&C_template&"/guestbook_1.html]]></loc><priority>1.00</priority><lastmod>"&year(now())&"-"&month(now())&"-"&day(now())&"</lastmod><changefreq>weekly</changefreq></url>"&vbCr
end if
sitemap=sitemap&"</urlset>"
%>
<form name="form1" method="post" action="?page=map.asp&action=creat">
<textarea style="width:100%; height:500px;" name="sitemap"><%=sitemap%></textarea>
<input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="生成SiteMap" /> *请到“<a href="http://zhanzhang.baidu.com/" target="_blank">百度站长平台</a>”提交sitemap
</form>

</div>
</div>
<%case "text_list.asp"%>
<%
if CA_a2<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
T_id=trim(Request("T_id"))

if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_text set T_title='"&Request.Form(x)&"' where T_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="entitle" then
conn.execute ("update SL_text set T_entitle='"&Request.Form(x)&"' where T_id="&split(x,"_")(1))
end if
Next 

response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_text("")
end if
response.Write "</div>"
call box("修改成功!","page.asp?page=text_list.asp","success")
response.end()
end if

if action="add" then

sql="select * from SL_text where T_id="&T_id&" order by T_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		T_title=rs("T_title")
		T_entitle=rs("T_entitle")
		end if
		rs.close
set rs=nothing

conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&T_title&"','"&T_entitle&"',99,0,'bars','text',"&T_id&")")
call box("添加成功!","page.asp?page=menu_list.asp","success")
end if

if action="del" then

conn.Execute ("delete from SL_text where T_id="&T_id)
conn.Execute ("delete from SL_menu where U_type='text' and U_typeid="&T_id)
call box("删除成功!同时在主菜单删除","page.asp?page=text_list.asp","success")
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>简介管理</b> >>  <font color="#0066ff"><u>简介列表</u></font> | <a href="page.asp?page=text_add.asp">新增简介</a></div>
<div class="content">
<h2>文章列表</h2><hr>
<form name="form1" method="post">
<%

id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_text where T_id="&id(i) 
conn.execute(sql)
conn.Execute ("delete from SL_menu where U_type='text' and U_typeid="&id(i))
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=text_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

T_id=trim(Request("T_id"))
sql="select * from SL_text  where T_id="&T_id&" order by T_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		T_title=rs("T_title")
		T_entitle=rs("T_entitle")
		end if
		rs.close
set rs=nothing

sql="select * from SL_text order by T_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>显示名称</td><td>英文名称</td><td>插图</td><td>编辑</td><td>删除</td><td>添加到主菜单</td></tr>"
		Do while Not rs.eof

	response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("T_id")&"'></td><td><input type='text' value='"&rs("T_title")&"' name='title_"&rs("T_id")&"' style='width:150px;'></td><td><input type='text' value='"&rs("T_entitle")&"' name='entitle_"&rs("T_id")&"' style='width:150px;'></td><td><input type='hidden' value='"&rs("T_pic")&"' name='pic_"&rs("T_id")&"'><img src='../"&rs("T_pic")&"' width='100px' alt='<img src=../"&rs("T_pic")&" width=400>'></td><td><a href='page.asp?page=text_add.asp&T_id="&rs("T_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=text_list.asp&action=del&T_id="&rs("T_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td><a href='page.asp?page=text_list.asp&action=add&T_id="&rs("T_id")&"'class='add'><i class='fa fa-plus-circle'></i> 添加</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=text_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=text_list.asp&action=edit')">
</form>
</div>

</div>
</div>
<%case "text_add.asp"%>
<%
if CA_a2<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
T_id=Request.QueryString("T_id")
if T_id<>"" then
aa="edit&T_id="&T_id
sql="Select * from SL_text Where T_id="&T_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		T_title=rs("T_title")
		T_entitle=rs("T_entitle")
		T_content=rs("T_content")
		T_pic=rs("T_pic")
		T_keywords=rs("T_keywords")
		T_description=rs("T_description")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if

if action="add" then
T_title=Request.Form("T_title")
T_entitle=Request.Form("T_entitle")
T_content=Request.Form("T_content")
T_pic=Request.Form("T_pic")
T_keywords=Request.Form("T_keywords")
T_description=Request.Form("T_description")
U_sub=Request.Form("U_sub")

if left(T_pic,5)="media" then
T_pic=T_pic
else
T_pic="media/"&T_pic
end if

if T_title<>"" and T_content<>"" and T_pic<>"" then

sql="Select * from SL_text"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		rs.addnew
		rs("T_title")=T_title
		rs("T_entitle")=T_entitle
		rs("T_content")=T_content
		rs("T_pic")=T_pic
		rs("T_keywords")=T_keywords
		rs("T_description")=T_description
		rs.update
		rs.close
sql="Select top 1 * from SL_text order by T_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		T_id=rs("T_id")
		end if
		rs.close
set rs=nothing
conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&T_title&"','"&T_entitle&"',99,"&U_sub&",'bars','text',"&T_id&")")
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_text(T_id)
end if
response.Write "</div>"
call box("添加文章成功!同时添加到主菜单","page.asp?page=text_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

if action="edit" then
T_title=Request.Form("T_title")
T_entitle=Request.Form("T_entitle")
T_content=Request.Form("T_content")
T_pic=Request.Form("T_pic")
T_keywords=Request.Form("T_keywords")
T_description=Request.Form("T_description")
if left(T_pic,5)="media" then
T_pic=T_pic
else
T_pic="media/"&T_pic
end if

if T_title<>"" and T_content<>"" and T_pic<>""  then

sql="Select * from SL_text Where T_id="&T_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("T_title")=T_title
		rs("T_entitle")=T_entitle
		rs("T_content")=T_content
		rs("T_pic")=T_pic
		rs("T_keywords")=T_keywords
		rs("T_description")=T_description
		rs.update
		rs.close
		end if
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_text(T_id)
end if
response.Write "</div>"
call box("修改文章成功!","page.asp?page=text_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>简介管理</b> >>  <a href="page.asp?page=text_list.asp">简介列表</a> | <font color="#0066ff"><u>新增简介</u></font></div>
<div class="content">
<h2>添加文章</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=text_add.asp&action=<%=aa%>">
<table width="100%">
<tr><td width="12%">文章标题：</td><td><%call input("T_title",T_title)%></td></tr>
<tr><td width="12%">英文标题：</td><td><%call input("T_entitle",T_entitle)%></td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>关键词keywords：</td><td><%call input("T_keywords",T_keywords)%> *留空则继承主站keywords</td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>描述descriotion：</td><td><%call input("T_description",T_description)%> *留空则继承主站description</td></tr>
<tr><td width="12%">文章配图：</td><td><%call input("T_pic",T_pic)%> <%call uploadpic("T_pic")%></td></tr>
</table>
<%
call content("T_content",T_content)
%>
<table width="100%">
<%if T_id="" then%>
<tr><td width="8%">菜单所属：</td><td><select name="U_sub"><option value="0">网站主菜单</option>
			<%
				sql1="Select U_title,U_id from SL_menu where U_sub=0 order by U_order"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("U_id")%>" >┗ <%=rs1("U_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
			  <%end if%>
<tr><td width="12%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>

</table>
</form>
</div>
</div>
<%case "news_list.asp"%>
<%
if CA_a3<>1 then
response.Write "<div style='border:#FF0000 solid 1px;padding:10px;margin:10px;color:#FF0000'>您没有权限管理该模块！</div>"
response.end()
end if
Action=trim(Request("Action"))
if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_news set N_title='"&Request.Form(x)&"' where N_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="order" then
conn.execute ("update SL_news set N_order="&Request.Form(x)&" where N_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="sort" then
conn.execute ("update SL_news set N_sort="&Request.Form(x)&" where N_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="top" then
conn.execute ("update SL_news set N_top="&Request.Form(x)&" where N_id="&split(x,"_")(1))
end if

Next 

response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list("")
call creat_news_info("")
end if
response.Write "</div>"
call box("修改成功!","page.asp?page=news_list.asp","success")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>新闻管理</b> >>   <font color="#0066ff">新闻列表</u></font> | <a href="page.asp?page=news_add.asp">新增新闻</a> | <a href="page.asp?page=Nsort_list.asp">新闻分类列表</a> | <a href="page.asp?page=Nsort_add.asp">新增新闻分类</a></div>
<div class="content">
<h2>新闻列表</h2><hr>
<form action="?page=news_list.asp&action=search" method="post" style="float:right;">查询：<input type="text" name="N_search"> <select name="N_type">
<option value="N_title">标题</option>
<option value="N_author">作者</option>
<option value="N_id">文章ID</option>

</select> <input type="submit" value="确定"></form> <a href="page.asp?page=news_list.asp">所有分类</a> >> |
<%

id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_news where N_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=news_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if
S_id=Request.QueryString("S_id")
if S_id="" then
aa=""
else
aa="and S_id="&S_id
end if

sql="select * from SL_nsort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		response.Write "<a href='page.asp?page=news_list.asp&S_id="&rs("S_id")&"'>"&rs("S_title")&"</a> | "
		rs.movenext
		loop
	end if
rs.close
set rs=nothing
%>
<hr>
<form name="form1" method="post">
<%
Action=trim(Request("Action"))
N_id=trim(Request("N_id"))
N_search=request.Form("N_search")
N_type=request.Form("N_type")

if action="del" then
sql="select * from SL_news where N_id="&N_id
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
N_pic=rs("N_pic")
end if
rs.close
set rs=nothing
filedelete("../"&N_pic)
conn.Execute ("delete from SL_news where N_id="&N_id)
call box("删除成功!同时删除图片文件","page.asp?page=news_list.asp","success")
end if

if action="search" then
if N_search<>"" and N_type<>"" then
sql="select top 20  * from SL_news,SL_nsort where N_sort=S_id "&aa&" and "&N_type&" like '%"&N_search&"%' order by N_sort,N_order,N_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee' class='media'><tr bgcolor='#F7F7F7'><td>选择</td><td>排序</td><td>显示名称</td><td>审核</td><td>是否置顶</td><td>缩图</td><td>所属分类</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		
slide_sort="<select name='sort_"&rs("N_id")&"'>"
sql3="Select * from SL_nsort order by S_id"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs("S_id")=rs3("S_id") then
sort_select="selected='selected'"
else
sort_select=""
end if

slide_sort=slide_sort&"<option value='"&rs3("S_id")&"' "&sort_select&">"&rs3("S_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
slide_sort=slide_sort&"</select>"


if rs("N_top")=1 then
sort_select1="selected='selected'"
sort_select0=""
else
sort_select0="selected='selected'"
sort_select1=""
end if
news_top="<select name='top_"&rs("N_id")&"'>"
news_top=news_top&"<option value='1' "&sort_select1&">置顶</option>"
news_top=news_top&"<option value='0' "&sort_select0&">取消</option>"
news_top=news_top&"</select>"
		if rs("N_sh")=0 then
		sh_info="<font color='#009900'>已通过</font>"
		bg="#ffffff"
		end if
		if rs("N_sh")=1 then
		sh_info="<font color='#ff0000'>未通过</font>"
		bg="#FFEEEE"
		end if
		if rs("N_sh")=2 then
		sh_info="<font color='#ff9900'>未审核</font>"
		bg="#FFEED5"
		end if
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='"&bg&"'><td><input name='id' type='checkbox' id='id' value='"&rs("N_id")&"'></td><td><input type='text' value='"&rs("N_order")&"' name='order_"&rs("N_id")&"'  style='width:50px;'></td><td><textarea name='title_"&rs("N_id")&"' cols='50' rows='3'>"&rs("N_title")&"</textarea></td><td>"&sh_info&"</td><td>"&news_top&"</td><td><img src='../"&rs("N_pic")&"' width='50' alt='<img src=../"&rs("N_pic")&" width=400>'></td><td>"&slide_sort&"</td><td><a href='page.asp?page=news_add.asp&N_id="&rs("N_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=news_list.asp&action=del&N_id="&rs("N_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
else
call box("请输入相应内容!","back","error")
end if


else
sql="select top 20  * from SL_news,SL_nsort where N_sort=S_id "&aa&" order by N_sort,N_order,N_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee' class='media'><tr bgcolor='#F7F7F7'><td>选择</td><td>排序</td><td>显示名称</td><td>审核</td><td>是否置顶</td><td>缩图</td><td>所属分类</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		
slide_sort="<select name='sort_"&rs("N_id")&"'>"
sql3="Select * from SL_nsort order by S_id"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs("S_id")=rs3("S_id") then
sort_select="selected='selected'"
else
sort_select=""
end if

slide_sort=slide_sort&"<option value='"&rs3("S_id")&"' "&sort_select&">"&rs3("S_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
slide_sort=slide_sort&"</select>"


if rs("N_top")=1 then
sort_select1="selected='selected'"
sort_select0=""
else
sort_select0="selected='selected'"
sort_select1=""
end if
news_top="<select name='top_"&rs("N_id")&"'>"
news_top=news_top&"<option value='1' "&sort_select1&">置顶</option>"
news_top=news_top&"<option value='0' "&sort_select0&">取消</option>"
news_top=news_top&"</select>"

		if rs("N_sh")=0 then
		sh_info="<font color='#009900'>已通过</font>"
		bg="#ffffff"
		end if
		if rs("N_sh")=1 then
		sh_info="<font color='#ff0000'>未通过</font>"
		bg="#FFEEEE"
		end if
		if rs("N_sh")=2 then
		sh_info="<font color='#ff9900'>未审核</font>"
		bg="#FFEED5"
		end if
		
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='"&bg&"'><td><input name='id' type='checkbox' id='id' value='"&rs("N_id")&"'></td><td><input type='text' value='"&rs("N_order")&"' name='order_"&rs("N_id")&"'  style='width:50px;'></td><td><textarea name='title_"&rs("N_id")&"' cols='50' rows='3'>"&rs("N_title")&"</textarea></td><td>"&sh_info&"</td><td>"&news_top&"</td><td><img src='../"&rs("N_pic")&"' width='50' alt='<img src=../"&rs("N_pic")&" width=400>'></td><td>"&slide_sort&"</td><td><a href='page.asp?page=news_add.asp&N_id="&rs("N_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=news_list.asp&action=del&N_id="&rs("N_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
end if
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=news_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=news_list.asp&action=edit')">
</form>
</div>
</div>
	<script type="text/javascript">  
    $(document).ready(function(){  
        var range = 50;             //距下边界长度/单位px  
        var elemt = 500;           //插入元素高度/单位px  
        var maxnum = 200;            //设置加载最多次数  
        var num = 2;  
        var totalheight = 0; 

        var main = $(".media");                     //主体元素  
        $(window).scroll(function(){  
            var srollPos = $(window).scrollTop();    //滚动条距顶部距离(页面超出窗口的高度)  
            totalheight = parseFloat($(window).height()) + parseFloat(srollPos);  
            if(($(document).height()-range) <= totalheight  && num != maxnum) { 
            $.getJSON("ajax.asp",{p:num,s:<%=S_id or "0"%>,ajax:1,t:"news"},function(data){            	
            	$.each(data,function(index,val){
            	body='<tr onmouseout="this.style.backgroundColor=\'\'" onmouseover="this.style.backgroundColor=\'#F7F7F7\'" bgcolor="'+val.bg+'"><td><input name="id" type="checkbox" id="id" value="'+val.N_id+'"></td><td><input type="text" value="'+val.N_order+'" name="order_'+val.N_id+'"  style="width:50px;"></td><td><textarea name="title_'+val.N_id+'" cols="50" rows="3">'+val.N_title+'</textarea></td><td>'+val.N_sh+'</td><td>'+val.N_top+'</td><td><img src="../'+val.N_pic+'" width="50" alt="<img src=../'+val.N_pic+' width=400>"></td><td>'+val.N_select+'</td><td><a href="page.asp?page=news_add.asp&N_id='+val.N_id+'" class="edit"><i class="fa fa-edit"></i> 编辑</a></td><td><a href="javascript:;" onclick="swal({title: \'\',text: \'确定要删除吗？\',type: \'warning\',showCancelButton: true},function(){window.location.href=\'page.asp?page=news_list.asp&action=del&N_id='+val.N_id+'\';});" class="del"><i class="fa fa-times-circle"></i> 删除</a></td></tr>'
				
             main.append(body);  
            	});
            },'json');            
                num++;  
            }  
        });  
    });  
    </script>  
	
<%case "news_add.asp"%>
<%
if CA_a3<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
N_id=Request.QueryString("N_id")

if N_id<>"" then
aa="edit&N_id="&N_id
sql="Select * from SL_news Where N_id="&N_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		N_title=rs("N_title")
		N_author=rs("N_author")
		N_view=rs("N_view")
		N_content=rs("N_content")
		N_short=rs("N_short")
		N_pic=rs("N_pic")
		N_sort=rs("N_sort")
		N_date=rs("N_date")
		N_top=rs("N_top")
		N_sh=rs("N_sh")
		end if
		rs.close
set rs=nothing
else
aa="add"
N_date=now()
end if
		
if action="add" then
N_title=Request.Form("N_title")
N_author=Request.Form("N_author")
N_view=Request.Form("N_view")
N_date=Request.Form("N_date")
N_content=Request.Form("N_content")
N_pic=Request.Form("N_pic")
N_sort=Request.Form("N_sort")
N_top=Request.Form("N_top")
N_sh=Request.Form("N_sh")
if Request.Form("N_short")="" then
N_short=left(LoseHtml(N_content),200)
else
N_short=Request.Form("N_short")
end if

if left(N_pic,5)="media" then
N_pic=N_pic
else
N_pic="media/"&N_pic
end if

if N_view="" then
N_view=0
end if

if N_title<>"" and N_content<>"" and N_pic<>"" and N_sort<>"" then

sql="Select * from SL_news"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		rs.addnew
		rs("N_title")=N_title
		rs("N_author")=N_author
		rs("N_view")=N_view
		rs("N_content")=N_content
		rs("N_short")=N_short
		rs("N_pic")=N_pic
		rs("N_sort")=N_sort
		rs("N_date")=N_date
		rs("N_top")=N_top
		rs("N_sh")=N_sh
		rs.update
		rs.close
		sql="Select top 1 * from SL_news order by N_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		N_id=rs("N_id")
		N_sort=rs("N_sort")
		end if
		rs.close
		set rs=nothing
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list(N_sort)
call creat_news_info(N_id)
end if
response.Write "</div>"
call box("添加新闻成功!","page.asp?page=news_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if
if action="edit" then
N_title=Request.Form("N_title")
N_author=Request.Form("N_author")
N_view=Request.Form("N_view")
N_date=Request.Form("N_date")
N_content=Request.Form("N_content")
N_pic=Request.Form("N_pic")
N_sort=Request.Form("N_sort")
N_top=Request.Form("N_top")
N_sh=Request.Form("N_sh")
if Request.Form("N_short")="" then
N_short=left(LoseHtml(N_content),200)
else
N_short=Request.Form("N_short")
end if
if left(N_pic,5)="media" then
N_pic=N_pic
else
N_pic="media/"&N_pic
end if
if N_view="" then
N_view=0
end if

if N_title<>"" and N_content<>"" and N_pic<>"" and N_sort<>"" then
sql="Select * from SL_news Where N_id="&N_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("N_title")=N_title
		rs("N_author")=N_author
		rs("N_view")=N_view
		rs("N_content")=N_content
		rs("N_short")=N_short
		rs("N_pic")=N_pic
		rs("N_sort")=N_sort
		rs("N_date")=N_date
		rs("N_top")=N_top
		rs("N_sh")=N_sh
		rs.update
		rs.close
		end if
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list(N_sort)
call creat_news_info(N_id)
end if
response.Write "</div>"
call box("修改新闻成功!","page.asp?page=news_list.asp&S_id="&N_sort&"","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>新闻管理</b> >>  <a href="page.asp?page=news_list.asp">新闻列表</a> | <font color="#0066ff"><u>新增新闻</u></font> | <a href="page.asp?page=Nsort_list.asp">新闻分类列表</a> | <a href="page.asp?page=Nsort_add.asp">新增新闻分类</a></div>
<div class="content">
<h2>添加新闻</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=news_add.asp&action=<%=aa%>" onsubmit="return check();">
<table width="100%">
<tr><td width="12%">新闻标题：</td><td><%call input("N_title",N_title)%></td></tr>
<tr><td width="12%">新闻作者：</td><td><%call input("N_author",N_author)%></td></tr>
<tr><td width="12%">阅读次数：</td><td><%call input("N_view",N_view)%></td></tr>
<tr><td width="12%">是否置顶：</td><td> 
<%call radio("N_top",1,N_top)%> 置顶 
<%call radio("N_top",0,N_top)%> 取消
</td></tr>
<tr><td width="12%">是否审核：</td><td> 
<%call radio("N_sh",0,N_sh)%>已通过 
<%call radio("N_sh",1,N_sh)%>未通过 
<%call radio("N_sh",2,N_sh)%>未审核

</td></tr>
<tr><td width="12%">发布时间：</td><td><%call input("N_date",N_date)%></td></tr>
<tr><td width="12%">新闻概述<br>（建议200字以内）：</td><td><%call textarea("N_short",N_short)%> *留空则自动提取新闻前200字</td></tr>
</table>
<%
call content("N_content",N_content)
%>
<table width="100%"><tr><td width="12%">新闻图片：</td><td><%call input("N_pic",N_pic)%><%call uploadpic("N_pic")%> </td></tr>
<tr><td width="12%">新闻分类：</td><td><select name="N_sort">
			<%
				sql1="Select S_title,S_id from SL_nsort"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("S_id")%>" <%if cstr(rs1("S_id"))=cstr(N_sort) then%>selected="selected"<%end if%>><%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
<tr><td width="12%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
</div>

</div>
<%case "nsort_list.asp"%>
<%
if CA_a3<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>新闻管理</b> >>   <a href="page.asp?page=news_list.asp">新闻列表</a> | <a href="page.asp?page=news_add.asp">新增新闻</a> | <font color="#0066ff"><u>新闻分类列表</u></font> | <a href="page.asp?page=Nsort_add.asp">新增新闻分类</a></div>
<div class="content">
<h2>新闻分类列表</h2><hr>
<form action="page.asp?page=Nsort_list.asp&action=edit" method="post" onSubmit="submitonce()">
<%
Action=trim(Request("Action"))
S_id=trim(Request("S_id"))
sql="select * from SL_nsort where S_id="&S_id&" order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_title=rs("S_title")
		S_entitle=rs("S_entitle")
		end if
		rs.close
set rs=nothing
		
		
if action="add" then
conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&S_title&"','"&S_entitle&"',99,0,'bars','news',"&S_id&")")
call box("添加成功!","page.asp?page=menu_list.asp","success")
end if

if action="del" then
conn.Execute ("delete from SL_nsort where S_id="&S_id)
conn.Execute ("delete from SL_menu where U_type='news' and U_typeid="&S_id)
conn.Execute ("delete from SL_news where N_sort="&S_id)
call box("删除成功!同时在主菜单删除","page.asp?page=Nsort_list.asp","success")
end if

if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_nsort set S_title='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="entitle" then
conn.execute ("update SL_nsort set S_entitle='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if

Next 

response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list("")
end if
response.Write "</div>"
call box("修改成功!","page.asp?page=Nsort_list.asp","success")
response.end()
end if

sql="select * from SL_nsort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>显示名称</td><td>英文名称</td><td>编辑</td><td>删除</td><td>添加到主菜单</td></tr>"
		Do while Not rs.eof

		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input type='text' value='"&rs("S_title")&"' name='title_"&rs("S_id")&"' style='width:150px;'></td><td><input type='text' value='"&rs("S_entitle")&"' name='entitle_"&rs("S_id")&"' style='width:150px;'></td><td><a href='page.asp?page=Nsort_add.asp&S_id="&rs("S_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=Nsort_list.asp&action=del&S_id="&rs("S_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td><a href='page.asp?page=Nsort_list.asp&action=add&S_id="&rs("S_id")&"'class='add'><i class='fa fa-plus-circle'></i> 添加</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
rs.close
set rs=nothing
		
%>
*注意：删除新闻分类的同时，该分类下所有的新闻条目也会删除，该分类在主菜单的栏目名也会删除。
<input name="Submit" type="submit" class="submit" id="sub" onmouseover="this.className='submit2'" onmouseout="this.className='submit'" style="float:right; margin-top:10px;"  value="保存修改" />
</form>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>


</div>
</div>
<%case "nsort_add.asp"%>
<%
if CA_a3<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
S_id=Request.QueryString("S_id")

if S_id<>"" then
aa="edit&S_id="&S_id
sql="Select * from SL_nsort Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_title=rs("S_title")
		S_entitle=rs("S_entitle")
		S_description=rs("S_description")
		S_keywords=rs("S_keywords")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then
S_title=Request.Form("S_title")
S_entitle=Request.Form("S_entitle")
S_description=Request.Form("S_description")
S_keywords=Request.Form("S_keywords")
U_sub=Request.Form("U_sub")
if S_title<>"" then

conn.execute("Insert into SL_nsort(S_title,S_entitle,S_description,S_keywords) values('"&S_title&"','"&S_entitle&"','"&S_description&"','"&S_keywords&"')")
sql="Select top 1 * from SL_nsort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_id=rs("S_id")
		end if
		rs.close
set rs=nothing
conn.Execute("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&S_title&"','"&S_entitle&"',99,"&U_sub&",'bars','news',"&S_id&")")
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list(S_id)
end if
response.Write "</div>"
call box("添加新闻分类成功!同时添加到主菜单","page.asp?page=Nsort_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

if action="edit" then
S_title=Request.Form("S_title")
S_entitle=Request.Form("S_entitle")
S_description=Request.Form("S_description")
S_keywords=Request.Form("S_keywords")
if S_title<>"" then

sql="Select * from SL_nsort Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("S_title")=S_title
		rs("S_entitle")=S_entitle
		rs("S_description")=S_description
		rs("S_keywords")=S_keywords
		rs.update
		rs.close
		end if	
		
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_news_list(S_id)
end if
response.Write "</div>"	
call box("修改分类成功!","page.asp?page=Nsort_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>新闻管理</b> >>   <a href="page.asp?page=news_list.asp">新闻列表</a> | <a href="page.asp?page=news_add.asp">新增新闻</a> | <a href="page.asp?page=Nsort_list.asp">新闻分类列表</a> | <font color="#0066ff"><u>新增新闻分类</u></font></div>
<div class="content">
<h2>添加新闻分类</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=Nsort_add.asp&action=<%=aa%>" onSubmit="submitonce()">
<table width="100%">
<tr><td width="12%">新闻分类标题：</td><td><%call input("S_title",S_title)%></td></tr>
<tr><td width="12%">英文标题：</td><td><%call input("S_entitle",S_entitle)%></td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>关键词keywords：</td><td><%call input("S_keywords",S_keywords)%> *留空则继承主站keywords</td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>描述descriotion：</td><td><%call input("S_description",S_description)%> *留空则继承主站description</td></tr>

<%if S_id="" then%>
<tr><td width="8%">菜单所属：</td><td><select name="U_sub"><option value="0">网站主菜单</option>
			<%
				sql1="Select U_title,U_id from SL_menu where U_sub=0 order by U_order"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("U_id")%>" >┗ <%=rs1("U_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
			  <%end if%>
<tr><td width="12%"></td><td><input name="Submit" type="submit" id="sub" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
</div>
</div>
<%case "product_list.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="buy" then
conn.execute ("update SL_product set P_buy="&Request.Form(x)&" where P_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="title" then
conn.execute ("update SL_product set P_title='"&Request.Form(x)&"' where P_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="price" then
conn.execute ("update SL_product set P_price="&Request.Form(x)&" where P_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="order" then
conn.execute ("update SL_product set P_order="&Request.Form(x)&" where P_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="sort" then
conn.execute ("update SL_product set P_sort="&Request.Form(x)&" where P_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="top" then
conn.execute ("update SL_product set P_top="&Request.Form(x)&" where P_id="&split(x,"_")(1))
end if

Next 

response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list("")
call creat_product_info("")
end if
response.Write "</div>"
call box("修改成功!","page.asp?page=product_list.asp","success")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <font color="#0066ff"><u>产品列表</u></font> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <a href="page.asp?page=order_list.asp">订单管理</a></div>
<div class="content">
<h2>产品列表</h2><hr>
请从右侧搜索产品 →
<form action="?page=product_list.asp&action=search" method="post" style="float:right;">查询：<input type="text" name="P_search"> <select name="P_type">
<option value="P_title">产品名</option>
<option value="P_price">产品价格</option>
<option value="P_id">产品ID</option>
</select> <input type="submit" value="确定"></form> 
<hr>
<%
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_product where P_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=product_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

S_id=Request.QueryString("S_id")
if S_id="" then
aa=""
else
aa="and S_id="&S_id
end if
%>

<table width="100%"><tr align=""><td width="20%" valign="top">
<table width='100%' bgcolor='#eeeeee'>
<tr bgcolor='#F7F7F7'><td>产品分类</td></tr>
<%
sql1="select * from SL_Psort where S_sub=0 order by S_id desc"
set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.open sql1,conn,1,1
if not rs1.eof then
Do while Not rs1.eof
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#EFF2FE'><td><b>"&rs1("S_title")&"</b></td></tr>"
sql="select * from SL_Psort where S_sub="&rs1("S_id")&" order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		sql2="select count(P_id) as P_count from SL_product where P_sort="&rs("S_id")
		set rs2=Server.CreateObject("ADODB.RecordSet")
rs2.open sql2,conn,1,1
if not rs2.eof then
P_count=rs2("P_count")
end if
rs2.close
set rs2=nothing
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td> ┗ <a href='page.asp?page=product_list.asp&S_id="&rs("S_id")&"'>"&rs("S_title")&"</a>（"&P_count&"）</td></tr> "
		rs.movenext
		loop
	end if
rs.close
set rs=nothing

rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
</table>

</td><td width="80%" valign="top">
<form name="form1" method="post">
<%
Action=trim(Request("Action"))
P_id=trim(Request("P_id"))
P_search=request.Form("P_search")
P_type=request.Form("P_type")

if action="del" then

conn.Execute ("delete from SL_product where P_id="&P_id)
call box("删除成功!","page.asp?page=product_list.asp&S_id="&rs("S_id")&"","success")
end if

if action="search" then
if P_search<>"" and P_type<>"" then
sql="select  top 20 * from SL_product,SL_Psort where P_sort=S_id "&aa&"  and "&P_type&" like '%"&P_search&"%' order by P_sort,P_order,P_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee' class='media'><tr bgcolor='#F7F7F7'><td>选择</td><td>排序</td><td>显示名称</td><td>是否置顶</td><td>价格</td><td>开启购买</td><td>缩图</td><td>所属分类</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		
product_sort="<select name='sort_"&rs("P_id")&"'>"
sql3="Select * from SL_Psort where not S_sub=0 order by S_id"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs("S_id")=rs3("S_id") then
sort_select="selected='selected'"
else
sort_select=""
end if

product_sort=product_sort&"<option value='"&rs3("S_id")&"' "&sort_select&">"&rs3("S_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
product_sort=product_sort&"</select>"

if rs("P_top")=1 then
sort_select1="selected='selected'"
sort_select0=""
else
sort_select0="selected='selected'"
sort_select1=""
end if
news_top="<select name='top_"&rs("P_id")&"'>"
news_top=news_top&"<option value='1' "&sort_select1&">置顶</option>"
news_top=news_top&"<option value='0' "&sort_select0&">取消</option>"
news_top=news_top&"</select>"

response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("P_id")&"'></td><td><input type='text' value='"&rs("P_order")&"' name='order_"&rs("P_id")&"'  style='width:50px;'></td><td><input type='text' value='"&rs("P_title")&"' name='title_"&rs("P_id")&"' style='width:200px;'></td><td>"&news_top&"</td><td><input type='text' value='"&formatnumber(rs("P_price"),2,-1)&"' name='price_"&rs("P_id")&"'  style='width:50px;'></td><td><input type='radio' name='buy_"&rs("P_id")&"' value='1'"
if rs("P_buy")=1 then
response.Write "checked='checked'"
end if
response.Write "/>开 <input type='radio' name='buy_"&rs("P_id")&"' value='0'"
if rs("P_buy")=0 then
response.Write "checked='checked'"
end if
response.Write " />关</td><td><input type='hidden' value='"&rs("P_thumb")&"' name='thumb_"&rs("P_id")&"'><input type='hidden' value='"&rs("P_path")&"' name='pic_"&rs("P_id")&"'><img src='../"&rs("P_thumb")&"' width='50' alt='<img src=../"&rs("P_path")&" width=400>'></td><td>"&product_sort&"</td><td><a href='page.asp?page=product_add.asp&P_id="&rs("P_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=product_list.asp&action=del&P_id="&rs("P_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
else
call box("请输入搜索信息!","back","error")
end if
else
sql="select  top 20 * from SL_product,SL_Psort where P_sort=S_id "&aa&" order by P_sort,P_order,P_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee' class='media'><tr bgcolor='#F7F7F7'><td>选择</td><td>排序</td><td>显示名称</td><td>是否置顶</td><td>价格</td><td>开启购买</td><td>缩图</td><td>所属分类</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		
product_sort="<select name='sort_"&rs("P_id")&"'>"
sql3="Select * from SL_Psort where not S_sub=0 order by S_id"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs("S_id")=rs3("S_id") then
sort_select="selected='selected'"
else
sort_select=""
end if

product_sort=product_sort&"<option value='"&rs3("S_id")&"' "&sort_select&">"&rs3("S_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
product_sort=product_sort&"</select>"

if rs("P_top")=1 then
sort_select1="selected='selected'"
sort_select0=""
else
sort_select0="selected='selected'"
sort_select1=""
end if
news_top="<select name='top_"&rs("P_id")&"'>"
news_top=news_top&"<option value='1' "&sort_select1&">置顶</option>"
news_top=news_top&"<option value='0' "&sort_select0&">取消</option>"
news_top=news_top&"</select>"

response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("P_id")&"'></td><td><input type='text' value='"&rs("P_order")&"' name='order_"&rs("P_id")&"'  style='width:50px;'></td><td><input type='text' value='"&rs("P_title")&"' name='title_"&rs("P_id")&"' style='width:200px;'></td><td>"&news_top&"</td><td><input type='text' value='"&formatnumber(rs("P_price"),2,-1)&"' name='price_"&rs("P_id")&"'  style='width:50px;'></td><td><input type='radio' name='buy_"&rs("P_id")&"' value='1'"
if rs("P_buy")=1 then
response.Write "checked='checked'"
end if
response.Write "/>开 <input type='radio' name='buy_"&rs("P_id")&"' value='0'"
if rs("P_buy")=0 then
response.Write "checked='checked'"
end if
response.Write " />关</td><td><input type='hidden' value='"&rs("P_thumb")&"' name='thumb_"&rs("P_id")&"'><input type='hidden' value='"&rs("P_path")&"' name='pic_"&rs("P_id")&"'><img src='../"&rs("P_thumb")&"' width='50' alt='<img src=../"&rs("P_path")&" width=400>'></td><td>"&product_sort&"</td><td><a href='page.asp?page=product_add.asp&P_id="&rs("P_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=product_list.asp&action=del&P_id="&rs("P_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
end if
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=product_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=product_list.asp&action=edit')">
</form>
</td></tr></table>
</div>
</div>
	<script type="text/javascript">  
    $(document).ready(function(){  
        var range = 50;             //距下边界长度/单位px  
        var elemt = 500;           //插入元素高度/单位px  
        var maxnum = 200;            //设置加载最多次数  
        var num = 2;  
        var totalheight = 0; 

        var main = $(".media");                     //主体元素  
        $(window).scroll(function(){  
            var srollPos = $(window).scrollTop();    //滚动条距顶部距离(页面超出窗口的高度)  
            totalheight = parseFloat($(window).height()) + parseFloat(srollPos);  
            if(($(document).height()-range) <= totalheight  && num != maxnum) { 
            $.getJSON("ajax.asp",{p:num,s:<%=S_id or "0"%>,t:"product"},function(data){            	
            	$.each(data,function(index,val){
				body='<tr onmouseout="this.style.backgroundColor=\'\'" onmouseover="this.style.backgroundColor=\'#F7F7F7\'" bgcolor="#ffffff"><td><input name="id" type="checkbox" id="id" value="'+val.P_id+'"></td><td><input type="text" value="'+val.P_order+'" name="order_'+val.P_id+'"  style="width:50px;"></td><td><input type="text" value="'+val.P_title+'" name="title_'+val.P_id+'" style="width:200px;"></td><td>'+val.P_top+'</td><td><input type="text" value="'+val.P_price+'" name="price_'+val.P_id+'"  style="width:50px;"></td><td>'+val.P_radio+'</td><td><input type="hidden" value="../'+val.P_thumb+'" name="thumb_'+val.P_id+'"><input type="hidden" value="'+val.P_path+'" name="pic_'+val.P_id+'"><img src="../'+val.P_path+'" width="50" alt="<img src=../'+val.P_path+' width=400>"></td><td>'+val.P_select+'</td><td><a href="page.asp?page=product_add.asp&P_id='+val.P_id+'" class="edit"><i class="fa fa-edit"></i> 编辑</a></td><td><a href="javascript:;" onclick="swal({title: \'\',text: \'确定要删除吗？\',type: \'warning\',showCancelButton: true},function(){window.location.href=\'page.asp?page=product_list.asp&action=del&P_id='+val.P_id+'\';});" class="del"><i class="fa fa-times-circle"></i> 删除</a></td></tr>'

             main.append(body);  
            	});
            },'json');            
                num++;  
            }  
        });  
    });  
    </script>  
<%case "product_add.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
P_id=Request.QueryString("P_id")

if P_id<>"" then
aa="edit&P_id="&P_id
sql="Select * from SL_product,SL_Psort Where P_sort=S_id and P_id="&P_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		P_title=rs("P_title")
		P_price=formatnumber(rs("P_price"),2,-1)
		P_buy=rs("P_buy")
		P_top=rs("P_top")
		P_content=rs("P_content")
		P_short=rs("P_short")
		P_path=rs("P_path")
		P_thumb=rs("P_thumb")
		P_sort=rs("P_sort")
		P_shuxing=rs("P_shuxing")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then

For Each x In Request.Form
if split(x,"_")(0)="sctitle" then
For Each y In Request.Form
if split(y,"_")(0)="scvvvv"&split(x,"_")(1) then
if Request.Form(y)="" then
call box("属性值不可留空!","back","error")
response.End()
else
sc=sc&Request.Form(y)&"|"
end if
end if
next
sc=left(sc,len(sc)-1)
For Each y In Request.Form
if split(y,"_")(0)="spvvvv"&split(x,"_")(1) then
if Request.Form(y)="" then
call box("对价格的影响不可留空!","back","error")
response.End()
else
sp=sp&Request.Form(y)&"|"
end if
end if
next
sp=left(sp,len(sp)-1)

if Request.Form(x)="" then
call box("属性名称不可留空!","back","error")
response.End()
else
shuxing=shuxing&Request.Form(x)&"_"&sc&"_"&sp&"@"
end if

end if
sc=""
sp=""
Next 
shuxing=left(shuxing,len(shuxing)-1)


P_title=Request.Form("P_title")
P_price=Request.Form("P_price")
P_buy=Request.Form("P_buy")
P_top=Request.Form("P_top")
P_content=Request.Form("P_content")
P_path=Request.Form("P_path")
P_thumb=Request.Form("P_thumb")
P_sort=Request.Form("P_sort")

if P_price="" then
P_price=0
end if

if Request.Form("P_short")="" then
P_short=left(LoseHtml(P_content),200)
else
P_short=Request.Form("P_short")
end if


if left(P_path,5)="media" then
P_path=P_path
else
P_path="media/"&P_path
end if

if left(P_thumb,5)="media" then
P_thumb=P_thumb
else
P_thumb="media/"&P_thumb
end if

if P_title<>"" and P_content<>"" and P_path<>"" and P_thumb<>"" and P_sort<>"" then

sql="Select * from SL_product"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		rs.addnew
		rs("P_title")=P_title
		rs("P_price")=P_price
		rs("P_buy")=P_buy
		rs("P_top")=P_top
		rs("P_content")=P_content
		rs("P_short")=P_short
		rs("P_path")=P_path
		rs("P_thumb")=P_thumb
		rs("P_sort")=P_sort
		rs("P_shuxing")=shuxing
		rs("P_order")=0
		rs.update
		rs.close

sql="Select top 1 * from SL_product order by P_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		P_id=rs("P_id")
		P_sort=rs("P_sort")
		end if
		rs.close
		set rs=nothing
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list(P_sort)
call creat_product_info(P_id)
end if
response.Write "</div>"
call box("添加产品成功!","page.asp?page=product_list.asp&S_id="&P_sort&"","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

if action="edit" then
For Each x In Request.Form
if split(x,"_")(0)="sctitle" then
For Each y In Request.Form
if split(y,"_")(0)="scvvvv"&split(x,"_")(1) then
if Request.Form(y)="" then
call box("属性值不可留空!","back","error")
response.End()
else
sc=sc&Request.Form(y)&"|"
end if
end if
next
sc=left(sc,len(sc)-1)
For Each y In Request.Form
if split(y,"_")(0)="spvvvv"&split(x,"_")(1) then
if Request.Form(y)="" then
call box("对价格的影响不可留空!","back","error")
response.End()
else
sp=sp&Request.Form(y)&"|"
end if
end if
next
sp=left(sp,len(sp)-1)

if Request.Form(x)="" then
call box("属性名称不可留空!","back","error")
response.End()
else
shuxing=shuxing&Request.Form(x)&"_"&sc&"_"&sp&"@"
end if

end if
sc=""
sp=""
Next 
shuxing=left(shuxing,len(shuxing)-1)

if shuxing="" then
shuxing=null
end if

P_title=Request.Form("P_title")
P_price=Request.Form("P_price")
P_buy=Request.Form("P_buy")
P_top=Request.Form("P_top")
P_content=Request.Form("P_content")
P_path=Request.Form("P_path")
P_thumb=Request.Form("P_thumb")
P_sort=Request.Form("P_sort")

if P_price="" then
P_price=0
end if

if Request.Form("P_short")="" then
P_short=left(LoseHtml(P_content),200)
else
P_short=Request.Form("P_short")
end if

if left(P_path,5)="media" then
P_path=P_path
else
P_path="media/"&P_path
end if


if left(P_thumb,5)="media" then
P_thumb=P_thumb
else
P_thumb="media/"&P_thumb
end if

if P_title<>"" and P_content<>"" and P_path<>"" and P_thumb<>"" and P_sort<>"" then

sql="Select * from SL_product Where P_id="&P_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("P_title")=P_title
		rs("P_price")=P_price
		rs("P_buy")=P_buy
		rs("P_top")=P_top
		rs("P_content")=P_content
		rs("P_short")=P_short
		rs("P_path")=P_path
		rs("P_thumb")=P_thumb
		rs("P_sort")=P_sort
		rs("P_shuxing")=shuxing
		rs.update
		rs.close
		end if
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list(P_sort)
call creat_product_info(P_id)
end if
response.Write "</div>"
call box("修改产品成功!","page.asp?page=product_list.asp&S_id="&P_sort&"","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

%>
<script> 
function AddRow()
{
 //添加一行
 var i =tab1.rows.length;
 var Nam="'div1'";
 var Cod="fuJ"+i;
 var newTr = tab1.insertRow();
 var _id='pd'+i;
 var newTd0 = newTr.insertCell();
 var newTd1 = newTr.insertCell();
 var newTd2 = newTr.insertCell();
 newTr.id=_id;
 newTr.setAttribute("bgcolor", "#FFFFFF");
 newTr.setAttribute("onmouseout", "this.style.backgroundColor=''");
 newTr.setAttribute("onmouseover", "this.style.backgroundColor='#F7F7F7'");
 
 newTd0.innerHTML = "属性名称：<input type='text' name='sctitle_"+i+"' value='' class='input3'/>";
 newTd1.innerHTML ="<table width='100%' bgcolor='#FFFFFF' id='table"+i+"'><tr id='pd"+i+"_0"+"' bgcolor='#eeeeee' onmouseout='this.style.backgroundColor=\"\"' onmouseover='this.style.backgroundColor=\"#FFFFFF\"'><td>属性值：<input type='text' name='scvvvv"+i+"_0' value='' class='input3'/></td><td>对价格的影响：<input type='text' name='spvvvv"+i+"_0' value='' class='input4'/>元</td><td><input type='button' value='- 删掉该行' onclick='DelRow2(\"table"+i+"\",\""+i+"_0"+"\")' style='margin:5px;'/></td></tr></table><div><input type='button' value='＋ 新增一行' onclick='AddRow2(\"table"+i+"\","+i+")' style='margin:5px;'/></div>";
 
 newTd2.innerHTML = "<input type='button' value='- 删掉该属性' onclick='DelRow("+i+")' style='margin:5px;'/>";

}

function AddRow2(tab,j)
{
 var Container = document.getElementById(tab);	
 var i =Container.rows.length;
 var Nam="'div1'";
 var Cod="fuJ"+i;
 var newTr = Container.insertRow();
 var _id='pd'+j+"_"+i;

 var newTd0 = newTr.insertCell();
 var newTd1 = newTr.insertCell();
 var newTd2 = newTr.insertCell();
 newTr.id=_id;
 newTr.setAttribute("bgcolor", "#EEEEEE");
 newTr.setAttribute("onmouseout", "this.style.backgroundColor=''");
 newTr.setAttribute("onmouseover", "this.style.backgroundColor='#FFFFFF'");
 
 newTd0.innerHTML = "属性值：<input type='text' name='scvvvv"+j+"_"+i+"' value='' class='input3'/>";
 newTd1.innerHTML ="对价格的影响：<input type='text' name='spvvvv"+j+"_"+i+"' value='' class='input4'/>元";
 newTd2.innerHTML = "<input type='button' value='- 删掉该行' onclick='DelRow2(\""+tab+"\",\""+j+"_"+i+"\")' style='margin:5px;'/>";

}

function DelRow(i)
{
	var Container = document.getElementById("tab1");		
		var _tr=document.getElementById("pd"+i);	
		row=_tr.rowIndex;
		Container.deleteRow(row);	
}
function DelRow2(tab,i)
{
	    var Container = document.getElementById(tab);		
		var _tr=document.getElementById("pd"+i);	
		row=_tr.rowIndex;
		Container.deleteRow(row);	
}
function sayHello(name) {
form.P_content.value=name;
}
function changecity(){
 index = form1.Province.options.selectedIndex-1;
 form1.City.length = City[index].length;
 for(var i = 0;i<City[index].length;i++)
  {
   var text = City[index][i].split("-");
   form1.City.options[i].text = text[0];
   form1.City.options[i].value =text[1];
  }
}
var City = new Array(
<%
j=0
sql="Select * from SL_PSort where S_sub=0"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
Do while Not rs.eof
response.Write "new Array("

i=0
sql1="Select * from SL_PSort where S_sub="&rs("S_id")
set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.open sql1,conn,1,1
if not rs1.eof then
Do while Not rs1.eof
response.Write """"&rs1("S_title")&"-"&rs1("S_id")&""""

i=i+1
if i<rs1.recordcount then
response.Write ","
end if


rs1.movenext
loop
end if
rs1.close
set rs1=nothing

response.Write ")"
j=j+1
if j<rs.recordcount then
response.Write ","
end if

rs.movenext
loop
end if

rs.close
set rs=nothing

%>
);
</script>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <font color="#0066ff"><u>新增产品</u></font> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <a href="page.asp?page=order_list.asp">订单管理</a></div>
<div class="content">
<h2>添加产品</h2><hr>
<form id="form1" name="form1" method="post" action="page.asp?page=product_add.asp&action=<%=aa%>" onSubmit="return check();">
<table width="100%">
<tr><td width="12%">产品标题：</td><td><%call input("P_title",P_title)%></td></tr>
<tr><td width="12%">产品价格：</td><td><%call input("P_price",P_price)%> 元</td></tr>
<tr><td width="12%">开启购买：</td><td>
<%call radio("P_buy",1,P_buy)%>开启 
<%call radio("P_buy",0,P_buy)%>关闭 
</td></tr>
<tr><td width="12%">是否置顶：</td><td> 
<%call radio("P_top",1,P_top)%>置顶
<%call radio("P_top",0,P_top)%>取消
</td></tr>
<tr><td width="12%">产品概述：<br>（建议200字以内）</td><td>
<%call textarea("P_short",P_short)%>
 *留空则自动提取产品描述前200字</td></tr>
</table>
<%
call content("P_content",P_content)
%>
<table width="100%">
<tr><td width="12%">产品大图：</td><td><%call input("P_path",P_path)%><%call uploadpic("P_path")%></td></tr>
<tr><td width="12%">产品小图：</td><td><%call input("P_thumb",P_thumb)%><%call uploadpic("P_thumb")%></td></tr>
<tr><td width="12%">产品属性：</td><td>
<table width="100%" bgcolor='#eeeeee' id="tab1">
<tr bgcolor='#F7F7F7'><td>属性名称</td><td>属性值 / 对价格的影响</td><td>删除该属性</td></tr>
<%
shuxing=split(P_shuxing,"@")
if shuxing(0)="" then
else
For j = 0 To UBound(shuxing)
response.Write "<tr id='pd"&j+1&"' onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#FFFFFF'><td>属性名称：<input type='text' name='sctitle_"&j&"' value='"&split(shuxing(j),"_")(0)&"' class='input3'/></td><td>"
response.Write "<table width='100%' bgcolor='#FFFFFF' id='table"&j&"'>"
sc=split(split(shuxing(j),"_")(1),"|")
sp=split(split(shuxing(j),"_")(2),"|")
For i = 0 To UBound(sc)
response.Write "<tr id='pd"&j&"_"&i&"' bgcolor='#eeeeee' onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#FFFFFF""'><td>属性值：<input type='text' name='scvvvv"&j&"_"&i&"' value='"&sc(i)&"' class='input3'/></td><td>对价格的影响：<input type='text' name='spvvvv"&j&"_"&i&"' value='"&sp(i)&"' class='input4'/>元</td><td><input type='button' value='- 删掉该行' onclick='DelRow2(""table"&j&""","""&j&"_"&i&""")' style='margin:5px;'/></td></tr>"
Next
response.Write "</table>"
response.Write "<div><input type='button' value='＋ 新增一行' onclick='AddRow2(""table"&j&""","&j&")' style='margin:5px;'/></div></td><td><input type='button' value='- 删掉该属性' onclick='DelRow("&j+1&")' style='margin:5px;'/></td></tr>"
Next
end if
%>
</table>
<input type="button" value="＋ 新增一个属性" onclick="AddRow()" style="margin:5px;" /> <a href="javascript:void(0);" onClick="swal({title:'',text:'填写示例<br><table width=100%><tr><td>属性名称：容量</td><td>属性值：16G</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：32G</td><td>对价格影响：1000元</td></tr><tr><td></td><td>属性值：64G</td><td>对价格影响：2000元</td></tr><tr><td>属性名称：颜色</td><td>属性值：灰色</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：银色</td><td>对价格影响：100元</td></tr><tr><td></td><td>属性值：金色</td><td>对价格影响：200元</td></tr><tr><td>属性名称：运营商</td><td>属性值：移动</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：联通</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：全网通</td><td>对价格影响：100元</td></tr></table>说明：<br>“属性值”和“属性名称/对价格影响”支持多条，支持动态增删，不限制条数，可留空',html: true});"><img src="img/q.png" alt="填写示例<br><table width='500'><tr><td>属性名称：容量</td><td>属性值：16G</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：32G</td><td>对价格影响：1000元</td></tr><tr><td></td><td>属性值：64G</td><td>对价格影响：2000元</td></tr><tr><td>属性名称：颜色</td><td>属性值：灰色</td><td>对价格影响：0元</td></tr><tr><td></td><td>属性值：银色</td><td>对价格影响：100元</td></tr><tr><td></td><td>属性值：金色</td><td>对价格影响：200元</td></tr></table>"></a>
</td></tr>
<tr><td width="12%">产品分类：</td><td>
<select name="P_sorts" id="Province"  onchange="changecity()" >
<option value="">请选择</option>
<%
sql="Select * from SL_PSort where S_id="&P_sort
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
S_sub=rs("S_sub")
rs.close
set rs=nothing
				sql1="Select S_title,S_id from SL_PSort where S_sub=0"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("S_id")%>" <%if cstr(rs1("S_id"))=cstr(S_sub) then%>selected="selected"<%end if%>><%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select>
<SELECT name="P_sort" id="City">
<OPTION value="">请选择</OPTION>
<%
sql="Select * from SL_PSort where S_sub="&S_sub
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
for i=1 to rs.recordcount

%>
<option value="<%=rs("S_id")%>" <%if cstr(rs("S_id"))=cstr(P_sort) then%>selected="selected"<%end if%>><%=rs("S_title")%></option>
<%
rs.movenext
next
end if
rs.close
set rs=nothing
%>
</SELECT>
</td></tr>
<tr><td width="12%"></td><td><input type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
</div>
</div>
<%case "product_add2.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#FF0000 solid 1px;padding:10px;margin:10px;color:#FF0000'>您没有权限管理该模块！</div>"
response.end()
end if
%>
<script> 
function sayHello(name) {
form.P_content.value=name;
}
function changecity(){
 index = form1.Province.options.selectedIndex-1;
 form1.select.length = select[index].length;
 for(var i = 0;i<select[index].length;i++)
  {
   var text = select[index][i].split("-");
   form1.select.options[i].text = text[0];
   form1.select.options[i].value =text[1];
  }
}
var select = new Array(
<%
j=0
sql="Select * from SL_PSort where S_sub=0"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
Do while Not rs.eof
response.Write "new Array("

i=0
sql1="Select * from SL_PSort where S_sub="&rs("S_id")
set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.open sql1,conn,1,1
if not rs1.eof then
Do while Not rs1.eof
response.Write """"&rs1("S_title")&"-"&rs1("S_id")&""""

i=i+1
if i<rs1.recordcount then
response.Write ","
end if


rs1.movenext
loop
end if
rs1.close
set rs1=nothing

response.Write ")"
j=j+1
if j<rs.recordcount then
response.Write ","
end if

rs.movenext
loop
end if

rs.close
set rs=nothing

%>
);
</script>
<script language="javascript">
function challs_flash_update(){ //Flash 初始化函数
	var a={};
	//定义变量为Object 类型

	a.title = "上传文件"; //设置组件头部名称
	
	a.FormName = "Filedata";
	//设置Form表单的文本域的Name属性
	
	a.url="../upload/update.asp"; 
	//设置服务器接收代码文件
	
	a.parameter="bs=tyi&id=50"; 
	//设置提交参数，以GET形式提交
	
	a.typefile=["Images (*.gif,*.png,*.jpg,*jpeg)","*.gif;*.png;*.jpg;*.jpeg;","GIF (*.gif)","*.gif;","PNG (*.png)","*.rar;","JPEG (*.jpg,*.jpeg)","*.jpg;*.jpeg;"];
	//设置可以上传文件 数组类型
	//"Images (*.gif,*.png,*.jpg)"为用户选择要上载的文件时可以看到的描述字符串,
	//"*.gif;*.png;*.jpg"为文件扩展名列表，其中列出用户选择要上载的文件时可以看到的 Windows 文件格式，以分号相隔
	//2个为一组，可以设置多组文件类型
	
	a.UpSize=0;
	//可限制传输文件总容量，0或负数为不限制，单位MB
	
	a.fileNum=0;
	//可限制待传文件的数量，0或负数为不限制
	
	a.size=2;
	//上传单个文件限制大小，单位MB，可以填写小数类型
	
	a.FormID=['select','select2'];
	//设置每次上传时将注册了ID的表单数据以POST形式发送到服务器
	//需要设置的FORM表单中checkbox,text,textarea,radio,select项目的ID值,radio组只需要一个设置ID即可
	//参数为数组类型，注意使用此参数必须有 challs_flash_FormData() 函数支持
	
	a.autoClose=1;
	//上传完成条目，将自动删除已完成的条目，值为延迟时间，以秒为单位，当值为 -1 时不会自动关闭，注意：当参数CompleteClose为false时无效
	
	a.CompleteClose=false;
	//设置为true时，上传完成的条目，将也可以取消删除条目，这样参数 UpSize 将失效, 默认为false
	
	a.repeatFile=true;
	//设置为true时，可以过滤用户已经选择的重复文件，否则可以让用户多次选择上传同一个文件，默认为false
	
	a.returnServer=true;
	//设置为true时，组件必须等到服务器有反馈值了才会进行下一个步骤，否则不会等待服务器返回值，直接进行下一步骤，默认为false
	
	a.MD5File = 1;
	//设置MD5文件签名模式，参数如下
	//0为关闭MD5计算签名
	//1为直接计算MD5签名后上传
	//2为计算签名，将签名提交服务器验证，在根据服务器反馈来执行上传或不上传
	//3为先提交文件基本信息，根据服务器反馈，执行MD5签名计算或直接上传，如果是要进行MD5计算，计算后，提交计算结果，在根据服务器反馈，来执行是否上传或不上传
	
	a.loadFileOrder=true;
	//选择的文件加载文件列表顺序，TRUE = 正序加载，FALSE = 倒序加载
	
	a.mixFileNum=0;
	//至少选择的文件数量，设置这个将限制文件列表最少正常数量（包括等待上传和已经上传）为设置的数量，才能点击上传，0为不限制
	
	return a ;
	//返回Object
}

function challs_flash_onComplete(a){ //每次上传完成调用的函数，并传入一个Object类型变量，包括刚上传文件的大小，名称，上传所用时间,文件类型
	var name=a.fileName; //获取上传文件名
	var size=a.fileSize; //获取上传文件大小，单位字节
	var time=a.updateTime; //获取上传所用时间 单位毫秒
	var type=a.fileType; //获取文件类型，在 Windows 上，此属性是文件扩展名。 在 Macintosh 上，此属性是由四个字符组成的文件类型
	document.getElementById('show').innerHTML+=name+' --- '+size+'字节 ----文件类型：'+type+'--- 用时 '+(time/1000)+'秒<br><br>'
}

function challs_flash_onCompleteData(a){ //获取服务器反馈信息事件
	document.getElementById('show').innerHTML+='<font color="#ff0000">服务器端反馈信息：</font><br />'+a+'<br />';	
}
function challs_flash_onStart(a){ //开始一个新的文件上传时事件,并传入一个Object类型变量，包括刚上传文件的大小，名称，类型
	var name=a.fileName; //获取上传文件名
	var size=a.fileSize; //获取上传文件大小，单位字节
	var type=a.fileType; //获取文件类型，在 Windows 上，此属性是文件扩展名。 在 Macintosh 上，此属性是由四个字符组成的文件类型
	document.getElementById('show').innerHTML+=name+'开始上传！<br />';
}

function challs_flash_onCompleteAll(a){ //上传文件列表全部上传完毕事件,参数 a 数值类型，返回上传失败的数量
	document.getElementById('show').innerHTML+='<font color="#ff0000">所有文件上传完毕，</font>上传失败'+a+'个！<br />';
	//window.location.href='http://www.access2008.cn/update'; //传输完成后，跳转页面
}

function challs_flash_onError(a){ //上传文件发生错误事件，并传入一个Object类型变量，包括错误文件的大小，名称，类型
	var err=a.textErr; //错误信息
	var name=a.fileName; //获取上传文件名
	var size=a.fileSize; //获取上传文件大小，单位字节
	var type=a.fileType; //获取文件类型，在 Windows 上，此属性是文件扩展名。 在 Macintosh 上，此属性是由四个字符组成的文件类型
	document.getElementById('show').innerHTML+='<font color="#ff0000">'+name+' - '+err+'</font><br />';
}

function challs_flash_FormData(a){ // 使用FormID参数时必要函数
	try{
		var value = '';
		var id=document.getElementById(a);
		if(id.type == 'radio'){
			var name = document.getElementsByName(id.name);
			for(var i = 0;i<name.length;i++){
				if(name[i].checked){
					value = name[i].value;
				}
			}
		}else if(id.type == 'checkbox'){
			if(id.checked){
				value = id.value;
			}
		}else{
			value = id.value;
		}
		return value;
	 }catch(e){
		return '';
	 }
}

var isMSIE = (navigator.appName == "Microsoft Internet Explorer");   
function thisMovie(movieName){   
  if(isMSIE){   
  	return window[movieName];   
  }else{
  	return document[movieName];   
  }   
}
</script>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <font color="#0066ff"><u><b>批量上传产品</b></u></font> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <a href="page.asp?page=order_list.asp">订单管理</a></div>
<div class="content">
<h2>批量添加图片</h2><hr>
<table width="100%">
<tr><td width="12%">图片分类：</td><td>
<form id="form1">
<select name="P_sorts" id="Province"  onchange="changecity()" >
<option value="">请选择</option>
<%
sql="Select * from SL_PSort where S_id="&P_sort
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
S_sub=rs("S_sub")
rs.close
set rs=nothing
				
				
				sql1="Select S_title,S_id from SL_PSort where S_sub=0"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("S_id")%>" <%if cstr(rs1("S_id"))=cstr(S_sub) then%>selected="selected"<%end if%>><%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select>
			  
<SELECT name="P_sort" id="select">
<OPTION value="">请选择</OPTION>
</SELECT>
</form>
</td></tr>
<tr><td>选择文件</td>
<td>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="320" id="update" align="middle">
                  <param name="allowFullScreen" value="false" />
                  <param name="allowScriptAccess" value="always" />
                  <param name="movie" value="update.swf?domain=<%=D_domain%>" />
                  <param name="quality" value="high" />
                  <param name="bgcolor" value="#ffffff" />
                  <embed src="update.swf?domain=<%=D_domain%>" quality="high" bgcolor="#ffffff" width="100%" height="320" name="update" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />                
</object>
</td>
</tr>		  
<tr><td></td><td>批量上传功能每次能够处理多张图片，上传后图片标题以及描述与图片文件名一致，缩略图为自动生成。
</td></tr></table>
</div>
<div id="show" style="margin-top:20px; width:500px; text-align:left;"></div>
</div>
<%case "psort_list.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <font color="#0066ff"><u>产品分类列表</u></font> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <a href="page.asp?page=order_list.asp">订单管理</a></div>
<div class="content">
<h2>产品分类列表</h2><hr>
<form action="page.asp?page=Psort_list.asp&action=edit" method="post" onSubmit="submitonce()">
<%
Action=trim(Request("Action"))
S_id=trim(Request("S_id"))
sql="select * from SL_Psort where S_id="&S_id&" order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_title=rs("S_title")
		S_entitle=rs("S_entitle")
		end if
		rs.close
set rs=nothing
if action="add" then
conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&S_title&"','"&S_entitle&"',99,0,'bars','product',"&S_id&")")
call box("添加成功!","page.asp?page=menu_list.asp","success")
response.end()
end if

if action="del" then
conn.Execute ("delete from SL_Psort where S_id="&S_id)
conn.Execute ("delete from SL_Psort where S_sub="&S_id)
conn.Execute ("delete from SL_menu where U_type='product' and U_typeid="&S_id)
conn.Execute ("delete from SL_product where P_sort="&S_id)
conn.Execute ("delete from SL_product where P_sort in (select S_id from SL_psort where S_sub="&S_id&")")
call box("删除成功!同时在主菜单删除","page.asp?page=Psort_list.asp","success")
response.end()
end if

if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_Psort set S_title='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="entitle" then
conn.execute ("update SL_Psort set S_entitle='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="sub" then
conn.execute ("update SL_Psort set S_sub="&Request.Form(x)&" where S_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="order" then
conn.execute ("update SL_Psort set S_order="&Request.Form(x)&" where S_id="&split(x,"_")(1))
end if

Next 
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list("")
end if
response.Write "</div>"

call box("修改成功!","page.asp?page=Psort_list.asp","success")
response.end()
end if

sql="select * from SL_Psort where S_sub=0 order by S_order,S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>排序</td><td>显示名称</td><td>英文名称</td><td>封面图片</td><td>所属</td><td>编辑</td><td>删除</td><td>添加到主菜单</td></tr>"
		Do while Not rs.eof

response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#EFF2FE'><td><input type='text' value='"&rs("S_order")&"' name='order_"&rs("S_id")&"' style='width:30px;'></td><td><input type='text' value='"&rs("S_title")&"' name='title_"&rs("S_id")&"' style='width:150px;'></td><td><input type='text' value='"&rs("S_entitle")&"' name='entitle_"&rs("S_id")&"' style='width:150px;'></td><td>/</td><td><b>--根类别--</b></td><td><a href='page.asp?page=Psort_add.asp&S_id="&rs("S_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=Psort_list.asp&action=del&S_id="&rs("S_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td><a href='page.asp?page=Psort_list.asp&action=add&S_id="&rs("S_id")&"'class='add'><i class='fa fa-plus-circle'></i> 添加</a></td></tr>"
		
		sql1="select * from SL_Psort where S_sub="&rs("S_id")&" order by S_order,S_id"
		set rs1=Server.CreateObject("ADODB.RecordSet")
		rs1.open sql1,conn,1,1
		if not rs1.eof then
		Do while Not rs1.eof
		
S_sub="<select name='sub_"&rs1("S_id")&"'>"
sql3="Select * from SL_Psort where S_sub=0 order by S_id"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs("S_id")=rs3("S_id") then
sort_select="selected='selected'"
else
sort_select=""
end if

S_sub=S_sub&"<option value='"&rs3("S_id")&"' "&sort_select&">"&rs3("S_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
S_sub=S_sub&"</select>"

response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>┗<input type='text' value='"&rs1("S_order")&"' name='order_"&rs1("S_id")&"' style='width:30px;'></td><td>┗ <input type='text' value='"&rs1("S_title")&"' name='title_"&rs1("S_id")&"' style='width:150px;'></td><td>┗ <input type='text' value='"&rs1("S_entitle")&"' name='entitle_"&rs1("S_id")&"' style='width:150px;'></td><td><img src='../"&rs1("S_pic")&"' height='50' alt='<img src=../"&rs1("S_pic")&" width=400>'></td><td>"&S_sub&"</td><td><a href='page.asp?page=Psort_add.asp&S_id="&rs1("S_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='page.asp?page=Psort_list.asp&action=del&S_id="&rs1("S_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td><a href='page.asp?page=Psort_list.asp&action=add&S_id="&rs1("S_id")&"'class='add'><i class='fa fa-plus-circle'></i> 添加</a></td></tr>"
		rs1.movenext
		loop
	end if
rs1.close
set rs1=nothing
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
*注意：删除相册分类的同时，该分类下所有的产品也会删除，该分类在主菜单的栏目名也会删除。
<input name="Submit" type="submit" class="submit" id="sub" onmouseover="this.className='submit2'" onmouseout="this.className='submit'" style="float:right; margin-top:10px;"  value="保存修改" />
</form>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
<%case "psort_add.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
S_id=Request.QueryString("S_id")

if S_id<>"" then
aa="edit&S_id="&S_id
sql="Select * from SL_Psort Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_pic=rs("S_pic")
		S_title=rs("S_title")
		S_entitle=rs("S_entitle")
		S_order=rs("S_order")
		S_sub=rs("S_sub")
		S_description=rs("S_description")
		S_keywords=rs("S_keywords")
		end if
		rs.close
set rs=nothing
bb="and not S_id="&S_id
else
aa="add"
bb=""
end if
		
if action="add" then
S_pic=Request.Form("S_pic")
S_title=Request.Form("S_title")
S_entitle=Request.Form("S_entitle")
S_sub=Request.Form("S_sub")
S_order=Request.Form("S_order")
S_description=Request.Form("S_description")
S_keywords=Request.Form("S_keywords")
U_sub=Request.Form("U_sub")
if left(S_pic,5)="media" then
S_pic=S_pic
else
S_pic="media/"&S_pic
end if

if S_title<>"" then
conn.execute("Insert into SL_Psort(S_title,S_entitle,S_sub,S_order,S_pic,S_description,S_keywords) values('"&S_title&"','"&S_entitle&"',"&S_sub&","&S_order&",'"&S_pic&"','"&S_description&"','"&S_keywords&"')")
sql="Select top 1 * from SL_Psort order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_id=rs("S_id")
		end if
		rs.close
set rs=nothing
conn.Execute("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&S_title&"','"&S_entitle&"',99,"&U_sub&",'bars','product',"&S_id&")")
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list(S_id)
end if
response.Write "</div>"	
call box("添加分类成功!","page.asp?page=Psort_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if


if action="edit" then
S_pic=Request.Form("S_pic")
S_title=Request.Form("S_title")
S_entitle=Request.Form("S_entitle")
S_sub=Request.Form("S_sub")
S_order=Request.Form("S_order")
S_description=Request.Form("S_description")
S_keywords=Request.Form("S_keywords")

if left(S_pic,5)="media" then
S_pic=S_pic
else
S_pic="media/"&S_pic
end if
if S_title<>"" then

sql="Select * from SL_Psort Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("S_pic")=S_pic
		rs("S_title")=S_title
		rs("S_entitle")=S_entitle
		rs("S_sub")=S_sub
		rs("S_order")=S_order
		rs("S_description")=S_description
		rs("S_keywords")=S_keywords
		rs.update
		rs.close
		end if
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_product_list(S_id)
end if
response.Write "</div>"	
call box("修改分类成功!","page.asp?page=Psort_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <font color="#0066ff"><u>新增产品分类</u></font> | <a href="page.asp?page=order_list.asp">订单管理</a></div>
<div class="content">
<h2>添加产品分类</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=Psort_add.asp&action=<%=aa%>" onSubmit="submitonce()">
<table width="100%">
<tr><td width="10%">上级分类：</td><td>
<select name="S_sub" id="S_sub" onChange="cmbChange()">
<option value="0">--根类别--</option>
<%
				sql1="Select S_title,S_id from SL_PSort where S_sub=0 "&bb
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("S_id")%>" <%if cstr(rs1("S_id"))=cstr(S_sub) then%>selected="selected"<%end if%>><%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
		    </select>
</td></tr>
<tr><td width="10%">产品分类标题：</td><td><%call input("S_title",S_title)%></td></tr>
<tr><td width="10%">英文标题：</td><td><%call input("S_entitle",S_entitle)%></td></tr>
<tr><td width="10%">排序：</td><td><%call input("S_order",S_order)%></td></tr>
<tr bgcolor="#F7FFF7"><td width="10%"><b>SEO设置</b><br>关键词keywords：</td><td><%call input("S_keywords",S_keywords)%> *留空则继承主站keywords</td></tr>
<tr bgcolor="#F7FFF7"><td width="10%"><b>SEO设置</b><br>描述descriotion：</td><td><%call input("S_description",S_description)%> *留空则继承主站description</td></tr>
<tr id="pic_id"><td width="10%">产品分类封面：</td><td><%call input("S_pic",S_pic)%> <%call uploadpic("S_pic")%></td></tr>
<%if S_id="" then%>
<tr><td width="10%">菜单所属：</td><td><select name="U_sub"><option value="0">网站主菜单</option>
			<%
				sql1="Select U_title,U_id from SL_menu where U_sub=0 order by U_order"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("U_id")%>" >┗ <%=rs1("U_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
			  <%end if%>
<tr><td width="10%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'" id="sub"  value="确 认" /></td></tr></table>
</form>
</div>
</div>
<%case "form_list.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
if action="edit" then
For Each x In Request.Form 
if split(x,"_")(0)="Ctitle" then
conn.execute ("update SL_content set C_title='"&Request.Form(x)&"' where C_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="Ftitle" then
conn.execute ("update SL_form set F_title='"&Request.Form(x)&"' where F_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="Fentitle" then
conn.execute ("update SL_form set F_entitle='"&Request.Form(x)&"' where F_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="order" then
conn.execute ("update SL_content set C_order="&Request.Form(x)&" where C_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="module" then
conn.execute ("update SL_form set F_module='"&Request.Form(x)&"' where F_id="&split(x,"_")(1))
end if
Next 
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_form("")
end if
response.Write "</div>"
call box("修改成功!","page.asp?page=form_list.asp","success")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <font color="#0066ff"><u>表单列表</u></font> | <a href="page.asp?page=form_add.asp">新增表单</a> | <a href="page.asp?page=content_add.asp">新增条目</a> | <a href="page.asp?page=tj_list.asp">查看统计</a></div>
<div class="content">
<h2>表单列表</h2><hr>
<form name="form1" method="post">
<%
Action=trim(Request("Action"))
F_id=trim(Request("F_id"))
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from F_content where C_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=form_list.asp","success") 
response.End()
else 
call box("删除失败!","back","error")
response.End()
end if 
end if

sql="select * from SL_form where F_id="&F_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		F_title=rs("F_title")
		F_entitle=rs("F_entitle")
		end if
		rs.close
set rs=nothing
if action="add" then
conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&F_title&"','"&F_entitle&"',99,0,'bars','form',"&F_id&")")
call box("添加成功!","page.asp?page=menu_list.asp","success")
response.End()
end if

if action="del" then
conn.Execute ("delete from SL_form where F_id="&F_id)
conn.Execute ("delete from SL_menu where U_type='form' and U_typeid="&F_id)
conn.Execute ("delete from SL_content where C_fid="&F_id)
call box("删除成功!同时在主菜单删除","page.asp?page=form_list.asp","success")
response.End()
end if

sql="select * from SL_form order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>排序</td><td>显示名称</td><td>英文名称</td><td>展示方式</td><td>封面</td><td>管理条目</td><td>查看统计</td><td>生成excel</td><td>编辑</td><td>删除</td><td>添加到主菜单</td></tr>"
		Do while Not rs.eof
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#EFF2FE'><td>/</td><td>/</td><td><b><input type='text' value='"&rs("F_title")&"' name='Ftitle_"&rs("F_id")&"' style='width:150px;'></b></td><td><b><input type='text' value='"&rs("F_entitle")&"' name='Fentitle_"&rs("F_id")&"' style='width:150px;'></b></td><td></td><td><img src='../"&rs("F_pic")&"' alt='<img src=../"&rs("F_pic")&" width=400>' height='50'></td><td><a href='page.asp?page=content_list.asp&F_id="&rs("F_id")&"'><img src='img/edit.gif'><b>管理条目</b></a></td><td><a href='page.asp?page=response_list.asp&F_id="&rs("F_id")&"'><img src='img/scan.gif'> <b>查看统计</b></a></td><td><a href='page.asp?page=excel_list.asp&F_id="&rs("F_id")&"'><img src='img/excel.jpg'> <b>生成excel</b></a></td><td><a href='page.asp?page=form_add.asp&F_id="&rs("F_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='page.asp?page=form_list.asp&action=del&F_id="&rs("F_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td><a href='page.asp?page=form_list.asp&action=add&F_id="&rs("F_id")&"'class='add'><i class='fa fa-plus-circle'></i> 添加</a></td></tr>"
		
		sql2="select * from SL_content where C_fid="&rs("F_id")&" order by C_order"
		set rs2=Server.CreateObject("ADODB.RecordSet")
		rs2.open sql2,conn,1,1
		if not rs2.eof then
		Do while Not rs2.eof
		if rs2("C_type")="text" then
		C_type="文本框"
		end if
		
		if rs2("C_type")="area" then
		C_type="文本域"
		end if
		
		if rs2("C_type")="radio" then
		C_type="单选按钮"
		end if
		
		if rs2("C_type")="checkbox" then
		C_type="多选按钮"
		end if
		
	    if rs2("C_type")="option" then
		C_type="下拉列表"
		end if
		
		if rs2("C_type")="pic" then
		C_type="上传图片/文件"
		end if
		
		if rs2("C_type")="date" then
		C_type="选择日期"
		end if
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs2("C_id")&"'></td><td><input type='text' value='"&rs2("C_order")&"' name='order_"&rs2("C_id")&"'  style='width:50px;'></td><td>┗ <input type='text' value='"&rs2("C_title")&"' name='Ctitle_"&rs2("C_id")&"' style='width:150px;'></td><td></td><td>"&C_type&"</td><td></td><td></td><td></td><td></td><td><a href='page.asp?page=content_add.asp&C_id="&rs2("C_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=content_list.asp&action=del&C_id="&rs2("C_id")&"&F_id="&rs("F_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td><td></td></tr>"
		rs2.movenext
		loop
	end if
		rs2.close
set rs2=nothing
		
		
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=form_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=form_list.asp&action=edit')">
<input type="button" onclick="document.location.href='page.asp?page=form_add.asp'" value="新增一个表单"> <input type="button" onclick="document.location.href='page.asp?page=content_add.asp'" value="新增一个条目">
</form>

*注意：删除表单的同时，该表单下所有的条目也会删除，该分类在主菜单的栏目名也会删除。
</div>
</div>
<%case "content_list.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <a href="page.asp?page=form_list.asp">表单列表</a> | <a href="page.asp?page=form_add.asp">新增表单</a> | <a href="page.asp?page=content_add.asp">新增条目</a> | <a href="page.asp?page=tj_list.asp">查看统计</a></div>
<div class="content">
<%
F_id=request.QueryString("F_id")
sql="select * from SL_form where F_id="&F_id
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
F_title=rs("F_title")
end if
rs.close
set rs=nothing

%>
<h2><%F_title%>条目列表</h2>
<%

id=request.QueryString("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_content where C_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
response.Write("<script>alert('删除成功');location.href='content_list.asp?F_id="&F_id&"';</script>") 
else 
response.write("<Script>alert('删除失败');javascript:history.back();</script>") 
end if 
end if
if F_id="" then
aa=""
else
aa="and F_id="&F_id
end if
%>
<hr><form action="content_list.asp">
<%
Action=trim(Request("Action"))
C_id=trim(Request("C_id"))
F_id=Request("F_id")


if action="del" then
conn.Execute ("delete from SL_content where C_id="&C_id)
conn.Execute ("delete from SL_response where R_cid="&C_id)
Response.Write"<script>alert('删除成功!');window.location='content_list.asp?F_id="&F_id&"';</script>"
end if


sql="select F_id,C_id,C_order,C_title,F_title,C_type from SL_content,SL_form where C_fid=F_id "&aa&" order by C_order"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>序号</td><td>显示名称</td><td>所属分类</td><td>类型</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		if rs("C_type")="text" then
		C_type="文本框"
		end if
		
		if rs("C_type")="area" then
		C_type="文本域"
		end if
		
		if rs("C_type")="radio" then
		C_type="单选按钮"
		end if
		
		if rs("C_type")="checkbox" then
		C_type="多选按钮"
		end if
		
	    if rs("C_type")="option" then
		C_type="下拉列表"
		end if
		
		if rs("C_type")="pic" then
		C_type="上传图片/文件"
		end if
		
		if rs("C_type")="date" then
		C_type="选择日期"
		end if
		
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("C_id")&"'></td><td>"&rs("C_order")&"</td><td>"&rs("C_title")&"</td><td>"&rs("F_title")&"</td><td>"&C_type&"</td><td><a href='page.asp?page=content_add.asp&C_id="&rs("C_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='page.asp?page=content_list.asp&action=del&C_id="&rs("C_id")&"&F_id="&rs("F_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="submit" value="删除所选"> <input type="button" onclick="document.location.href='page.asp?page=content_add.asp'" value="新增一个条目"><br>
</form>
</div>
</div>


<%case "form_add.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")
F_id=Request.QueryString("F_id")

if F_id<>"" then
aa="edit&F_id="&F_id
sql="Select * from SL_form Where F_id="&F_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		F_title=rs("F_title")
		F_entitle=rs("F_entitle")
		F_bz=rs("F_bz")
		F_yz=rs("F_yz")
		F_pic=rs("F_pic")
		F_module=rs("F_module")
		F_keywords=rs("F_keywords")
		F_description=rs("F_description")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then
F_title=Request.Form("F_title")
F_entitle=Request.Form("F_entitle")
F_bz=Request.Form("F_bz")
F_yz=Request.Form("F_yz")
F_pic=Request.Form("F_pic")
F_keywords=Request.Form("F_keywords")
F_desription=Request.Form("F_description")
U_sub=Request.Form("U_sub")
if left(F_pic,5)="media" then
F_pic=F_pic
else
F_pic="media/"&F_pic
end if


if F_title<>"" then
sql="Insert into SL_form(F_title,F_entitle,F_bz,F_yz,F_pic,F_keywords,F_description) values('"&F_title&"','"&F_entitle&"','"&F_bz&"',1,'"&F_pic&"','"&F_keywords&"','"&F_description&"')"
conn.execute(sql)
sql="Select top 1 * from F_form order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		F_id=rs("F_id")
		end if
		rs.close
set rs=nothing
conn.Execute("insert into menu1(U_title,U_entitle,U_order,U_sub,U_ico,U_type,U_typeid) values('"&F_title&"','"&F_entitle&"',99,"&U_sub&",'bars','form',"&F_id&")")

response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_form(F_id)
end if
response.Write "</div>"

call box("添加表单成功!","page.asp?page=form_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

if action="edit" then
F_title=Request.Form("F_title")
F_entitle=Request.Form("F_entitle")
F_bz=Request.Form("F_bz")
F_yz=Request.Form("F_yz")
F_pic=Request.Form("F_pic")
F_description=Request.Form("F_description")
F_keywords=Request.Form("F_keywords")

if left(F_pic,5)="media" then
F_pic=F_pic
else
F_pic="media/"&F_pic
end if

if F_title<>"" then
sql="Select * from SL_form Where F_id="&F_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("F_title")=F_title
		rs("F_entitle")=F_entitle
		rs("F_bz")=F_bz
		rs("F_yz")=F_yz
		rs("F_pic")=F_pic
		rs("F_keywords")=F_keywords
		rs("F_description")=F_description
		rs.update
		rs.close
		end if		
		
response.Write "<div style='display:none'>"
if C_html=1 then
call creat_index()
call creat_form(F_id)
end if
response.Write "</div>"
call box("修改表单成功!","page.asp?page=form_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <a href="page.asp?page=form_list.asp">表单列表</a> | <font color="#0066ff"><u>新增表单</u></font> | <a href="page.asp?page=content_add.asp">新增条目</a> | <a href="page.asp?page=tj_list.asp">查看统计</a></div>
<div class="content">
<h2>添加/编辑表单</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=form_add.asp&action=<%=aa%>" onsubmit="return check();">
<table width="100%">
<tr><td width="10%">表单标题：</td><td><%call input("F_title",F_title)%></td></tr>
<tr><td width="10%">英文标题：</td><td><%call input("F_entitle",F_entitle)%></td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>关键词keywords：</td><td><%call input("F_keywords",F_keywords)%> *留空则继承主站keywords</td></tr>
<tr bgcolor="#F7FFF7"><td width="12%"><b>SEO设置</b><br>描述descriotion：</td><td><%call input("F_description",F_description)%> *留空则继承主站description</td></tr>
<tr><td width="10%">开启登录验证：</td><td>
<%call radio("F_yz",1,F_yz)%>开启 
<%call radio("F_yz",0,F_yz)%>关闭 
</td></tr>
<tr><td width="10%">表单备注：</td><td>
<%call textarea("F_bz",F_bz)%><%call help("解释表单标题的内容")%>
</td></tr>
<tr><td width="10%">表单配图：</td><td><%call input("F_pic",F_pic)%> <%call uploadpic("F_pic")%></td></tr>
<%if F_id="" then%>
<tr><td width="10%">菜单所属：</td><td><select name="U_sub"><option value="0">网站主菜单</option>
			<%
				sql1="Select U_title,U_id from SL_menu where U_sub=0 order by U_order"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("U_id")%>" >┗ <%=rs1("U_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
			  <%end if%>
<tr><td width="10%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
</div>
</div>
<%case "content_add.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
C_id=Request.QueryString("C_id")
F_id=Request.QueryString("F_id")
if C_id<>"" then
aa="edit&C_id="&C_id
sql="Select * from SL_content Where C_id="&C_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		C_title2=rs("C_title")
		C_content2=rs("C_content")
		C_type=rs("C_type")
		C_bz=rs("C_bz")
		C_fid=rs("C_fid")
		C_order=rs("C_order")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
if action="add" then
C_title=Request.Form("C_title")
C_content=Request.Form("C_content")
C_type=Request.Form("C_type")
C_bz=Request.Form("C_bz")
C_fid=Request.Form("C_fid")
C_order=Request.Form("C_order")
if C_title<>"" and C_order<>"" then
sql="Insert into SL_content(C_title,C_content,C_type,C_bz,C_fid,C_order) values('"&C_title&"','"&C_content&"','"&C_type&"','"&C_bz&"',"&C_fid&","&C_order&")"
conn.execute(sql)
call box("添加条目成功!","page.asp?page=content_list.asp&F_id="&C_fid&"","success")
else
call box("请填全信息！","back","error")
end if
end if
if action="edit" then
C_title=Request.Form("C_title")
C_content=Request.Form("C_content")
C_type=Request.Form("C_type")
C_bz=Request.Form("C_bz")
C_fid=Request.Form("C_fid")
C_order=Request.Form("C_order")
if C_title<>"" and C_order<>"" then
sql="Select * from SL_content Where C_id="&C_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("C_title")=C_title
		rs("C_content")=C_content
		rs("C_type")=C_type
		rs("C_bz")=C_bz
		rs("C_fid")=C_fid
		rs("C_order")=C_order
		rs.update
		rs.close
		end if
call box("修改条目成功!","page.asp?page=content_list.asp&F_id="&C_fid&"","success")
else
call box("请填全信息！","back","error")
end if
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <a href="page.asp?page=form_list.asp">表单列表</a> | <a href="page.asp?page=form_add.asp">新增表单</a> | <font color="#0066ff"><u>新增条目</u></font> | <a href="page.asp?page=tj_list.asp">查看统计</a></div>
<div class="content">
<h2>添加/编辑条目</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=content_add.asp&action=<%=aa%>" onsubmit="return check();">
<table width="100%">
<tr><td width="12%">条目标题：</td><td><%call input("C_title",C_title2)%></td></tr>
<tr><td width="12%">条目备注：</td><td><textarea name='C_bz' cols='80' rows='3' onpropertychange="if(this.scrollHeight>80) this.style.posHeight=this.scrollHeight+5"><%=C_bz%></textarea>  <a href="javascript:void(0);" onClick="swal('','解释条目标题的内容');"><img src="img/q.png" alt="解释条目标题的内容"></a></td></tr>
<tr><td width="12%">条目内容：</td><td><textarea name='C_content' cols='80' rows='3' onpropertychange="if(this.scrollHeight>80) this.style.posHeight=this.scrollHeight+5"><%=C_content2%></textarea> <a href="javascript:void(0);" onClick="swal('','条目类型为“文本框”、“文本域”、“上传图片”、“选择时间”时留空；条目类型为“单选按钮”、“多选按钮”、“下拉列表”时用“|”符号分开选项');"><img src="img/q.png" alt="条目类型为“文本框”、“文本域”、“上传图片”、“选择时间”时留空<br>条目类型为“单选按钮”、“多选按钮”、“下拉列表”时用“|”符号分开选项"></a></td></tr>
<tr><td width="12%">条目编号：</td><td><%call input("C_order",C_order)%><%call help("填写大于0的整数，数字越小排序越靠前")%></td></tr>
<tr><td width="12%">条目类型：</td><td>
<%call radio("C_type","text",C_type)%>文本框
<%call radio("C_type","area",C_type)%>文本域
<%call radio("C_type","radio",C_type)%>单选按钮
<%call radio("C_type","checkbox",C_type)%>多选按钮
<%call radio("C_type","option",C_type)%>下拉列表
<%call radio("C_type","pic",C_type)%>上传图片/文件
<%call radio("C_type","date",C_type)%>选择时间
</td></tr>
<tr><td width="12%">条目所属：</td><td><select name="C_fid">
			<%
				sql1="Select F_title,F_id from SL_form"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("F_id")%>" <%if cstr(rs1("F_id"))=cstr(C_fid) then%>selected="selected"<%end if%>><%=rs1("F_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
<tr><td width="12%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
</div>

</div>
<%case "tj_list.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <a href="page.asp?page=form_list.asp">表单列表</a> | <a href="page.asp?page=form_add.asp">新增表单</a> | <a href="page.asp?page=content_add.asp">新增条目</a> | <font color="#0066ff"><u>查看统计</u></font></div>
<div class="content">
<h2>查看统计</h2><hr>
<%

sql="select F_title,F_id from SL_form order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>显示名称</td><td>查看统计</td><td>生成excel文件</td></tr>"
		Do while Not rs.eof
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&rs("F_title")&"</td><td><a href='page.asp?page=response_list.asp&F_id="&rs("F_id")&"' class='add'><i class='fa fa-sign-out'></i> 查看统计</a></td><td><a href='page.asp?page=excel_list.asp&F_id="&rs("F_id")&"'class='edit'><i class='fa fa-file-excel-o'></i> 生成excel文件</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
rs.close
set rs=nothing
		
%>
</div>
</div>
<%case "response_list.asp"%>
<%
if CA_a5<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Function MoveR(Rstr) 
Dim i,SpStr 
SpStr = Split(Rstr,"|") 
For i = 0 To Ubound(Spstr) 
If I = 0 then 
MoveR = MoveR & SpStr(i) & "|" 
Else 
If instr(MoveR,SpStr(i))=0 and i=Ubound(Spstr) Then 
MoveR = MoveR & SpStr(i) 
Elseif instr(MoveR,SpStr(i))=0 Then 
MoveR = MoveR & SpStr(i) & "|" 
End If 
End If 
Next 
End Function
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>表单系统</b> >>   <a href="page.asp?page=form_list.asp">表单列表</a> | <a href="page.asp?page=form_add.asp">新增表单</a> | <a href="page.asp?page=content_add.asp">新增条目</a> | <font color="#0066ff"><u>查看统计</u></font></div>
<div class="content">

<%
Action=trim(Request("Action"))
F_id=trim(Request("F_id"))
R_rid=trim(Request("R_rid"))

if action="del" then
conn.Execute ("delete from SL_response where R_rid like '"&R_rid&"'")
call box("删除成功!","page.asp?page=response_list.asp&F_id="&F_id&"","success")
response.End()
end if

id=request("id")



if not id="" then
id=Split(replace(id," ",""),",") 
shu=0 

For Each x In id
sql="delete from SL_response where R_rid like '"&x&"'"
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=response_list.asp&F_id="&F_id&"","success") 
response.End()
else 
call box("删除失败!","back","error")
response.End()
end if 
end if

sql="select * from SL_form where F_id="&F_id&" order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		F_title=rs("F_title")
		end if
		rs.close
set rs=nothing
%>
<h2><%=F_title%>-统计</h2><hr>
<form name="form1" method="post">
<%

response.Write("<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>会员</td>")
sql="select * from SL_content where C_Fid="&F_id&" order by C_order"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		response.Write "<td>"&rs("C_title")&"</td>"
		rs.movenext
		loop
	end if
rs.close
set rs=nothing
response.Write "<td>提交时间</td><td>删除</td></tr>"
'------------------
sql="select R_time,R_rid,R_member,M_login from SL_response,SL_content,SL_member where R_Cid=C_id and R_member=M_id and C_fid="&F_id&" order by R_time"
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		
line=line&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("R_rid")&"'></td><td>"&rs("M_login")&"</td>"
sql1="select * from SL_response,SL_content where R_Cid=C_id and R_rid like '"&rs("R_rid")&"' order by C_order"
set rs1=Server.CreateObject("ADODB.RecordSet")
		rs1.open sql1,conn,1,1
		if not rs1.eof then
		Do while Not rs1.eof
		if right(rs1("R_content"),3)="jpg" or right(rs1("R_content"),3)="png" or right(rs1("R_content"),3)="gif" then
		R_content="<a href='"&C_dir&"media/"&rs1("R_content")&"' target='_blank'><img src='"&C_dir&"media/"&rs1("R_content")&"' height='30' width='30'> 点击查看大图</a>"
		else
		if right(rs1("R_content"),3)="doc" or right(rs1("R_content"),3)="pdf" or right(rs1("R_content"),3)="ppf" or right(rs1("R_content"),3)="rar" or right(rs1("R_content"),3)="swf" then
		R_content="<a href='"&C_dir&"media/"&rs1("R_content")&"?1' target='_blank'><img src='img/file.gif'> 点击查看附件</a>"
		else
		R_content=rs1("R_content")
		end if
		end if
		line=line& "<td>"&R_content&"</td>"
		rs1.movenext
		loop
	end if
	rs1.close
	set rs1=nothing
line=line& "<td>"&rs("R_time")&"</td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=response_list.asp&action=del&R_rid="&rs("R_rid")&"&F_id="&F_id&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>|"
rs.movenext
		loop
end if
rs.close
set rs=nothing

line=MoveR(line)
response.Write replace(line,"|","")
response.Write "</table>"
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=response_list.asp&F_id=<%=F_id%>');});">
</form>
</div>
</div>
<%case "excel_list.asp"%>
<%


F_id=trim(Request("F_id"))

sql="select * from SL_form where F_id="&F_id&" order by F_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		F_title=rs("F_title")
		end if
		rs.close
set rs=nothing

Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition","inline; filename = "&F_title&".xls"

response.Write("<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>会员</td>")
sql="select * from SL_content where C_Fid="&F_id&" order by C_order"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		response.Write "<td>"&rs("C_title")&"</td>"
		rs.movenext
		loop
	end if
rs.close
set rs=nothing
response.Write "<td>提交时间</td></tr>"
'------------------
sql="select R_time,R_rid,R_member,M_login from SL_response,SL_content,SL_member where R_Cid=C_id and R_member=M_id and C_fid="&F_id&" order by R_time"
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		
line=line&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&rs("M_login")&"</td>"
sql1="select * from SL_response,SL_content where R_Cid=C_id and R_rid like '"&rs("R_rid")&"' order by C_order"
set rs1=Server.CreateObject("ADODB.RecordSet")
		rs1.open sql1,conn,1,1
		if not rs1.eof then
		Do while Not rs1.eof
		if right(rs1("R_content"),3)="jpg" or right(rs1("R_content"),3)="png" or right(rs1("R_content"),3)="gif" then
		R_content="<a href='http://"&C_domain&C_dir&"media/"&rs1("R_content")&"' target='_blank'>点击查看大图</a>"
		else
		if right(rs1("R_content"),3)="doc" or right(rs1("R_content"),3)="pdf" or right(rs1("R_content"),3)="ppf" or right(rs1("R_content"),3)="rar" or right(rs1("R_content"),3)="swf" then
		R_content="<a href='http://"&C_domain&C_dir&"media/"&rs1("R_content")&"?1' target='_blank'>点击查看附件</a>"
		else
		R_content=rs1("R_content")
		end if
		end if
		line=line& "<td>"&R_content&"</td>"
		rs1.movenext
		loop
	end if
	rs1.close
	set rs1=nothing
line=line& "<td>"&rs("R_time")&"</td></tr>|"
rs.movenext
		loop
end if
rs.close
set rs=nothing

line=MoveR(line)
response.Write replace(line,"|","")
response.Write "</table>"
case "order_list.asp"
%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
if action="edit" then
For Each x In Request.Form 
if split(x,"_")(0)="state" then
conn.execute ("update SL_orders set O_state="&Request.Form(x)&" where O_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="price" then
conn.execute ("update SL_orders set O_price="&Request.Form(x)&" where O_id="&split(x,"_")(1))
end if
if split(x,"_")(0)="num" then
conn.execute ("update SL_orders set O_num="&Request.Form(x)&" where O_id="&split(x,"_")(1))
end if
Next 
call box("修改成功!","page.asp?page=order_list.asp","success")
response.end()
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <font color="#0066ff"><u>订单管理</u></font></div>
<div class="content">
<h2>订单列表</h2><hr>
<%
Action=trim(Request("Action"))
O_id=trim(Request("O_id"))

if action="del" then
conn.Execute ("delete from SL_orders where O_id="&O_id)
call box("删除成功!","page.asp?page=order_list.asp","success")
end if
%>
<form name="form1" method="post">
<table width="100%" bgcolor="#eeeeee">
<tr bgcolor="#F7F7F7"><td>选择</td><td>商品名称</td><td>图片</td><td>单价</td><td>数量</td><td>总价</td><td>属性</td><td>状态</td><td>强制更改状态</td><td>操作</td><td>交易号</td><td>会员</td><td>提交时间</td><td>删除</td></tr>
<%
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_orders where O_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=order_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

sql="select * from SL_orders,SL_product,SL_member where O_member=M_id and O_pid=P_id order by O_id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if rs("O_state")=0 then
		O_state="未付款"
		O_pay="等待买家付款"
		end if
		if rs("O_state")=1 then
		O_state="已付款未发货"
		O_pay="<a href='page.asp?page=sent.asp&O_id="&rs("O_id")&"'><img src='../images/sent.png'></a>"
		end if
		if rs("O_state")=2 then
		O_state="已发货(<a href='page.asp?page=wuliu.asp&O_id="&rs("O_id")&"'>查物流</a>)"
		O_pay="已发货"
		end if
		if rs("O_state")=3 then
		O_state="已确认"
		O_pay="已确认"
		end if
		if rs("O_state")=4 then
		O_state="申请退款"
		O_pay="<a href='page.asp?page=tk.asp&O_id="&rs("O_id")&"'>处理退款</a>"
		end if
		if rs("O_state")=5 then
		O_state="已退款"
		O_pay="交易关闭"
		end if
		
menu_sub="<select name='state_"&rs("O_id")&"'>"
menu_sub=menu_sub&"<option>请选择</option>"

menu_sub=menu_sub&"<option value='0' "
if rs("O_state")=0 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">未付款</option>"

menu_sub=menu_sub&"<option value='1' "
if rs("O_state")=1 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">已付款未发货</option>"

menu_sub=menu_sub&"<option value='2' "
if rs("O_state")=2 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">已付款已发货</option>"

menu_sub=menu_sub&"<option value='3' "
if rs("O_state")=3 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">已确认</option>"

menu_sub=menu_sub&"<option value='4' "
if rs("O_state")=4 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">用户申请退款</option>"

menu_sub=menu_sub&"<option value='5' "
if rs("O_state")=5 then menu_sub=menu_sub&"selected='selected'"
menu_sub=menu_sub&">已退款</option>"

menu_sub=menu_sub&"</select>"

if rs("O_shuxing")="" then
O_shuxing="标配"
else
O_shuxing=rs("O_shuxing")
end if


if rs("O_tradeno")<>"" and isnull(rs("O_tradeno"))=false then
O_tradeno=split(rs("O_tradeno"),"（")(0)

if InStr(rs("O_tradeno"),"支付宝付款")>0 then
paytype="<img src='img/alipay.ico' height='16'> "
end if
if InStr(rs("O_tradeno"),"微信付款")>0 then
paytype="<img src='img/wxpay.ico' height='16'> "
end if
if InStr(rs("O_tradeno"),"网银付款")>0 then
paytype="<img src='img/bank.png' height='16'> "
end if
else
O_tradeno=""
paytype=""
end if
	response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("O_id")&"'></td><td><a href='page.asp?page=product_add.asp&P_id="&rs("P_id")&"'>"&rs("P_title")&"</a></td><td><a href='"&C_dir&"index.asp?type=productinfo&S_id="&rs("P_id")&"' target='_blank'><img src='../"&rs("P_path")&"' height='30'></a></td><td><input type='text' value='"&formatnumber(rs("O_price"),2,-1)&"' name='price_"&rs("O_id")&"' style='width:50px;'> 元</td><td><input type='text' value='"&rs("O_num")&"' name='num_"&rs("O_id")&"' style='width:30px;'></td><td><font color='red'><b>"&formatnumber(rs("O_num")*rs("O_price"),2,-1)&"元</b></font></td><td>"&O_shuxing&"</td><td>"&O_state&"</td><td>"&menu_sub&"</td><td>"&O_pay&"</td><td>"&paytype&O_tradeno&"</td><td><a href='page.asp?page=member_add.asp&M_id="&rs("M_id")&"'>"&rs("M_login")&"</a></td><td>"&rs("O_time")&"</td><td><a href='page.asp?page=order_list.asp&action=del&O_id="&rs("O_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
</table>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=order_list.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=order_list.asp&action=edit')">
</form>
</div>
</div>
<%case "sent.asp"%>
<%
if CA_a7<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
O_id=trim(Request("O_id"))
sql="select * from SL_orders,SL_product,SL_member where O_pid=P_id and O_member=M_id and O_id="&O_id&" order by O_id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
M_login=rs("M_login")
M_name=rs("M_name")
M_add=rs("M_add")
M_mobile=rs("M_mobile")
M_code=rs("M_code")
M_email=rs("M_email")
P_title=rs("P_title")
O_num=rs("O_num")
O_price=rs("O_price")
O_tradeno=rs("O_tradeno")
if rs("O_shuxing")="" then
O_shuxing="标配"
else
O_shuxing=rs("O_shuxing")
end if
end if
rs.close
set rs=nothing
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <font color="#0066ff"><u>订单管理</u></font></div>
<div class="content">
<h2>发货</h2><hr>
<%
if Action="sent" then
O_id=request.Form("O_id")
O_wl=request.Form("O_wl")
O_wlid=request.Form("O_wlid")
O_tradeno=request.Form("O_tradeno")

if O_id<>"" then
conn.execute("update SL_Orders set O_wl='"&O_wl&"',O_wlid='"&O_wlid&"',O_state=2 where O_id="&O_id)
call sendmail("商品发货通知","<h2>您在网站“"&C_webtitle&"”的发货通知</h2><hr>商品名称："&P_title&"<br>数量："&O_num&"<br>属性："&O_shuxing&"<br>价格："&formatnumber(O_price*O_num,2,-1)&"元<hr>状态：卖家已发货<br>物流公司："&O_wl&"<br>运单号："&O_wlid,M_email)
call box("发货成功!","page.asp?page=order_list.asp","success")
response.End()
end if
end if
%>
订单名称：<%=P_title%><br>
数量：<%=O_num%>件<br>
总价：<%=formatNumber(O_price*O_num,2,-1)%>元<br>
属性：<%=O_shuxing%>
<hr>
会员名：<%=M_login%><br>
真实姓名：<%=M_name%><br>
收货地址：<%=M_add%><br>
手机号码：<%=M_mobile%><br>
邮政编码：<%=M_code%><hr>
<form action="page.asp?page=sent.asp&action=sent" method="post">
<table width="100%" bgcolor="#eeeeee">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>物流公司</td><td><%call input("O_wl",O_wl)%></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>运单编号</td><td><%call input("O_wlid",O_wlid)%></td></tr>
<input type="hidden" name="O_id" value="<%=O_id%>"><input type="hidden" name="O_tradeno" value="<%=O_tradeno%>">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</table>
</form>
</div>
</div>
<%case "tk.asp"%>
<%
if CA_a4<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
O_id=trim(Request("O_id"))

sql="select * from SL_orders,SL_product,SL_member where O_pid=P_id and O_member=M_id and O_id="&O_id&" order by O_id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
M_login=rs("M_login")
M_name=rs("M_name")
M_add=rs("M_add")
M_mobile=rs("M_mobile")
M_code=rs("M_code")
M_email=rs("M_email")
P_title=rs("P_title")
O_num=rs("O_num")
B_price=rs("B_price")
O_tradeno=rs("O_tradeno")
O_shuxing=rs("O_shuxing")
O_price=rs("O_price")
end if
rs.close
set rs=nothing
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <font color="#0066ff"><u>订单管理</u></font></div>
<div class="content">
<h2>处理退款</h2><hr>
<%


if Action="tk" then
if O_id<>"" then
conn.execute("update SL_Orders set O_state=5 where O_id="&O_id)
call sendmail("商品退款处理","<h2>您在网站“"&C_webtitle&"”的退款处理</h2><hr>商品名称："&P_title&"<br>数量："&O_num&"<br>属性："&O_shuxing&"<br>价格："&formatnumber(O_price*O_num,2,-1)&"元<br>状态：卖家同意退款",M_email)
call box("退款成功!请登录支付宝完成退款操作","page.asp?page=order_list.asp","success")
response.End()
end if
end if

if Action="untk" then
if O_id<>"" then
conn.execute("update SL_Orders set O_state=2 where O_id="&O_id)
call sendmail("商品退款处理","<h2>您在网站“"&C_webtitle&"”的退款处理</h2><hr>商品名称："&P_title&"<br>数量："&O_num&"<br>属性："&O_shuxing&"<br>价格："&formatnumber(O_price*O_num,2,-1)&"元<br>状态：卖家拒绝退款",M_email)
call box("拒绝退款!","page.asp?page=order_list.asp","success")
response.End()
end if
end if

%>
订单名称：<%=P_title%><br>
数量：<%=O_num%>件<br>
属性：<%=O_shuxing%><br>
总价：<%=formatnumber(O_price*O_num,2,-1)%>元
<hr>
会员名：<%=M_login%><br>
真实姓名：<%=M_name%><br>
收货地址：<%=M_add%><br>
手机号码：<%=M_mobile%><br>
邮政编码：<%=M_code%><hr>
<input type="button" onclick="window.location.href='page.asp?page=tk.asp&O_id=<%=O_id%>&action=tk'" value="同意退款"> <input type="button" onclick="window.location.href='page.asp?page=tk.asp&O_id=<%=O_id%>&action=untk'" value="拒绝退款">
</div>
</div>
<%case "wuliu.asp"%>
<%
if CA_a7<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>产品管理</b> >>  <a href="page.asp?page=product_list.asp">产品列表</a> | <a href="page.asp?page=product_add.asp">新增产品</a> | <a href="page.asp?page=product_add2.asp"><b>批量上传产品</b></a> | <a href="page.asp?page=Psort_list.asp">产品分类列表</a> | <a href="page.asp?page=Psort_add.asp">新增产品分类</a> | <font color="#0066ff"><u>订单管理</u></font></div>
<div class="content">
<h2>查物流</h2><hr>
<%
O_id=trim(Request("O_id"))

sql="select * from SL_orders where O_id="&O_id&""
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if not rs.eof then
O_wl=rs("O_wl")
O_wlid=rs("O_wlid")
end if
rs.close
set rs=nothing
%>
物流公司：<%=O_wl%><br>
运单号：<%=O_wlid%>
<hr>
<iframe src="http://www.kuaidi100.com/frame/app/index.html" frameborder=0 width="100%" height="400"></iframe>
</div>
</div>
<%case "template_list.asp"%>
<%
if CA_a6<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
if request.QueryString("action")="open" then
call WriteToTextFile("../data/agent.txt","true|"&split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(1),"utf-8")
end if
if request.QueryString("action")="close" then
call WriteToTextFile("../data/agent.txt","false|"&split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(1),"utf-8")
end if
function folderexists(folername)
set fso=server.createobject("scripting.filesystemobject") 
if fso.folderexists(server.mappath(folername)) Then
folderexists=true
else
folderexists=false
end if
set fso=nothing 
end function
action=request.QueryString("action")
call sub1(action)
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>模板管理</b> >> <font color="#0066ff"><u>切换模板</u></font>  | <a href="page.asp?page=template_html.asp">编辑模板</a> | <a href="page.asp?page=template_2html.asp">生成静态</a>
</div>
<div class="content">
<h2>已安装的模板</h2><hr>
<form action="page.asp?page=template_list.asp&action=use" method="post" onSubmit="submitonce()">
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>模板编号</td><td>缩图</td><td>应用该模板</td><td>说明文件</td><td>编辑模板</td><td>删除</td></tr>"
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
   Path = Server.MapPath("..")&"/template"
   Set FsoFile = Fso.GetFolder(Path)
   For Each DirFolder in FsoFile.SubFolders
   FolderName=DirFolder.name
   if FolderName=C_template then
   D_info="checked='checked'"
   end if
   response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&FolderName&"</td><td><img src='../template/"&FolderName&"/template.jpg' width='100' alt='<img src=../template/"&FolderName&"/template.jpg width=400>'></td><td><input type='radio' value='"&FolderName&"' name='C_template' "&D_info&"> 选择</td><td><a href='page.asp?page=template_attention.asp&T_id="&FolderName&"' class='add'><i class='fa fa-sign-out'></i> 查看</a></td><td><a href='page.asp?page=template_html.asp&T_id="&FolderName&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='page.asp?page=template_list.asp&action=del&D_id="&FolderName&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
D_info=""
Next
%>

<tr onmouseout='this.style.backgroundColor=""' onmouseover='this.style.backgroundColor="#F7F7F7"' bgcolor='#ffffff'><td></td><td></td><td><input type="submit" value="应用选中模板" id="sub"  class="add" style="font-size:15px;"></td><td></td><td></td><td></td></tr>
</table>

</form>
</div>
<%if split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(0)="true" then%>
<div style="float:right"><a href="?page=template_list.asp&action=close">-</a></div>
<h2>所有模板</h2><hr>
<%
info=GetBody2(C_domain,"template")
For j = 0 To UBound(split(info,"|"))
if j<=UBound(split(info,"|")) then
if folderexists("../template/"&split(info,"|")(j))=false then
downinfo="<a href='page.asp?page=template_list.asp&action=down&T_id="&split(info,"|")(j)&"'class='add'><i class='fa fa-cloud-download'></i> 下载</a>"
else
downinfo="<a class='edit'><i class='fa fa-check-circle'></i> 已安装</a>"
end if
response.Write "<div style='width:120px;margin:10px; padding:10px;float:left;background-color:#FFFFFF;line-height:200%;border:#DDDDDD solid 1px;' align='center'><a href='demo.asp?T_id="&split(info,"|")(j)&"'><img src='http://www.s-cms.cn/media/"&split(info,"|")(j)&"_s.jpg' width='110' alt='<img src=http://www.s-cms.cn/media/"&split(info,"|")(j)&".jpg width=400>'></a><br>模板"&split(info,"|")(j)&" / "&downinfo&"</div>"
end if
Next
%>
<%else%>
<div style="float:right"><a href="?page=template_list.asp&action=open">+</a></div>
<%end if%>
</div>
<%case "template_html.asp"%>
<%
if CA_a6<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if

T_id=request.QueryString("T_id")

if T_id="" then
T_id=C_template
end if
%>

<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>模板管理</b> >> <a href="page.asp?page=template_list.asp">切换模板</a>  | <font color="#0066ff"><u>编辑模板</u> | <a href="page.asp?page=template_2html.asp">生成静态</a></font>
</div>
<div class="content">
<h2>选择要编辑的模板文件（模板编号：<%=T_id%>）</h2><hr>
<%

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fileobj = fso.GetFolder(server.mappath("../template/"&T_id))
Set fsofile = fileobj.Files
For Each file in fsofile
FileName=file.name

select case split(FileName,".")(0)
case "index"
type_info="网站首页"
case "text"
type_info="简介页面"
case "news"
type_info="新闻列表页"
case "newsinfo"
type_info="新闻内容页"
case "product"
type_info="产品列表页"
case "productinfo"
type_info="产品内容页"
case "form"
type_info="万能表单页"
case "contact"
type_info="联系方式页"
case "guestbook"
type_info="留言页面"
case "top"
type_info="网页顶部"
case "foot"
type_info="网页底部"
case "left"
type_info="网页左侧"
case "right"
type_info="网页右侧"
end select
if split(FileName,".")(1)="html" then
response.Write "<div style='width:100px;margin:10px; padding:10px;float:left;background-color:#FFFFFF;line-height:200%;border:#DDDDDD solid 1px;' align='center'><a href='page.asp?page=template_edit.asp&T_id="&T_id&"&T_type="&split(FileName,".")(0)&"'><img src='images/html.png' width='50'><br>"&FileName&"<br>"&type_info&"</a></div>"
end if
Next
%>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
<%case "template_edit.asp"%>
<%
if CA_a6<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
action=request.QueryString("action")
T_id=request.QueryString("T_id")
T_type=request.QueryString("T_type")
if action="edit" then
T_content=request.Form("T_content")
call WriteToTextFile("../template/"&T_id&"/"&T_type&".html",T_content,"utf-8") 
call box("保存成功!","page.asp?page=template_html.asp","success")
end if
LoadTemplate2=ReadFromTextFile("../template/"&T_id&"/"&T_type&".html","utf-8")
%>
<link rel=stylesheet href="lib/codemirror.css">
<link rel=stylesheet href="doc/docs.css">
<script src="lib/codemirror.js"></script>
<script src="mode/xml/xml.js"></script>
<script src="mode/javascript/javascript.js"></script>
<script src="mode/css/css.js"></script>
<script src="mode/htmlmixed/htmlmixed.js"></script>
<script src="addon/edit/matchbrackets.js"></script>
<script src="doc/activebookmark.js"></script>

<style>
  .CodeMirror { height: auto; border: 1px solid #ddd;max-width: 1000px;}
  .CodeMirror-scroll { max-height: 500px;}
  .CodeMirror pre { padding-left: 7px; line-height: 1.25; }
</style>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>模板管理</b> >> <a href="page.asp?page=template_list.asp">切换模板</a>  | <font color="#0066ff"><u>编辑模板</u> | <a href="page.asp?page=template_2html.asp">生成静态</a></font>
</div>
<div class="content">
<h2>编辑模板</h2><hr>

<form action="page.asp?page=template_edit.asp&action=edit&T_id=<%=T_id%>&T_type=<%=T_type%>" method="post">
<table width="100%" bgcolor="#eeeeee">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="120">模板编号</td><td><%=T_id%></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="120">文件名称</td><td><%=T_type%>.html</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="120">文件内容</td><td>

<textarea id="demotext" name='T_content'><%=Server.htmlencode(LoadTemplate2)%></textarea>

</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="120"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /> *无html基础请勿随意修改。</td></tr>

</table>
</form>
  <script>
    var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
      lineNumbers: true,
      mode: "text/html",
      matchBrackets: true
    });
  </script>
</div>
</div>
<%case "template_2html.asp"%>
<%
if CA_a6<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if

if C_html=0 then
call box("网站未开启静态，请到“基本设置”开启！","page.asp?page=config.asp","error")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>模板管理</b> >> <a href="page.asp?page=template_list.asp">切换模板</a>  | <a href="page.asp?page=template_html.asp">编辑模板</a> | <font color="#0066ff"><u>生成静态</u></font>
</div>
<div class="content">
<h2>生成静态html文件</h2><hr>
<%
if request.QueryString("action")="del" then
filedelete("../html/"&C_template&"/"&request.QueryString("file"))
call box("删除文件成功!","page.asp?page=template_2html.asp","success")
response.end()
end if

if request.QueryString("action")="creat" then

if request.Cookies("authorization")<>md5(request.servervariables("HTTP_HOST")) then
call box("免费版不支持生成静态文件，请升级到授权版!","page.asp?page=index2.asp#auth","error")
else
server.ScriptTimeout = 90000
strTestFolder = Server.Mappath("../html/"&C_template) 
 Set objFSO = CreateObject("Scripting.FileSystemObject") 
 '检查文件夹是否存在 
 If objFSO.FolderExists(strTestFolder) Then 
 else
  objFSO.CreateFolder(strTestFolder) 
 end if 
 Set objFSO = Nothing 
select case request.QueryString("type")
case "index"
call creat_index()
case "text"
call creat_text("")
case "news_list"
call creat_news_list("")
case "news_info"
call creat_news_info("")
case "product_list"
call creat_product_list("")
case "product_info"
call creat_product_info("")
case "form"
call creat_form("")
case "guestbook"
call creat_guestbook()
case "contact"
call creat_contact()
case "all"
call creat_index()
call creat_text("")
call creat_news_list("")
call creat_news_info("")
call creat_product_list("")
call creat_product_info("")
call creat_form("")
call creat_guestbook()
call creat_contact()
end select
response.Write "生成静态html文件完毕!请点击按钮返回<br><input type='button' onclick='document.location.href=""page.asp?page=template_2html.asp""' value='点击返回'>"
response.End()
end if
end if

%>
<table width="100%" bgcolor="#eeeeee">
<tr bgcolor="#F7F7F7"><td>网页类型</td><td>列表页</td><td>内容页</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>网站首页</td><td></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=index" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>简介页面</td><td></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=text" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>新闻页面</td><td><a href="page.asp?page=template_2html.asp&action=creat&type=news_list" class='edit'><i class='fa fa-wrench'></i> 生成列表页</a></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=news_info" onClick="swal('耗费时间较长，请等待','<img src=img/loading.gif>',501,277);" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>产品页面</td><td><a href="page.asp?page=template_2html.asp&action=creat&type=product_list" class='edit'><i class='fa fa-wrench'></i> 生成列表页</a></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=product_info" onClick="swal('耗费时间较长，请等待','<img src=img/loading.gif>',501,277);" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>表单页面</td><td></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=form" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>留言页面</td><td></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=guestbook" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>联系页面</td><td></td><td><a href="page.asp?page=template_2html.asp&action=creat&type=contact" class='add'><i class='fa fa-wrench'></i> 生成内容页</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>全站页面</td><td><a href="page.asp?page=template_2html.asp&action=creat&type=all" onClick="swal({title: '',text: '耐心等待，请不要关闭页面',imageUrl: 'img/loading.gif',html: true,showConfirmButton: false});" class='del'><i class='fa fa-wrench'></i> 生成全站页面</a></td>
<td>* 短时间内耗费较高的服务器资源</td>
</tr>
</table>
*静态页面即后缀为.html的页面，较易被搜索引擎收录。
</div>


<div class="content" style=" margin-top:10px;">
<h2>管理静态文件</h2><hr>
<%

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fileobj = fso.GetFolder(server.mappath("../html/"&C_template))
Set fsofile = fileobj.Files
For Each file in fsofile
FileName=file.name

select case split(FileName,"_")(0)
case "index"
type_info="网站首页"
case "text"
type_info="简介页面"
case "news"
type_info="新闻列表页"
case "newsinfo"
type_info="新闻内容页"
case "product"
type_info="产品列表页"
case "productinfo"
type_info="产品内容页"
case "form"
type_info="万能表单页"
case "contact"
type_info="联系方式页"
case "guestbook"
type_info="留言页面"
end select

if split(FileName,".")(1)="html" then
response.Write "<div style='width:120px;margin:10px; padding:10px;float:left;background-color:#FFFFFF;line-height:200%;border:#DDDDDD solid 1px;' align='center'><a href='"&C_dir&"html/"&C_template&"/"&FileName&"' target='_blank'><img src='images/html.png' width='50'></a><br>"&FileName&"<br><a href='"&C_dir&"html/"&C_template&"/"&FileName&"' target='_blank' class='add'><i class='fa fa-sign-out'></i> 查看</a> <a href='page.asp?page=template_2html.asp&action=del&file="&FileName&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></div>"
end if
Next
%>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>

</div>
<%case "contact.asp"%>
<%
if CA_a8<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
sql="Select * from SL_contact"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		C_address=rs("C_address")
		C_zb=rs("C_zb")
		C_title=rs("C_title")
		C_entitle=rs("C_entitle")
		C_content=rs("C_content")
		C_map=rs("C_map")
		rs.close
		end if
call sub2(action)
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>留言管理</b> >> <a href="page.asp?page=book.asp">留言列表</a> | <font color="#0066ff"><u>联系方式</u></font></div>
<div class="content">
<h2>编辑信息</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=contact.asp&action=edit" onsubmit="return check();">
<table width="100%">
<tr><td width="12%">标题：</td><td><%call input("C_title",C_title)%></td></tr>
<tr><td width="12%">英文标题：</td><td><%call input("C_entitle",C_entitle)%></td></tr>
<tr><td width="12%">地图类型：</td><td>
<%call radio("C_map","baidu",C_map)%> 百度地图  
<%call radio("C_map","google",C_map)%> 谷歌地图
</td></tr>
<tr><td width="12%">地图设置（坐标）：</td><td>
<%call input("C_zb",C_zb)%>
<%call help("使用坐标拾取器获得坐标")%></td></tr>
<tr><td width="12%">地图设置（地址）：</td><td>
<%call input("C_address",C_address)%>
<%call help("显示在地图上的地址")%>
</td></tr>
<% 
call content("C_content",C_content)
%>
<table width="100%">
<tr><td width="12%"></td><td>
<input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" />
<a href="page.asp?page=contact.asp&action=add">添加到主菜单</a></td></tr>
</form>
</table>
</div>
</div>
<%case "book.asp"%>
<%
if CA_a8<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>留言管理</b> >> <font color="#0066ff"><u>留言列表</u></font> | <a href="page.asp?page=contact.asp">联系方式</a></div>
<div class="content">
<h2>查看留言</h2><hr>
<form name="form1" id="form1" method="post">
<%
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_guestbook where G_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 
if shu>0 then 
call box("删除成功!","page.asp?page=book.asp","success")
else 
call box("删除失败!","back","error")
end if 
end if
Action=trim(Request("Action"))
G_id=trim(Request("G_id"))
if action="del" then
conn.Execute ("delete from SL_guestbook where G_id="&G_id)
call box("删除成功!","page.asp?page=book.asp","success")
response.End()
end if
sql="Select * from SL_guestbook order by G_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>标题</td><td>姓名</td><td>手机</td><td>内容</td><td>邮箱</td><td>留言时间</td><td>审核</td><td>回复</td><td>删除</td></tr>"
		Do while Not rs.eof
		G_title=rs("G_title")
		G_name=rs("G_name")
		G_phone=rs("G_phone")
		G_msg=rs("G_msg")
		G_email=rs("G_email")
		G_sh=rs("G_sh")
		if G_sh=0 then
		G_shinfo="<font color='#FF0000'>未审核</font>"
		else
		G_shinfo="<font color='#009900'>已审核</font>"
		end if
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("G_id")&"'></td><td><input value='"&G_title&"'></td><td><input value='"&G_name&"'></td><td><input value='"&G_phone&"'></td><td><textarea ROWS='5' COLS='40'>"&G_msg&"</textarea></td><td><input value='"&G_email&"'></td><td>"&rs("G_time")&"</td><td>"&G_shinfo&"</td><td><a href='page.asp?page=book_edit.asp&G_id="&rs("G_id")&"'class='edit'><i class='fa fa-edit'></i> 回复</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=book.asp&action=del&G_id="&rs("G_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
set rs=nothing
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=book.asp');});">
</form>
</div>
</div>
<%case "book_edit.asp"%>
<%
if CA_a8<>1 then
response.Write "<div style='border:#FF0000 solid 1px;padding:10px;margin:10px;color:#FF0000'>您没有权限管理该模块！</div>"
response.end()
end if

action=Request.QueryString("action")
G_id=Request.QueryString("G_id")

sql="Select * from SL_guestbook Where G_id="&G_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		G_title=rs("G_title")
		G_name=rs("G_name")
		G_phone=rs("G_phone")
		G_msg=rs("G_msg")
		G_email=rs("G_email")
		G_sh=rs("G_sh")
		G_reply=rs("G_reply")
		end if
		rs.close
set rs=nothing


if action="edit" then
G_id=Request.QueryString("G_id")
G_sh=Request.Form("G_sh")
G_reply=Request.Form("G_reply")
G_name=Request.Form("G_name")
G_title=Request.Form("G_title")
G_phone=Request.Form("G_phone")
G_msg=Request.Form("G_msg")
G_email=Request.Form("G_email")

if G_sh<>"" and G_reply<>"" then
sql="Select * from SL_guestbook where G_id="&G_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		rs("G_name")=G_name
		rs("G_title")=G_title
		rs("G_phone")=G_phone
		rs("G_msg")=G_msg
		rs("G_email")=G_email
		rs("G_sh")=G_sh
		rs("G_reply")=G_reply
		rs.update
		rs.close
call box("回复留言成功!","page.asp?page=book.asp","success")
call sendmail("您的留言有回复，来自"&C_webtitle,"原留言："&G_msg&"<br>回复内容："&G_reply,G_email)
else
call box("请填全信息！","back","error")
end if
end if
%>
<div style="padding:20px;">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>留言管理</b> >> <a href="page.asp?page=book.asp">留言列表</a> | <a href="page.asp?page=contact.asp">联系方式</a></div>
<div class="content">
<h2>回复留言</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=book_edit.asp&action=edit&G_id=<%=G_id%>">
<table width="100%">
<tr><td width="12%">标题：</td><td><%call input("G_title",G_title)%></td></tr>
<tr><td width="12%">姓名：</td><td><%call input("G_name",G_name)%></td></tr>
<tr><td width="12%">邮箱：</td><td><%call input("G_email",G_email)%></td></tr>
<tr><td width="12%">手机：</td><td><%call input("G_phone",G_phone)%></td></tr>
<tr><td width="12%">留言：</td><td><%call textarea("G_msg",G_msg)%></td></tr>
<tr><td width="12%">审核：</td><td>
<%call radio("G_sh",1,G_sh)%>审核
<%call radio("G_sh",0,G_sh)%>未审核
</td></tr>
<tr><td width="12%">回复：</td><td><%call textarea("G_reply",G_reply)%></td></tr>

<tr><td width="12%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /> *将回复内容发送到留言者邮箱（主机需支持Jmail组件）</td></tr>

</table>
</form>
</div>
</div>
<%case "wap_config.asp"%>
<%
if CA_a10<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>手机版本</b> >> <font color="#0066ff"><u>基本设置</u></font> | <a href="page.asp?page=wap_config2.asp">自定义设置</a> | <a href="page.asp?page=wap_slide.asp">焦点图管理</a> | <a href="page.asp?page=wap_template.asp">切换模板</a>
</div>
<div class="content">
<h2>手机版设置</h2><hr>
<%
action=Request.QueryString("action")
if action="edit" then
W_show=Request.Form("W_show")
W_phone=Request.Form("W_phone")
W_email=Request.Form("W_email")
W_msg=Request.Form("W_msg")
W_logo=Request.Form("W_logo")
W_template=Request.Form("W_template")

if W_show<>"" then
sql="Select * from SL_wap"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("W_show")=W_show
		rs("W_phone")=W_phone
		rs("W_email")=W_email
		rs("W_msg")=W_msg
		rs("W_logo")=W_logo
		rs("W_template")=W_template
		
		rs.update
		rs.close
		end if
call box("修改网站设置成功!","page.asp?page=wap_config.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if


sql="select * from SL_wap"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		W_show=rs("W_show")
		W_phone=rs("W_phone")
		W_email=rs("W_email")
		W_msg=rs("W_msg")
		W_logo=rs("W_logo")
		W_template=rs("W_template")
		end if
rs.close
set rs=nothing
%>
<form id="form" name="form1" method="post" action="page.asp?page=wap_config.asp&action=edit" onsubmit="return check();">
<table width="100%">
<tr bgcolor="#EEEEEE">
    <td rowspan="3" scope="col" width="15%" align="center"><b>手机版显示</b></td>
    <td scope="col" width="15%">自带：</td>
    <td scope="col" width="70%"><%call radio("W_show",1,W_show)%> 使用电脑版自带的手机版（部分模板不自带）</td>
  </tr>
<tr bgcolor="#EEEEEE"><td>独立：</td><td> <%call radio("W_show",2,W_show)%> 使用独立手机版</td></tr>
<tr bgcolor="#EEEEEE"><td>不显示：</td><td> <%call radio("W_show",0,W_show)%> 不显示手机版</td></tr>
<tr align="left" bgcolor="#F7F7F7">
    <td rowspan="2" align="center"><b>联系方式</b></td>
    <td width="15%">拨打电话：</td><td><%call input("W_phone",W_phone)%><%call help("手机版本下方显示")%></td></td>
  </tr>
<tr bgcolor="#F7F7F7"><td width="15%">发送邮件：</td><td><%call input("W_email",W_email)%><%call help("手机版本下方显示")%></td></tr>

<tr align="left" bgcolor="#EEEEEE">
    <td rowspan="2" scope="col" width="15%" align="center"><b>留言设置</b></td>
    <td width="15%">开启：</td>
    <td><%call radio("W_msg",1,W_msg)%> 手机版显示用户的留言记录 </td></td>
  </tr>

<tr bgcolor="#EEEEEE"><td width="15%">关闭：</td>
  <td><%call radio("W_msg",0,W_msg)%> 手机版不显示用户的留言记录</td>
</tr>

<tr align="left" bgcolor="#F7F7F7">
    <td rowspan="1" scope="col" width="15%" align="center"><b>手机版LOGO</b></td>
    <td width="15%">LOGO设置：</td><td><%call input("W_logo",W_logo)%><%call uploadpic("W_logo")%><%call help("留空则使用电脑版logo")%></td></td>
  </tr>
<tr><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr></table>
</form>
<hr>
说明：本后台系统在谷歌浏览器下运行，显示效果更佳。
</div>
<%case "wap_config2.asp"%>
<%
if CA_a10<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=request.QueryString("action")
if action="edit" then
config_data="<?xml version='1.0' encoding='utf-8'?><xml>"
Set xml=Server.CreateObject("Microsoft.XMLDOM")
xml.Async=False
xml.Load(Server.MapPath("../wap/"&C_wap&"/config.xml"))
nCntChd=xml.documentElement.ChildNodes.length-1

for i=0 to nCntChd
nCntAtr=xml.documentElement.ChildNodes.item(i).ChildNodes.length-1
config_data=config_data&"<page title='"&xml.documentElement.ChildNodes.item(i).Attributes.item(0).Text&"'>"
for j=0 to nCntAtr
config_data=config_data&"<tag><title>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</title><content><![CDATA["&Request.Form("C_"&i&j)&"]]></content><en><![CDATA["&Request.Form("E_"&i&j)&"]]></en><type>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</type><url>"&Request.Form("U_"&i&j)&"</url></tag>"
next
config_data=config_data&"</page>"
next
Set xml=Nothing
config_data=config_data&"</xml>"

call WriteToTextFile("../wap/"&C_wap&"/config.xml",config_data,"utf-8") 
call box("保存成功!","page.asp?page=wap_config2.asp","success")
response.End()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>手机版本</b> >> <a href="page.asp?page=wap_config.asp">基本设置</a> | <font color="#0066ff"><u>自定义设置</u></font> | <a href="page.asp?page=wap_slide.asp">焦点图管理</a> | <a href="page.asp?page=wap_template.asp">切换模板</a></div>
<div class="content">
<h2>自定义设置</h2><hr>
<form name="form1" method="post" action="page.asp?page=wap_config2.asp&action=edit">
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td width='10%'>页面</td><td width='10%'>标签名称</td><td width='30%'>内容</td><td width='25%'>英文内容</td><td width='5%'>类型</td><td width='20%'>链接</td></tr>"
Set xml=Server.CreateObject("Microsoft.XMLDOM")
xml.Async=False
xml.Load(Server.MapPath("../wap/"&C_wap&"/config.xml"))
nCntChd=xml.documentElement.ChildNodes.length-1
for i=0 to nCntChd
nCntAtr=xml.documentElement.ChildNodes.item(i).ChildNodes.length-1
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#FFFFFF'><td rowspan='"&xml.documentElement.ChildNodes.item(i).ChildNodes.length&"' scope='col' bgcolor='#F7F7F7' align='center'><b>"&xml.documentElement.ChildNodes.item(i).Attributes.item(0).Text&"</b></td>"
for j=0 to nCntAtr
select case xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text
case "text"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><textarea name='C_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text)&"</textarea></td><td scope='col'><textarea name='E_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(2).Text)&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><textarea name='C_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text)&"</textarea></td><td><textarea name='E_"&i&j&"' cols='40' rows='3'>"&server.HTMLEncode(xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(2).Text)&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
end if
case "img"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' name='C_"&i&j&"' id='C_"&i&j&"' class='input3'> <input type='button' value='上传文件' onclick=""showUpload('C_"&i&j&"','C_"&i&j&"','../wap/"&C_wap&"/images',1,null,'','');"" /></td><td scope='col'><img src='../wap/"&C_wap&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' width='40' alt='<img src=../wap/"&C_wap&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&" width=400>'><input type='hidden' value='' name='E_"&i&j&"' id='E_"&i&j&"'></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' name='C_"&i&j&"' id='C_"&i&j&"' class='input3'> <input type='button' value='上传文件' onclick=""showUpload('C_"&i&j&"','C_"&i&j&"','../wap/"&C_wap&"/images',1,null,'','');"" /></td><td><img src='../wap/"&C_wap&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"' width='50' alt='<img src=../wap/"&C_wap&"/images/"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&" width=400>'><input type='hidden' value='' name='E_"&i&j&"' id='E_"&i&j&"'></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&i&j&"' id='U_"&i&j&"' class='input3'></td></tr>"
end if
case "video"
if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td scope='col'><textarea name='C_"&j&"' cols='40' rows='3'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</textarea></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&j&"' id='U_"&j&"' class='input3'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td><textarea name='C_"&j&"' cols='40' rows='3'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</textarea></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text&"</td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td><input type='text' value='"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(4).Text&"' name='U_"&j&"' id='U_"&j&"' class='input3'></td></tr>"
end if
case "color"

if j=0 then
response.Write "<td scope='col' align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td>"
%>
<input type="text" name="C_<%=j%>" id="U_color<%=j%>" value="<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>" class="input3" onfocus="this.className='input2'" onblur="this.className='input1'"/> <img src="img/rect.gif" border=0 style="cursor:pointer;background-Color:<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>;" id="4" title="选取颜色!" onClick="Getcolor(this.id,'U_color<%=j%>');">
<%
response.Write "</td><td scope='col'></td><td scope='col'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td scope='col'></td></tr>"
else
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td align='center'>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(0).Text&"</td><td>"
%>
<input type="text" name="C_<%=j%>" id="U_color<%=j%>" value="<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>" class="input3" onfocus="this.className='input2'" onblur="this.className='input1'"/> <img src="img/rect.gif" border=0 style="cursor:pointer;background-Color:<%=xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(1).Text%>;" id="4" title="选取颜色!" onClick="Getcolor(this.id,'U_color<%=j%>');">
<%
response.Write "</td><td></td><td>"&xml.documentElement.ChildNodes.item(i).ChildNodes.item(j).ChildNodes.item(3).Text&"</td><td></td></tr>"
end if
end select
next
next
Set xml=Nothing
%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td><td></td><td></td><td></td></tr>
</table>
</form>
</div>
</div>
<%case "wap_slide.asp"%>
<%
if CA_a10<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
Action=trim(Request("Action"))
S_id=trim(Request("S_id"))

if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="title" then
conn.execute ("update SL_wapslide set S_title='"&Request.Form(x)&"' where S_id="&split(x,"_")(1))
end if

Next 
call box("修改成功!","page.asp?page=wap_slide.asp","success")
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>手机版本</b> >> <a href="page.asp?page=wap_config.asp">基本设置</a> | <a href="page.asp?page=wap_config2.asp">自定义设置</a> | <font color="#0066ff"><u>焦点图管理</u></font> | <a href="page.asp?page=wap_template.asp">切换模板</a>
</div>
<div class="content">
<h2>手机版焦点图列表</h2><hr>
<form name="form1" method="post">
<%


id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_wapslide where S_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=wap_slide.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

if action="del" then
conn.Execute ("delete from SL_wapslide where S_id="&S_id)

call box("删除成功!同时删除图片文件","page.asp?page=wap_slide.asp","success")
end if


sql="select * from SL_wapslide order by S_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>显示名称</td><td>缩图</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("S_id")&"'></td><td><input type='text' value='"&rs("S_title")&"' name='title_"&rs("S_id")&"' style='width:150px;'></td><td><img src='../"&rs("S_pic")&"' width='50' alt='<img src=../"&rs("S_pic")&" width=400>'></td><td><a href='page.asp?page=wap_slide_add.asp&S_id="&rs("S_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=wap_slide.asp&action=del&S_id="&rs("S_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=wap_slide.asp');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=wap_slide.asp&action=edit')">
<input type="button" value="新增一个焦点图" onclick="document.location.href='page.asp?page=wap_slide_add.asp'">
</form>
</div>
</div>
<%case "wap_slide_add.asp"%>
<%
if CA_a10<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
S_id=Request.QueryString("S_id")

if S_id<>"" then
aa="edit&S_id="&S_id
sql="Select * from SL_wapslide Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_title=rs("S_title")
		S_content=rs("S_content")
		S_pic=rs("S_pic")
		S_thumb=rs("S_thumb")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if
		
if action="add" then
S_title=Request.Form("S_title")
S_pic=Request.Form("S_pic")
S_thumb=Request.Form("S_thumb")
S_content=Request.Form("S_content")

if left(S_pic,5)="media" then
S_pic=S_pic
end if

if left(S_pic,4)="http" then
S_pic=S_pic
end if

if left(S_pic,1)="2" then
S_pic="media/"&S_pic
end if

if left(S_thumb,5)="media" then
S_thumb=S_thumb
end if

if left(S_thumb,4)="http" then
S_thumb=S_thumb
end if

if left(S_thumb,1)="2" then
S_thumb="media/"&S_thumb
end if


if S_title<>"" and S_pic<>"" and S_content<>"" then
sql="Insert into SL_wapslide(S_title,S_pic,S_content) values('"&S_title&"','"&S_pic&"','"&S_content&"')"
conn.execute(sql)
call box("添加幻灯成功!","page.asp?page=wap_slide.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

if action="edit" then
S_title=Request.Form("S_title")
S_pic=Request.Form("S_pic")
S_thumb=Request.Form("S_thumb")
S_content=Request.Form("S_content")


if left(S_pic,5)="media" then
S_pic=S_pic
end if

if left(S_pic,4)="http" then
S_pic=S_pic
end if

if left(S_pic,1)="2" then
S_pic="media/"&S_pic
end if

if left(S_thumb,5)="media" then
S_thumb=S_thumb
end if

if left(S_thumb,4)="http" then
S_thumb=S_thumb
end if

if left(S_thumb,1)="2" then
S_thumb="media/"&S_thumb
end if

if S_title<>"" and S_pic<>"" and S_content<>"" then
sql="Select * from SL_wapslide Where S_id="&S_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("S_title")=S_title
		rs("S_pic")=S_pic
		
		rs("S_content")=S_content
		rs.update
		rs.close
		end if
call box("修改幻灯成功!","page.asp?page=wap_slide.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>手机版本</b> >> <a href="page.asp?page=wap_config.asp">基本设置</a> | <a href="page.asp?page=wap_config2.asp">自定义设置</a> | <font color="#0066ff"><u>焦点图管理</u></font> | <a href="page.asp?page=wap_template.asp">切换模板</a>
</div>
<div class="content">
<h2>添加焦点图</h2><hr>
	<table width="100%">
<form id="form" name="form1" method="post" action="page.asp?page=wap_slide_add.asp&action=<%=aa%>" onsubmit="return check();">
<tr><td width="8%">幻灯标题：</td><td><%call input("S_title",S_title)%></td></tr>
<tr><td width="8%">文字描述：</td>
  <td><%call textarea("S_content",S_content)%></td>
</tr>
<tr><td width="8%">幻灯大图：</td><td><%call input("S_pic",S_pic)%><%call uploadpic("S_pic")%></td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</form>
</table>
</div>
</div>
<%case "wap_template.asp"%>
<%
if CA_a10<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
if request.QueryString("action")="open" then
call WriteToTextFile("../data/agent.txt",split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(1)&"|true","utf-8")
end if
if request.QueryString("action")="close" then
call WriteToTextFile("../data/agent.txt",split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(1)&"|false","utf-8")
end if

function folderexists(folername)
set fso=server.createobject("scripting.filesystemobject") 
if fso.folderexists(server.mappath(folername)) Then
folderexists=true
else
folderexists=false
end if
set fso=nothing 
end function

action=request.QueryString("action")
call sub3(action)
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>手机版本</b> >> <a href="page.asp?page=wap_config.asp">基本设置</a> | <a href="page.asp?page=wap_config2.asp">自定义设置</a> | <a href="page.asp?page=wap_slide.asp">焦点图管理</a> | <font color="#0066ff"><u>切换模板</u></font>
</div>
<div class="content">
<h2>已安装的模板</h2><hr>
<form action="page.asp?page=wap_template.asp&action=use" method="post" onSubmit="submitonce()">
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>模板编号</td><td>缩图</td><td>应用该模板</td><td>删除</td></tr>"
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
   Path = Server.MapPath("..")&"/wap"
   Set FsoFile = Fso.GetFolder(Path)
   For Each DirFolder in FsoFile.SubFolders
   FolderName=DirFolder.name
   if FolderName=C_wap then
   D_info="checked='checked'"
   end if
   response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&FolderName&"</td><td><img src='../wap/"&FolderName&"/template.jpg' height='100' alt='<img src=../wap/"&FolderName&"/template.jpg height=400>'></td><td><input type='radio' value='"&FolderName&"' name='C_template' "&D_info&"> 选择</td><td><a href='page.asp?page=wap_template.asp&action=del&D_id="&FolderName&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
D_info=""
Next
%>
<tr onmouseout='this.style.backgroundColor=""' onmouseover='this.style.backgroundColor="#F7F7F7"' bgcolor='#ffffff'><td></td><td></td><td><input type="submit" value="应用选中模板" id="sub"  class="add" style="font-size:15px;"></td><td></td></tr>
</table>
</form>
</div>

<%if split(ReadFromTextFile("../data/agent.txt","utf-8"),"|")(1)="true" then%>
<div style="float:right"><a href="?page=wap_template.asp&action=close">-</a></div>
<h2>所有手机模板</h2><hr>
<%
info=GetBody2(C_domain,"wap")
For j = 0 To UBound(split(info,"|"))
if j<=UBound(split(info,"|")) then

if folderexists("../wap/"&split(info,"|")(j))=false then
downinfo="<a href='page.asp?page=wap_template.asp&action=down&T_id="&split(info,"|")(j)&"'class='add'><i class='fa fa-cloud-download'></i> 下载</a>"
else
downinfo="<a class='edit'><i class='fa fa-check-circle'></i> 已安装</a>"
end if

response.Write "<div style='width:120px;margin:10px; padding:10px;float:left;background-color:#FFFFFF;line-height:200%;border:#DDDDDD solid 1px;' align='center'><a href='demo.asp?T_id="&split(info,"|")(j)&"'><img src='http://www.s-cms.cn/media/"&split(info,"|")(j)&".jpg' width='110' alt='<img src=http://www.s-cms.cn/media/"&split(info,"|")(j)&".jpg height=400>'></a><br>模板"&split(info,"|")(j)&" / "&downinfo&"</div>"
end if
Next
%>
<%else%>
<div style="float:right"><a href="?page=wap_template.asp&action=open">+</a></div>
<%end if%>
</div>
<%case "menu_list.asp"%>
<%
if CA_a7<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>菜单管理</b> >> <font color="#0066ff"><u>菜单列表</u></font> | <a href="page.asp?page=menu_add.asp">新增菜单</a></div>
<div class="content">
<h2>菜单列表</h2><hr>
<form action="page.asp?page=menu_list.asp&action=edit" method="post">
<%
id=trim(Request("id"))
order=trim(Request("order"))
Action=trim(Request("Action"))

if action="del" then
conn.Execute ("delete from SL_menu where U_id="&id)
conn.Execute ("delete from SL_menu where U_sub="&id)
call box("删除成功!","page.asp?page=menu_list.asp","success")
end if


if action="edit" then

For Each x In Request.Form 

if split(x,"_")(0)="order" then
conn.execute ("update SL_menu set U_order="&Request.Form(x)&" where U_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="title" then
conn.execute ("update SL_menu set U_title='"&Request.Form(x)&"' where U_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="entitle" then
conn.execute ("update SL_menu set U_entitle='"&Request.Form(x)&"' where U_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="hide" then
conn.execute ("update SL_menu set U_hide="&Request.Form(x)&" where U_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="sub" then
conn.execute ("update SL_menu set U_sub="&Request.Form(x)&" where U_id="&split(x,"_")(1))
end if

if split(x,"_")(0)="url" then
conn.execute ("update SL_menu set U_url='"&Request.Form(x)&"' where U_id="&split(x,"_")(1))
end if

Next 
call box("修改菜单成功!","page.asp?page=menu_list.asp","success")
response.end()
end if

if action="down" then
sql="select * from SL_menu where U_id="&Request.QueryString("U_id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1

sql2="select top 1 * from SL_menu where U_order>"&rs("U_order")&" and U_sub="&rs("U_sub")&" order by U_order asc"
set rs2=Server.CreateObject("ADODB.RecordSet")
rs2.open sql2,conn,1,1
U_order2=rs2("U_order")
conn.execute("update SL_menu set U_order="&rs("U_order")&" where U_id="&rs2("U_id"))
conn.execute("update SL_menu set U_order="&U_order2&" where U_id="&rs("U_id"))
rs2.close
set rs2=nothing
rs.close
set rs=nothing
end if

if action="top" then
sql="select * from SL_menu where U_id="&Request.QueryString("U_id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1

sql2="select top 1 * from SL_menu where U_order<"&rs("U_order")&" and U_sub="&rs("U_sub")&" order by U_order desc"
set rs2=Server.CreateObject("ADODB.RecordSet")
rs2.open sql2,conn,1,1
U_order2=rs2("U_order")
conn.execute("update SL_menu set U_order="&rs("U_order")&" where U_id="&rs2("U_id"))
conn.execute("update SL_menu set U_order="&U_order2&" where U_id="&rs("U_id"))
rs2.close
set rs2=nothing
rs.close
set rs=nothing
end if
sql="select * from SL_menu where U_sub=0 order by U_order"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
response.Write "<table width='100%' bgcolor='#D5DCF7'><tr bgcolor='#DFE6FD'><td>排序<span style='float:right;padding-right:5px;'>调整</span></td><td>名称</td><td>英文名称</td><td>展示类型</td><td>手机图标</td><td>色调</td><td>链接</td><td>菜单隐藏</td><td>所属</td><td>编辑</td><td>删除</td></tr>"
for j=1 to rs.recordcount
if rs("U_type")="index" then
U_type="首页"
end if
if rs("U_type")="text" then
U_type="简介"
end if
if rs("U_type")="product" then
U_type="产品"
end if
if rs("U_type")="news" then
U_type="新闻"
end if
if rs("U_type")="form" then
U_type="表单"
end if
if rs("U_type")="contact" then
U_type="联系"
end if
if rs("U_type")="guestbook" then
U_type="留言"
end if
if rs("U_type")="link" then
U_type="链接"
end if
select case j
case 1
order_arrow="<a href='page.asp?page=menu_list.asp&action=down&U_id="&rs("U_id")&"'><img src='img/arrow_down.gif' alt='下移一条'></a>"
case rs.recordcount
order_arrow="<a href='page.asp?page=menu_list.asp&action=top&U_id="&rs("U_id")&"'><img src='img/arrow_top.gif' alt='上移一条'></a>"
case else
order_arrow="<a href='page.asp?page=menu_list.asp&action=down&U_id="&rs("U_id")&"'><img src='img/arrow_down.gif' alt='下移一条'></a><a href='page.asp?page=menu_list.asp&action=top&U_id="&rs("U_id")&"'><img src='img/arrow_top.gif' alt='上移一条'></a>"
end select
if rs("U_hide")=0 then
selected0="selected='selected'"
selected1=""
else
selected0=""
selected1="selected='selected'"
end if
menu_sub="<select name='sub_"&rs("U_id")&"'><option  value='0' selected='selected'>主菜单</option>"
if rs("U_type")<>"sub" then
sql3="Select * from SL_menu where U_sub=0 and not U_id="&rs("U_id")&" order by U_order"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount
menu_sub=menu_sub&"<option value='"&rs3("U_id")&"'>"&rs3("U_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
else
menu_sub=menu_sub&"</select>"
end if
response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#DFE6FD""' bgcolor='#EFF2FE'><td><b><input type='text' value='"&rs("U_order")&"' name='order_"&rs("U_id")&"' style='width:20px;'></b><span style='float:right;padding:5px;'>"&order_arrow&"</span></td><td><b><input type='text' value='"&rs("U_title")&"' name='title_"&rs("U_id")&"'  style='width:60px;'></b></td><td><b><input type='text' value='"&rs("U_entitle")&"' name='entitle_"&rs("U_id")&"'  style='width:60px;'></b></td><td><b>"&U_type&"</b></td><td><i class='fa fa-"&rs("U_ico")&" fa-2x'></li></td><td><font color='"&rs("U_color")&"'>█</font></td><td><input type='text' value='"&rs("U_url")&"' name='url_"&rs("U_id")&"' style='width:150px;'></td><td><select name='hide_"&rs("U_id")&"'><option  value='0' "&selected0&">显示</option><option  value='1' "&selected1&">隐藏</option></select></td><td>"&menu_sub&"</td><td><a href='page.asp?page=menu_add.asp&U_id="&rs("U_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=menu_list.asp&action=del&id="&rs("U_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"

sql1="select * from SL_menu where U_sub="&rs("U_id")&" order by U_order"
		set rs1=Server.CreateObject("ADODB.RecordSet")
		rs1.open sql1,conn,1,1
		if not rs1.eof then
		for k=1 to rs1.recordcount

if rs1("U_type")="index" then
U_type1="首页"
end if
if rs1("U_type")="text" then
U_type1="简介"
end if
if rs1("U_type")="product" then
U_type1="产品"
end if
if rs1("U_type")="news" then
U_type1="新闻"
end if
if rs1("U_type")="form" then
U_type1="表单"
end if
if rs1("U_type")="contact" then
U_type1="联系"
end if
if rs1("U_type")="guestbook" then
U_type1="留言"
end if
if rs1("U_type")="link" then
U_type1="链接"
end if


select case k
case 1
order_arrow2="<a href='page.asp?page=menu_list.asp&action=down&U_id="&rs1("U_id")&"'><img src='img/arrow_down.gif' alt='下移一条'></a>"
case rs1.recordcount
order_arrow2="<a href='page.asp?page=menu_list.asp&action=top&U_id="&rs1("U_id")&"'><img src='img/arrow_top.gif' alt='上移一条'></a>"
case else
order_arrow2="<a href='page.asp?page=menu_list.asp&action=down&U_id="&rs1("U_id")&"'><img src='img/arrow_down.gif' alt='下移一条'></a><a href='page.asp?page=menu_list.asp&action=top&U_id="&rs1("U_id")&"'><img src='img/arrow_top.gif' alt='上移一条'></a>"
end select

if rs1("U_hide")=0 then
selected0="selected='selected'"
selected1=""
else
selected0=""
selected1="selected='selected'"
end if


menu_sub="<select name='sub_"&rs1("U_id")&"'><option value='0'>主菜单</option>"
sql3="Select * from SL_menu where U_sub=0 order by U_order"
set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount

if rs1("U_sub")=rs3("U_id") then
sub_select="selected='selected'"
else
sub_select=""
end if

menu_sub=menu_sub&"<option value='"&rs3("U_id")&"' "&sub_select&">"&rs3("U_title")&"</option>"
rs3.movenext
next
end if
rs3.close
set rs3=nothing
menu_sub=menu_sub&"</select>"

response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#DFE6FD""' bgcolor='#ffffff'><td>┗ <input type='text' value='"&rs1("U_order")&"' name='order_"&rs1("U_id")&"' style='width:20px;'><span style='float:right;padding:5px;'>"&order_arrow2&"</span></td><td>┗ <input type='text' value='"&rs1("U_title")&"' name='title_"&rs1("U_id")&"'  style='width:60px;'></td><td>┗ <input type='text' value='"&rs1("U_entitle")&"' name='entitle_"&rs1("U_id")&"'  style='width:60px;'></td><td>"&U_type1&"</td><td><i class='fa fa-"&rs1("U_ico")&" fa-2x'></li></td><td><font color='"&rs1("U_color")&"'>█</font></td><td><input type='text' value='"&rs1("U_url")&"' name='url_"&rs1("U_id")&"' style='width:150px;'></td><td>┗ <select name='hide_"&rs1("U_id")&"'><option  value='0' "&selected0&">显示</option><option  value='1' "&selected1&">隐藏</option></select></td><td>"&menu_sub&"</td><td><a href='page.asp?page=menu_add.asp&U_id="&rs1("U_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=menu_list.asp&action=del&id="&rs1("U_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
rs1.movenext
		next
	end if
rs1.close
set rs1=nothing


rs.movenext
		next
	end if
	response.Write "</table>"
rs.close
set rs=nothing
%>
<input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'" style="float:right; margin-top:10px;"  value="保存修改" />
</form>
*注意：若删除主菜单，则其目录下的子菜单也会相应删除！
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
<%case "menu_add.asp"%>
<script type="text/javascript">$(function(){$("#f1").bigColorpicker("f1","L",10);});</script>
<%
if CA_a7<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

U_id=Request.QueryString("U_id")
if U_id<>"" then
aa="edit&U_id="&U_id

sql="Select * from SL_menu Where U_id="&U_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		U_title=rs("U_title")
		U_entitle=rs("U_entitle")
		U_order=rs("U_order")
		U_sub=rs("U_sub")
		U_ico=rs("U_ico")
		U_color=rs("U_color")
		U_type=rs("U_type")
		U_typeid=rs("U_typeid")
		U_hide=rs("U_hide")
		U_url=rs("U_url")
		rs.close
		end if
else
aa="add"
end if

action=Request.QueryString("action")

if action="add" then
U_title=Request.Form("U_title")
U_entitle=Request.Form("U_entitle")
U_sub=Request.Form("U_sub")
U_ico=Request.Form("U_ico")
U_color=Request.Form("U_color")
U_order=Request.Form("U_order")
U_path=Request.Form("U_path")
U_hide=Request.Form("U_hide")
U_url=Request.Form("U_url")

if U_title<>"" and U_order<>"" and U_path<>"" then
conn.Execute ("insert into SL_menu(U_title,U_entitle,U_order,U_sub,U_type,U_typeid,U_hide,U_url,U_ico,U_color) values('"&U_title&"','"&U_entitle&"',"&U_order&","&U_sub&",'"&split(U_path,"/")(0)&"',"&split(U_path,"/")(1)&","&U_hide&",'"&U_url&"','"&U_ico&"','"&U_color&"')")

call box("添加菜单成功!","page.asp?page=menu_list.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

if action="edit" then
U_title=Request.Form("U_title")
U_entitle=Request.Form("U_entitle")
U_sub=Request.Form("U_sub")
U_ico=Request.Form("U_ico")
U_color=Request.Form("U_color")
U_order=Request.Form("U_order")
U_path=Request.Form("U_path")
U_hide=Request.Form("U_hide")
U_url=Request.Form("U_url")


sql="select * from SL_menu where U_id="&U_id
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
U_type=rs("U_type")
U_typeid=rs("U_typeid")
rs.close
set rs=nothing

if U_title<>"" and U_order<>"" and U_path<>"" then
sql="Select * from SL_menu Where U_id="&U_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("U_title")=U_title
		rs("U_entitle")=U_entitle
		rs("U_order")=U_order
		rs("U_sub")=U_sub
		rs("U_ico")=U_ico
		rs("U_color")=U_color
		rs("U_type")=split(U_path,"/")(0)
		rs("U_typeid")=split(U_path,"/")(1)
		rs("U_icon")=U_icon
		rs("U_hide")=U_hide
		rs("U_url")=U_url
		rs.update
		rs.close
		end if
call box("修改菜单成功!","page.asp?page=menu_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<script type="text/javascript" src="js/jquery.bigcolorpicker.js"></script>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>菜单管理</b> >> <a href="page.asp?page=menu_list.asp">菜单列表</a>  | <font color="#0066ff"><u>新增菜单</u></font></div>
<div class="content">
<h2>编辑菜单</h2><hr>
<form method="post" action="page.asp?page=menu_add.asp&action=<%=aa%>">
	<table width="100%">

<tr><td width="8%">菜单标题：</td><td><%call input("U_title",U_title)%></td></tr>
<tr><td width="8%">英文标题：</td><td><%call input("U_entitle",U_entitle)%></td></tr>
<tr><td width="8%">链接到：</td><td>
<span style="width:15pt;overflow:hidden"><select name="U_path" id="path">
<option value="" <%if U_type="" then%>selected="selected"<%end if%>>请选择</option>
<option value="index/1" <%if U_type="index" then%> selected="selected"<%end if%>>网站首页</option>
<optgroup label="新闻模块">
			<%

'-----------------------新闻模块-------------------------------
				sql1="Select S_title,S_id from SL_Nsort"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="news/<%=rs1("S_id")%>" <%if U_type="news" and U_typeid=rs1("S_id") then%>selected="selected"<%end if%>>┗ <%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
				%>
</optgroup>
<optgroup label="产品模块">
				<%

'-----------------------产品模块-------------------------------
				sql1="Select S_title,S_id from SL_Psort"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="product/<%=rs1("S_id")%>" <%if U_type="product" and U_typeid=rs1("S_id") then%>selected="selected"<%end if%>>┗ <%=rs1("S_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
				%>
</optgroup>
<optgroup label="简介模块">
				<%
'-----------------------简介模块-------------------------------

				sql1="Select T_title,T_id from SL_text"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="text/<%=rs1("T_id")%>" <%if U_type="text" and U_typeid=rs1("T_id") then%>selected="selected"<%end if%>>┗ <%=rs1("T_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
				%>
</optgroup>
<optgroup label="表单模块">
				<%
			
'-----------------------表单模块-------------------------------

				sql1="Select * from SL_form"
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="form/<%=rs1("F_id")%>" <%if U_type="form" and U_typeid=rs1("F_id") then%>selected="selected"<%end if%>>┗ <%=rs1("F_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
</optgroup>
<optgroup label="联系模块">
			<option value="contact/1" <%if U_type="contact" then%> selected="selected"<%end if%>>┗ 联系方式</option>
			<option value="guestbook/1" <%if U_type="guestbook" then%> selected="selected"<%end if%>>┗ 在线留言</option>
</optgroup>
			<option value="link/1" <%if U_type="link" then%>selected="selected"<%end if%>>外部网址</option>
			 </select></span> 
			 <input type="button" value="新建栏目" onclick="swal({title: '选择需要新建的栏目类型 ',text: '<a href=\'page.asp?page=text_add.asp\'><div style=\'border:#999999 solid 2px; font-size:17px; padding:15px; margin:15px;-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius:15px; float:left \'>简介 [单页图文]</div></a><a href=\'page.asp?page=nsort_add.asp\'><div style=\'border:#999999 solid 2px;font-size:17px;  padding:15px; margin:15px;-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius:15px;  float:left\'>新闻 [列表+多页图文]</div></a><a href=\'page.asp?page=form_add.asp\'><div style=\'border:#999999 solid 2px;font-size:17px;  padding:15px; margin:15px;-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius:15px;  float:left\'>表单 [万能表单]</div></a><a href=\'page.asp?page=psort_add.asp\'><div style=\'border:#999999 solid 2px;font-size:17px;  padding:15px; margin:15px;-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius:15px;  float:left\'>产品 [列表+多页图文]</div></a>', html: true});">
			 
			 </td></tr>
<tr><td width="8%">菜单排序：</td><td><%call input("U_order",U_order)%><%call help("填写大于0的整数，数字越小排序越靠前")%></td></tr>
<tr><td width="8%">手机版图标：</td><td><%call input("U_ico",U_ico)%> <a href="javascript:void(0);" onClick="swal({title: 'Font-awesome图标文档 ',text: '<a href=http://fontawesome.dashgame.com target=blank>http://fontawesome.dashgame.com/</a>', html: true});"><img src="img/q.png" alt="图标文档 http://fontawesome.dashgame.com/"></a></td></tr>
<tr><td width="8%">手机版色调：</td><td><input type="text" name="U_color" id="f1" value="<%=U_color%>" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> <%call help("用于在手机网站上显示")%></td></tr>
<tr><td width="8%">外链网址：</td><td><%call input("U_url",U_url)%> <%call help("可以链接到其他网站")%></td></tr>
<tr><td width="8%">菜单所属：</td><td><select name="U_sub"><option value="0" <%if cstr(rs1("U_id"))=0 then%>selected="selected"<%end if%>>网站主菜单</option>
			<%
			    if U_id<>"" then
				sql1="Select U_title,U_id from SL_menu where U_sub=0 and not U_id="&U_id&" order by U_order"
				else
				sql1="Select U_title,U_id from SL_menu where U_sub=0 order by U_order"
				end if
				set rs1=Server.CreateObject("ADODB.RecordSet")
				rs1.open sql1,conn,1,1
				if not rs1.eof then
				for i=1 to rs1.recordcount
			%>
				<option value="<%=rs1("U_id")%>" <%if cstr(rs1("U_id"))=cstr(U_sub) then%>selected="selected"<%end if%>>┗ <%=rs1("U_title")%></option>
			<%
				rs1.movenext
				next
				end if
				rs1.close
				set rs1=nothing
			%>
			  </select></td></tr>
<tr><td width="8%">隐藏菜单：</td><td>
<%call radio("U_hide",0,U_hide)%>显示
<%call radio("U_hide",1,U_hide)%>隐藏
</td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</table>
</form>
</div>
</div>
<%case "admin_list.asp"%>
<%
if CA_a9<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>账号管理</b> >> <a href="page.asp?page=member_list.asp">会员管理</a> | <font color="#0066ff"><u>管理员列表</u></font> | <a href="page.asp?page=admin_add.asp">新增管理员</a></div>
<div class="content">
<h2>管理员列表</h2><hr>
<%
Action=trim(Request("Action"))
A_id=trim(Request("A_id"))		

if action="del" then

sql="select count(A_id) as A_count from SL_admin"
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
A_count=rs("A_count")
rs.close
set rs=nothing

if A_count>1 then
conn.Execute ("delete from SL_admin where A_id="&A_id)
call box("删除成功!","page.asp?page=admin_list.asp","success")
response.end()
else
call box("请至少保留一个管理员，否则无法登录后台！","page.asp?page=admin_list.asp","error")
response.end()
end if
end if



sql="select * from SL_admin"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>管理员</td><td>权限</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
		
		
if split(rs("A_part"),"|")(0)<>1 then
CA_a0info="<font color='#ff0000'>×</font>"
else
CA_a0info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(1)<>1 then
CA_a1info="<font color='#ff0000'>×</font>"
else
CA_a1info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(2)<>1 then
CA_a2info="<font color='#ff0000'>×</font>"
else
CA_a2info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(3)<>1 then
CA_a3info="<font color='#ff0000'>×</font>"
else
CA_a3info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(4)<>1 then
CA_a4info="<font color='#ff0000'>×</font>"
else
CA_a4info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(5)<>1 then
CA_a5info="<font color='#ff0000'>×</font>"
else
CA_a5info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(6)<>1 then
CA_a6info="<font color='#ff0000'>×</font>"
else
CA_a6info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(7)<>1 then
CA_a7info="<font color='#ff0000'>×</font>"
else
CA_a7info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(8)<>1 then
CA_a8info="<font color='#ff0000'>×</font>"
else
CA_a8info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(9)<>1 then
CA_a9info="<font color='#ff0000'>×</font>"
else
CA_a9info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(10)<>1 then
CA_a10info="<font color='#ff0000'>×</font>"
else
CA_a10info="<font color='#009900'>√</font>"
end if

if split(rs("A_part"),"|")(11)<>1 then
CA_a11info="<font color='#ff0000'>×</font>"
else
CA_a11info="<font color='#009900'>√</font>"
end if

		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&rs("A_login")&"</td><td>后台首页 "&CA_a0info&"  基本设置 "&CA_a1info&"  简介设置 "&CA_a2info&"  新闻管理 "&CA_a3info&"  产品管理 "&CA_a4info&"   万能表单 "&CA_a5info&" <br> 模板管理 "&CA_a6info&"  留言管理 "&CA_a7info&"  手机版本 "&CA_a10info&"  菜单管理 "&CA_a8info&"  账号管理 "&CA_a9info&" 网站安全 "&CA_a11info&"</td><td><a href='page.asp?page=admin_edit.asp&A_id="&rs("A_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='page.asp?page=admin_list.asp&action=del&A_id="&rs("A_id")&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%>
</div>
</div>
<%case "admin_add.asp"%>
<%
if CA_a9<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

action=Request.QueryString("action")

if action="add" then
A_login=Request.Form("A_login")
A_pwd=Request.Form("A_pwd")


sql="Select * from SL_admin Where A_login='"&A_login&"'"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
call box("该帐号名已被占用，请重新输入！","back","error")
response.End()
end if
rs.close
set rs=nothing

A_a0=Request.Form("A_a0")
if A_a0<>1 then
A_a0=0
end if
A_a1=Request.Form("A_a1")
if A_a1<>1 then
A_a1=0
end if
A_a2=Request.Form("A_a2")
if A_a2<>1 then
A_a2=0
end if
A_a3=Request.Form("A_a3")
if A_a3<>1 then
A_a3=0
end if
A_a4=Request.Form("A_a4")
if A_a4<>1 then
A_a4=0
end if
A_a5=Request.Form("A_a5")
if A_a5<>1 then
A_a5=0
end if
A_a6=Request.Form("A_a6")
if A_a6<>1 then
A_a6=0
end if
A_a7=Request.Form("A_a7")
if A_a7<>1 then
A_a7=0
end if
A_a8=Request.Form("A_a8")
if A_a8<>1 then
A_a8=0
end if
A_a9=Request.Form("A_a9")
if A_a9<>1 then
A_a9=0
end if

A_a10=Request.Form("A_a10")
if A_a10<>1 then
A_a10=0
end if
A_a11=Request.Form("A_a11")
if A_a11<>1 then
A_a11=0
end if

A_part=A_a0&"|"&A_a1&"|"&A_a2&"|"&A_a3&"|"&A_a4&"|"&A_a5&"|"&A_a6&"|"&A_a7&"|"&A_a8&"|"&A_a9&"|"&A_a10&"|"&A_a11
if A_login<>"" and A_pwd<>"" then
sql="Insert into SL_admin(A_login,A_pwd,A_part) values('"&A_login&"','"&md5(A_pwd)&"','"&A_part&"')"
conn.execute(sql)
call box("添加成功!","page.asp?page=admin_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>账号管理</b> >> <a href="page.asp?page=member_list.asp">会员管理</a> | <a href="page.asp?page=admin_list.asp">管理员列表</a> | <font color="#0066ff"><u>新增管理员</u></font></div>
<div class="content">
<h2>新增管理员</h2><hr>
	<table width="100%">
<form id="form" name="form1" method="post" action="page.asp?page=admin_add.asp&action=add" onsubmit="return check();">
<tr><td width="8%">名称：</td><td><%call input("A_login",A_login)%></td></tr>
<tr><td width="8%">密码：</td><td><%call input("A_pwd","")%></td></tr>
<tr><td width="8%">权限：</td><td>
<%call checkbox("A_a0",1,A_a0)%>后台首页
<%call checkbox("A_a1",1,A_a1)%>基本设置
<%call checkbox("A_a2",1,A_a2)%>新闻管理
<%call checkbox("A_a3",1,A_a3)%>产品管理
<%call checkbox("A_a4",1,A_a4)%>产品管理
<%call checkbox("A_a5",1,A_a5)%>万能表单<br>
<%call checkbox("A_a6",1,A_a6)%>模板管理
<%call checkbox("A_a7",1,A_a7)%>菜单管理
<%call checkbox("A_a8",1,A_a8)%>联系方式
<%call checkbox("A_a9",1,A_a9)%>账号管理
<%call checkbox("A_a10",1,A_a10)%>手机版本
<%call checkbox("A_a11",1,A_a11)%>网站安全
</td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</form>
</table>
 *非顶级管理员请不要给“账号管理”的权限
</div>
</div>
<%case "admin_edit.asp"%>
<%
if CA_a9<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

A_id=Request.QueryString("A_id")
action=Request.QueryString("action")
sql="Select * from SL_admin Where A_id="&A_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		A_login=rs("A_login")
		A_pwd=rs("A_pwd")
		A_part=rs("A_part")
A_a0=split(A_part,"|")(0)
A_a1=split(A_part,"|")(1)
A_a2=split(A_part,"|")(2)
A_a3=split(A_part,"|")(3)
A_a4=split(A_part,"|")(4)
A_a5=split(A_part,"|")(5)
A_a6=split(A_part,"|")(6)
A_a7=split(A_part,"|")(7)
A_a8=split(A_part,"|")(8)
A_a9=split(A_part,"|")(9)
A_a10=split(A_part,"|")(10)
A_a11=split(A_part,"|")(11)
		rs.close
		end if

if action="edit" then
A_login=Request.Form("A_login")
A_pwd=Request.Form("A_pwd")

A_a0=Request.Form("A_a0")
if A_a0<>1 then
A_a0=0
end if
A_a1=Request.Form("A_a1")
if A_a1<>1 then
A_a1=0
end if
A_a2=Request.Form("A_a2")
if A_a2<>1 then
A_a2=0
end if
A_a3=Request.Form("A_a3")
if A_a3<>1 then
A_a3=0
end if
A_a4=Request.Form("A_a4")
if A_a4<>1 then
A_a4=0
end if
A_a5=Request.Form("A_a5")
if A_a5<>1 then
A_a5=0
end if
A_a6=Request.Form("A_a6")
if A_a6<>1 then
A_a6=0
end if
A_a7=Request.Form("A_a7")
if A_a7<>1 then
A_a7=0
end if
A_a8=Request.Form("A_a8")
if A_a8<>1 then
A_a8=0
end if
A_a9=Request.Form("A_a9")
if A_a9<>1 then
A_a9=0
end if
A_a10=Request.Form("A_a10")
if A_a10<>1 then
A_a10=0
end if
A_a11=Request.Form("A_a11")
if A_a11<>1 then
A_a11=0
end if



A_part=A_a0&"|"&A_a1&"|"&A_a2&"|"&A_a3&"|"&A_a4&"|"&A_a5&"|"&A_a6&"|"&A_a7&"|"&A_a8&"|"&A_a9&"|"&A_a10&"|"&A_a11
if A_login<>"" and A_pwd<>"" then
sql="Select * from SL_admin Where A_id="&A_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("A_login")=A_login
		rs("A_pwd")=md5(A_pwd)
		rs("A_part")=A_part
		rs.update
		rs.close
		end if
session("A_user")=A_login
session("A_pass")=md5(A_pwd)
call box("修改成功!","page.asp?page=admin_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>账号管理</b> >> <a href="page.asp?page=member_list.asp">会员管理</a> | <a href="page.asp?page=admin_list.asp">管理员列表</a> | <font color="#0066ff"><u>新增管理员</u></font></div>
<div class="content">
<h2>编辑管理员</h2><hr>
	<table width="100%">
<form id="form" name="form1" method="post" action="page.asp?page=admin_edit.asp&action=edit&A_id=<%=A_id%>" onsubmit="return check();">
<tr><td width="8%">名称：</td><td><%call input("A_login",A_login)%></td></tr>
<tr><td width="8%">新密码：</td><td><%call input("A_pwd","")%></td></tr>
<tr><td width="8%">权限：</td><td>
<%call checkbox("A_a0",1,A_a0)%>后台首页
<%call checkbox("A_a1",1,A_a1)%>基本设置
<%call checkbox("A_a2",1,A_a2)%>新闻管理
<%call checkbox("A_a3",1,A_a3)%>产品管理
<%call checkbox("A_a4",1,A_a4)%>产品管理
<%call checkbox("A_a5",1,A_a5)%>万能表单<br>
<%call checkbox("A_a6",1,A_a6)%>模板管理
<%call checkbox("A_a7",1,A_a7)%>菜单管理
<%call checkbox("A_a8",1,A_a8)%>联系方式
<%call checkbox("A_a9",1,A_a9)%>账号管理
<%call checkbox("A_a10",1,A_a10)%>手机版本
<%call checkbox("A_a11",1,A_a11)%>网站安全
</td></tr>
<tr><td width="8%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</form>
</table>
</div>
</div>
<%case "member_list.asp"%>
<%
if CA_a9<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>账号管理</b> >>  <font color="#0066ff"><u>会员管理</u></font> | <a href="page.asp?page=admin_list.asp">管理员列表</a> | <a href="page.asp?page=admin_add.asp">新增管理员</a></div>
<div class="content">
<h2>会员列表</h2><hr>
<form action="page.asp?page=member_list.asp" method="post">
<%
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="delete from SL_member where M_id="&id(i) 
conn.execute(sql)
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=member_list.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if

Action=trim(Request("Action"))
M_id=trim(Request("M_id"))

if action="del" then
conn.Execute ("delete from SL_member where M_id="&M_id)
call box("删除成功!","page.asp?page=member_list.asp","success")
end if

sql="select * from SL_member where not M_id=6 order by M_id desc"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>会员名称</td><td>会员头像</td><td>邮箱</td><td>编辑</td><td>删除</td></tr>"
		Do while Not rs.eof
if left(rs("M_pic"),4)<>"http" then
M_pic="/media/"&rs("M_pic")
else
M_pic=rs("M_pic")
end if
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("M_id")&"'></td><td>"&rs("M_login")&"</td><td><img src='"&M_pic&"'  style='width:50px; height:50px; border-radius:50%; overflow:hidden;'></td><td>"&rs("M_email")&"</td><td><a href='page.asp?page=member_add.asp&M_id="&rs("M_id")&"' class='edit'><i class='fa fa-edit'></i> 编辑</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=member_list.asp&action=del&M_id="&rs("M_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		rs.movenext
		loop
	end if
	response.Write "</table>"
	rs.close
set rs=nothing
		
%><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="submit" value="删除所选">
</form>
</div>
</div>
</div>
<%case "member_add.asp"%>
<%
if CA_a9<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
M_id=Request.QueryString("M_id")

if M_id<>"" then
aa="edit&M_id="&M_id
sql="Select * from SL_member Where M_id="&M_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		M_login=rs("M_login")
		M_pwd=rs("M_pwd")
		M_name=rs("M_name")
		M_code=rs("M_code")
		M_email=rs("M_email")
		M_qq=rs("M_qq")
		M_add=rs("M_add")
		M_mobile=rs("M_mobile")
		M_pic=rs("M_pic")
		end if
		rs.close
set rs=nothing
else
aa="add"
end if

if action="add" then
M_login=request.Form("M_login")
M_pwd=request.Form("M_pwd")
M_email=request.Form("M_email")
M_qq=request.Form("M_qq")
M_mobile=request.Form("M_mobile")
M_add=request.Form("M_add")
M_name=request.Form("M_name")
M_code=request.Form("M_code")
if M_login<>"" then
sql="Insert into SL_member(M_login,M_pwd,M_name,M_email,M_mobile,M_add,M_code,M_qq) values('"&M_login&"','"&M_pwd&"','"&M_name&"','"&M_email&"','"&M_mobile&"','"&M_add&"','"&M_code&"','"&M_qq&"')"
conn.execute(sql)
call box("添加会员成功!","page.asp?page=member_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

if action="edit" then
M_login=request.Form("M_login")
M_pwd=request.Form("M_pwd")
M_email=request.Form("M_email")
M_qq=request.Form("M_qq")
M_mobile=request.Form("M_mobile")
M_add=request.Form("M_add")
M_name=request.Form("M_name")
M_code=request.Form("M_code")
if M_login<>"" then
sql="Select * from SL_member Where M_id="&M_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("M_login")=M_login
rs("M_pwd")=M_pwd
		rs("M_email")=M_email
		rs("M_qq")=M_qq
		rs("M_mobile")=M_mobile
		rs("M_add")=M_add
		rs("M_name")=M_name
		rs("M_code")=M_code
		rs.update
		rs.close
		end if
call box("修改会员成功!","page.asp?page=member_list.asp","success")
else
call box("请填全信息！","back","error")
end if
end if

if left(M_pic,4)<>"http" then
M_pic=C_dir&"media/"&M_pic
end if

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>账号管理</b> >>  <font color="#0066ff"><u>会员管理</u></font> | <a href="page.asp?page=admin_list.asp">管理员列表</a> | <a href="page.asp?page=admin_add.asp">新增管理员</a></div>
<div class="content">
<h2>添加/编辑会员</h2><hr>
<form id="form" name="form1" method="post" action="page.asp?page=member_add.asp&action=<%=aa%>">
<table width="100%">
<tr><td width="12%">会员头像：</td><td><img src="<%=M_pic%>" style="width:100px; height:100px; border-radius:50%; overflow:hidden;" /></td></tr>
<tr><td>会员名称：</td><td><%call input("M_login",M_login)%></td></tr>
<tr><td>登录密码</td><td><%call input("M_pwd",M_pwd)%></td></tr>
<tr><td>真实姓名</td><td><%call input("M_name",M_name)%></td></tr>
<tr><td>电子邮箱</td><td><%call input("M_email",M_email)%></td></tr>
<tr><td>QQ号码</td><td><%call input("M_QQ",M_QQ)%></td></tr>
<tr><td>联系地址</td><td><%call input("M_add",M_add)%></td></tr>
<tr><td>手机号码</td><td><%call input("M_mobile",M_mobile)%></td></tr>
<tr><td>邮政编码</td><td><%call input("M_code",M_code)%></td></tr>
<tr><td width="12%"></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 认" /></td></tr>
</table>
</form>
</div>
</div>
<%case "safe_config.asp"%>
<%
if CA_a11<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
action=Request.QueryString("action")
if action="edit" then
S_filesize=Request.Form("S_filesize")
S_filetype=Request.Form("S_filetype")
S_ip=Request.Form("S_ip")
S_word=Request.Form("S_word")


if S_filesize<>"" and S_word<>"" then
sql="Select * from SL_safe"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if not rs.eof then
		rs("S_filesize")=S_filesize
		rs("S_filetype")=S_filetype
		rs("S_ip")=S_ip
		rs("S_word")=S_word
		rs.update
		rs.close
		end if
call box("修改安全设置成功!","page.asp?page=safe_config.asp","success")
response.End()
else
call box("请填全信息！","back","error")
response.End()
end if
end if

sql="select * from SL_safe"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		S_filesize=rs("S_filesize")
		S_filetype=rs("S_filetype")
		S_ip=rs("S_ip")
		S_word=rs("S_word")
		end if
rs.close
set rs=nothing

%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站安全</b> >>  <font color="#0066ff"><u>安全设置</u></font> | <a href="page.asp?page=space.asp">空间占用</a> | <a href="page.asp?page=checkmm.asp">木马检测</a> | <a href="page.asp?page=backup.asp">数据备份</a> |  <a href="page.asp?page=file.asp">文件管理</a></div>
<div class="content">
<h2>安全设置</h2><hr>
<form action="page.asp?page=safe_config.asp&action=edit" method="post">
<table width="100%" bgcolor="#EEEEEE">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>上传文件格式限制：</td><td><input type="text" name="S_filetype" value="<%=S_filetype%>" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> *用“|”分开</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>上传文件大小限制：</td><td><input type="text" name="S_filesize" value="<%=S_filesize%>" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> M *用于万能表单用户上传文件大小限制</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>IP黑名单设置：</td><td><input type="text" name="S_ip" value="<%=S_ip%>" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> *用“|”分开，支持通配符，如“123.45.67.89|123.45.67.*”</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>敏感字符过滤：</td><td><input type="text" name="S_word" value="<%=S_word%>" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> *用“|”分开，防止网站注入攻击</td></tr>

<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="确 定" /></td></tr>
</table>
</form>
<div style="font: 0px/0px sans-serif;clear: both;display: block;"> </div>
</div>
</div>
<%case "space.asp"%>
<%
if CA_a11<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

Function ShowSpaceInfo(filesize)
size =filesize
showsize = size & "&nbsp;Byte"
If size > 1024 Then
   size = (size \ 1024)
   showsize = size & "&nbsp;KB"
End If
If size > 1024 Then
   size = (size / 1024)
   showsize = formatnumber(size,2,-1) & "&nbsp;MB"
End If
If size > 1024 Then
   size = (size / 1024)
   showsize = formatnumber(size,2,-1) & "&nbsp;GB"
End If
ShowSpaceInfo="<font face=verdana>" & showsize & "</font>"
End Function

Sub Showspecialspaceinfo(method)
	Dim FSO, d, FC, f1, size, showsize, drvpath
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	If method = "All" Then
		size = d.size
	ElseIf method = "Program" Then
		Set FC = d.Files
		For Each f1 In FC
			size = size + f1.size
		Next
	End If
	showsize = size & "&nbsp;Byte"
	If size > 1024 Then
	   size = (size \ 1024)
	   showsize = size & "&nbsp;KB"
	End If
	If size > 1024 Then
	   size = (size / 1024)
	   showsize = formatnumber(size,2,-1) & "&nbsp;MB"
	End If
	If size > 1024 Then
	   size = (size / 1024)
	   showsize = formatnumber(size,2,-1) & "&nbsp;GB"
	End If
	Response.Write "<font face=verdana>" & showsize & "</font>"
End Sub
Function Drawbar(drvpath)
	Dim FSO, drvpathroot, d, size, totalsize, barsize
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	totalsize = d.size
	Set d = FSO.GetFolder(Server.MapPath(C_dir & drvpath))
	size = d.size	
	barsize = CInt((size / totalsize) * 100)
	Drawbar = barsize
End Function
Function Drawspecialbar()
	Dim FSO, drvpathroot, d, FC, f1, size, totalsize, barsize
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set d = FSO.GetFolder(Server.MapPath(C_dir))
	totalsize = d.size
	Set FC = d.Files
	For Each f1 In FC
		size = size + f1.size
	Next
	barsize = CInt((size / totalsize) * 100)
	Drawspecialbar = barsize
End Function
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站安全</b> >>  <a href="page.asp?page=safe_config.asp">安全设置</a> | <font color="#0066ff"><u>空间占用</u></font> | <a href="page.asp?page=checkmm.asp">木马检测</a> | <a href="page.asp?page=backup.asp">数据备份</a> |  <a href="page.asp?page=file.asp">文件管理</a></div>
<div class="content">
<h2>空间占用</h2><hr>
<%
response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>文件夹/文件名称</td><td>占用大小</td><td>备注</td></tr>"

SysPath = Server.MapPath(C_dir)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set F = FSO.GetFolder(SysPath)
Set FC = F.SubFolders
		I = 1
		I2 = 1
For Each F In FC

select case F.name
case "alipay"
folderinfo="支付宝接口文件"
case "conn"
folderinfo="数据库连接文件"
case "css"
folderinfo="层叠样式表"
case "data"
folderinfo="数据库"
case "html"
folderinfo="静态html页面存放"
case "images"
folderinfo="系统图片"
case "js"
folderinfo="javascript脚本文件"
case "kindeditor"
folderinfo="富文本编辑器"
case "media"
folderinfo="用户上传图片"
case "member"
folderinfo="会员系统"
case "qq"
folderinfo="qq登录接口"
case "template"
folderinfo="模板文件夹"
case "upload"
folderinfo="文件上传设置"
case "backup"
folderinfo="数据库备份"
case "wap"
folderinfo="手机网站"
case "weixin"
folderinfo="微信公众号接口"
case "wxpay"
folderinfo="微信支付接口"
case "wapmember"
folderinfo="手机版会员系统"
case "bank"
folderinfo="网银支付接口"
case else
folderinfo="未知文件夹"
end select


if folderinfo<>"未知文件夹" then
folderinfo=folderinfo&"（<font color='#ff0000'>不可删除</font>）"
else
folderinfo=folderinfo&"（<font color='#ff9900'>谨慎操作</font>）"
end if


response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><img src='images/folder.png' height='10'> "&F.name&"</td><td><img src='images/bar2.gif' width='"&Drawbar(F.name)&"' height=10> "&ShowSpaceInfo (F.size)&"</td><td><div style='color:#999999'>"&folderinfo&"</div></td></tr>"

I = I + 1
	If I2 < 10 Then
	I2 = I2 + 1
	Else
	I2 = 1
	End If
Next
response.Write "</table>"
%>
<span style="float:right">空间总占用 [<span style="color:#FF0000; font-weight:bold;"><%Showspecialspaceinfo ("All")%></span>]</span>
<div style="font: 0px/0px sans-serif;clear: both;display: block;"> </div>
</div>
</div>
<%case "checkmm.asp"%>
<%
if CA_a11<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
Const FilterFiles="function.asp,search.asp,conn.asp,conn2.asp,install.asp,member_pay.asp,login.asp"   '定义过滤不检测的文件,多个文件用逗号隔开
dim Report
%>

<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站安全</b> >>  <a href="page.asp?page=safe_config.asp">安全设置</a> | <a href="page.asp?page=space.asp">空间占用</a> | <font color="#0066ff"><u>木马检测</u></font> | <a href="page.asp?page=backup.asp">数据备份</a> | <a href="page.asp?page=file.asp">文件管理</a> </div>
<div class="content">
<h2>检测木马</h2><hr>
<%if Request.QueryString("action")<>"scan" then%>
<table width="100%" bgcolor='#eeeeee' >
<form name="form1" action="page.asp?page=checkmm.asp&action=scan" method="post">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>检测路径：</td><td><input name="path" type="text" style="border:1px solid #999" value="/" size="30" /> *根目录填写“/”,子目录填写“/文件夹名/”</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>检测的扩展名：</td><td><input name="FileExt" type="text" style="border:1px solid #999" value="asp,cer,asa,cdx" size="30" /> *多个扩展名,请用逗号隔开如果想检测是否有图片格式伪木马请添加“jpg,gif”等扩展名</td></tr>

<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td><input type="submit" value=" 开始扫描 " class="submit1" /></td></tr>
</form>
</table>
1、执行本操作需要耗费较多时间，请在访问量少的时候执行本操作。<br>
2、您可以用此工具检查您的站点是否存在木马文件。<br>
3、由于新的木马变种经常变化出现,本工具不保证所有木马都可以查出来。
<%else%>
<table width="100%" bgcolor='#eeeeee' >
  <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff">
    <td colspan="2" align="right" id="message"><img src="images/wait.gif">&nbsp; </td>
    <td width="57%" align="left" id="msg">&nbsp;</td>
  </tr>
</table>
<%
	server.ScriptTimeout = 90000
	DimFileExt = Request("FileExt")
	If DimFileExt="" Then DimFileExt="asp"
	Sun = 0
	SumFiles = 0
	SumFolders = 1
	if request.Form("path")="" then
		call box("请输入要检测的路径!","back","error")
		response.End()
	end if
	timer1 = timer

	if request.Form("path")="\" then
		TmpPath = Server.MapPath(finddir(request.servervariables("URL")))&"\"		
	elseif request.Form("path")="." then
		TmpPath = Server.MapPath("\")
	else
		TmpPath = Server.MapPath(finddir(request.servervariables("URL")))&request.Form("path")
	end if

	Call ShowAllFile(TmpPath)	
	Dim Msg
	If Sun=0 Then
	 Msg="<img src=images/info_success.gif width=16 height=16 align=absmiddle> 扫描完毕！恭喜您,您的系统很安全,没有发现木马,希望您能保持！"
	Else
	 Msg="<img src=images/info_success.gif width=16 height=16 align=absmiddle> 扫描完毕！一共检查文件夹<font color=""#FF0000"">" & SumFolders & "</font>个，文件<font color=""#FF0000"">" & SumFiles & "</font>个，发现可疑点<font color=""#FF0000"">" & Sun & "</font>个&nbsp;"
	End If
	Response.Write "<script>message.innerHTML='" & MSG & "';</script>"
	Response.Flush()
%>
	<% If Sun<>0 Then%>
	<table width="100%" bgcolor='#eeeeee'>
	  <tr  onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#f7f7f7">
		<td width="16%">文件相对路径</td>
		<td width="16%">特征码</td>
		<td width="43%">描述</td>
		<td width="25%">创建/修改时间</td>
	  </tr>
	  <%=Report%>
	</table>
	<%end if%>
<%
	timer2 = timer
	thetime=cstr(int(((timer2-timer1)*10000 )+0.5)/10)
	response.write "<li class='dfsa'><font size=""2"">本次检测共用了"&thetime&"毫秒</font></li>"
end if
%>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
</body>
<%

'遍历处理path及其子目录所有文件
Sub ShowAllFile(Path)
	Set Fso=Server.CreateObject("Scripting.FileSystemObject")
	if not fso.FolderExists(path) then exit sub
	Set f = FSO.GetFolder(Path)
	Set fc2 = f.files
	For Each myfile in fc2
		If CheckExt(FSO.GetExtensionName(path&"\"&myfile.name)) Then
		    If FoundInArr(lcase(FilterFiles),lcase(myfile.name),",")=false Then
			 Call ScanFile(Path&Temp&"\"&myfile.name, "")
			End If
			SumFiles = SumFiles + 1
			Response.Write "<script>msg.innerHTML='&nbsp;正在检测文件:" & myfile.name & "';</script>"
			Response.Flush()
		End If
	Next
	Set fc = f.SubFolders
	For Each f1 in fc
		ShowAllFile path&f1.name
		SumFolders = SumFolders + 1
    Next
	Set FSO = Nothing
End Sub

'*************************************************************************************
'函数名:finddir
'作  用:寻找路径
'*************************************************************************************
Function finddir(filepath)                            
	finddir=""
	for hzh_i=1 to len(filepath)                   
	if left(right(filepath,hzh_i),1)="/" or left(right(filepath,hzh_i),1)="\" then
	  abc=hzh_i
	  exit for
	end if
	next
	if abc <> 1 then
		finddir=left(filepath,len(filepath)-abc+1)
		finddir=replace(finddir,C_admin&"/","",1,-1,1)            
    end if
end Function
'**************************************************
'函数：FoundInArr
'作  用：检查一个数组中所有元素是否包含指定字符串
'参  数：strArr     ----字符串
'        strToFind    ----要查找的字符串
'       strSplit    ----数组的分隔符
'返回值：True,False
'**************************************************
Function FoundInArr(strArr, strToFind, strSplit)
	Dim arrTemp, i
	FoundInArr = False
	If InStr(strArr, strSplit) > 0 Then
		arrTemp = Split(strArr, strSplit)
		For i = 0 To UBound(arrTemp)
		If LCase(Trim(arrTemp(i))) = LCase(Trim(strToFind)) Then
			FoundInArr = True:Exit For
		End If
		Next
	Else
		If LCase(Trim(strArr)) = LCase(Trim(strToFind)) Then FoundInArr = True
	End If
End Function

'检测文件
Sub ScanFile(FilePath, InFile)
	If InFile <> "" Then
		Infiles = "该文件被<a href=""http://"&request.servervariables("HTTP_HOST")&"\"&InFile&""" target=_blank>"& InFile & "</a>文件包含执行"
	End If
	Set FSOs = Server.CreateObject("Scripting.FileSystemObject")
	on error resume next
	set ofile = fsos.OpenTextFile(FilePath)
	filetxt = Lcase(ofile.readall())
	If err Then Exit Sub end if
	if len(filetxt)>0 then
		    '特征码检查
		    temp = replace(FilePath,server.MapPath("/")&"/","")
			'Check "WScr"&DoMyBest&"ipt.Shell"
			If instr( filetxt, Lcase("WScr"&DoMyBest&"ipt.Shell") ) or Instr( filetxt, Lcase("clsid:72C24DD5-D70A"&DoMyBest&"-438B-8A42-98424B88AFB8") ) then
				Report = Report&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&temp&"</td><td>WScr"&DoMyBest&"ipt.Shell 或者 clsid:72C24DD5-D70A"&DoMyBest&"-438B-8A42-98424B88AFB8</td><td>危险组件，一般被ASP木马利用。"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
			End if
			'Check "She"&DoMyBest&"ll.Application"
			If instr( filetxt, Lcase("She"&DoMyBest&"ll.Application") ) or Instr( filetxt, Lcase("clsid:13709620-C27"&DoMyBest&"9-11CE-A49E-444553540000") ) then
				Report = Report&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&temp&"</td><td>She"&DoMyBest&"ll.Application 或者 clsid:13709620-C27"&DoMyBest&"9-11CE-A49E-444553540000</td><td>危险组件，一般被ASP木马利用。"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
			End If
			'Check .Encode
			Set regEx = New RegExp
			regEx.IgnoreCase = True
			regEx.Global = True
			regEx.Pattern = "@\s*LANGUAGE\s*=\s*[""]?\s*(vbscript|jscript|javascript).encode\b"
			If regEx.Test(filetxt) Then
				Report = Report&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&temp&"</td><td>(vbscript|jscript|javascript).Encode</td><td>似乎脚本被加密了，一般ASP文件是不会加密的。"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
			End If
			'Check my ASP backdoor :(
			regEx.Pattern = "\bEv"&"al\b"
			If regEx.Test(filetxt) Then
				Report = Report&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&temp&"</td><td>Ev"&"al</td><td>e"&"val()函数可以执行任意ASP代码，被一些后门利用。其形式一般是：ev"&"al(X)<br>但是javascript/css代码中也可以使用，有可能是误报。"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
			End If
			'Check exe&cute backdoor
			regEx.Pattern = "[^.]\bExe"&"cute\b"
			If regEx.Test(filetxt) Then
				Report = Report&"<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td>"&temp&"</td><td>Exec"&"ute</td align='center'><td>e"&"xecute()函数可以执行任意ASP代码，被一些后门利用。其形式一般是：ex"&"ecute(X)。<br>"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
			End If
			Set regEx = Nothing
			
		'Check include file
		Set regEx = New RegExp
		regEx.IgnoreCase = True
		regEx.Global = True
		regEx.Pattern = "<!--\s*#include\s*file\s*=\s*"".*"""
		Set Matches = regEx.Execute(filetxt)
		For Each Match in Matches
			tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\")
			If Not CheckExt(FSOs.GetExtensionName(tFile)) Then
				Call ScanFile( Mid(FilePath,1,InStrRev(FilePath,"\"))&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) )
				SumFiles = SumFiles + 1
			End If
		Next
		Set Matches = Nothing
		Set regEx = Nothing
		
		'Check include virtual
		Set regEx = New RegExp
		regEx.IgnoreCase = True
		regEx.Global = True
		regEx.Pattern = "<!--\s*#include\s*virtual\s*=\s*"".*"""
		Set Matches = regEx.Execute(filetxt)
		For Each Match in Matches
			tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\")
			If Not CheckExt(FSOs.GetExtensionName(tFile)) Then
				Call ScanFile( Server.MapPath("\")&"\"&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) )
				SumFiles = SumFiles + 1
			End If
		Next
		Set Matches = Nothing
		Set regEx = Nothing
		
		'Check Server&.Execute|Transfer
		Set regEx = New RegExp
		regEx.IgnoreCase = True
		regEx.Global = True
		regEx.Pattern = "Server.(Exec"&"ute|Transfer)([ \t]*|\()"".*"""
		Set Matches = regEx.Execute(filetxt)
		For Each Match in Matches
			tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\")
			If Not CheckExt(FSOs.GetExtensionName(tFile)) Then
				Call ScanFile( Mid(FilePath,1,InStrRev(FilePath,"\"))&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) )
				SumFiles = SumFiles + 1
			End If
		Next
		Set Matches = Nothing
		Set regEx = Nothing
		
		'Check Server&.Execute|Transfer
		Set regEx = New RegExp
		regEx.IgnoreCase = True
		regEx.Global = True
		regEx.Pattern = "Server.(Exec"&"ute|Transfer)([ \t]*|\()[^""]\)"
		If regEx.Test(filetxt) Then
			Report = Report&"<tr bgcolor='#FFFFFF'><td align='center'>"&temp&"</td><td>Server.Exec"&"ute</td><td align='center'>不能跟踪检查Server.e"&"xecute()函数执行的文件。请管理员自行检查。<br>"&infiles&"</td><td align='center'>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
			Sun = Sun + 1
		End If
		Set Matches = Nothing
		Set regEx = Nothing
		
		'Check Crea"&"teObject
		Set regEx = New RegExp
		regEx.IgnoreCase = True
		regEx.Global = True
		regEx.Pattern = "CreateO"&"bject[ |\t]*\(.*\)"
		Set Matches = regEx.Execute(filetxt)
		For Each Match in Matches
			If Instr(Match.Value, "&") or Instr(Match.Value, "+") or Instr(Match.Value, """") = 0 or Instr(Match.Value, "(") <> InStrRev(Match.Value, "(") Then
				Report = Report&"<tr bgcolor='#FFFFFF'><td>"&temp&"</td><td>Creat"&"eObject</td><td>Crea"&"teObject函数使用了变形技术，仔细复查。"&infiles&"</td><td>"&GetDateCreate(filepath)&"&nbsp;"&GetDateModify(filepath)&"</td></tr>"
				Sun = Sun + 1
				exit sub
			End If
		Next
		Set Matches = Nothing
		Set regEx = Nothing

	end if
	set ofile = nothing
	set fsos = nothing
End Sub

'检查文件后缀，如果与预定的匹配即返回TRUE
Function CheckExt(FileExt)
	If DimFileExt = "*" Then CheckExt = True
	Ext = Split(DimFileExt,",")
	For i = 0 To Ubound(Ext)
		If Lcase(FileExt) = Ext(i) Then 
			CheckExt = True
			Exit Function
		End If
	Next
End Function

Function GetDateModify(filepath)
	Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(filepath) 
	ss = f.DateLastModified 
	set f = nothing
	set fso = nothing
	GetDateModify = ss
End Function

Function GetDateCreate(filepath)
	Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(filepath) 
	ss = f.DateCreated 
	set f = nothing
	set fso = nothing
	GetDateCreate = ss
End Function
%>
<%case "backup.asp"%>
<%
if CA_a11<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if

function folderexists(folername)
set fso=server.createobject("scripting.filesystemobject") 
if fso.folderexists(server.mappath(folername)) Then
folderexists=true
else
folderexists=false
end if
set fso=nothing 
end function
Function CopyMyFolder(FolderName,FolderPath) 
sFolder=server.mappath(FolderName) 
oFolder=server.mappath(FolderPath) 
set fso=server.createobject("scripting.filesystemobject") 
if fso.folderexists(server.mappath(FolderName)) Then
if fso.folderexists(server.mappath(FolderPath)) Then
fso.copyfolder sFolder,oFolder 
Else
CreateNewFolder = Server.Mappath(FolderPath) 
fso.CreateFolder(CreateNewFolder) 
fso.copyfolder sFolder,oFolder 
End if 
CopyMyFolder="" 
Else 
CopyMyFolder="错误,原文件夹["&sFolde&"]不存在!" 
End If 
set fso=nothing 
End Function 
function delfolder(foldername)
set objfilesys=server.createobject("scripting.filesystemobject")
foldername=server.mappath(foldername)
if objfilesys.FOLDERExists(foldername) then
objfilesys.deleteFOLDER foldername
else
delfolder="文件夹不存在"
end if
end function
action=request.QueryString("action")
B_id=request.QueryString("B_id")
if action="backup" then
newfolder=gen_key(10)
conn.execute("insert into SL_backup(B_folder,B_time,B_admin,B_content) values('"&newfolder&"','"&now()&"','"&session("A_user")&"','"&request.Form("B_content")&"')")
conn.Close()
set conn = Nothing
response.Write CopyMyFolder("../data","../backup/"&newfolder)
call box("备份数据库成功!","page.asp?page=backup.asp","success")
Response.end()
end if
if action="edit" then
For Each x In Request.Form 
if split(x,"_")(0)="content" then
conn.execute ("update SL_backup set B_content='"&Request.Form(x)&"' where B_id="&split(x,"_")(1))
end if
Next 
call box("修改成功!","page.asp?page=backup.asp","success")
response.end()
end if


if action="del" then
sql="select * from SL_backup where B_id="&B_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		B_folder=rs("B_folder")
		rs.close
		set rs=nothing
response.Write delfolder("../backup/"&B_folder)
conn.execute("delete from SL_backup where B_id="&B_id)
call box("删除备份成功!","page.asp?page=backup.asp","success")
Response.end()
end if

if action="recovery" then
sql="select * from SL_backup where B_id="&B_id
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		B_folder=rs("B_folder")
		rs.close
		set rs=nothing
response.Write CopyMyFolder("../backup/"&B_folder,"../data")
call box("还原备份成功!","page.asp?page=backup.asp","success")
Response.end()
end if

if action="delmore" then
id=request("id")
if not id="" then
id=Split(id,",") 
shu=0 
for i=0 to UBound(id) 
sql="select * from SL_backup where B_id="&int(id(i))
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		B_folder=rs("B_folder")
		rs.close
		set rs=nothing
conn.execute("delete from SL_backup where B_id="&id(i))
if B_folder<>"" then
response.Write delfolder("../backup/"&B_folder)
end if
shu=shu+1 
next 

if shu>0 then 
call box("删除成功!","page.asp?page=backup.asp","success") 
else 
call box("删除失败!","back","error")
end if 
end if
end if
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站安全</b> >>  <a href="page.asp?page=safe_config.asp">安全设置</a> | <a href="page.asp?page=space.asp">空间占用</a> | <a href="page.asp?page=checkmm.asp">木马检测</a> | <font color="#0066ff"><u>数据备份</u></font>  | <a href="page.asp?page=file.asp">文件管理</a> </div>
<div class="content">
<h2>数据备份</h2><hr>
<form action="page.asp?page=backup.asp&action=backup" method="post">
<table width="100%" bgcolor="#EEEEEE">

<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td>填写备注：</td><td><input type="text" name="B_content" value="" class="input1" onfocus="this.className='input2'" onblur="this.className='input1'"/> *方便记忆该次备份</td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor="#ffffff"><td></td><td><input name="Submit" type="submit" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="开始备份" /></td></tr>
</table>
</form>
<h2>恢复数据</h2><hr>
<form name="form1" method="post">
<%
sql="select * from SL_backup"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		response.Write "<table width='100%' bgcolor='#eeeeee'><tr bgcolor='#F7F7F7'><td>选择</td><td>数据库文件夹</td><td>备份时间点</td><td>备份管理员</td><td>备注</td><td>还原</td><td>删除</td></tr>"
		Do while Not rs.eof
		if folderexists("../backup/"&rs("B_folder")) then
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""' bgcolor='#ffffff'><td><input name='id' type='checkbox' id='id' value='"&rs("B_id")&"'></td><td>"&rs("B_folder")&"</td><td>"&rs("B_time")&"</td><td>"&rs("B_admin")&"</td><td><input type='text' value='"&rs("B_content")&"' name='content_"&rs("B_id")&"' style='width:150px;'></td><td><a href='page.asp?page=backup.asp&B_id="&rs("B_id")&"&action=recovery'class='add'><i class='fa fa-history'></i> 还原</a></td><td><a href='javascript:;' onclick=""swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){window.location.href='page.asp?page=backup.asp&action=del&B_id="&rs("B_id")&"';});"" class='del'><i class='fa fa-times-circle'></i> 删除</a></td></tr>"
		else
		conn.execute("delete from SL_backup where B_folder='"&rs("B_folder")&"'")
		end if
		rs.movenext
		loop
		response.Write "</table>"
		else
		response.Write "暂时还未备份数据库！"
	end if
	rs.close
set rs=nothing
%>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选 
<input type="button" value="删除所选" onclick="swal({title: '',text: '确定要删除吗？',type: 'warning',showCancelButton: true},function(){manySend('page.asp?page=backup.asp&action=delmore');});">
<input type="button" value="保存修改" onclick="manySend('page.asp?page=backup.asp&action=edit')">
</form>
<span style="float:right">提示：若还原较早时间点的备份，则该时间点之后的备份不会再出现。</span>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
<%case "file.asp"%>
<%
if CA_a11<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系管理员</span></div>"
response.end()
end if
if request.QueryString("action")="del" then
filedelete("../media/"&request.QueryString("file"))
call box("删除文件成功!","page.asp?page=file.asp","success")
end if
%>
<style>
#wrapper{width: 100% margin: 15px auto;}
.brand-list{width: 100%; overflow: hidden; margin-left: -10px;}
.brand-list .brand-bd{position: relative; margin-left: 10px; margin-top: 5px;}
.brand-list .item{position: absolute; width: 122px; background-color: #f8f8f8; border: 1px solid #f8f8f8; padding: 18px; top:0; left: 40%; -webkit-transition: all 0.3s;-moz-transition: all 0.3s;-o-transition: all 0.3s;-ms-transition: all 0.3s;transition: all 0.3s;}
.brand-list .hover{box-shadow: 0px 1px 8px rgba(200,200,200,.6); background-color: #fff; border-color: #c8c8c8;}
.brand-list .additem{padding: 0; width: 160px; border: none; }
.brand-list .item h3{font-size: 42px; color: #666; font-family: arial; font-weight: bold; line-height: .8; margin-bottom: 20px;}
.brand-list .item p{margin-bottom: 15px;}
</style>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>网站安全</b> >>  <a href="page.asp?page=safe_config.asp">安全设置</a> | <a href="page.asp?page=space.asp">空间占用</a> | <a href="page.asp?page=checkmm.asp">木马检测</a> | <a href="page.asp?page=backup.asp">数据备份</a>  | <font color="#0066ff"><u>文件管理</u></font> </div>
<div class="content">
<h2>文件管理</h2><hr>
<div id="wrapper">
  <div class="brand-list">
    <div class="brand-bd cle" id="brand-waterfall">
<%

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fileobj = fso.GetFolder(server.mappath("../media/"))
Set fsofile = fileobj.Files
For Each file in fsofile
FileName=file.name

response.Write " <div class='item' id='brand-n'><a href='"&C_dir&"media/"&FileName&"' ><img src='"&C_dir&"media/"&FileName&"'  width='100%'></a><br><div style='width:120px;overflow:hidden;'>"&FileName&"</div><br><a href='"&C_dir&"media/"&FileName&"'  class='add'><i class='fa fa-sign-out'></i> 查看</a> <a href='page.asp?page=file.asp&action=del&file="&FileName&"' class='del'><i class='fa fa-times-circle'></i> 删除</a></div>"

Next
%>
    </div>
  </div>
</div>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
<script>

$(function(){
$('#brand-waterfall').waterfall();
});
;(function ($) {
    $.fn.waterfall = function(options) {
        var df = {
            item: '.item',
            margin: 15,
            addfooter: true
        };
        options = $.extend(df, options);
        return this.each(function() {
            var $box = $(this), pos = [],
            _box_width = $box.width(),
            $items = $box.find(options.item),
            _owidth = $items.eq(0).outerWidth() + options.margin,
            _oheight = $items.eq(0).outerHeight() + options.margin,
            _num = Math.floor(_box_width/_owidth);

            (function() {
                var i = 0;
                for (; i < _num; i++) {
                    pos.push([i*_owidth,0]);
                } 
            })();

            $items.each(function() {
                var _this = $(this),
                _temp = 0,
                _height = _this.outerHeight() + options.margin;

                _this.hover(function() {
                    _this.addClass('hover');
                },function() {
                    _this.removeClass('hover');
                });

                for (var j = 0; j < _num; j++) {
                    if(pos[j][1] < pos[_temp][1]){
                        //暂存top值最小那列的index
                        _temp = j;
                    }
                }
                this.style.cssText = 'left:'+pos[_temp][0]+'px; top:'+pos[_temp][1]+'px;';
                //插入后，更新下该列的top值
                pos[_temp][1] = pos[_temp][1] + _height;
            });

            // 计算top值最大的赋给外围div
            (function() {
                var i = 0, tops = [];
                for (; i < _num; i++) {
                    tops.push(pos[i][1]);
                }
                tops.sort(function(a,b) {
                    return a-b;
                });
                $box.height(tops[_num-1]);

                //增加尾部填充div
                if(options.addfooter){
                    addfooter(tops[_num-1]);
                }

            })();

            function addfooter(max) {
                var addfooter = document.createElement('div');
                addfooter.className = 'item additem';
                for (var i = 0; i < _num; i++) {
                    if(max != pos[i][1]){
                        var clone = addfooter.cloneNode(),
                        _height = max - pos[i][1] - options.margin;
                        clone.style.cssText = 'left:'+pos[i][0]+'px; top:'+pos[i][1]+'px; height:'+_height+'px;';
                        $box[0].appendChild(clone);
                    }
                }
            }

        });
    }
})(jQuery);</script>
<%case "template_attention.asp"%>
<%
if CA_a6<>1 then
response.Write "<div style='border:#CCCCCC solid 1px; background:#FFFFFF; padding:10px; margin:200px auto; font-size:15px; width:500px; height:55px; text-align:center; font-family:微软雅黑;'><img src='img/X.png' width='50' style='margin: 0 20px -20px 0px;'> <span style=' line-height:50px;'>您没有权限管理该模块！请联系顶级管理员</span></div>"
response.end()
end if
T_id=request.QueryString("T_id")
%>
<div style="padding:20px">
<div class="title"><img src="img/orange.png" style="margin-left:10px; margin-top:5px; margin-right:10px;"><b>模板管理</b> >> <font color="#0066ff"><u>切换模板</u></font>  | <a href="page.asp?page=template_html.asp">编辑模板</a> | <a href="page.asp?page=template_2html.asp">生成静态</a></font>
</div>
<div class="content">
<h2>模板说明文件</h2><hr>
<%
LoadTemplate2=ReadFromTextFile("../template/"&T_id&"/readme.txt","gb2312")
%>
<table width="100%" bgcolor="#eeeeee">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="12%">模板编号</td><td><%=T_id%></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="12%">说明文件</td><td><textarea name='T_content' style="width:600px;; height:300px;font-size:15px; padding:20px;"><%=Server.htmlencode(LoadTemplate2)%></textarea></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff'><td width="12%"></td><td><input type="button" class="submit" onmouseover="this.className='submit2'" onmouseout="this.className='submit'"  value="返 回" onclick="document.location.href='page.asp?page=template_list.asp'" /></td></tr>
</table>
</div>
</div>
<%
end select
%>
</body>
</html>