⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managebook.asp

📁 图书销售系统,页面丰富,连接数据库,多个运行.
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#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
end if
if session("flag")>2 then
response.Write "<script language='javascript'>alert('您没有权限管理此页!');window.location.reload('login.asp')</script>"
end if
%>
<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">
</head>
<script language="javascript">
function chk1()
{
myform.action="managebook.asp?action=zhuanyi";return false
myform.submit();
}
function chk2()
{
myform.action="managebook.asp?action=del";return false
myform.submit();
}
function chkup()
{
return(confirm("您确定所选择的操作吗?"));
}
</script>

<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
   count = 0
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
		set rs=nothing
%>
		
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.Nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
             document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<body>
<%dim selectm,selectkey,selectbookid,queshu,anclassid,zhuanyi,action,comeurl
comeurl=request.ServerVariables("HTTP_REFERER")
action=request.QueryString("action")
zhuanyi=request("zhuanyi")
selectkey=trim(request(trim("selectkey")))
selectm=trim(request("selectm"))
if selectm="" then selectm=trim(request.QueryString("selectm"))
queshu=request.QueryString("queshu")
anclassid=request.QueryString("anclassid")
if selectkey="" then
selectkey=request.QueryString("selectkey")
end if
if selectm="" then  selectm=request.QueryString("selectm")
selectbookid=request("selectbookid")

select case action
case "del"   '//删除图书
if selectbookid="" then response.redirect  Request.ServerVariables("HTTP_REFERER")
conn.execute "delete from shop_books where bookid in ("&selectbookid&")"
response.write "<script language=javascript>alert('所选图书已删除成功!');window.location.reload('"&comeurl&"')</script>"
response.End
case "zhuanyi"   '//转移图书目录
if zhuanyi="" or selectbookid="" then response.Redirect Request.ServerVariables("HTTP_REFERER")
conn.execute "update shop_books set anclassid="&int(request("anclassid"))&" where bookid in ("&selectbookid&")"
conn.execute "update shop_books set nclassid="&int(request("nclassid"))&" where bookid in ("&selectbookid&")"
response.write "<script language=javascript>alert('所选图书已完成分类转移!');window.location.reload('"&comeurl&"')</script>"
response.End
end select


%>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6396D6">
  <tr> 
    <td width="57%" height="18" background="images/admin_bg.gif"><div align="right"><font color="#FFFFFF"> 
        <b><%if queshu="yes" then
	response.write "管理缺少图书"
	else
	response.write "图书查看与修改"
	end if%></b>
        </font></div></td>
    <td width="43%" background="images/admin_bg.gif"> <div align="right">
        <%set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from shop_anclass order by anclassidorder ",conn,1,1%>
		 <select name="select" onchange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" ><base target=Right>
          <option>请选择图书分类</option>
		  <%do while not rs.eof%>
		  <option value="managebook.asp?anclassid=<%=int(rs("anclassid"))%>&queshu=<%=queshu%>" <%if trim(anclassid)=trim(rs("anclassid")) then response.write "selected"%>><%=trim(rs("anclass"))%></option>
		  <%rs.movenext
		  loop
		  rs.close
		  set rs=nothing%>
        </select>
      </div></td>
  </tr>
  <tr bgcolor="#DEE7FF">
    
      <td height="113" colspan="2"><table width="12" height="7" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td height=7></td>
          </tr>
        </table>
		<form name="myform" method="post" action="" onsubmit="return chkup();">
        <%'开始分页
				Const MaxPerPage=20
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if 
			set rs=server.CreateObject("adodb.recordset")
			if queshu="yes" then  '缺书状态
			if anclassid="" or anclassid=0 then  '没有选择分类
			select case selectm
			case ""
            rs.open "select bookid,bookname,adddate,shichangjia,huiyuanjia,tuantijia,bestbook,bookchuban from shop_books where queshu=1 order by adddate desc",conn,1,1
		    case "0"
			response.write "<center>请返回选择您要查询的方式!<br><br><a href=javascript:history.go(-1)>点击返回上一页</a></center>"
			response.End
			case "name"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookname like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "zuozhe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookzz like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "chubanshe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookchuban like '%"&selectkey&"%' order by adddate desc",conn,1,1
		    case "isbn"
		    rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and isbn = '"&selectkey&"' order by adddate desc",conn,1,1
			case "bookid"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookid="&int(selectkey)&" order by adddate desc",conn,1,1
			case "pubdate"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookdate='"&selectkey&"' order by adddate desc",conn,1,1
			
		    end select
		  else  '选择分类
		  select case selectm
			case ""
            rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and anclassid="&anclassid&" order by adddate desc",conn,1,1
		    case "0"
			response.write "<center>请返回选择您要查询的方式!<br><br><a href=javascript:history.go(-1)>点击返回上一页</a></center>"
			response.End
			case "name"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and anclassid="&anclassid&" and bookname like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "zuozhe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and anclassid="&anclassid&" and bookzz like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "chubanshe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and anclassid="&anclassid&" and bookchuban like '%"&selectkey&"%' order by adddate desc",conn,1,1
		  case "isbn"
		  	rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookdate="&anclassid&" and isbn = '"&selectkey&"' order by adddate desc",conn,1,1
			case "bookid"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookid="&int(selectkey)&" order by adddate desc",conn,1,1
			case "pubdate"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=1 and bookdate='"&selectkey&"' order by adddate desc",conn,1,1
		  
		  end select
		  end if
		'////////////////////////////////////////////////////
		  else  '缺书状态
		  if anclassid=""  then  '没有选择分类
		  select case selectm
			case ""
            rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 order by adddate desc",conn,1,1
		    case "0"
			response.write "<center>请返回选择您要查询的方式!<br><br><a href=javascript:history.go(-1)>点击返回上一页</a></center>"
			response.End
			case "name"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookname like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "zuozhe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookzz like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "chubanshe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookchuban like '%"&selectkey&"%' order by adddate desc",conn,1,1
		  case "isbn"
		  	rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and isbn = '"&selectkey&"' order by adddate desc",conn,1,1
		  case "bookid"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookid="&int(selectkey)&" order by adddate desc",conn,1,1
			case "pubdate"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookdate like '%"&selectkey&"%' order by adddate desc",conn,1,1
		  end select
		  else
		  select case selectm
			case ""
            rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and anclassid="&anclassid&" order by adddate desc",conn,1,1
		    case "0"
			response.write "<center>请返回选择您要查询的方式!<br><br><a href=javascript:history.go(-1)>点击返回上一页</a></center>"
			response.End
			case "name"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and anclassid="&anclassid&" and bookname like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "zuozhe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and anclassid="&anclassid&" and bookzz like '%"&selectkey&"%' order by adddate desc",conn,1,1
			case "chubanshe"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and anclassid="&anclassid&" and bookchuban like '%"&selectkey&"%' order by adddate desc",conn,1,1
		  case "isbn"
		  	rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and anclassid="&anclassid&" and isbn = '"&selectkey&"' order by adddate desc",conn,1,1
			case "bookid"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookid="&int(selectkey)&" order by adddate desc",conn,1,1
			case "pubdate"
			rs.open "select bookid,bookname,adddate,bookchuban,shichangjia,huiyuanjia,bestbook,tuantijia from shop_books where queshu=0 and bookdate='"&selectkey&"' order by adddate desc",conn,1,1
		  
		  end select
		  end if
		  end if
		  
		   	if err.number<>0 then
				response.write "数据库中无数据"
				end if
				
  				if rs.eof And rs.bof then
       				Response.Write "<p align='center' class='contents'> 数据库中没有您要查看的图书!</p>"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -