📄 zhuanti.asp
字号:
<!--#include file="connection.asp"-->
<!--#include file="Vchar.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.reload('login.asp')</script>"
response.End
else
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if
end if
dim Action
Action=trim(request.QueryString("action"))
if Action="save" then call saveData()
if action="del" then call delData()
if action="add" then call addData()
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
}
-->
</style></head>
<body>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#5d5d5d">
<tr>
<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>图书专题管理</strong></font></div></td>
</tr>
<tr>
<td height="44" bgcolor="#dfdfdf"><br>
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#cecece">
<td width="33%"><div align="center">专题名称</div></td>
<td width="21%"><div align="center">专题排序</div></td>
<td width="31%"><div align="center">确定操作</div></td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_zhuanti order by zhuantiidorder ",conn,1,1
dim paixu
if rs.EOF and rs.BOF then
response.Write "<div align=center><font color=red>还没有专题</font></center>"
paixu=0
else
do while not rs.EOF
%>
<form name="form1" method="post" action="zhuanti.asp?action=save&id=<%=int(rs("zhuantiid"))%>">
<tr bgcolor="#cecece">
<td><div align="center">
<input name="zhuantiName" type="text" id="zhuantiName" size="12" value="<%=trim(rs("zhuantiName"))%>">
</div></td>
<td><div align="center">
<input name="zhuantiidorder" type="text" id="zhuantiidorder" size="4" value="<%=int(rs("zhuantiidorder"))%>">
</div></td>
<td><div align="center">
<input type="submit" name="Submit" value="修 改">
<a href="zhuanti.asp?id=<%=int(rs("zhuantiid"))%>&action=del" onClick="return confirm('您确定进行删除操作吗?')"><font color=red>删除</font></a>
</div></td>
</tr>
</form>
<%rs.MoveNext
loop
paixu=rs.RecordCount
end if%>
</table>
<br> </td>
</tr>
</table>
<br>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#5d5d5d">
<tr>
<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>添加新专题</strong></font></div></td>
</tr>
<tr>
<td bgcolor="#dfdfdf"><br>
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#cecece">
<td width="33%"><div align="center">专题名称</div></td>
<td width="21%"><div align="center">专题排序</div></td>
<td width="31%"><div align="center">确定操作</div></td>
</tr>
<form name="form1" method="post" action="zhuanti.asp?action=add">
<tr bgcolor="#cecece">
<td><div align="center">
<input name="zhuantiName" type="text" id="zhuantiName" size="12">
</div></td>
<td><div align="center">
<input name="zhuantiidorder" type="text" id="zhuantiidorder" size="4" value="<%=paixu+1%>">
</div></td>
<td><div align="center">
<input type="submit" name="Submit3" value="添 加">
</div></td>
</tr>
</form>
</table>
<br> </td>
</tr>
</table>
<br>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#5d5d5d">
<tr>
<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>操作注意事项及说明</strong></font></div></td>
</tr>
<tr>
<td height="31" bgcolor="#dfdfdf"><table width="80%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="16">·当删除专题时,专题内的图书将变成无专题……!</td>
</tr>
</table></td>
</tr>
</table><!--#include file="copyright.asp"-->
</body>
</html>
<%sub saveData()
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_zhuanti where zhuantiId="&int(request.QueryString("id")),conn,1,3
rs("zhuantiName")=trim(request("zhuantiName"))
rs("zhuantiIdOrder")=int(request("zhuantiIdOrder"))
rs.update
rs.close
response.redirect "zhuanti.asp"
end sub
sub addData()
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_zhuanti ",conn,1,3
rs.addnew
rs("zhuantiName")=trim(request("zhuantiName"))
rs("zhuantiIdOrder")=int(request("zhuantiIdOrder"))
rs.update
rs.close
response.redirect "zhuanti.asp"
end sub
sub delData()
conn.execute "delete from shop_zhuanti where zhuantiId="&int(request.QueryString("id"))
response.redirect "zhuanti.asp"
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -