admin_userskinbak.asp
来自「实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员」· ASP 代码 · 共 666 行 · 第 1/2 页
ASP
666 行
<%
if session("globalecmaster")="" or session("masterflag")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login.asp';</SCRIPT>"
response.end
end if
%>
<% data_path="../../" 'ACC连接数据库路径,对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<html>
<head>
<title>用户模版管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/style.css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<SCRIPT language=javascript>
function unselectall()
{
if(document.form2.chkAll.checked){
document.form2.chkAll.checked = document.form2.chkAll.checked&0;
}
}
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;
}
}
</SCRIPT>
<%
dim action
const msg_per_page=100
dim totalPut,CurrentPage,TotalPages,strGuide,ispass
Action=trim(request("Action"))
select case Action
case "saveconfig"
call saveconfig()
case "showskin"
call showskin()
case "modiskin"
call modiskin()
case "savedefault"
call savedefault()
case "delconfig"
call delconfig()
case "addskin"
call addskin()
case "saveaddskin"
call saveaddskin()
case "passskin"
call passskin
case "unpassskin"
call unpassskin
end select
sub showskin()
dim rs,psql,sql,strFileName
ispass=clng(request("ispass"))
if ispass=1 then
strFileName="admin_userskin.asp?action=showskin&ispass=1"
psql=" where ispass=1 "
else
strFileName="admin_userskin.asp?action=showskin&ispass=0"
psql=" where ispass=0 "
end if
set rs=Server.CreateObject("Adodb.RecordSet")
sql="select id,userskinname,skinauthor,skinauthorurl,isdefault,ispass,skinpic from Yixiang_userskin "&psql&" order by id desc "
rs.Open sql,Conn,1,1
if rs.eof and rs.bof then
strGuide=strGuide & " (共有0个模板)</h1>"
response.write "<div align='right'>"&strGuide&"</div>"
else
dim i
i=0
%>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<br>
<table cellpadding="2" cellspacing="1" border="0" width="98%" class="tableBorder" align=center>
<tr align="center">
<th height=25 align="center"><strong>用户模版管理</strong></th>
</tr>
<tr align="center">
<td height=25 align="left" class="forumRow">管理选项:<strong> </strong><a href="admin_userskin.asp?action=showskin&ispass=1">通过审核的模板</a> <a href="admin_userskin.asp?action=showskin&ispass=0">未通过审核的模版</a><br>
<span class="STYLE1">注意>>所有的模版文件的图片与CSS都放在/skin/目录下</span></td>
</tr>
</table>
<form name="form2" method="post" action="admin_userskin.asp" onSubmit="return confirm('确定要执行选定的操作吗?');">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" Class="tableBorder">
<tr >
<th height="25" colspan="6" class="tableHeaderText"><strong><%if ispass=1 then response.Write "通过审核的模板" else response.write "未通过审核的模版"%></strong></th>
</tr>
<tr >
<td width="10%" height="25" class="bodytitle"> <div align="center">ID</div></td>
<td width="20%" class="bodytitle"> <div align="center">名称<b>(红色为默认模板)</b></div></td>
<td width="10%" class="bodytitle"> <div align="center">审核</div></td>
<td width="10%" class="bodytitle"> <div align="center">选中</div></td>
<td width="40%" class="bodytitle"> <div align="center">模版管理</div></td>
</tr>
<%
do while not rs.eof
dim userskinname
userskinname=rs("userskinname")
%>
<tr class=forumRow >
<td width="10%" class=forumRow> <div align="center"><%= rs("id") %> </div></td>
<td width="20%" class=forumRow> <div align="center">
<%if rs("isdefault")=1 then
response.Write "<font color='red'>"&userskinname&"</red>"
else
response.Write userskinname
end if
%>
</div></td>
<td width="10%" class=forumRow> <div align="center"><%if rs("ispass")=1 then response.Write("已审核") else response.Write("未审核")%></div></td>
<td width="10%" class=forumRow> <div align="center">
<input name="checkbox" type="checkbox" onClick="unselectall()" id= "checkbox" class=forumRow value='<%=rs("id")%>'>
</div></td>
<td width="40%" class=forumRow> <div align="left">
<a href="../showskin.asp?id=<%=rs("id")%>" target="_blank">预览</a>
<%if ispass=0 then%>
<a href="admin_userskin.asp?action=passskin&id=<%=rs("id")%>">通过审核</a>
<%else%>
<a href="admin_userskin.asp?action=unpassskin&id=<%=rs("id")%>">取消审核</a>
<%end if%>
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<option value="">请选择要修改的模板</option>
<option value="admin_edit.asp?skinorder=0&id=<%=rs("id")%>">修改主模版</option>
<option value="admin_edit.asp?skinorder=2&id=<%=rs("id")%>">修改供应信息模版</option>
<option value="admin_edit.asp?skinorder=3&id=<%=rs("id")%>">修改产品展厅模版</option>
<option value="admin_edit.asp?skinorder=4&id=<%=rs("id")%>">修改采购信息模版</option>
<option value="admin_edit.asp?skinorder=5&id=<%=rs("id")%>">修改公司介绍模版</option>
<option value="admin_edit.asp?skinorder=6&id=<%=rs("id")%>">修改客户评价模版</option>
<option value="admin_edit.asp?skinorder=7&id=<%=rs("id")%>">修改展会信息模版</option>
<option value="admin_edit.asp?skinorder=8&id=<%=rs("id")%>">修改招聘中心模版</option>
<option value="admin_edit.asp?skinorder=9&id=<%=rs("id")%>">修改客户留言模版</option>
<option value="admin_edit.asp?skinorder=10&id=<%=rs("id")%>">修改联系方式模版</option>
</select>
<a href="admin_userskin.asp?action=modiskin&id=<%=rs("id")%>">修改模版(文本方式)</a>
<a href="admin_userskin.asp?action=delconfig&id=<%=rs("id")%>" onclick=return(confirm("确定要删除这个模版吗?"))>删除模版</a></div></td>
</tr>
<%
i=i+1
if i>=msg_per_page then exit do
rs.movenext
loop
%><tr>
<td height="40" colspan="6" align="center" class=forumRow> <div align="center">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox" />
全选
<input type="radio" value="savedefault" name="action" checked>默认模板</option>
<%if ispass=0 then%>
<input type="radio" value="passskin" name="action" >通过审核</option>
<%else%>
<input type="radio" value="unpassskin" name="action">取消审核</option>
<%end if%>
<input type="radio" value="delconfig" name="action" >删除</option>
<input type="submit" name="Submit" value="保存设置">
</div></td>
</tr>
<tr height="20" bgcolor="#ffffff">
<td class=forumrowHighLight align="center" colspan="5"><b><%
%></b></td>
</tr>
</table>
</form>
<%
end if
rs.Close
set rs=Nothing
end sub
sub savedefault()
dim isdefaultID
isdefaultID=trim(request("checkbox"))
if instr(isdefaultID,",")>0 then
Response.Write("<script language=javascript>alert('用户默认模板只可以选择一个!');history.back();</script>")
Response.End()
elseif isdefaultID="" then
Response.Write("<script language=javascript>alert('请指定要设定为默认的模板!');history.back();</script>")
Response.End()
exit sub
end if
conn.execute("update Yixiang_userskin set isdefault=0")
conn.execute("update Yixiang_userskin set isdefault=1 where id="&isdefaultID)
Response.Write"<script language=JavaScript>"
Response.Write"alert(""修改成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
end sub
sub passskin()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
id=replace(id," ","")
conn.execute("update Yixiang_userskin set ispass=1 where id in ("&id&")")
elseif id="" then
id=clng(request("id"))
conn.execute("update Yixiang_userskin set ispass=1 where id="&id)
else
conn.execute("update Yixiang_userskin set ispass=1 where id="&id)
end if
Response.Write"<script language=JavaScript>"
Response.Write"alert(""通过审核成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
response.end
end sub
sub unpassskin()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
id=replace(id," ","")
conn.execute("update Yixiang_userskin set ispass=0 where id in ("&id&")")
elseif id="" then
id=clng(request("id"))
conn.execute("update Yixiang_userskin set ispass=0 where id="&id)
else
conn.execute("update Yixiang_userskin set ispass=0 where id="&id)
end if
Response.Write"<script language=JavaScript>"
Response.Write"alert(""取消审核成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
response.end
end sub
sub saveconfig()
dim rs,sql
if trim(request("userskinname"))="" then oblog.sys_err("模版名不能为空"):response.End()
if trim(request("skinmain"))="" then oblog.sys_err("主模版不能为空"):response.End()
'if trim(request("skinshowlog"))="" then oblog.sys_err("副模版不能为空"):response.End()
set rs=server.CreateObject("adodb.recordset")
sql="select * from Yixiang_userskin where id="&clng(request.QueryString("id"))
if not IsObject(conn) then link_database
rs.open sql,conn,1,3
rs("userskinname")=trim(request("userskinname"))
rs("skinauthor")=trim(request("skinauthor"))
rs("skinmain")=request("skinmain")
rs("skinshowlog")=request("skinshowlog")
rs("skinpic")=trim(request("skinpic"))
rs("skinauthorurl")=trim(request("skinauthorurl"))
rs("SkinSupply")=trim(request("SkinSupply"))
rs("SkinPtHall")=trim(request("SkinPtHall"))
rs("SkinPurInfo")=trim(request("SkinPurInfo"))
rs("SkinCompanyInfo")=trim(request("SkinCompanyInfo"))
rs("SkinCusApp")=trim(request("SkinCusApp"))
rs("SkinUnInfo")=trim(request("SkinUnInfo"))
rs("SkinEmpInfo")=trim(request("SkinEmpInfo"))
rs("SkinCusMsg")=trim(request("SkinCusMsg"))
rs("SkinCantact")=trim(request("SkinCantact"))
rs.update
rs.close
set rs=nothing
Response.Write"<script language=JavaScript>"
Response.Write"alert(""保存成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
response.end
end Sub
sub delconfig()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
id=replace(id," ","")
conn.execute("delete from Yixiang_userskin where id in ("&id&")")
elseif id="" then
id=clng(request.QueryString("id"))
conn.execute("delete from Yixiang_userskin where id="&id)
else
conn.execute("delete from Yixiang_userskin where id="&id)
end if
Response.Write"<script language=JavaScript>"
Response.Write"alert(""删除成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
response.end
end sub
sub modiconfig()
dim rs
set rs=conn.execute("select * from Yixiang_userskin where id="&clng(request.QueryString("id")))
End Sub
sub saveaddskin()
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
'if trim(request("userskinname"))="" then oblog.sys_err("模版名不能为空"):response.End()
if trim(request("userskinname"))="" then
Response.Write"<script language=JavaScript>"
Response.Write"alert(""模版名不能为空!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
response.End()
end if
'if trim(request("skinmain"))="" then oblog.sys_err("主模版不能为空"):response.End()
if trim(request("skinmain"))="" then
Response.Write"<script language=JavaScript>"
Response.Write"alert(""主模版不能为空!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?