<%
	function fselect(db,query)
		dim rs,con
		set con=server.createObject("adodb.connection")
		con.open db
		set rs=server.createObject("adodb.recordset")

		rs.CursorLocation= 3 ' adUseClient

		rs.open query,con

		set fselect=rs

		set rs.activeconnection=nothing

		set fselect=rs
		con.close
		set con=nothing
    end function
	'----------------------------------------
	sub showCount(id)
		dim rs,count
		count=0
		set rs= fselect(Application("Product"),"select count1 from basket  where ids='" & Session.SessionID & "' and idp=" & request("id"))
		while not rs.eof
			if rs.bof then break
			count=rs("count1")
			rs.moveNext
		wend
		rs.close
		set rs= nothing
		response.write count
	end sub
%>
<html>
<head>
<style>
	A {text-decoration: none;color:#663366}
</style>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" rightmargin=0 marginwidth=0 marginheight=0 bottommargin=0 link="#000000" alink="#000000" vlink="#000000">
<table width="100%" cellspacing="2" cellpadding="3" border="0" vspace="0" hspace="0">
<tr><td colspan=2 width="100%" style="FONT: 12px Tahoma"><font face=tahoma color="red"><b></b></font></td></tr>
<%
    set rs=fselect(Application("Product"),"select * from ITEMS where id=" & request("id"))

    while not rs.eof
		if rs.bof then  break

%>
<tr><td colspan=2 width="100%" style="FONT: 14px Tahoma"><font face=tahoma color="#673467"><b><%=rs("name")%></b></font></td></tr>
<tr><td colspan=2 width="70%" valign=top><hr color="#ff365c"></td></tr>
<tr><td valign=top align="left" width="18%">
       <table width="18%" cellpadding=0 cellspacing=0>
          <tr><td align="left"><center><img src="<%="productImages/" & rs("image")%>"></center></td></tr>
          <tr><td><p>&nbsp;</p></td></tr>
          <tr><td align="left" style="FONT: 13px Tahoma"><center><b><%=rs("remark")%></b></center></td></tr>
          <tr><td><p>&nbsp;</p></td></tr>
          <tr><td align="left" style="FONT: 13px Tahoma"><center>
          	<a href="picture.asp?id=<%=rs("id")%>" target="_blank"><img src="images/untitled.bmp" border=0></a></center>
          	</td>
		  <tr><td><hr></td></tr>
          <tr><td><font size=2 face=monospaced color=red><b>Count:&nbsp;&nbsp;&nbsp;&nbsp;<% showCount(rs("id"))%></b></font></td></tr>
          </tr>
       </table>
    </td>
    <td width="32%" align="left" valign="top">
       <table width="90%" cellpadding=0 cellspacing=0>
          <tr><td align="left" style="FONT: 12px Tahoma"><font face="Tahoma"><b>Description</b></font></td></tr>
          <tr><td><p>&nbsp;</p></td></tr>
          <tr><td align="left" style="FONT: 12px Tahoma"><font face="Tahoma"><%=rs("description")%></font></td></tr>
          <tr><td><p>&nbsp;</p></td></tr>

          <tr><td align="left" style="FONT: 13px Tahoma"><div><img src="images/cos.jpg">&nbsp;<font face="Tahoma"><a href="addtobasket.asp?id=<%=rs("id")%>"><b>Add Item to Shopping Cart</b></a></font></div></td></tr>
          <tr><td align="left" style="FONT: 13px Tahoma"><div><img src="images/cos.jpg">&nbsp;<font face="Tahoma"><a href="viewbasket.asp?id=<%=rs("id")%>"><b>View Shopping Cart</b></a></font></div></td></tr>
       </table>
    </td>
</tr>
<%
	rs.moveNext
    wend

    rs.close
    set rs= nothing
%>
<tr><td colspan=2 width="70%" valign=top><hr color="#ff365c"></td></tr>
</table>
</body>
</html>
