www.HighRiseTimes.dk

<% strFarve = "FFFFFF" %>

| baggrunde: |

<% if request.QueryString("hrt") = "ja" then response.write "

tilføj baggrund | start

" else response.write "

" end if %>

<% Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/ting.mdb") Conn.Open DSN strSQL = "Select * from monetter" Set rs = Conn.Execute(strSQL) strMonetter = rs("monetter") Conn.Close Set Conn = Nothing MyDay = Day(Now) MyMonth = Month(Now) MyHour = Hour(Now) MyMinute = Minute(Now) MySecond = Second(Now) If len(MyDay) < 2 then strD = "0" else strD = "" end if If len(MyMonth) < 2 then strM = "0" else strM = "" end if If len(MyHour) < 2 then strH = "0" else strH = "" end if If len(MyMinute) < 2 then strMi = "0" else strMi = "" end if If len(MySecond) < 2 then strS = "0" else strS = "" end if strLigeNu = strD & Day(Now) & "-" & strM & Month(Now) & "-" & Year(Now) & " " & strH & Hour(Now) & ":" & strMi & Minute(Now) & ":" & strS & Second(Now) strMode = Request.QueryString("side") Select Case strMode Case "skriv" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If %> Navn:
Beskrivelse:
Antal:
Handelsværdi i planter:
Grafik (f.eks. penthouse.gif):

| tilføj |

<% Case "opret" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN If len(Request.Form("beskrivelse")) > 2500 Then Response.Write "OBS: Din beskrivelse må højest fylde 2500 tegn." ElseIf Request.Form("navn") = "" Then Response.Write "OBS: Du mangler at skrive navnet på tingen." ElseIf Request.Form("hhinfo") = "" Then Response.Write "OBS: Du mangler at angive antallet." ElseIf Request.Form("grafik") = "" Then Response.Write "OBS: Du mangler at indtaste URL adressen til grafikken." ElseIf Request.Form("verdi") = "" Then Response.Write "OBS: Du mangler at angive værdien på baggrunden." Else strSQL = "Insert into baggrunde (" strSQL = strSQL & "navn, " strSQL = strSQL & "beskrivelse, " strSQL = strSQL & "antal, " strSQL = strSQL & "verdi, " strSQL = strSQL & "grafik) " strSQL = strSQL & "values( " strSQL = strSQL & "'" & Server.HTMLEncode(Request("navn")) & "', " strSQL = strSQL & "'" & Request.Form("beskrivelse") & "', " strSQL = strSQL & "'" & Server.HTMLEncode(Request("hhinfo")) & "', " strSQL = strSQL & "'" & Server.HTMLEncode(Request("verdi")) & "', " strSQL = strSQL & "'" & Server.HTMLEncode(Request("grafik")) & "')" Conn.Execute(strSQL) Conn.Close Set Conn = Nothing Response.Redirect "baggrunde.asp?side=adminlist&hrt=ja" End If %> <% Case "slet" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strSQL = "Delete * From baggrunde Where Id = " & Request.Querystring("id") Conn.Execute(strSQL) Conn.Close Set Conn = Nothing Response.Redirect "baggrunde.asp?side=adminlist&hrt=ja" %> <% Case "rediger" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strSQL = "Select * from baggrunde Where Id = " & Request.Querystring("id") Set rs = Conn.Execute(strSQL) Response.Write " " Response.Write "Navn:
Beskrivelse:
" & rs("beskrivelse") & "
Antal:
Værdi i planter:
URL til grafik (f.eks. penthouse.gif):
" %>

| opdater |

