Buy.asp: Show goods and users shopping!

Source: Internet
Author: User
Check.asp: The user inspects the item that buys!

<!--#include file= "util.asp"-->

<%
Head= "Below is the list of items you have purchased."

ProductList = Session ("ProductList")
If Len (productlist) = 0 Then Response.Redirect "nothing.asp"

DBPath = SERVER. MapPath ("Shopbag.mdb")
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open "Driver={microsoft Access driver (*.mdb)};d bq=" & DBPath

If Request ("myself") = "Yes" Then
ProductList = ""
Products = Split (Request ("ProductID"), ",")
For I=0 to UBound (products)
Puttoshopbag Products (I), productlist
Next
Session ("productlist") = ProductList
Session ("a") = "No"
End If

sql = "SELECT * FROM Products"
sql = SQL & "Where ProductID in" ("& ProductList &") "
sql = SQL & "ORDER by ProductID"
Set RS = conn. Execute (SQL)
%>

<HTML>
<HEAD><TITLE><%=Head%></TITLE></HEAD>
<body background= "B01.jpg" >
&LT;H2 align=center><%=head%><CENTER>
<form action=check.asp method=post>
<input Type=hidden name=myself value=yes>
<table border=1>
<tr bgcolor= #00FFFF >
<TD> Cancellation </TD><TD> book number </TD><TD> magazine name </TD><TD> price </TD><TD> Quantity </TD><TD> Total Price </TD><TD> product introduction </TD></TR>
<%
Sum = 0
C_productid= ""
C_quatity= ""
While not Rs. Eof
If session ("a") = "yes" then
Quatity=1
Else
quatity = CInt (Request ("Q_" & RS ("ProductID"))
If quatity <= 0 Then
Quatity = CInt (Session (RS ("ProductID"))
If quatity<=0 Then quatity = 1
End If
End If
Session (RS ("ProductID") = Quatity
sum = sum + CDBL (RS ("price")) * quatity

If Len (C_productid) = 0 Then
C_productid = "" & RS ("ProductID") & ""
C_productname = "" & RS ("ProductName") & ""
C_quatity = "" & Quatity & ""
Else
C_productid = C_productid & "/" & RS ("ProductID") & ""
C_productname = c_productname & "/" & RS ("ProductName") & ""
c_quatity = c_quatity & "/" & Quatity & ""
End If


%>
<TR>
&LT;TD align=center>
<input type=checkbox name= "ProductID value=" <%=rs ("ProductID")%> "checked>"
</TD>

<td><%=rs ("ProductID")%></td>
<td><%=rs ("ProductName")%></td>
&LT;TD align=right><%=rs ("Price")%></td>
<td><input type=text name= "<%=" Q_ "& RS (" ProductID ")%>" value=<%=quatity%> size=3></ Td>
<td Align=right><%=cdbl (RS ("price")) *quatity%></td>
<td><a href=<%=rs ("Link")%>><%=rs ("Description")%></a></td>
</TR>
<%
Rs. MoveNext
Wend
%>
&LT;TR&GT;&LT;TD align=right colspan=7><font color=red> Total Price =<%=sum%></font></td></tr >
</TABLE>
<input type=submit value= "Change Quantity" >
</Form>
&LT;HR width=80%>
<a href=clear.asp> return all items </A><P>
<% Listcategory Conn%>
&LT;HR width=80%>
<form action=buyfinish.asp method=post>
Name: <input type=text name=customer_n value= "" ><br>
Tel: <input type=text name=customer_t value= "" ><br>
Address: <input type=text name=customer_a value= "" ><br>
<input type=hidden name=customer_p value= "<%=C_ProductID%>" >
<input type=hidden name=customer_pn value= "<%=C_ProductName%>" >
<input type=hidden name=customer_q value= "<%=C_Quatity%>" >
<input type=hidden name=customer_s value= "<%=Sum%>" >
<input type=submit value= "submit to complete a shopping trip." ">
&LT;/FORM&GT;&LT;HR width=80%>
</CENTER>

</BODY>
</HTML>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.