<%If Session("admin") = "ok" Then If Request.Querystring("mess") = "bort" Then mess = "alert('Posten borttaget!');return true;" End If If Request.Querystring("mess") = "andra" Then mess = "alert('Posten ändrat!');return true;" End If%> <%Public Function FixSQL(ByVal sString) ' As String If Len("" & sString) = 0 Then Exit Function sString = Replace(sString, "'","''") sString = Replace(sString, "\","\\") FixSQL = sString End Function%> Admin BYLA

Admin BYLA

<% Set Connha = Server.CreateObject("ADODB.Connection") Connha.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/byla.mdb")%> <%With RecSetha .MoveFirst .PageSize = foha .AbsolutePage = sidaha End With Sidorha = RecSetha.PageCount Countha = 0 Do While Not RecSetha.EOF And Countha < RecSetha.PageSize%> <%Countha = Countha + 1 RecSetha.MoveNext Loop If Sidorha >= 1 Then%> <%Else%> <%End If End If%>
<%If Request.Querystring("action")= "" Then%> <%Set RecSetha = Server.CreateObject("ADODB.Recordset") Const foha = 10 Sidanha = Request.QueryString("sidaha") If Sidanha = "" then sidaha = 1 Else sidaha = Sidanha End If With RecSetha .CursorLocation = 3 .CacheSize = foha End With SQLha = "SELECT tjanster.rubrik, tjanster.texten, tjanster.bild, tjanster.id FROM tjanster Order By id asc" RecSetha.Open SQLha, Connha If RecSetha.EOF Then%>
Inga Händelser inlagd
<%Else%>

Hantera Händelser

