Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
buttonname_Click
<%
Dim oRs, oCm
Dim strSQL
Dim VaraPris, TotPris, Rabatt, Frakt
Dim intCounter
VaraPris = 0
TotPris = 0
if Request.Form("Tabort") = "" then
Set oRs = Server.CreateObject("ADODB.Recordset")
With oRs
.ActiveConnection = "DSN=SYCENT;"
'DB Hintar
.CursorLocation = 3
.CursorType = 3
.LockType = 4
strSQL = "SELECT Namn, Antal, Pris FROM KorgInnehall " & _
"INNER JOIN Varor ON KorgInnehall.VaruID = Varor.Id " & _
"WHERE KorgInnehall.KorgId = 5"
.Open strSQL
Set .ActiveConnection = Nothing
if oRs.Recordcount = 0 then
Response.Write "<font size=""4"">Din kundkorg är <font color=""#D61303"">tom!</font></font>"
else
Response.Write "<form name=""KundKorg"">"
Response.Write "<select name=""Korgen"">"
While Not oRs.EOF
Response.Write "<option SELECTED=""true"" value=""" & oRs("Antal").Value & " st " & oRs("Namn").Value & " á " & oRs("Pris").Value & " kr" & """>" & oRs("Antal") & " st " & oRs("Namn") & " á " & oRs("Pris") & " kr </option>"
VaraPris = oRs("Antal") * oRs ("Pris")
TotPris = Totpris + VaraPris
oRs.MoveNext
Wend
Response.Write "</select> "
Response.Write " <input type=""button"" name=""Tabort"" value=""Tabort varan"">"
Response.Write "</form>"
Response.Write "Att betala: " & TotPris & " kr"
end if
.Close
End With
Set oRs = Nothing
else
for intCounter = 1 to Request.Form.Count
if (Request.Form.Key(intCounter) <> "Tabort") then
intID = cint(Request.Form.Item(intCounter))
strSQL = "DELETE FROM MyTable WHERE id = " & intID
Set oCm = Server.CreateObject("ADODB.Command")
With oCm
.ActiveConnection = "DSN=SYCENT;"
.CommandType = adText
.CommandText = strSQL
.Execute
End With
end if
next
Set oCm = Nothing
end if
%>