clear variables contents - Please URGENT!!
Hello
my program is a shopping card program and the problem that i have is when i make an order my quantity and my material stays in memory. When i´m trying to make another order that previous material and quantity appear. Please help me.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("farm") <> "") Then
Recordset1__MMColParam = Request.QueryString("farm")
End If
%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "2"
If (Request.QueryString("farm2") <> "") Then
Recordset2__MMColParam = Request.QueryString("farm2")
End If
%>
<%
Dim Recordset3__MMColParam
Recordset3__MMColParam = "3"
If (Request.QueryString("familia") <> "") Then
Recordset3__MMColParam = Request.QueryString("familia")
End If
%>
<%
'Dim Recordset1__MMColParam1
'Recordset1__MMColParam1 = "1"
'If (Request.QueryString("teste") <> "") Then
' Recordset1__MMColParam1 = Request.QueryString("teste")
Set Recordset0 = Server.CreateObject("ADODB.Recordset")
Recordset0.ActiveConnection = MM_Profarin_STRING
Recordset0.Source = "SELECT * FROM Consulta2 WHERE CodCliente = '" & Session("delegado") & "'"
Recordset0.CursorType = 0
Recordset0.CursorLocation = 2
Recordset0.LockType = 1
Recordset0.Open()
While (NOT Recordset0.EOF)
Tipo_Farm = Recordset0.Fields.Item("Tipo_farm").Value
Recordset0.MoveNext()
wend
Recordset0.Close()
'End If
%>
<%
myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\Menu\Profarin\Profarin2. mdb"
set CN=server.createobject("ADODB.Connection")
CN.Open myDSN
'cirRS stands for recordset corresponding to the resulting parameterized query
set Recordset1=server.createobject("ADODB.Recordset")
Recordset1.ActiveConnection = CN
'Dim Recordset1
'Dim Recordset1_numRows
'Set Recordset1 = Server.CreateObject("ADODB.Recordset")
'Recordset1.ActiveConnection = MM_Profarin_STRING
if Tipo_Farm = "A" then
if request("farm2") = "*" then
SQL = "SELECT * FROM Produtos_A order by Nome_Art"
Recordset1.Open SQL
else
if request("familia") <> "" then
SQL = "SELECT * FROM Produtos_A where Familia = " + Replace( Recordset3__MMColParam, "'", "''") + " order by Nome_Art"
Recordset1.Open SQL
else
if request("xpto") = "Cod" then
SQL = "SELECT * FROM Produtos_A where Cod_Art = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.Open SQL
else
if request("xpto") = "Nome" then
SQL = "SELECT * FROM Produtos_A WHERE Nome_Art like '" + Replace( Recordset1__MMColParam, "'", "''") + "%' order by Nome_Art"
Recordset1.Open SQL
end if
end if
end if
end if
else
if Tipo_Farm = "B" then
if request("farm2") = "*" then
SQL = "SELECT * FROM Produtos_B order by Nome_Art"
Recordset1.Open SQL
else
if request("familia") <> "" then
SQL = "SELECT * FROM Produtos_B where Familia = " + Replace( Recordset3__MMColParam, "'", "''") + " order by Nome_Art"
Recordset1.Open SQL
else
if request("xpto") = "Cod" then
SQL = "SELECT * FROM Produtos_B where Cod_Art = " + Replace( Recordset1__MMColParam, "'", "''") + ""
Recordset1.Open SQL
else
if request("xpto") = "Nome" then
SQL = "SELECT * FROM Produtos_B WHERE Nome_Art like '" + Replace( Recordset1__MMColParam, "'", "''") + "%' order by Nome_Art"
Recordset1.Open SQL
end if
end if
end if
end if
else
if Tipo_Farm = "C" then
if request("farm2") = "*" then
SQL = "SELECT * FROM Produtos_C order by Nome_Art"
Recordset1.Open SQL
else
if request("familia") <> "" then
SQL = "SELECT * FROM Produtos_C where Familia = " + Replace( Recordset3__MMColParam, "'", "''") + " order by Nome_Art"
Recordset1.Open SQL
else
if request("xpto") = "Cod" then
SQL = "SELECT * FROM Produtos_C where Cod_Art = " + Replace( Recordset1__MMColParam, "'", "''") + ""
Recordset1.Open SQL
else
if request("xpto") = "Nome" then
SQL = "SELECT * FROM Produtos_C WHERE Nome_Art like '" + Replace( Recordset1__MMColParam, "'", "''") + "%' order by Nome_Art"
Recordset1.Open SQL
end if
end if
end if
end if
end if
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style5 {font-family: "Times New Roman", Times, serif}
#Layer1 {
position:absolute;
width:109px;
height:2px;
z-index:1;
left: 336px;
top: 58px;
}
#Layer2 {
position:absolute;
width:625px;
height:8px;
z-index:1;
left: 198px;
top: 97px;
}
#Layer3 {
position:absolute;
width:36px;
height:33px;
z-index:2;
left: 358px;
top: 102px;
}
-->
</style>
</head>
<body>
<form action="hugo.asp" method="get" name="form1" target="_blank" id="form1">
<%
Sub ShowFullCatalog()
Dim aParameters ' as Variant (Array)
Dim I
Dim iItemCount ' Number of items we sell
' If you are really going to use this sample this should probably be pulled from a DB
iItemCount = 3
%>
<table width="913" height="63" border="0" cellpadding="0" cellspacing="1">
<tr>
<td colspan="6"><strong>P - Preço de Venda ao Público (PVP) </strong></td>
</tr>
<tr>
<td colspan="6"><strong>V - Preço de Venda Livre (PVL)</strong></td>
</tr>
<tr>
<td colspan="6"><strong><a href="PRF_motivos.asp">Motivos da Não Existência de Stock </a></strong>
<div id="Layer1"><strong><a href="PRF_ProdutosNovos.asp">Produtos Novos</a> </strong>
</marquee></div></td>
</tr>
<tr>
<td colspan="6"><strong><a href="PRF_passwordccredito.asp">Mapa de Controlo de Credito</a></strong></td>
</tr>
<tr>
<td colspan="6"><strong><a href="PRF_passwordextracto.asp">Extracto de Clientes</a></strong></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="justify"><img src="PRFCod_Art.png" width="100" height="20"></div></td>
<td><img src="PRFDes_Art.png" width="340" height="20"></td>
<td><img src="PRFPreco_Venda.png" width="100" height="20"></td>
<td><img src="Tipo.png" width="50" height="20"></td>
<td><img src="bonus.png" width="103" height="20"></td>
<td><img src="Stock_Exist.png" width="100" height="20"></td>
</tr>
<% i = 1%> <% do until Recordset1.EOF
if i > 0 then %>
<tr>
<td width="100"><div align="center"><strong><span class="style5">
<%=(Recordset1.Fields.Item("Cod_Art").Value)%></span></strong></div></td>
<td width="340"><div align="left"><strong><span class="style5"><%=left(Recordset1.Fields.Item("Nom e_Art").Value,40)%></span></strong></div></td>
<td width="100"><div align="right"><strong><span class="style5">
<%if Recordset1.Fields.Item("Preco Venda").Value <> 0 then%>
<%=(Recordset1.Fields.Item("Preco Venda").Value)%>
<%else%>
<%=(Recordset1.Fields.Item("Preco Venda MNSRM").Value)%>
<%end if%>
</span></strong></div></td>
<td width="50"><div align="center"><strong><%=(Recordset1.Fields.Item( "Tipo").Value)%></strong></div></td>
<td width="107"><strong><%=(Recordset1.Fields.Item("Em Cada 1").Value)%>-<%=(Recordset1.Fields.Item("Da 1").Value)%> / <%=(Recordset1.Fields.Item("Em Cada 2").Value)%>-<%=(Recordset1.Fields.Item("Da 2").Value)%> / <%=(Recordset1.Fields.Item("Em Cada 3").Value)%>-<%=(Recordset1.Fields.Item("Da 3").Value)%></strong></td>
<td width="104"><div align="center"><strong><span class="style5">
<%if (Recordset1.Fields.Item("QuantExi").Value) > 0 then %>
<%=response.write("S")%>
<%else%>
<%=response.write("N")%> - <%=(Recordset1.Fields.Item("S").Value)%>
<%end if%>
</span></strong></div></td>
<td><a href="main_old.asp?action=add&cod=<%=Recordset1.Fi elds.Item("Cod_Art").Value%>&item=<%=Recordset1.Fi elds.Item("Nome_Art").Value%>&count=1">
<%if (Recordset1.Fields.Item("QuantExi").Value) > 0 then %>
Encomendar<%end if%></a></td>
</tr>
<% i = i * -1
else %>
<tr bgcolor="#00CCFF">
<td width="100"><div align="center"><strong><span class="style5">
<%=(Recordset1.Fields.Item("Cod_Art").Value)%></span></strong></div></td>
<td width="340"><div align="left"><strong><span class="style5"><%=left(Recordset1.Fields.Item("Nom e_Art").Value,40)%></span></strong></div></td>
<td width="100"><div align="right"><strong><span class="style5">
<%if Recordset1.Fields.Item("Preco Venda").Value <> 0 then%>
<%=(Recordset1.Fields.Item("Preco Venda").Value)%>
<%else%>
<%=(Recordset1.Fields.Item("Preco Venda MNSRM").Value)%>
<%end if%>
</span></strong></div></td>
<td width="50"><div align="center"><strong><%=(Recordset1.Fields.Item( "Tipo").Value)%></strong></div></td>
<td width="107"><strong><%=(Recordset1.Fields.Item("Em Cada 1").Value)%>-<%=(Recordset1.Fields.Item("Da 1").Value)%> / <%=(Recordset1.Fields.Item("Em Cada 2").Value)%>-<%=(Recordset1.Fields.Item("Da 2").Value)%> / <%=(Recordset1.Fields.Item("Em Cada 3").Value)%>-<%=(Recordset1.Fields.Item("Da 3").Value)%></strong></td>
<td width="104"><div align="center"><strong><span class="style5">
<%if (Recordset1.Fields.Item("QuantExi").Value) > 0 then %>
<%=response.write("S")%>
<%else%>
<%=response.write("N")%> - <%=(Recordset1.Fields.Item("S").Value)%>
<%end if%>
</span></strong></div></td>
<td><a href="main_old.asp?action=add&cod=<%=Recordset1.Fi elds.Item("Cod_Art").Value%>&item=<%=Recordset1.Fi elds.Item("Nome_Art").Value%>&count=1">
<%if (Recordset1.Fields.Item("QuantExi").Value) > 0 then %>Encomendar<%end if%></a></td>
</tr>
<% i = i * -1
end if %>
<%
Recordset1.MoveNext()
loop
%>
</table>
<%End Sub %>
<%'while not recordset1.eof
'response.write("hugo") & (Recordset1.Fields.Item("Cod_Art").Value)
'recordset1.movenext()
'wend%>
<%
Sub AddItemToCart(iItemID, iItemCount, iItemCod)
If dictCart.Exists(iItemID) Then
dictCart(iItemID) = dictCart(iItemID) + iItemCount
Else
dictCart.Add iItemID, iItemCount
End If
Response.Write "<p>" & iItemCount & " item # " & iItemID & " " & iItemCod & " foi adicionado à sua encomenda.</p>" & vbCrLf
Response.Write "<p>" & "Se desejar adicionar uma unidade ao produto selecionado premir F5" & "<br>"
End Sub
Sub RemoveItemFromCart(iItemID, iItemCount)
If dictCart.Exists(iItemID) Then
If dictCart(iItemID) <= iItemCount Then
dictCart.Remove iItemID
Else
dictCart(iItemID) = dictCart(iItemID) - iItemCount
End If
Response.Write "<p>" & iItemCount & " item # " & iItemID & " foi removido da sua encomenda</p>" & vbCrLf
Else
Response.Write "<p>Não foi encontrado esse item na sua encomenda</p>" & vbCrLf
End If
End Sub
Sub ShowItemsInCart()
Dim objKey
Dim aParameters ' as Variant (Array)
Dim sTotal, sShipping
' Const ForReading = 1
' Const ForWriting = 2
' Const ForAppending = 8
%>
<br>
<table border="1" cellpadding="3" cellspacing="1">
<tr>
<td><strong>Item #</strong></td>
<td><strong>Código</strong></td>
<td><strong>Quantidade</strong></td>
<td><strong>Remove Item da Encomenda </strong></td>
<!-- <td>Price</td>
<td>Totals</td>-->
</tr>
<%
dim sqltemp
'Dim objFSO, objFile
'Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
set rst5=Server.CreateObject("ADODB.Recordset")
sTotal = 0
For Each objKey in dictCart
'sqltemp="select * from Produtos where "
'sqltemp=sqltemp & "Cod_Art="
'sqltemp=sqltemp & "'"
'sqltemp=sqltemp & objKey
'sqltemp=sqltemp & "'"
'rst5.open sqltemp, connection
'Set objFile = objFSO.OpenTextFile("C:\Inetpub\wwwroot\Menu\Profa rin\hit_count2.txt", 8, True)
Set rs_getDetail1 = Server.CreateObject("ADODB.Recordset")
rs_getDetail1.ActiveConnection = MM_Profarin_STRING
rs_getDetail1.Source = "SELECT * FROM Produtos WHERE Nome_Art = '" & objKey & "'"
rs_getDetail1.Open()
If not rs_getDetail1.EOF then
aParameters = GetItemParameters(objKey)
'nome = (rs_getDetail1.Fields.Item("Cod_Art").Value)
'objFile.WriteLine("" & Session("delegado") & " " & nome & " " & date() & " " & time())
%>
<tr>
<td align="center"><%= objKey %></td>
<td align="left"><%=rs_getDetail1.Fields.Item("Cod_Art ").Value %></td>
<td align="center"><%= dictCart(objKey) %></td>
<td align="left"><a href="main_old.asp?action=del&item=<%= objKey %>&count=1">Remove Um</a> <a href="main_old.asp?action=del&item=<%= objKey %>&count=<%= dictCart(objKey) %>">Remove Tudo</a></td>
<!-- <td align="right">$<%'= aParameters(2) %></td>
<td align="right">$<%'= FormatNumber(dictCart(objKey) * CSng(aParameters(2)), 2) %></td>-->
</tr>
<%
' sTotal = sTotal + (dictCart(objKey) * CSng(aParameters(2)))
'rst5.close
rs_getDetail1.close
end if
' objFile.close
' SET objFile = NOTHING
' SET objFSO = NOTHING
Next
%>
</table>
<%
End Sub
Sub PlaceOrder()
Dim objKey
Dim aParameters ' as Variant (Array)
Dim sTotal, sShipping
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
%>
<table border="1" cellpadding="3" cellspacing="1">
<tr>
<td><strong>Item #</strong></td>
<td><strong>Código</strong></td>
<td><strong>Quantidade</strong></td>
<!-- <td>Price</td>
<td>Totals</td>-->
</tr>
<%
Dim con, sql_insert, data_source
Dim objFSO, objFile
Dim iCount, tempo
Dim tsObject,textfile 'Text Stream Object
sTotal = 0
Application.Lock
Application("ASPCounter1") = Application("ASPCounter1") + 1
Application.Unlock
Application("ASPCounter1") = right("0000" & Application("ASPCounter1"), 4)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\Inetpub\wwwroot\Menu\Pro farin\Encomendas_Novas\" & Pd(DAY(date()),2) & Pd(Month(date()),2) & Application("ASPCounter1") & ".txt",true)
'Cabeçalho Ficheiro
' Nº Encomenda
Application.Lock
Application("ASPCounter") = Application("ASPCounter") + 1
Application.Unlock
Application("ASPCounter") = right(" " & Application("ASPCounter"), 12)
objFile.write Application("ASPCounter") & " 102 " & " 2 " & " 3F" & right("000000000" & Session("delegado"),9) & " 4 " & " 5" & Pd(DAY(date()),2) & Pd(Month(date()),2) & right(YEAR(Date()),2) & " " & " 6 "
'Inserir encomendas na BD
For Each objKey in dictCart
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open("C:\Inetpub\wwwroot\Menu\Profarin\profar in2.mdb")
Set rs_getDetail2 = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT Cod_Art, Nome_Art FROM Produtos WHERE Nome_Art = '" & objKey & "'"
rs_getDetail2.Open sSQL,conn, 3,3
If not rs_getDetail2.EOF then
data_source = "dsn=Profarin;"
sql_insert = "insert into Encomendas (CodEnc,CodFarm,CodProd, NomeProd,QtaEnc,Dia,Hora) values ('" & Application("ASPCounter") & "', '" & Session("delegado") & "', " & rs_getDetail2.Fields.Item("Cod_Art").Value & ", '" & rs_getDetail2.Fields.Item("Nome_Art").Value & "', " & dictCart(objKey) & ", #" & date() & "#, #" & time() & "#)"
' Creating the Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
' Executing the sql insertion code
con.Execute sql_insert
aParameters = GetItemParameters(objKey)
nome = (rs_getDetail2.Fields.Item("Cod_Art").Value)
'euNumber = RTrim(MyString)
'euNumber = right("000000000000" & nome, 12)
qta = dictCart(objKey)
qta = right("0000" & qta,4)
nome_qta = nome & qta
nome_qta = right(" " & nome_qta, 12)
'euNumber1 = left(euNumber,5)
'euNumber1 = replace(euNumber1,"0"," ")
'euNumber2 = mid(euNumber,6,12)
'euNumber3 = euNumber1 & euNumber2
iCount = iCount + 1
objFile.Write(nome_qta)
%>
<tr>
<td align="center"><%= objKey %></td>
<td align="left"><%=rs_getDetail2.Fields.Item("Cod_Art ").Value %></td>
<td align="center"><%= dictCart(objKey) %></td>
</tr>
<%
' sTotal = sTotal + (dictCart(objKey) * CSng(aParameters(2)))
rs_getDetail2.close
conn.close
end if
Next
iCount = iCount + 8
' iCount = right(iCount & " ", 12)
objFile.Write left("Z" & iCount & " ",12)
objFile.close
SET objFile = NOTHING
SET objFSO = NOTHING
' Done. Now Close the connection
con.Close
Set con = Nothing
' Calculate shipping
sShipping = CalculateShippingCost(sTotal)
' Add shipping to total
sTotal = sTotal + sShipping
%>
<!-- <tr>
<td colspan="4" align="right"><b>S+H:</b></td>
<td align="right">$<%= FormatNumber(sShipping, 2) %></td>
</tr>
<tr>
<td colspan="4" align="right"><b>Total:</b></td>
<td align="right">$<%= FormatNumber(sTotal, 2) %></td>
</tr>-->
</table>
<div id="Layer3"><a href="javascript:history.go(-2)"><img src="procurar.GIF" border="0" width="46" height="46" alt="Continue Looking" /></a></div>
<%
' You could also do whatever other processing you would need to here.
' For example, send credit card info to processor or send order details
' to your warehouse for shipping. I'm just gonna send an email with
' the product details so you can see how you'd access them. Please
' be aware that email is NOT SECURE! So please don't transfer users'
' personal or credit card information this way.
Dim objMessage, strMessageBody
strMessageBody = "Quantity Item# Description Unit Price Total" & vbCrLf & vbCrLf
For Each objKey in dictCart
aParameters = GetItemParameters(objKey)
strMessageBody = strMessageBody & " " & dictCart(objKey)
strMessageBody = strMessageBody & " " & objKey
' strMessageBody = strMessageBody & " " & aParameters(1)
' strMessageBody = strMessageBody & String(25 - Len(aParameters(1)), " ") & aParameters(2)
' strMessageBody = strMessageBody & " " & FormatNumber(dictCart(objKey) * CSng(aParameters(2)), 2) & vbCrLf
Next
strMessageBody = strMessageBody & vbCrLf
strMessageBody = strMessageBody & String(41, " ") & "Shipping: " & FormatNumber(sShipping, 2) & vbCrLf
strMessageBody = strMessageBody & vbCrLf
strMessageBody = strMessageBody & String(37, " ") & "Order Total: " & FormatNumber(sTotal, 2) & vbCrLf
'Response.Write "<pre>" & strMessageBody & "</pre>"
Set objMessage = Server.CreateObject("CDO.Message")
With objMessage
' Set message attributes
.To = "Full Name <user name@some domain.com>"
.From = "Full Name <user name@some domain.com>"
.Subject = "Shopping Cart Contents"
.TextBody = strMessageBody
' Send message - uncomment the following line only
' AFTER you've entered appropriate To and From
' addresses above. Then the script will actually
' send the messages.
'.Send
End With
Set objMessage = Nothing
'Response.AddHeader "Refresh", "5;URL=http://www.google.com/"
End Sub
' We implemented this this way so if you attach it to a database you'd only need one call per item
Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price
' However we need to keep price so it can be converted to a
' single for computation hence no currency symbol. This array
' can also be expanded to contain any other information about the
' product that you might want to pull from the DB.
' Select Case iItemID
' Case 1
aParameters = CStr(Request.QueryString("cod"))
' Case 2
' aParameters = Recordset1.Fields.Item("Nome_Art").Value
' Case 3
' aParameters = Recordset1.Fields.Item("Nome_Art").Value
' Case 4 ' Not in use because we couldn't draw a pen in a few seconds!
' aParameters = Recordset1.Fields.Item("Nome_Art").Value
' End Select
' Return array containing product info.
GetItemParameters = aParameters
End Function
' Free shipping if there's nothing to ship or the merchandise
' subtotal is over $100. Otherwise, small orders are $5 and
' larger orders are $7.50.
Function CalculateShippingCost(sngOrderTotal)
Dim sngShipping
If sngOrderTotal <= 0 Or sngOrderTotal > 100 Then
sngShipping = 0
ElseIf sngOrderTotal < 50 Then
sngShipping = 5
Else
sngShipping = 7.50
End If
CalculateShippingCost = sngShipping
End Function
%>
<% ' ***** Begin the infamous runtime script *****
' Declare our Vars
Dim dictCart ' as dictionary
Dim dictCart1 ' as dictionary
Dim sAction ' as string
Dim iItemID ' as integer
Dim iItemCount ' as integer
Dim iItemCod ' as integer
' Get a reference to the cart if it exists otherwise create it
If IsObject(Session("cart")) Then
Set dictCart = Session("cart")
' Set dictCart1 = Session("cart")
Else
' We use a dictionary so we can name our keys to correspond to our
' item numbers and then use their value to hold the quantity. An
' array would also work, but would be a little more complex and
' probably not as easy for readers to follow.
Set dictCart = Server.CreateObject("Scripting.Dictionary")
' Set dictCart1 = Server.CreateObject("Scripting.Dictionary")
End If
If IsObject(Session("cart1")) Then
Set dictCart1 = Session("cart1")
' Set dictCart1 = Session("cart")
Else
' We use a dictionary so we can name our keys to correspond to our
' item numbers and then use their value to hold the quantity. An
' array would also work, but would be a little more complex and
' probably not as easy for readers to follow.
Set dictCart1 = Server.CreateObject("Scripting.Dictionary")
' Set dictCart1 = Server.CreateObject("Scripting.Dictionary")
End If
' Get all the parameters passed to the script
sAction = CStr(Request.QueryString("action"))
iItemID = CStr(Request.QueryString("item"))
iItemCount = CInt(Request.QueryString("count"))
iItemCod = CStr(Request.QueryString("cod"))
'session("teste") = iItemCod
'teste = left(iItemCod,7)
'Session.Abandon
%>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><%
' Select action based on user input
Select Case sAction
Case "add"
AddItemToCart iItemID, iItemCount, iItemCod
' AddItemToCart1 iItemID, iItemCount, iItemCod
ShowItemsInCart
%>
</td></tr>
<tr><td align="right"><a href="javascript:history.go(-1)"><img src="procurar.GIF" border="0" width="46" height="46" alt="Continue Looking" /></a> <a href="main_old.asp?action=checkout"><img src="checkout.GIF" border="0" width="46" height="46" alt="Checkout" /></a>
<%
Case "del"
RemoveItemFromCart iItemID, iItemCount
ShowItemsInCart
%>
</td></tr>
<tr><td align="right"><a href="javascript:history.go(-1)"><img src="procurar.GIF" border="0" width="46" height="46" alt="Continue Looking" /></a> <a href="main_old.asp?action=checkout"><img src="checkout.GIF" border="0" width="46" height="46" alt="Checkout" /></a>
<%
Case "viewcart"
ShowItemsInCart
%>
</td></tr>
<tr><td align="right"><a href="javascript:history.go(-1)"><img src="procurar.GIF" border="0" width="46" height="46" alt="Continue Looking" /></a> <a href="main_old.asp?action=checkout"><img src="checkout.GIF" border="0" width="46" height="46" alt="Checkout" /></a>
<%
Case "checkout"
PlaceOrder
%>
</td></tr>
<tr><td align="left">
<br /><br />
<h3>Obrigado pela sua encomenda</h3>
<!-- <p>
If this had been an actual shopping cart, this is where you would have had them enter
their personal information and payment method and then taken care of any backend
processing before finalizing their order. However as this is a shopping cart sample
and this is where security becomes a problem, we'll leave it for a future sample.
</p>-->
<%
Case Else ' Shop
ShowFullCatalog
%>
</td></tr>
<tr>
<td align="right"><a href="main_old.asp?action=viewcart"><br>
<img src="carrinho.GIF" border="0" width="36" height="39" alt="View Cart Contents" /></a>
<%
End Select
' Return cart to Session for storage
Set Session("cart") = dictCart
Set Session("cart1") = dictCart1
'Set Session("cart") = dictCart1
'set objKey = nothing
%>
</td>
</tr>
</table>
<%
Function pd(n, totalDigits)
if totalDigits > len(n) then
pd = String(totalDigits-len(n),"0") & n
else
pd = n
end if
End Function
%>
</form>
<p> </p>
</body>
</html>
<%
'Recordset1.Close()
'Set Recordset1 = Nothing
CN.Close
set CN=nothing
%>
|