Rubrik: Texten: Bild:  
<%=RecSetha("rubrik")%> <%=RecSetha("texten")%> "width="80%" height="40%" > &#tab1">Ändra   &#tab1')">Ta bort
<%If Sidorha <> 1 Then For Sidha = 1 To Sidorha If (Int(Sidha)) = (Int(sidaha)) Then%><%=Sidha%><%Else%> <%=Sidha%> <%End If%> <%Next%> Lägg till
Lägg till
<% RecSetha.Close Set RecSetha = Nothing End If End If If Request.QueryString("action") = "change_ha" Then Set RecSetha = Connha.Execute("SELECT * FROM tjanster WHERE id="& Request.Querystring("id"))%> &#tab1" name="change" enctype="multipart/form-data" onSubmit="return add()">
Rubrk:
">
Text:
">
bild:
">
<%RecSetha.Close Set RecSetha = Nothing End If If Request.QueryString("action") = "andrat_ha" Then byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin contentType = UploadRequest.Item("bild").Item("ContentType") filepathname = UploadRequest.Item("bild").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) value = UploadRequest.Item("bild").Item("Value") bilden = filename rubrik = FixSQL(UploadRequest.Item("rubrik").Item("Value")) texten = FixSQL(UploadRequest.Item("texten").Item("Value")) Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14 if bilden = "" then Set RecSetha = Connha.Execute("SELECT * FROM tjanster WHERE id="& Request.Querystring("id")) bilden = RecSetha("bild") else Set MyFile = ScriptObject.CreateTextFile(Server.mappath("bild/"&filename)) 'Response.write filename bilden = "bild/"&filename For i = 1 to LenB(value) MyFile.Write chr(AscB(MidB(value,i,1))) Next MyFile.Close end if 'response.write bilden Connha.execute("Update tjanster Set rubrik='" & rubrik & "', texten='" & texten & "', bild='" & bilden & "' Where id = "& Request.Querystring("id")) Response.Redirect "Fradminha.asp?visa=cp&#tab1" Sub BuildUploadRequest(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile <%laggtill = "check" %>
Lägg till ny Bild:
Rubrik:
Text:
Bild:
<%End If If Request.Querystring("action") = "spara_ha" Then rubrik = FixSQL(Request.Form("rubrik")) texten = FixSQL(Request.Form("texten")) bild = FixSQL(Request.Form("bild")) blid = "janne" Connha.Execute("Insert Into tjanster (rubrik,texten,bild) Values('" & rubrik & "','" & texten & "','" & bild & "')") Response.Redirect "Fradminha.asp?visa=cp&#tab1" End If%>
<% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/byla.mdb")%> <%With RecSet .MoveFirst .PageSize = fo .AbsolutePage = sida End With Sidor = RecSet.PageCount Count = 0 Do While Not RecSet.EOF And Count < RecSet.PageSize%> <%Count = Count + 1 RecSet.MoveNext Loop If Sidor >= 1 Then%> <%Else%> <%End If End If%>
<%If Request.Querystring("action")= "" Then%> <%Set RecSet = Server.CreateObject("ADODB.Recordset") Const fo = 10 Sidan = Request.QueryString("sida") If Sidan = "" then sida = 1 Else sida = Sidan End If With RecSet .CursorLocation = 3 .CacheSize = fo End With SQL = "SELECT sponsorer.url, sponsorer.bild, sponsorer.id, sponsorer.info FROM sponsorer Order By id asc" RecSet.Open SQL, Conn If RecSet.EOF Then%>
Inga Sponsorer inlagd
<%Else%>

Hantera Sponsorer

Sponsor Url:: Info: Logga:  
<%=RecSet("url")%> <%=RecSet("info")%> "width="100%" height="100%" > &#tab3">Ändra   &#tab3')">Ta bort
<%If Sidor <> 1 Then For Sid = 1 To Sidor If (Int(Sid)) = (Int(sida)) Then%><%=Sid%><%Else%> <%=Sid%> <%End If%> <%Next%> Lägg till
Lägg till
<% RecSet.Close Set RecSet = Nothing End If End If If Request.QueryString("action") = "change" Then Set RecSet = Conn.Execute("SELECT * FROM sponsorer WHERE id="& Request.Querystring("id"))%> &#tab3" name="change" enctype="multipart/form-data" onSubmit="return add()">
Ändring av Sponsorer:
Sponsor Url:
">
Info:
Logga:
">
<%RecSet.Close Set RecSet = Nothing End If If Request.QueryString("action") = "andrat" Then byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin contentType = UploadRequest.Item("bild").Item("ContentType") filepathname = UploadRequest.Item("bild").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) value = UploadRequest.Item("bild").Item("Value") bild = filename namn = UploadRequest.Item("url").Item("Value") info = UploadRequest.Item("om").Item("Value") Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14 if bild = "" then Set RecSet = Conn.Execute("SELECT * FROM sponsorer WHERE id="& Request.Querystring("id")) bilden = RecSet("bild") else Response.write filename Set MyFile = ScriptObject.CreateTextFile(Server.mappath("bilder/"&filename)) bilden = "bilder/"&filename For i = 1 to LenB(value) MyFile.Write chr(AscB(MidB(value,i,1))) Next MyFile.Close end if Conn.execute("Update sponsorer Set url='" & namn & "', info='" & info & "', bild='" & bilden & "' Where id = "& Request.Querystring("id")) Response.Redirect "Fradmin.asp?visa=cp&#tab3" Sub BuildUploadRequest(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile <%laggtill = "check" %>
Lägg till ny Sponsor:
Sponsor Url:
Info:
Logga:
<%End If If Request.Querystring("action") = "spara" Then namn = Request.Form("url") info = Request.Form("info") bild = Request.Form("bild") blid = "janne" Conn.Execute("Insert Into sponsorer (url,info,bild) Values('" & namn & "','" & info & "','" & bild & "')") Response.Redirect "Fradmin.asp?visa=cp&#tab3" End If%>
<%Public Function FixSQL(ByVal sString) ' As String If Len("" & sString) = 0 Then Exit Function sString = Replace(sString, "'","''") sString = Replace(sString, "\","\\") FixSQL = sString End Function Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/gastbok.mdb")%> <%If Request.QueryString("do") = "" Then%>

Gästbokadmin:

