File: D:/HostingSpaces/RImmers/duitsedog.tk/wwwroot/onderhoud/fotos.asp
<%
option explicit
%>
<!-- #INCLUDE VIRTUAL="/includes/inc_default.asp" -->
<!-- #INCLUDE VIRTUAL="/includes/inc_auth.asp" -->
<%
dim intId, strNaam, strSortOrder, strSort, strMsg, Rs, strClass, strDatum, intFotoTypeId, strOms
If Request.ServerVariables("CONTENT_LENGTH") <> 0 Then
intFotoTypeId = FormToInt(Request.Form("selTypes"))
session("ViewFotos") = Request.Form("cbViewFotos")<>""
Else
If Request.QueryString("Mode") = "del" Then
intId = FormToInt(Request.Querystring("Id"))
strOms = FotoOms(intId)
Call VerwijderFoto(intId)
strMsg = "Foto """ & strOms & """ verwijderd."
End If
intFotoTypeId = FormToInt(Request.QueryString("type_id"))
End If
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/onderhoud.css">
<base target="main">
<script language="JavaScript">
function doConfirm(oms){
if(confirm('Foto "'+ oms + '" verwijderen?')){
document.form1.submit();
return true;
}
else{
return false;
}
}
</script>
</head>
<body>
<%
If Request.QueryString("sort")<>"" Then strSort = Request.QueryString("sort") Else strSort = "DD_FOTOS.oms" End If
If Request.QueryString("order")<>"" Then strSortOrder = Request.QueryString("order") Else strSortOrder = "ASC" End If
If Request.QueryString("msg")<>"" Then strMsg = Request.QueryString("msg") End If
%>
<h2>Foto's</h2>
<%
If strMsg<>"" Then Response.Write("<p>" & StrToHTML(strMsg) & "</p>") End If
%>
<form method="POST" id="form1" name="form1" action="fotos.asp">
<p>
<b>Type</b>
<select name="selTypes" onchange="javascript:form1.submit();">
<%
Set Rs = GetRs("select * from DD_FOTO_TYPES ORDER BY Oms")
While Not Rs.EOF
If IsNull(intFotoTypeId) Then intFotoTypeId = Rs("id")
%>
<option <%If intFotoTypeId = Rs("id") Then Response.Write("selected")%> value="<%=Rs("id")%>"><%=Rs("oms")%></option>
<%
Rs.MoveNext
Wend
Rs.Close
%>
</select>
Foto's tonen:<input type="checkbox" name="cbViewFotos" onclick="javascript:form1.submit();" <%If session("ViewFotos") Then Response.Write("checked")%>>
<input type="button" value="Toevoegen" onclick="document.location.href='wijzig_foto.asp';" name="button1">
</p>
<table class="clsDefault" cellSpacing="1">
<tr>
<th width="15"> </th>
<th width="15"> </th>
<th width="150"><%WriteTableHead "Omschrijving", "DD_FOTOS.oms", strSort, strSortOrder, "fotos.asp?type_id=" & intFotoTypeId, ""%></th>
<th width="150"><%WriteTableHead "Seizoen", "DD_FOTO_SEIZOENEN.oms", strSort, strSortOrder, "fotos.asp?type_id=" & intFotoTypeId, ""%></th>
<th width="100"><%WriteTableHead "Grootte", "DD_FOTOS.grootte", strSort, strSortOrder, "fotos.asp?type_id=" & intFotoTypeId, ""%></th>
<th width="60"><%WriteTableHead "Hits", "DD_FOTOS.hits", strSort, strSortOrder, "fotos.asp?type_id=" & intFotoTypeId, ""%></th>
<th width="60"><%WriteTableHead "Actief", "DD_FOTOS.ind_actief", strSort, strSortOrder, "fotos.asp?type_id=" & intFotoTypeId, ""%></th>
<%If session("ViewFotos") Then %><th width="150">Foto</th><%End If%>
</tr>
<%
Set Rs = GetRS("SELECT DD_FOTOS.*, DD_FOTO_SEIZOENEN.oms AS seizoen FROM DD_FOTO_SEIZOENEN RIGHT JOIN DD_FOTOS ON DD_FOTO_SEIZOENEN.id = DD_FOTOS.seizoen_id WHERE (((DD_FOTOS.seizoen_id)=[DD_FOTO_SEIZOENEN].[ID])) AND DD_FOTOS.TYPE_ID=" & IntToSql(intFotoTypeId) & " ORDER BY " & strSort & " " & strSortOrder)
While Not Rs.EOF
strClass = "clsItemActive"
%>
<tr>
<td class="<%=strClass%>"><a href="wijzig_foto.asp?id=<%=Rs("id")%>"><img SRC="../images/icons/edit.gif" border="0" HEIGHT="12"></a></td>
<td class="<%=strClass%>"><a href="fotos.asp?id=<%=Rs("id")%>&mode=del"><img SRC="../images/icons/delete.gif" onClick="return doConfirm('<%=StrToJScript(Rs("oms"))%>');" border="0" HEIGHT="12"></a></td>
<td class="<%=strClass%>"><%=StrToHTML(Rs("oms"))%></td>
<td class="<%=strClass%>"><%=StrToHTML(Rs("seizoen"))%></td>
<td class="<%=strClass%>"><%=FormatFileSize(Rs("grootte"))%></td>
<td class="<%=strClass%>"><%=IntToHTML(Rs("hits"))%></td>
<td align="center" class="<%=strClass%>"><%If SqlToBool(Rs("ind_actief")) Then Response.Write("<IMG SRC=""../images/icons/checked_icon.gif"">") Else Response.Write("<IMG SRC=""../images/icons/not_checked_icon.gif"">") End If%></td>
<%
If session("ViewFotos") Then
%>
<td>
<%
If Not IsNull(Rs("bestandsnaam")) Then
%>
<a href="wijzig_foto.asp?id=<%=Rs("id")%>"><img height="100" src="../fotos/<%=FotoTypeOms(Rs("type_id")) & "/" & Rs("bestandsnaam")%>" border="0"></img></a>
<%
End If
%>
</td>
<%
End If
%>
</tr>
<%
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
%>
<tr>
<td class="clsBottom" colSpan="8"> </td>
</tr>
</table>
</form>
</body>
</html>