<% ' Get Variables customer = TRIM(Request ("customer")) shipID = TRIM(Request ("shipment")) firstname = TRIM(Request ("firstn")) lastname = TRIM(Request ("lastn")) 'This is so a user can access there invoice without login in If NOT customer = "" THEN userID = customer username = firstname End If ' Open Database Connection Server.MapPath(".") dbPath = "E:/hshome/webcaddy/database/storedbexchange.mdb" Set Con = Server.CreateObject("ADODB.Connection") Con.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath %> Order Confirmation and Status USERID: <%=userID%>
ShipID: <%=shipID%>
<% ' Retrieve Orders If shipID = "" THEN sqlString = "SELECT * " &_ " FROM (orders INNER JOIN (users INNER JOIN ship ON users.user_id = ship.ship_userID) " &_ " ON orders.order_shipID = ship.ship_shipID) " &_ " INNER JOIN Products ON orders.order_productID = Products.product_id " &_ " WHERE (((users.user_id)= " & userID & " )) " &_ " ORDER BY ship.ship_shipID DESC, orders.order_productID DESC" ELSE sqlString = "SELECT * " &_ " FROM (orders INNER JOIN (users INNER JOIN ship ON users.user_id = ship.ship_userID) " &_ " ON orders.order_shipID = ship.ship_shipID) " &_ " INNER JOIN Products ON orders.order_productID = Products.product_id " &_ " WHERE order_shipID = " & shipID END IF IF session( "iDebugLevel" ) > 0 THEN %> Session Debug Level Set to:<%=session( "iDebugLevel" )%>
sqlString: <%=sqlstring%>
<%END IF%> <% SET RS = Server.CreateObject( "ADODB.Recordset" ) RS.CursorType = adOpenStatic RS.ActiveConnection = Con RS.Open sqlString username = TRIM( Request ( "username" ) ) %>
<%If customer = "" THEN%> Order Confirmation and Status for: <%=username%> <%End If%>

Print for Invoice

<% IF RS.EOF THEN %>

 

No ACTIVE Orders at this time 

<%END IF WHILE NOT RS.EOF %> <%IF session( "iDebugLevel" ) > 0 THEN %> Session Debug Level Set to: <%=session( "iDebugLevel" )%>
User ID: <%=userID%>
username: <%=username%>
firstname: <%=RS( "user_firstname" )%>
lastname: <%=RS( "user_lastname" )%>
discount: <%=RS( "user_discount" )%>
username cookie: <%=Request ( "username")%>
password: <%=password%>
email: <%=email%>
error: <%=error%>
register: <%=register%>
login: <%=login%>
Status Code Test 3: <%=shipmentStatus(3)%>
shipStatus = <%=RS( "ship_status")%>
shipCharge = <%=RS( "ship_charge")%>
paymentMethod = <%=RS( "ship_paymethod" )%>
shipPayment = <%=RS( "ship_payment")%>
shipPayDate = <%=RS( "ship_paydate")%>
<%FOR EACH cookie IN request.Cookies Response.Write cookie & " - " & Request ( cookie ) & "
" NEXT%> <%END IF%>

Mogg Adapter - Purchase Invoice # <%=RS( "ship_shipID")%>

Tax Invoice - ABN: 11933592661

Name: <%=RS( "user_username" )%>  Address:
Order Date: <%=RS( "order_entrydate" )%>  <%=RS( "user_username" )%>
<%=RS( "user_street" )%>
<%=RS( "user_street2" )%>
<%=RS( "user_city" )%> , <%=RS( "user_State" )%> <%=RS( "user_zip" )%>
<%=RS( "user_country" )%>
Pay Date: <% IF isDATE( RS( "ship_paydate" ) ) THEN %> <%=RS( "ship_paydate" )%> <% ELSE %>NOT Paid<% END IF %>
Ship Date: <% IF isDATE( RS( "ship_shipped" ) ) THEN %> <%=RS( "ship_shipped" )%> <% ELSE %>NOT Shipped<% END IF %>
 Email: <%=RS( "user_email" )%> 
