<%@ language=JavaScript %> <% Response.AddHeader('P3P',"CP=CAO PSA OUR") var act = new String(Request.Form("act")); var prodNamesArr = new Array("E-market Czech Republic 2008"); var prodPricesGBP = new Array("8400"); /* var prodNamesArr = new Array("E-market Czech Republic 2006"); var prodPricesGBP = new Array("6900"); var prodID = 1 */ if (act=="add"){ //adding products var now = new Date(); var expDate = new Date(); expDate.setTime(now.getTime()+1000*60*60*24*30);//cookie expires after 1 day Response.Cookies("CartCookieCZ").expires = (expDate.getMonth() + 1) + "/" + expDate.getDate() + "/" + expDate.getFullYear(); var prodID = parseInt(new Number(Request.Form("pid"))); Response.Cookies("CartCookieCZ")(""+prodID+"") = 1; Response.redirect("panier.asp"); Response.end; } if (act=="rem"){ //removing products var prodID = parseInt(new Number(Request.Form("pid"))); Response.Cookies("CartCookieCZ")(""+prodID+"") = 0; Response.redirect("panier.asp"); Response.end; } %> Cart
" strTableCont += ''; strTableCont += ''; strTableCont += ''; strTableCont += ''; totalGBP = totalGBP + (new Number(prodPricesGBP[x-1])); } cartColl.moveNext(); } cartColl = null; if (prodspresent){ //display table %>
<% var prodspresent = false; var strTableCont = new String(); var cartColl = new Enumerator(Request.Cookies("CartCookieCZ")); var totalGBP = 0; while (!cartColl.atEnd()) { var x = parseInt(new Number(cartColl.item())); var qty = parseInt(new Number(Request.Cookies("CartCookieCZ")(""+x+""))); if (qty==1){ //product is in cart prodspresent = true; strTableCont += "
'+prodNamesArr[x-1]+''+ (new Number(prodPricesGBP[x-1])) +'Odstranit
<%=strTableCont%>
Produkt Cena (CZK)  
Celkem <%=Math.round(totalGBP*1)%>  

<% } else Response.write("Nákupní vozík je prázdný.") %>
" method=post>