<%@ language="VBScript"%> <% response.buffer=true %> <% dim scode dim totamt dim totqty totamt=0 totqty=0 scode = request.form("icode") qty = request.form("txtqty") act = request.queryString("act") tar = request.queryString("target") if(act="add" and tar="wishlist") then 'adding product into wish list con.execute("insert into wishlist values('" & scode & "','" & session("curuser") & "','" & date & "')") %> <% end if if(act="add" and tar="cart") then if(len(session("cart"))>=1) then arr3 = split(session("cart"),"--",-1) flag=0 for each st in arr3 arr4 = split(st,"#",-1) icode = arr4(0) if(icode=scode) then flag=1 exit for end if next if(flag=0) then session("cart") = session("cart") & "--" & scode & "#" & qty end if else session("cart") = scode & "#" & qty end if 'response.write(session("cart")) con.execute("delete from wishlist where pcode='" & scode & "'") end if if(act="remove" and tar="cart") then arr5 = split(session("cart"),"--",-1) stt="" for each st in arr5 arr6 = split(st,"#",-1) icode = arr6(0) if(trim(icode)<>trim(scode)) then if(len(stt)>=1) then stt = stt & "--" & st else stt = st end if end if next session("cart") = stt end if if(act="update" and tar="cart") then arr5 = split(session("cart"),"--",-1) stt="" for each st in arr5 arr6 = split(st,"#",-1) icode = arr6(0) if(trim(icode)<>trim(scode)) then if(len(stt)>=1) then stt = stt & "--" & st else stt = st end if else if(len(stt)>=1) then stt = stt & "--" & arr6(0) & "#" & qty else stt = arr6(0) & "#" & qty end if end if next session("cart") = stt end if arr1 = split(session("cart"),"--",-1) %>
 


<% for each st in arr1 arr2 = split(st,"#",-1) icode = arr2(0) qty = arr2(1) set rs = con.execute("select *from prod where pcode='"&trim(icode)&"'") iname = rs("pname") price= rs("price") amount = qty*price totamt = totamt + amount totqty = totqty + qty %> method=post> <% next session("totamt")= totamt session("totqty")= totqty %>
Code Product Price(US$) Qty. Amount  
<%=icode%> <%=iname%>
  Total Quantity <%=session("totqty")%> Total Cost <%=session("totamt")%>





<% set rs = nothing %>