STATUS: <%=shipmentStatus(RS( "ship_status"))%> 
<%currentShipment=RS( "ship_shipID" ) orderTotal=0 nextShipment = "FALSE" shipStatus = RS( "ship_status") shipCharge = RS( "ship_charge") shipGST = RS( "ship_GST") shipCurrency = RS( "ship_currency") payment = RS( "ship_payment" ) paymentMethod = RS( "ship_paymethod" ) shipPayment = RS( "ship_payment") shipNotes = RS( "ship_notes") shipPayDate = RS( "ship_paydate")%> <%first_name = RS( "user_firstname") last_name = RS( "user_lastname") address1 = RS( "user_street") address2 = "" city = RS( "user_city") state = RS( "user_state") zip = RS( "user_zip") country = RS( "user_country") discount = RS( "user_discount") %> <%WHILE NOT RS.EOF AND nextShipment = "FALSE" %> <%IF currentShipment = RS( "ship_shipID" ) THEN %> <%orderTotal = orderTotal + ( RS( "order_quantity" ) * RS( "order_price" ) ) RS.MoveNext ELSE nextShipment = "TRUE" END IF WEND discountAmount = orderTotal * discount / 100 if shipGST > 0 then orderTotal = orderTotal + shipcharge - discountAmount else orderTotal = orderTotal + shipcharge - discountAmount shipGST = 0 end if balance = orderTotal - payment %> <%IF session( "iDebugLevel" ) > 0 THEN %> Session Debug Level Set to: <%=session( "iDebugLevel" )%>
OrderTotal: <%=orderTotal%>
shipcharge: <%=shipcharge%>
discountamount: <%=discountAmount%>
shipGST: <%=shipGST%>
<%END IF%> <%If discount > 0 then%> <%end if%> <%if shipGST > 0 then%> <%end if %>
Product: Qty Price Total
<%=RS( "product_name" )%>  <%=RS( "order_quantity" )%>  <%=shipcurrency & FormatCurrency( RS( "order_price" ) )%>  <%=shipcurrency & FormatCurrency( RS( "order_quantity" ) * RS( "order_price" ) )%> 
Discount % <%=discount%>  Discount <%=shipcurrency & FormatCurrency( discountAmount)%> 
Payment Method: <% If balance <= 0 THEN %> Thanks for Payment via <%=paymentMethod%> <%ELSE%> <%IF paymentMethod = "PayPal" THEN %>

> > > > Click Logo to make Payment

<%ELSE%> <%IF paymentMethod = "Credit" THEN %>

> > > > Click Logo
Credit Card Payment

<%ELSE%> Please print this page Then mail with your check to address below. <%END IF%> <%END IF%> <%END IF%>
Shipping: <%=shipcurrency & FormatCurrency( shipCharge)%>  
GST (Tax included) <%=shipcurrency & FormatCurrency( shipGST)%> 
Total: <%=shipcurrency & FormatCurrency( orderTotal)%> 
  Payment <%=shipcurrency & FormatCurrency( payment )%> 
Balance <%=shipcurrency & FormatCurrency( balance )%> 

Shipping Notes: <%=shipNotes%>


<%IF paymentMethod = "Check" THEN IF country = "Australia" OR country = "AUSTRALIA" OR country = "AU" OR country = "australia"then %>

Mail Check to:

    Steven Mogg
    P.O. Box 219
    Jerrabomberra NSW 2619
    Australia

    Email: Steven@webcaddy.com.au <%else%>

No longer accepting US$ Checks <%end if%> -  Email: Steven@webcaddy.com.au <%else%> <%END IF%>

Thanks for ordering from us. We hope you enjoy using our products

Regards,
Steven
<%WEND%>  



Copyright Steven Mogg 2001-2011
Home: http://moggadapters.com  Email: steven@moggadapters.com