<%If Request.Querystring("action")= "" Then%> <%Set RecSet = Server.CreateObject("ADODB.Recordset") Const gbaps1 = 15 Sidan = Request.QueryString("sida") If Sidan = "" then sida = 1 Else sida = Sidan End If With RecSet .CursorLocation = 3 .CacheSize = gbaps1 End With SQL = "Select * From gastbok Order By datum desc" RecSet.Open SQL, Conn If RecSet.EOF Then%>
Inga inlägg i gästboken!
<%Else%> Visa Rubrik: Datum: Namn:   <%With RecSet .MoveFirst .PageSize = gbaps1 .AbsolutePage = sida End With Sidor = RecSet.PageCount Count = 0 Do While Not RecSet.EOF And Count < RecSet.PageSize %> '&#tab5" value="<%=RecSet("verify")%>" <%If RecSet("verify")="1" Then Response.Write " Checked"%>> <%=RecSet("rubrik")%> <%=FormatDateTime(RecSet("Datum"),2)%> <%=RecSet("namn")%> &#tab5">Svara &#tab5">dra &#tab5" onClick="return confirm('Vill du verkligen ta bort <%=RecSet("rubrik")%>?');">Ta bort <%Count = Count + 1 RecSet.MoveNext Loop If Sidor > 1 Then%> <%If Sidor <> 1 Then For Sid = 1 To Sidor If (Int(Sid)) = (Int(sida)) Then%><%=Sid%><%Else%> <%=Sid%> <%End If%> <%Next%> <%End If End If%> <%RecSet.Close:Set RecSet = Nothing End If ElseIf Request.QueryString("action") = "verifyg" Then Set Koll = Conn.Execute("Select * from gastbok Where id=" & FixSQL(Request.QueryString("id"))) If Koll("verify") = "1" Then Conn.Execute("Update gastbok Set verify=0 Where id=" & FixSQL(Request.QueryString("id"))) Else Conn.Execute("Update gastbok Set verify=1 Where id=" & FixSQL(Request.QueryString("id"))) End If Koll.CLose:Set Koll=Nothing Response.Redirect "Fradmin.asp#tab5" ElseIf Request.Querystring("action")= "changeg" Then Set RecSet = Conn.Execute("Select * From gastbok Where id="& FixSQL(Request.Querystring("id")))%> &#tab5" name="gastbok" onSubmit="return Gb()">
Skrivet av <%=RecSet("namn")%> | <%=FormatDateTime(RecSet("datum"),2)%> (<%=FormatDateTime(RecSet("datum"),4)%>) | <%=RecSet("ip")%>
Namn:">
Rubrik:">
Email:">
Hemsida:">
Inlägg:
<%RecSet.Close:Set RecSet = Nothing Conn.Close:Set Conn = Nothing ElseIf Request.Querystring("action") = "andratg" Then Namn = FixSQL(Request.Form("namn")) Rubrik = FixSQL(Request.Form("rubrik")) Mail = FixSQL(Request.Form("mail")) Url = FixSQL(Request.Form("url")) Msg = FixSQL(Request.Form("msg")) Conn.execute("Update gastbok Set namn='" & Namn & "',rubrik='" & Rubrik & "',mail='" & Mail & "',url='" & Url & "',msg='" & Msg & "' Where id = "& Request.Querystring("id")) Conn.Close:Set Conn = Nothing Response.Redirect "Fradmin.asp#tab5" ElseIf Request.Querystring("action") = "deleteg" Then Conn.Execute("Delete * From gastbok Where id=" & FixSQL(Request.Querystring("id"))) Conn.Close:Set Conn = Nothing Response.Redirect "Fradmin.asp#tab5" ElseIf Request.Querystring("action") = "svarag" Then Set RecSet = Conn.Execute("Select * From gastbok Where id=" & FixSQL(Request.Querystring("id")))%> &#tab5" name="answer">
Skrivet av <%=RecSet("namn")%> | <%=FormatDateTime(RecSet("datum"),2)%> (<%=FormatDateTime(RecSet("datum"),4)%>)
<%=Replace(RecSet("msg"), vbCrLf, "
")%>
Skriv ditt svar här
<%RecSet.Close:Set RecSet = Nothing Conn.Close:Set Conn = Nothing ElseIf Request.Querystring("action") = "svaratg" Then Svar = FixSQL(Request.Form("svar")) Conn.Execute("Update gastbok Set Svar='"& Svar &"' Where id=" & FixSQL(Request.Querystring("id"))) Conn.Close:Set Conn = Nothing Response.Redirect "Fradmin.asp#tab5" End If ElseIf Request.Querystring("do") = "logut" Then Session.Abandon Conn.Close:Set Conn = Nothing Response.Redirect "Fradmin.asp#tab5" End If%>

Lägg till tabort Partners i nedre delen av sidan

Partners

Lägg till tabort Sponsorer

Sonsorer

<%End If%>