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

📄 editbook.asp

📁 佳可商务购物程序v1.0
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');history.go(-1);</script>"
response.End
end if
dim bookid
bookid=request.QueryString("id")
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<%dim count%>
<script language = "JavaScript">
subcat = new Array();
subcatz = new Array();
<%
   count = 0
  set rs=server.createobject("adodb.recordset")
  rs.open "select * from shop_Nclass order by Nclassidorder ",conn,1,1
  
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>

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

    var locationid=locationid;
    var i;
    var j;
    var k;
    j=1;
    for (i=0;i < <%=count%>; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
            if (j==1)
            {
            j=2;
            k=subcat[i][2];
            };
             document.myform.nclassid.options[document.myform.nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    changelocationz(k);    
    }

<%
   count = 0
  set rs=server.createobject("adodb.recordset")
  rs.open "select * from shop_Zclass order by Zclassidorder ",conn,1,1
  
   do while not rs.eof 
%>
subcatz[<%=count%>] = new Array("<%= trim(rs("Zclass"))%>","<%= rs("nclassid")%>","<%= rs("Zclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>

function changelocationz(locationid)
    {
    document.myform.zclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < <%=count%>; i++)
        {
            if (subcatz[i][1] == locationid)
            { //这句不是很理解
             document.myform.zclassid.options[document.myform.zclassid.length] = new Option(subcatz[i][0], subcatz[i][2]);
            }        
        }
        
    }
</script>
<body bgcolor="#799AE1">
<table width="80%" border="1" cellspacing="0" cellpadding="1" bordercolor="#6699FF" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td background="../images/back_3.gif" rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6B8FC8">
                          <tr> 
                            <td bgcolor="#FFFFFF" height="20"> 
                              <div align="center"><font color="#000000">修改商品</font></div>
                            </td>
                          </tr>
                          <tr> 
                            <form name="myform" method="post" action="saveaddbook.asp?action=edit&id=<%=bookid%>">
                              <td height="126" bgcolor="#E8F1FF"> 
                                <table width="88%" border="0" align="center" cellpadding="2" cellspacing="0">
                                  <tr> 
                                    <td width="16%"> 
                                      <div align="center">选择分类:</div>
                                    </td>
                                    <td colspan="2"> <%dim selanclass,selnclass,rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_books where bookid="&bookid,conn,1,1
        rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加大类!"
	response.end
	else
%> 
                                      大类:<select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                                        <%      
         selanclass=rs("anclassid")
        do while not rs.eof
%> 
                                        <option value="<%=rs("anclassid")%>" <%if rs1("anclassid")=rs("anclassid") then%>selected<%selanclass=rs("anclassid")%><% end if%>><%=trim(rs("anclass"))%></option>
                                        <%
        rs.movenext
        loop
	end if
        rs.close
%> 
                                      </select>小类:<select name="nclassid">
                                        <%rs.open "select * from shop_Nclass where anclassid="&selanclass ,conn,1,1
if (rs.eof and rs.bof) then
%> 
                                        <option selected value="0">请添加小类</option>
<%selnclass=0
else
selnclass=rs("NclassID")
do while not rs.eof%> 
                                        <option value="<%=rs("NclassID")%>" <%if rs1("nclassid")=rs("nclassid") then%>selected<%selnclass=rs("nclassid")%><% end if%>><%=rs("Nclass")%></option>
                                        <% rs.movenext
loop
end if
        rs.close
        
%> 
                                      </select>专题:<select name="zclassid">
                                        <%rs.open "select * from shop_zclass where nclassid="&selnclass ,conn,1,1
if (rs.eof and rs.bof) then
%> 
                                        <option selected value="0">请添加专题</option>
<%
else
do while not rs.eof%> 
                                        <option value="<%=rs("zclassID")%>" <%if rs1("zclassid")=rs("zclassid") then%>selected<% end if%>><%=rs("zclass")%></option>
                                        <% rs.movenext
loop
end if
        rs.close
        set rs = nothing
        
%> 
                                      </select>
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td> 
                                      <div align="center">
                                        <input type="text" name="mch" size="12" value="<%=rs1("mch")%>">
                                      </div>
                                    </td>
                                    <td colspan="2"> 
                                      <input name="bookname" type="text" id="bookname" size="30" value="<%=trim(rs1("bookname"))%>">
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td> 
                                      <div align="center">
                                        <input type="text" name="pp" size="12" value="<%=rs1("pp")%>">
                                      </div>
                                    </td>
                                    <td colspan="2"> 
                                      <input name="pingpai" type="text" id="pingpai" size="20" value="<%=trim(rs1("pingpai"))%>">
                                      <%
set rs_s=server.createobject("adodb.recordset")
rs_s.open "select * from pingpai order by pingpaiorder ",conn,1,1
%> 
                                      <select name="select" onChange="(document.myform.pingpai.value=this.options[this.selectedIndex].value)">
                                        <option selected>请选择品牌</option>
                                        <%
while not rs_s.eof
%> 
                                        <option value="<%=rs_s("pingpainame")%>"><%=rs_s("pingpainame")%></option>
                                        <%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%> 
                                      </select>
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td> 
                                      <div align="center">
                                        <input type="text" name="qch" size="12" value="<%=rs1("qch")%>">

⌨️ 快捷键说明

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