📄 admin_picsort.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetadmin")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim totalpic,currentpage,totalpages,showye,founderr
Rem 判断数字是否整型
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
if request.form("MM_insert") then
if request.form("action")="newpiccat" then
sql="select * from a125_pic"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim piccatname
piccatname=trim(replace(request.form("piccat_name"),"'",""))
if piccatname="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
rs("piccat_name")=piccatname
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_picsort.asp?action=piccat"
end if
elseif request.form("action")="editpiccat" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from a125_pic where piccat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
piccatname=trim(replace(request.form("piccat_name"),"'",""))
if piccatname="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
rs("piccat_name")=piccatname
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_picsort.asp?action=piccat"
end if
elseif request.form("action")="delpiccat" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from a125_pic where piccat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_picsort.asp?action=piccat"
end if
end if%>
<HTML><HEAD><TITLE>网站管理系统 - 图片展示管理</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) topmargin='20' leftmargin='0' bottommargin='0'>
<%
if request.querystring("action")="piccat" then
sql="select * from a125_pic order by piccat_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<p align="center"><a href="admin_picsort.asp?action=piccat">图片分类管理</a> | <a href="admin_picsort.asp?action=newpiccat">添加图片分类</a></p>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>图片分类管理</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<tr bgcolor='#A1BBE0' class='td4'>
<td width="10%" height="23" ><div align="center">编号</div></td>
<td width="70%" height="23"><div align="center">分类名称</div></td>
<td width="20%" height="23"><div align="center">操作</div></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td align="center"><%=rs("piccat_id")%> </td>
<td><a href="#"><%=rs("piccat_name")%></a> </td>
<td align="center"><a href="admin_picsort.asp?id=<%=rs("piccat_id")%>&action=editpiccat">编辑</a> <a href="admin_picsort.asp?id=<%=rs("piccat_id")%>&action=delpiccat">删除</a> <a href="../pic.asp?cat_id=<%=rs("piccat_id")%>" target="_blank">查看</a></td>
</tr>
<%rs.movenext
loop
if rs.bof and rs.eof then%>
<tr align="center">
<td colspan="3">当前没有分类!</td>
</tr>
<%rs.close
set rs=nothing
end if%>
</table></td></tr></table><br>
<%end if
if request.querystring("action")="newpiccat" then%>
<p align="center"><a href="admin_picsort.asp?action=piccat">图片分类管理</a> | <a href="admin_picsort.asp?action=newpiccat">添加图片分类</a></p>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>新增图片分类</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<form name="form1" method="post" action="">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>分类名称-
<input type="text" name="piccat_name" size="40">
</td>
</tr>
<tr bgcolor='#115F8F'>
<td align="center">
<input type="submit" name="Submit" value="确定新增">
<input type="reset" name="Reset" value="清空重填">
</td>
</tr>
<input type="hidden" name="action" value="newpiccat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table></td></tr></table><br>
<%end if
if request.QueryString("action")="editpiccat" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的分类ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from a125_pic where piccat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>修改图片分类</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<form name="form1" method="post" action="">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>分类名称-
<input name="piccat_name" type="text" id="piccat_name" size="40" value="<%=rs("piccat_name")%>">
</td>
</tr>
<tr bgcolor='#115F8F'>
<td align="center"> <input name="Submit" type="submit" id="Submit" value="确定修改">
<input name="Reset" type="reset" id="Reset" value="清空重填"> </td>
</tr>
<input type="hidden" name="id" value="<%=rs("piccat_id")%>">
<input type="hidden" name="action" value="editpiccat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table></td></tr></table><br>
<%end if
if request.QueryString("action")="delpiccat" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的分类ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from a125_pic where piccat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>删除图片分类</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<form name="form1" method="post" action="">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>分类名称- <%=rs("piccat_name")%></td>
</tr>
<tr bgcolor='#115F8F'>
<td align="center">
<input name="Submit" type="submit" id="Submit" value="确定删除">
</td>
</tr>
<input type="hidden" name="id" value="<%=rs("piccat_id")%>">
<input type="hidden" name="action" value="delpiccat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
conn.Close
Set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -