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

📄 editbook.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
dim bookid
bookid=request.QueryString("id")
dim paihangkongzhi
set rs=server.CreateObject("adodb.recordset")
rs.open "select paihangkongzhi from shop_config",conn,1,1
paihangkongzhi=int(rs("paihangkongzhi"))
rs.close
set rs=nothing
%>
<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>
<%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
%>
		
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>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6396D6">
  <tr> 
    <td height="18" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>添加新图书</strong></font></div></td>
  </tr>
  <tr><form name="myform" method="post" action="saveaddbook.asp?action=edit&id=<%=bookid%>">
      <td height="126" bgcolor="#DEE7FF"><br>
        <table width="88%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
          <tr bgcolor="#DEE7FF"> 
            <td width="13%" style="Padding-left:6px">选择分类:</td>
            <td colspan="2" style="Padding-left:6px"> <%
        rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
	dim rs2,rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_books where bookid="&bookid,conn,1,1
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select shop_anclass.anclass,shop_nclass.nclass from shop_anclass,shop_nclass where shop_nclass.anclassid=shop_anclass.anclassid and shop_nclass.nclassid="&rs1("nclassid") ,conn,1,1
dim selclass
selclass=int(rs1("anclassid"))
%> <select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                <option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                <% 
        rs.movenext
        do while not rs.eof
response.write "<option value="&rs("anclassid")
if trim(rs("anclass"))=trim(rs2("anclass")) then
response.write " selected>"
else
response.write ">"
end if
response.write trim(rs("anclass"))&"</option>"
               
        rs.movenext
        loop
	end if
        rs.close
%>
              </select>
              小类:<select name="Nclassid">
                <%rs.open "select * from shop_Nclass where Anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
response.write "<option value="&rs("nclassid")
if trim(rs("nclass"))=trim(rs2("nclass")) then
response.write " selected"
end if
response.write ">"
response.write trim(rs("nclass"))&"</option>"
 rs.movenext
do while not rs.eof
response.write "<option value="&rs("nclassid")
if trim(rs("nclass"))=trim(rs2("nclass")) then
response.write " selected"
end if
response.write ">"
response.write trim(rs("nclass"))&"</option>"
 rs.movenext
loop
end if
        rs.close
        set rs = nothing
        
%>
              </select> <%
			 rs2.close
			 set rs2=nothing			  
			  %> &nbsp; &nbsp; <input name="fenlei" type="checkbox" id="fenlei" value="1" checked>
              修改图书分类 &nbsp;&nbsp;&nbsp;&nbsp; </td>
          </tr>
          <tr bgcolor="#DEE7FF">
            <td style="Padding-left:6px">所属专题:</td>
            <td colspan="2" style="Padding-left:6px"><select name="zhuantiId">
                <%set rs=server.CreateObject("adodb.recordset")
				rs.open "select * from shop_zhuanti order by zhuantiIdOrder",conn,1,1%>
                <option value="0" selected>+ 请选择所属专题 +</option>
                <option value="0" <%if int(rs1("zhuantiId"))=0 then response.write "selected"%>>不属于任何专题</option>
                <%
				
				do while not rs.eof
				response.write "<option value="&rs("zhuantiId")
				if int(rs1("zhuantiId"))=int(rs("zhuantiId")) then response.write " selected "
				response.write ">"&trim(rs("zhuantiName"))&"</option>"
				rs.movenext
				loop
				
				rs.close
				set rs=nothing
				
				%>
              </select></td>
          </tr>
          <tr bgcolor="#DEE7FF"> 
            <td style="Padding-left:6px">图书名称:</td>
            <td colspan="2" style="Padding-left:6px"><input name="bookname" type="text" id="bookname" size="60" value="<%=trim(rs1("bookname"))%>"></td>
          </tr>
          <tr bgcolor="#DEE7FF"> 
            <td style="Padding-left:6px">图书作者:</td>
            <td colspan="2" style="Padding-left:6px"><input name="bookzz" type="text" id="bookzz" size="30" value="<%=trim(rs1("bookzz"))%>"></td>
          </tr>
          <tr bgcolor="#DEE7FF"> 
            <td style="Padding-left:6px">出 版 社:</td>
            <td colspan="2" style="Padding-left:6px"><input name="bookchuban" type="text" id="bookchuban" size="30" value="<%=trim(rs1("bookchuban"))%>"></td>
          </tr>
          <tr bgcolor="#DEE7FF"> 
            <td height="20" style="Padding-left:6px">出版日期:</td>
            <td colspan="2" style="Padding-left:6px"><select name="bookdateyear" id="bookdateyear">
                <%dim i
				for i=1998 to 2008 
				response.write "<option value="&i
				if year(rs1("bookdateorder"))=i then
				response.write " selected"
				end if
				response.write ">"&i&"</option>"
				next
			%>
              </select>
              <select name="bookdatemonth" id="bookdatemonth">
                <%for i=1 to 12
				response.write "<option value="&i
				if month(rs1("bookdateorder"))=i then
				response.write " selected"
				end if
				response.write ">"&i&"</option>"
				next%>
              </select>

⌨️ 快捷键说明

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