<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选择组合商品</title>
<link href="i.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body{margin:5; padding:0;}
.style1 {font-size: 14px}
.style11 {
	font-size: 14px;
	color: #990000;
	font-weight: bold;
}
.style12 {color: #990000}
-->
</style>

<script language="javascript">
<!--
function SetBgColor(Menu)
{
		Menu.style.background="#F5F5F4";
}
function RestoreBgColor(Menu)
{
		Menu.style.background="#ffffff";
}
-->
</script>
<SCRIPT LANGUAGE="JavaScript"> 
<!-- 
function pick(sym0) 
{ 
	if (window.opener && !window.opener.closed) 
	window.opener.document.theForm.zuhepkid.value = window.opener.document.theForm.zuhepkid.value + sym0; 
	window.opener.document.theForm.zuhepkid.focus(); 
	window.opener.document.theForm.model.focus();
	window.close(); 
} 
// --> 
</SCRIPT> 
</head>

<body margintop=0>
<TABLE width="650" border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
<tr>
<form name="form1" method="post" action="prozuhelist.asp">
<TD>
主分类:<select name="kind" style="width:150px; font-size:12px;" onChange="window.location.href='<%=nowpath%>?kind='+ this.options[this.selectedIndex].value">
          <%
	  dim rs,sql,maxkind,kindnum,kindname,grade,i,gradestr

	response.write "<option value=''></option>"

		sql="select * from sh_kind order by kindnum"
		set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,1
		if rs.bof or rs.eof then
		else
		do while not rs.eof
			kindnum=rs("kindnum")
			kindname=rs("kindname")
			grade=len(kindnum)/4
			i=1
			gradestr=""
			for i=1 to grade-1
				gradestr=gradestr &"—"
			next
			response.write "<option value='"&kindnum&"'>|—"&gradestr&kindname&"</option>"
		rs.movenext
		loop
		end if
		rs.close
		set rs=nothing
%>
        </select>&nbsp; 编号或商品名关键字<input name="myword" type="text" size="14" maxlength="25"> <input type="submit" name="Submit" value="搜索">
		&nbsp; <a href='prozuhelist.asp'>全部商品</a>
</TD>
</form>
</tr>
</table>
<TABLE width="98%" border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
  <tr>
    <td> 
		<%
		dim kind,nowpage
		dim pkid,model,productname,smallpicpath,price1,price2,pipai
		
		kind=request("kind")
		myword=request("myword")
		nowpage=request("page")

		sql_condition=" where pkid>0 "
		if myword<>"" then
			sql_condition=sql_condition&" and model like '%"&myword&"%' or productname like '%"&myword&"%' "
		end if
		if kind<>"" then
			sql_condition=sql_condition&" and kind like '"&kind&"%' "
		end if

		sql="select pkid,model,productname,smallpicpath,price1,price2,kindname,pipai,addtime from view_product "&sql_condition&" order by pkid desc"
		
		set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,1
		if rs.bof or rs.eof then
			response.write "没有商品记录！"
		else
		
		
		i=1
		%>
								  <TABLE align=center border=1 cellPadding=2 cellSpacing=0 width="99%"  bordercolorlight=#e1e1e1 bordercolordark=#ffffff>
									<TBODY>
									<tr height=30 bgcolor=#e1e1e1>
									  <td>&nbsp;</td>
									  <td align="center">商品号</td>
									  <td align="center">品　牌</td>
									  <td align="center">商品名</td>
									  <td align="center">市场价</td>
									  <td align="center">会员价</td>
									  
									  <td>选择</td>
									</tr>
									  
										
		<%
					rs.pagesize=10
					rs.absolutepage=1
					if request("page")<>"" then rs.absolutepage=request("page")
					rowcount=rs.pagesize
					if not rs.eof then
						do while not rs.eof and rowcount>0
						pkid=rs("pkid")
						model=rs("model")
						productname=rs("productname")
						smallpicpath=rs("smallpicpath")
						price1=rs("price1")
						price2=rs("price2")
						pipai=rs("pipai")
						kindname=rs("kindname")
						'addtime=rs("addtime")
		%>
								<TR height='30' Onmouseover='return SetBgColor(this);' Onmouseout='return RestoreBgColor(this);'> 
									  <td><div align="center"><A href="show.asp?pkid=<%=pkid%>"> <IMG src="<%=smallpicpath%>" height='40' border="0" class=img1></A></div></td>
									  <td><%=model%>&nbsp;</td>
									  <td><%=pipai%>&nbsp;</td>
									  <td style=' WIDTH: 230px;'><%=productname%></td>
									  <td><FONT class='oldprice'><del>￥<%=price1%></del></FONT></td>
									  <td><font class='nowprice'>￥<%=price2%></font></td>
									  
									  <td align="center"><a href="javascript:void(0)" onclick="pick(',<%=pkid%>')">选择</a></td>
		
								</TR>
									<%
		
						rs.movenext
						rowcount=rowcount-1
						loop
					end if
		
		%>
									   
		
									</TBODY>
								  </TABLE>
									   <table><TR> 
										<TD height="1"></TD>
									  </TR></table>
		
		<%
		if nowpage="" then nowpage=1
		nowpath=request.servervariables("script_name")
		kind=server.URLEncode(kind)
		response.write "<table width='550' align='center'>"
		  response.write "<tr> "
		   response.write " <td width='440' height='22' align=right style='font-size:9pt;'> "
				response.write "共"&rs.recordcount&"条记录&nbsp;每页10条&nbsp;现在 "&nowpage&"/"&rs.pagecount &" 页&nbsp;"	
				response.write "<input type='button' name='Button3' value='首页' onclick=window.location.href='"&nowpath&"?kind="&kind&"&myword="&myword&"&none='>&nbsp;"
				if clng(nowpage)>1 then
				response.write "<input type='button' name='Button4' value='上页' onclick=window.location.href='"&nowpath&"?page="&nowpage-1&"&kind="&kind&"&myword="&myword&"&none='>&nbsp;"
				else
				response.write "<input type='button' name='Button4' value='上页'>&nbsp;"
				end if
				if clng(nowpage)<>clng(rs.pagecount) then
				response.write "<input type='button' name='Button5' value='下页' onclick=window.location.href='"&nowpath&"?page="&nowpage+1&"&kind="&kind&"&myword="&myword&"&none='>&nbsp;"
				else
				response.write "<input type='button' name='Button5' value='下页'>&nbsp;"
				end if
				response.write "<input type='button' name='Button6' value='末页' onclick=window.location.href='"&nowpath&"?page="&rs.pagecount&"&kind="&kind&"&myword="&myword&"&none='>"
			response.write "</td><form name='form29' method='post' action='"&nowpath&"?kind="&kind&"&myword="&myword&"&none='><td width='110'>&nbsp;转到<input type='text' name='page' size=3>页<input type='submit' name='Submitpage' value='GO'></td></form>"
		  response.write "</tr>"
		response.write "</table>"
		
		end if
		rs.close
		set rs=nothing
		
		%> 
		
		<br>
			 

    </td>
  </tr>
</table>

<%
conn.close
set conn=nothing
%>
</body>
</html>

