📄 adminpublish.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临本图书馆</title>
<Link href="Css.css" rel=stylesheet>
</head>
<!--#include file="Conn.asp"-->
<!--#include file="Function.asp"-->
<body topmargin="0" leftmargin="0">
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="Images/title.jpg" width="283" height="51"></td>
</tr>
<% If Session("admin") <> "" Then %>
<tr>
<td height="25" ><table width="780" border="0" bgcolor="#EFEFEF" align="center" cellpadding="0" cellspacing="0" style="border-color:#000000;border-top-style: solid;border-top-width: 1">
<tr>
<td height="25" bgcolor="#EFEFEF"> <a href="Default.asp">首页 </a>|<a href="AdminBorrow.asp"> 借书管理 </a>|<a href="AdminPublish.asp"> 出版社管理 </a>|<a href="AdminBook.asp"> 图书管理 </a>|<a href="AdminUser.asp"> 用户管理 </a>|<a href="ModifyAdmin.asp"> 修改密码 </a>|<a href="Logout.asp"> 退出 </a>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="192" valign="top"><table width="100%" height="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="159" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#006666">
<tr align="center" bgcolor="#99AAA7">
<td height="30" colspan="2"><a href="AdminPublish.asp?action=Add">◆添加新出版社◆</a></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td width="33%" height="30">出版社名称</td>
<td width="34%" >相关操作</td>
</tr>
<% Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From publisherInfo"
Rs.Open Sql,conn,3,3
Do While not Rs.Eof
%>
<tr align="center" bgcolor="#FFFFFF">
<td height="30"><%=Rs("ptitle")%></td>
<td bgcolor="#FFFFFF">
<a href="AdminPublish.asp?action=Edit&pid=<%=Rs("pid")%>"><img src="Images/edit.jpg" width="15" height="15" border="0">修改</a>
<a href="javascript:if(window.confirm('你确实要删除此项记录吗?') == true){window.location ='AdminPublish.asp?action=Del&pid=<%=Rs("pid")%>';}"><img src="Images/delete.jpg" width="15" height="15" border="0">删除</a>
</td>
</tr>
<% Rs.MoveNext
Loop
Rs.Close
Set Rs=nothing
%>
<% Dim pid
pid=Request("pid")
If Request("action")="SaveEdit" Then
Call SaveEdit()
ElseIf Request("action")="SaveAdd" Then
Call SaveAdd()
ElseIf Request("action")="Del" Then
Call Del()
End If
%>
<% If Request("action")="Edit" Then
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From publisherInfo Where pid="&pid
Rs.Open Sql,conn,3,3
%>
<tr align="center" bgcolor="#FFFFFF">
<form name="form1" method="post" action="AdminPublish.asp?action=SaveEdit&pid=<%=pid%>">
<td height="30" bgcolor="#FFFFFF" colspan="2">修改出版社名称:
<input name="title" type="text" size="23" value="<%=Rs("ptitle")%>">
<input type="submit" name="Submit" value="确定修改">
</td></form>
</tr>
<% Rs.Close
Set Rs=nothing
End If
%>
<% If Request("action")="Add" Then %>
<tr align="center" bgcolor="#FFFFFF">
<form name="form1" method="post" action="AdminPublish.asp?action=SaveAdd" ID="Form1">
<td height="30" bgcolor="#FFFFFF" colspan="2">添加新出版社名称:
<input name="title" type="text" size="23" ID="Text1">
<input type="submit" name="Submit" value="确定添加" ID="Submit1">
</td></form>
</tr>
<% End If %>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<% Else %>
<tr>
<td height="50" align="center"><font color="ff0000">对不起,请不要非法登录!</font></td>
</tr>
<%End If%>
</table></td>
</tr>
<%
Sub SaveEdit()
dim title
title = Request.Form("title")
pid = Request("pid")
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From publisherInfo Where pid="&pid
Rs.Open Sql,conn,3,3
Rs("ptitle")=title
Rs.Update
Rs.Close
Set Rs=nothing
Response.Redirect "AdminPublish.asp?action=Edit&pid=" & pid
End Sub
%>
<%
Sub SaveAdd()
dim title
title=Request.Form("title")
If title = "" Then
Response.Write "<Script>alert('请输入要添加的出版社名称!')</Script>"
Else
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From publisherInfo"
Rs.Open Sql,conn,3,3
Rs.AddNew
Rs("ptitle") = title
Rs.Update
pid=Rs("pid")
Rs.Close
Set Rs=nothing
Response.Redirect "AdminPublish.asp"
End If
End Sub
%>
<%
Sub Del()
Dim pid
pid=Request("pid")
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From publisherInfo Where pid="&pid
Rs.Open Sql,conn,3,3
Rs.Delete
Rs.Update
Rs.Close
Set Rs=nothing
Response.Redirect "AdminPublish.asp"
End Sub
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -