<% 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 %>
CCW
Home | Contact <% if showcart then %>| My Cart <% end if if request.cookies("wishlist")<>"" then %>| My Wish List <% end if %><% if prevord then %>| My Orders <% end if 'Check if user is signed in if session("custid")<>"" then %>| My Profile | Sign Out <% else %>| Sign In <% end if %> 
Servers | Workstations | Notebooks | Components
  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) %>
Add Product | Add Category | <% if left(Session("privilages"),1)="1" then %> Edit Administrators | <% end if %> View Orders Administration Home | Sign Out
<% Select Case (menu) Case "users" case "customers" case "orders" %> View Orders | View Archive <% case else 'Display list of categories dim rscat set rscat=db.execute("select * from categories") if not rscat.eof then while not rscat.eof %> " style="color:<%= textdark %>;text-decoration:none;"> <%= rscat("catname") %> <% rscat.movenext if not rscat.eof then %>  |  <% end if wend end if end select %>
<% end sub %>