<% Conn.Close Set Conn = Nothing Case "opdater" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strBeskrivelse = Request.Form("beskrivelse") strBeskrivelse = Replace(strBeskrivelse,"'","''") strSQL = "Update baggrunde set " strSQL = strSQL & "navn = '" & Server.HTMLEncode(Request("navn")) & "', " strSQL = strSQL & "beskrivelse = '" & Server.HTMLEncode(strBeskrivelse) & "', " strSQL = strSQL & "antal = '" & Server.HTMLEncode(Request("hhinfo")) & "', " strSQL = strSQL & "verdi = '" & Server.HTMLEncode(Request("verdi")) & "', " strSQL = strSQL & "grafik = '" & Server.HTMLEncode(Request("grafik")) & "'" strSQL = strSQL & " Where Id = " & Request.Querystring("id") & "" Conn.Execute(strSQL) Conn.Close Set Conn = Nothing Response.Redirect "baggrunde.asp?side=adminlist&hrt=ja" %> <% Case "info" Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strSQL = "Select * from baggrunde Where Id = " & Request.Querystring("id") Set rs = Conn.Execute(strSQL) If Not (rs.BOF Or rs.EOF) Then Function StripHtml(Str) Str = Replace(Str, vbCrLf, "
") StripHtml = Str End Function verdi = rs("verdi") Response.Write "" & rs("navn") & "
" & StripHtml(rs("beskrivelse")) & "
Antal: " & rs("antal") & "
Værdi i planter: " & verdi & "
Værdi i monetter: " & verdi * strMonetter & "
Grafik:
" else Response.Write "OBS: Baggrunden findes ikke." end if Conn.Close Set Conn = Nothing %> <% Case "sog" %> Søg efter
som
:

| søg |

<% Case "bgres" Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath ("../../database/baggrunde.mdb") Conn.Open DSN If Request.Form("navn") = "" Then Response.Redirect "baggrunde.asp?side=sog" Else Response.write "Fandt du hvad du ledte efter? ny søgning
" if request.form("select") = "ligmed" then strSQL = "Select * From baggrunde Where " & Server.HTMLEncode(request.form("slags")) & " = '" & request.form("navn") & "'" elseif request.form("select") = "startermed" then strSQL = "SELECT * FROM baggrunde WHERE (" & Server.HTMLEncode(request.form("slags")) & " LIKE '" & request.form("navn") & "%')" elseif request.form("select") = "indeholder" then strSQL = "Select * From baggrunde where (" & Server.HTMLEncode(request.form("slags")) & " like '%" & request.form("navn") & "%')" end if Set rs = Conn.Execute(strSQL) If Not (rs.BOF Or rs.EOF) Then Response.Write "

| Søgeresultat:

" Do grafik = rs("grafik") Response.Write "
| " & rs("navn") & " " & left(Server.HTMLEncode(rs("beskrivelse")),50) & ".. se info
" rs.MoveNext Loop While Not rs.EOF Response.write "

Fandt du hvad du ledte efter? ny søgning
" Else Response.Write "OBS: Intet søgeresultat." End if end if %> <% Case "adminlist" If session ("login") <> "adminlogin" then Response.Redirect "../nyhed/nyheder.asp?side=adminlogin" End If Response.Write "Slet eller rediger baggrunds-informationer:
" Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strSQL = "Select * from baggrunde Order by navn" Set rs = Conn.Execute(strSQL) If Not (rs.BOF Or rs.EOF) Then Do id = rs("id") Response.Write "

|  | " & rs("navn") & " " & left(rs("beskrivelse"),100) & "...

" Response.Write "

| slet |  |  |  | rediger |

" rs.MoveNext Loop until rs.EOF else Response.Write "OBS: Der findes ingen baggrunde." end if Conn.Close Set Conn = Nothing %> <% Case Else strTal = 0 Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath("../../database/baggrunde.mdb") Conn.Open DSN strSQL = "Select * from baggrunde Order by id" Set rs = Conn.Execute(strSQL) if not (rs.EOF or rs.BOF) then Do strTal = strTal + 1 Response.Write "" & rs("navn") & "
" rs.MoveNext Loop until rs.EOF else Response.Write "OBS: Der findes ingen baggrunde." end if Conn.Close Set Conn = Nothing response.write "

| Facts: I alt er der " & strTal & " baggrunde, hvor de her på listen er sorteret efter dato.

" End Select %>