<% 'indlæsningsdelen ' Databaseforbindelse - husk at angive sti til din database Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../db/database.mdb") Conn.Open DSN 'Hvis der ikke er trykket på button1 endnu If Request.Form("accept1") <> "Godkend" Then 'her hentes prisen for de forskellige services ind som strings strSQL = "Select payment From Arrangement Where arrangementID=1" Set rs = Conn.Execute(strSQL) strPAYMENT1 = rs("payment")*(-1) strSQL = "Select payment From Arrangement Where arrangementID=2" Set rs = Conn.Execute(strSQL) strPAYMENT2 = rs("payment")*(-1) strSQL = "Select payment From Arrangement Where arrangementID=4" Set rs = Conn.Execute(strSQL) strPAYMENT4 = rs("payment")*(-1) strSQL = "Select payment From Arrangement Where arrangementID=5" Set rs = Conn.Execute(strSQL) strPAYMENT5 = rs("payment")*(-1) strSQL = "Select payment From Arrangement Where arrangementID=6" Set rs = Conn.Execute(strSQL) strPAYMENT6 = rs("payment")*(-1) 'tabellen med "varer" udskrives Response.Write "
" Response.Write "
" Response.Write "
" Response.Write "
Bestilling af sedcarts m.m.
" & strERR &"
" Response.Write "
" Response.Write "
Genoptryk af sedcarts:
" Response.Write "
" Response.Write "Hvis du ønsker flere sedcards, så vælg antal her:
" Response.Write "
" Response.Write "
" Response.Write "
50 sedcards (pris " & strPAYMENT1 &",- kr)
" Response.Write "
100 sedcards (pris " & strPAYMENT2 &",- kr)
" Response.Write "
" Response.Write "
" Response.Write "
Bestilling af nye sedcarts (nyt layout):
" Response.Write "
Hvis du ønsker helt nye sedcards:
" Response.Write "
" Response.Write "
" Response.Write "
50 nye sedcards (pris " & strPAYMENT4 & ",- kr)
" Response.Write "
100 nye sedcards (pris " & strPAYMENT5 &",- kr)
" Response.Write "
" Response.Write "
" Response.Write "
Bestilling af fotosession:
" Response.Write "
" Response.Write "Hvis du ønsker at få taget nye billeder til din mappe:
" Response.Write "
" Response.Write "
" Response.Write "
Fotosession (pris " & strPAYMENT6 & ",- kr)
" Response.Write "
" Response.Write "
" Response.Write "
Betaling:
" Response.Write "
Betalingsmetode:
" Response.Write "
" Response.Write "
Kontooverførsel til Den Danske Bank
" Response.Write "
Check / kontant
" Response.Write "
VISA / Dankort
" Response.Write "
" Response.Write "
" Response.Write "
" Response.Write "
" End If ' Hvis der er blevet trykket på knappen "Godkend" første gang skal databasen: If Request.Form("accept1") = "Godkend" Then 'Første del af tabellen er standard Response.Write "
" Response.Write "
" Response.Write "
" Response.Write "
Bestilling af sedcarts m.m.
" & strERR &"
" 'Først de 3 "tomme" valg If Request.Form("sedcards") = "none" And Request.Form("newsedcards") = "none" And Request.Form("photosession") = "none" Then strERR = "Du kan ikke afgive en tom bestilling" Response.Write "
" Response.Write "
" & strERR & "
" End If If Request.Form("newsedcards") <> "none" And Request.Form("sedcards") <> "none" And Request.Form("photosession") = "none" Then strERR = "Det er ikke muligt at bestille både genoptryk af sedcards samt nye sedcards på samme bestilling" Response.Write "
" Response.Write "
" & strERR & "
" End If '5 If Request.Form("sedcards") <> "none" And Request.Form("newsedcards") <> "none" And Request.Form("photosession") <> "none" Then strERR = "Det er ikke muligt at bestille både genoptryk af sedcards samt nye sedcards på samme bestilling" Response.Write "
" Response.Write "
" & strERR & "
" End If 'Dernæst de korrekte valg If Request.Form("sedcards") <> "none" And Request.Form("newsedcards") = "none" And Request.Form("photosession") = "none" Then strSED = Request.Form("sedcards") strSQL = "Select * From Arrangement Where arrangementID = " & strSED & " " Set rs = Conn.Execute(strSQL) strPRICE1 = rs("payment")*(-1) strARNAME = rs("name") Response.Write "
" Response.Write "
Genoptryk af sedcarts:
" Response.Write "
" Response.Write "Hvis du ønsker flere sedcards, så vælg antal her:
" Response.Write "
" Response.Write "
" & strARNAME & "
" Response.Write "
" Response.Write "
" Response.Write "
Betaling:
" Response.Write "
Betalingsmetode:
" Response.Write "
" Response.Write "
Kontooverførsel til Den Danske Bank
" Response.Write "
Check / kontant
" Response.Write "
VISA / Dankort
" Response.Write "
" Response.Write "
" Response.Write "
" End If Response.Write "
" End If ' Hvis der er blevet trykket på knappen "Godkend" anden gang skal databasen opdateres If Request.Form("accept2") = "Godkend" Then strUID = (Session("modelID")) strDATE = (Date) 'strSQL sætning opbygges strSQL = "Select *"&_ " From Models"&_ " Where (Models.email = '" & strUID & "') " ' Udfør forespørgsel (rs indeholder nu resultatet) Set rs = Conn.Execute(strSQL) ' Gennemløb Recordset (rs) med en løkke Do ' definer hvilken modelID det drejer sig om strMODELID = rs("modelID") ' Gå til næste Record i rs rs.MoveNext ' Fortsæt indtil rs er gennemløbet (EOF = End Of File) Loop While Not rs.EOF 'insert delen Do If Request.Form("sedcards") <> "none" And Request.Form("newsedcards") = "none" And Request.Form("photosession") = "none" Then strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("sedcards") & "', " strSQL = strSQL & "'" & strDATE & "' ) " End If '4 If Request.Form("sedcards") <> "none" And Request.Form("newsedcards") = "none" And Request.Form("photosession") <> "none" Then strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("sedcards") & "', " strSQL = strSQL & "'" & strDATE & "' ) " Conn.Execute(strSQL) strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("photosession") & "', " strSQL = strSQL & "'" & strDATE & "' ) " End If '8 If Request.Form("sedcards") = "none" And Request.Form("newsedcards") <> "none" And Request.Form("photosession") = "none" Then strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("newsedcards") & "', " strSQL = strSQL & "'" & strDATE & "' ) " End If '6 If Request.Form("sedcards") = "none" And Request.Form("newsedcards") <> "none" And Request.Form("photosession") <> "none" Then strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("newsedcards") & "', " strSQL = strSQL & "'" & strDATE & "' ) " Conn.Execute(strSQL) strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("photosession") & "', " strSQL = strSQL & "'" & strDATE & "' ) " End If '7 If Request.Form("sedcards") = "none" And Request.Form("newsedcards") = "none" And Request.Form("photosession") <> "none" Then strSQL = "Insert into Participants (" strSQL = strSQL & "modelID, " strSQL = strSQL & "arrangementID, " strSQL = strSQL & "date2 ) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & strMODELID & "', " strSQL = strSQL & "'" & Request.Form("photosession") & "', " strSQL = strSQL & "'" & strDATE & "' ) " End If ' SQL sætning eksekveres Conn.Execute(strSQL) ' Fortsæt indtil rs er gennemløbet (EOF = End Of File) Loop While Not rs.EOF If Len(strERR) > 0 Then ' Her laves fejlmeddelsen om til rød skrift strErr = "
" & strErr & "
" Else Response.Redirect("yourarrangements.asp") End If End If ' Luk databaseforbindelse Conn.Close Set Conn = Nothing %>