<%@LANGUAGE="VBSCRIPT" %>
<% option explicit
dim strDatabase %>
<!--#include file="connections.asp" -->
<%
' -- bildershow für Bereichte
function getBilder
dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strDatabase
dim url, id
url = request.Servervariables("SCRIPT_NAME")
dim pic : pic = 404
dim sql1, rs1
sql1 = "select min(ID), max(ID) from tbl_bilder where bdokID=" & pic
Set RS1 = Server.CreateObject("ADODB.Recordset")
RS1.Open sql1, objConn
dim anfang : anfang = rs1(0)
dim ende : ende = rs1(1)
rs1.close
set rs1=nothing
id = anfang
if Request.QueryString("id") <> "" then id = Request.QueryString("id")
dim prev : prev = Request.QueryString("prev")
dim anext : anext = Request.QueryString("next")
'++++++++++++++++++++++++++++++++++++++++++++++
if prev <> "" then
dim sql, rs
sql = "select * from tbl_bilder where bdokID=" & pic & " and ID < " & id & " order by ID DESC"
elseif anext <> "" then
sql = "select * from tbl_bilder where bdokID=" & pic & " and ID > " & id & " order by ID ASC"
else
sql = "select * from tbl_bilder where bdokID=" & pic & " and ID =" & id
end if
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open sql, objConn
' --- Bilderausgabe
dim AusgabeBild
AusgabeBild = "<div style=""text-align:center;"">" & _
"<img style=""border:1px solid #cccccc;"" src=""../pfad/" & _
rs(2) & "_" & rs(1) & ".jpg"">" & _
"</div>"
' ---- Anfang und Ende abfragen
dim mAnfang, mEnde
if rs(0) = anfang then mAnfang = true
if rs(0) = ende then mEnde = true
dim txt
txt = AusgabeBild & "<br>"
' ---- Blätterlinks
txt = txt & "<div style=""text-align:center;"">"
if mAnfang = false then
txt = txt & "<a href=""" & url & "?pic=" & pic & "&ID=" & anfang & """>Anfang</a> | "
txt = txt & "<a href=""" & url & "?pic=" & pic & "&prev=1&ID=" & rs(0) & """>prev</a> | "
else
txt = txt & "Anfang | prev | "
end if
if mEnde = false then
txt = txt & "<a href=""" & url & "?pic=" & pic & "&next=1&ID=" & rs(0) & """>next</a> | "
txt = txt & "<a href=""" & url & "?pic=" & pic & "&ID=" & ende & """>Ende</a> "
else
txt = txt & "next | Ende"
end if
txt = txt & "</div>"
'++++++++++++++++++++++++++++++++++++++++++++++++++++++
rs.close
Set RS = Nothing
' -- Verbindung schließen
objConn.close
set objConn = Nothing
getBilder = txt
end function
%>
<html>
<head>
<title>Bildershow</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size:80%;
margin:2px;
background-color:#cccccc;
text-align:center;
}
</style>
</head>
<body>
<div style="padding:10px;margin:10px;background-color:white;border:2px outset;width:550px;">
<%
Response.write getBilder
%>
</div>
<div style="font-size:70%;color:white;padding-left:10px;">©PTS Training Service</div>
</body>
</html>