<%@language = vbscript%> <% varpath = server.mappath("../../ms_access") varpath= varpath & "/e-nsw.mdb" if not isempty(request.form("cmdcheckout")) then Dim iMsg Set iMsg = CreateObject("CDO.Message") set conn = server.createobject("ADODB.connection") sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & varpath &_ "; Persist Security Info=False;" Conn.ConnectionString = sConnString Conn.open mycartarray=split(session("myarray"),"#") i = 0 a = 0 session("myarrayforserver") = "" varbody = "The following order has been submitted by:
" varbody = varbody & "Contact Name: " & request.form("ContactName") & "
" varbody = varbody & "Company Name: " & request.form("CompanyName") & "
" varbody = varbody & "Email Address: " & request.form("EmailAddress") & "
" varbody = varbody & "Tel No: " & request.form("telNo") & "

" varbody = varbody & "The following items and details are on this order

" '******************************** do until i = ubound(mycartarray) '******************************* varpricetotalforunit = "" varprice = "" varquantity = "" myitemarray=split(mycartarray(i),"|") varproductid = myitemarray(1) set rsdetails = conn.execute("SELECT * FROM tblproducts WHERE [clientid] = " & clng(session("theclientid")) & " AND productid = '" & varproductid & "'") vardesc = rsdetails("product_desc") set rsdetails = nothing varproductname = myitemarray(2) varoption = myitemarray(3) varquantity = myitemarray(4) varprice = FormatNumber((myitemarray(5)), 2, -2, -2, -2) varpricetotalforunit = FormatNumber(clng(myitemarray(4)) * ccur(myitemarray(5)) , 2, -2, -2, -2) varsubtotal = varsubtotal + ccur(varpricetotalforunit) varbody = varbody & varproductname & " - " & vardesc & " - " & varoption & "
Unit Price £" & varprice & " * " & varquantity & " = £" & varpricetotalforunit & "

" i = i + 1 loop 'varbody = varbody & "Total: £" & varsubtotal & " exc VAT
" varwithVAT = varsubtotal + ((varsubtotal / 100) * 17.5) varbody = varbody & "Total: £" & varwithVAT & " inc VAT
" '****************cdo sys*************************** Set Mail = Server.CreateObject("CDO.Message") 'Mail.Host = smtphost Mail.From = "sales@netsolutionswales.co.uk" Mail.To = "claudio@netsolutionswales.co.uk" Mail.Subject = "A new order from your website" Mail.TextBody = varbody strErr = "" bSuccess = False On Error Resume Next Mail.Send If Err <> 0 Then ' error occurred strErr = Err.Description response.write(strErr) else bSuccess = True End If set iMsg=nothing response.redirect("emailsent.htm") end if if not request.querystring("catid") = "" then vartosearch = request.querystring("catid") end if if request.querystring("vardelivery") <> "" then session("shippingid") = request.querystring("vardelivery") end if '_____________________________________________________________________________ if session("currencytype") = "" or session("shref") = "" or session("checkcode") = "" then 'check this cart has been configured set conn = server.createobject("ADODB.connection") sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & varpath &_ "; Persist Security Info=False;" Conn.ConnectionString = sConnString Conn.open set rsload = conn.execute("SELECT * FROM tblconfiguration WHERE [clientid] = " & clng(session("theclientid")) & "") if rsload.eof = true then varnoconfiguration = "true" else session("currencytype") = rsload("currencytype") session("shref") = rsload("shref") session("checkcode") = rsload("checkcode") end if rsload.close end if '__________________________________________________________________________________ %> NET Solutions Wales: e-commerce, consultants, software, hardware: Our products
nav

 



Product id
Name
Option
Qty
Price
Total
<% if session("myarray") = "" then%>
You have no items in your basket at this time. Click here to start shopping
<%else mycartarray=split(session("myarray"),"#") i = 0 a = 0 session("myarrayforserver") = "" '******************************** do until i = ubound(mycartarray) '******************************* varpricetotalforunit = "" varprice = "" varquantity = "" myitemarray=split(mycartarray(i),"|") varproductid = myitemarray(1) varproductname = myitemarray(2) varoption = myitemarray(3) varquantity = myitemarray(4) varprice = FormatNumber((myitemarray(5)), 2, -2, -2, -2) varpricetotalforunit = FormatNumber(clng(myitemarray(4)) * ccur(myitemarray(5)) , 2, -2, -2, -2) session("myarrayforserver") = session("myarrayforserver") & "[" & varproductid & "||" & varproductname & "-" & varoption & "|" & varprice & "|" & varquantity & "|" & varpricetotalforunit & "]" varsubtotal = varsubtotal + ccur(varpricetotalforunit) if not instr (varproductid, "!") > 0 then varneedadelivery = "yes" end if %>
<%=varproductid%>
<%=varproductname%>
<%=varoption%>
" size="2" value="<%=varquantity%>" class="textbox">
<%=session("currencytype")%><%=varprice%>
<%=session("currencytype")%><%=varpricetotalforunit%>
" value="<%=varproductid%>"> " value="<%=varproductname%>"> " value="<%=varoption%>"> " value="<%=varquantity%>"> " value="<%=varprice%>"> <% i = i + 1 loop %>


<% session("shippingid") = "na" if session("shippingid") = "" then%> Please select if required <% else vargrandtotal = varsubtotal + ccur(session("shippingamount")) 'response.write session("currencytype") & vargrandtotal & " exc. VAT
" varwithVAT = vargrandtotal + ((vargrandtotal / 100) * 17.5) response.write session("currencytype") & varwithVAT end if %>
Total includes VAT /Delivery

Please pick your items and select Total upto 10K
<%if not session("theclientid") = "34" then%>
*Contact Name:
Company Name:
*Email Address:
*Tel No:

<%else%>
This is only a demo. You cannot proceed to the checkout in this mode.
<%end if%>
/carddetails.html"> "> "> "> "> "> ">
<%end if%>
Unless otherwise stated, prices are in GBP and include VAT