<% on error resume next 'grab all of the info sent from the form... card = request.form("card") expiration = request.form("expmo") & " " & request.form("expyr") purchase_id = request.form("purchase_id") typez = request.form("type") lname = request.form("lname") email = request.form("email") 'lookup who our user is by id number call openConn SQL = "SELECT customer_id FROM customer_tbl WHERE customer_lname = '"&lname&"' AND customer_email = '"&email&"';" call openRS(SQL) while not rs.eof 'capture that customer_id id = rs("customer_id") rs.movenext Wend Call closeRS 'now, it is time to add the information into the purchase table to complete the purchase 'pull out the session information that has the class id's in it 'loop through for ever time there is an instance of a class... for each sessprop in session.contents if session.contents(sessprop) <> "" then SQL = "INSERT into purchase_tbl (purchase_id, customer_id, class_datetime_id, cc_number, cc_exp, cc_type) VALUES ('"&purchase_id&"', "&id&", "&sessprop&", '"&card&"','"&expiration&"','"&typez&"');" call openCMD(SQL) call closeCMD end if next 'response.write SQL SQL = "SELECT record_id FROM purchase_tbl;" call openRS2(SQL) While not rs2.eof 'capture the record id record_id = rs2("record_id") rs2.movenext wend call closeRS2 Call cleanup session.abandon 'now we are finished %>
Online Registration Checkout: COMPLETE
     
<% 'SQL to retrieve all those records we just registered for... SQL = "SELECT customer_tbl.Customer_lname, customer_tbl.customer_fname, class_tbl.class_name, " SQL = SQL & "class_tbl.class_price, class_datetime_tbl.class_datetime " SQL = SQL & "FROM (class_tbl INNER JOIN class_datetime_tbl ON " SQL = SQL & "class_tbl.class_id = class_datetime_tbl.class_id) " SQL = SQL & "INNER JOIN (customer_tbl INNER JOIN purchase_tbl ON " SQL = SQL & "customer_tbl.customer_id = purchase_tbl.customer_id) ON " SQL = SQL & "class_datetime_tbl.class_datetime_id = purchase_tbl.class_datetime_id " SQL = SQL & "WHERE purchase_tbl.purchase_id = '"& purchase_id &"' AND customer_tbl.Customer_email = '"&email&"';" call openConn call openRS(SQL) %> <% While not rs.eof response.write "" rs.movenext wend call cleanup %> <% 'set purchase id back to nothing so user who registers twice or uses back cannot screw up the db purchase_id = "" %>
<%=rs("customer_lname")& ", "&rs("customer_fname") %>
"& rs("class_name") &""& trimseconds(rs("class_datetime")) &""& formatcurrency(rs("class_price")) &"

Thank You!
Your online registration request has been successfully received.
Transaction Number: <%=record_id%>
Please save the Transaction Number for future reference regarding this order.

We will process your order and send a confirmation email to the email address you provided. The confirmation email will be your official receipt.

Thank you for using our online registration system and we look forward to having you in cooking class soon.
Best Regards,
Jay Bushman and Lara Ritchie