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

📄 selectproduct.asp

📁 一个不错的个人商务网站的源码
💻 ASP
字号:
<%dim nowplace
nowplace="product"
dim dbpath
dbpath="../"
%>
<!--#include file="chk.asp"-->
<!--#include file="../db_conn.asp" -->
<!--#include file="../comm/my_request.asp" -->
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选择商品</title>
<link href=AdminStyle.css rel=stylesheet type=text/css>
</head>
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from small_class order by addtime desc"
rs.open sql,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("txt_small_class"))%>","<%= trim(rs("iid"))%>","<%= trim(rs("id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form1.sid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form1.sid.options[document.form1.sid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    } 
function change(id)
{
var str;
str="selectproduct.asp?id="+id
location=str;
}

function copyto(a,b)
{
var a;
var b;
window.opener.document.form1.pname.value=b;
window.opener.document.form1.pid.value=a;
window.close()
}   
</script>
<body style="text-align: center">

<table border="0" width="100%" id="table1" cellspacing="1" cellpadding="4" style="border: 1px solid #183789; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
	<tr>
		<td background="Image/admin_bg_1.gif" height="25"><font color="#FFFFFF">
		<b>选择商品</b></font></td>
	</tr><form name=form1>
	<tr>
		<td><b>第一步:请选择类别</b></td>
	</tr>
	<tr>
		<td><select size="1" name="bid" onChange="changelocation(document.form1.bid.options[document.form1.bid.selectedIndex].value)">
		<option value="">≡≡请选择大类≡≡</option>
		<%
		sql="select id,txt_big_class from big_class order by addtime"
		set rs=conn.execute (sql)
		set id=rs("id")
		set big_class=rs("txt_big_class")
		do while not rs.eof
		%>
		<option value="<%=id%>"><%=big_class%></option>
		<%rs.movenext
		loop
		%>
		
		</select> <select name="sid" onChange="change(document.form1.sid.options[document.form1.sid.selectedIndex].value)" style='width:147;background-color:white;font-size:12;color:black; height:18' size="1"> 
<option selected value="">≡≡请选择小类≡≡</option></select></td>
	</tr></form>
	<%id=my_request("id",1)
	if id<>"" or isnull(id) then%>
	<tr>
		<td><b>第二步:请选择具体的商品(点击)</b></td>
	</tr>
	<tr>

		<td>
		<table border="0" width="100%" id="table2">
			<tr><%
	set rs=conn.execute ("select id,p_name from yqj_product where sid="&id)
	if rs.eof then
	else
	j=1
	do while not rs.eof
	%>
	<td width=30%><%=j&"."%><a href=# onclick="copyto(<%=rs(0)%>,'<%=rs(1)%>')" title="点击并选择"><%=rs(1)%></a></td>
	<%
	if j mod 3=0 then
	response.write "</tr>"
	end if
	rs.movenext
	j=j+1
	loop
	rs.close
	set rs=nothing
	end if
	%>
		</table>
		</td>
	<%
	end if
	%>
	<tr>

		<td>
		<p align="center"><input type="button" value="关闭窗口" name="B3" onclick="window.close();"></td>
	</table>

</body>

</html>

⌨️ 快捷键说明

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