%
Function valid_sql(s)
For i = 1 To Len(s)
If Mid(s, i, 1) = "'" Then
temp = temp + "'"
End If
temp = temp + Mid(s, i, 1)
Next
valid_sql=trim(temp)
End Function
sub header
%>
 |
 |
City Computer's Eshop |
|
<%
end sub
sub footer
%><%
end sub
sub categorymenu
showcart=false
'work out contents of shopping cart
numitems=0
If IsArray(Session("cart")) = false Then
Dim acart(19,1)
Session("cart") = acart
showcart=false
else
acart=Session("cart")
for i=lbound(acart) to ubound(acart)
if acart(i,0)<>"" and acart(i,1)<>"" then
numitems=numitems+acart(i,1)
showcart=true
end if
next
end if
'Check if customer has any previous orders in the system
if session("custid")<>"" then
set rsprevord=db.execute("select * from orders where custid=" & valid_sql(session("custid")))
if not(rsprevord.eof) then
prevord=true
end if
end if
if numitems>1 then
plural="items"
else
plural="item"
end if
%><%
end sub
sub verify
if session("verified")<>true then
response.redirect("index.asp")
end if
end sub
sub adminmenu (menu)
%>
<%
end sub
%>