<% Response.buffer=True If Session("LoginName") = "" then Response.redirect "login.asp?Redirect=" &Request.Servervariables("URL") End If %>
   Liste des pages 
Esplanade Parmentier
62600 Berck-sur-Mer 
Tél : 03.21.09.21.21   
Fax : 03.21.09.29.29   

<% dim adoCn dim strSQL dim strActive set adoCn = Server.CreateObject("ADODB.Connection") adoCn.Open strConn if Request.QueryString("action")="del" then strSQL = "DELETE FROM Images where ImageID=" & Request.QueryString("ImageID") adoCn.Execute strSQL end if if Request.QueryString("action")="Activate" then strSQL = "Update Images set Active = 'Yes' where ImageID=" & Request.QueryString("ImageID") adoCn.Execute strSQL end if if Request.QueryString("action")="DeActivate" then strSQL = "Update Images set Active = 'No' where ImageID=" & Request.QueryString("ImageID") adoCn.Execute strSQL end if if Request.QueryString("action")="ByCategory" then strSQL = "SELECT * FROM Images WHERE CatID = '" & Request.QueryString("CatID") & "' ORDER BY CatID;" adoCn.Execute strSQL end if dim adoRs set adoRs = Server.CreateObject("ADODB.Recordset") strSQL = "Select * From Images order by CatID Desc" %> <% adoRs.Open strSQL, adoCn, 3, 1, &H0001 %> <% If adoRs.RecordCount = 0 Then %>
[ Aucun produit ]

[ Ajouter un produit ]

<% Response.End Else End IF %> <% Dim ShowPage ShowPage = CInt(Request.QueryString("ShowPage")) Dim PageSize ' nombre de produits a afficher sur la page If Request.QueryString("HideDesc")="HideDesc" Then PageSize = 20 Else PageSize = 5 End IF adoRs.PageSize = PageSize Dim NumOfPages NumOfPages = adoRs.PageCount If ShowPage < 1 then ShowPage = 1 ElseIf ShowPage > NumOfPages Then ShowPage = NumOfPages End If adoRs.AbsolutePage = ShowPage Dim i i = 0 %> <% Do While Not adoRs.EOF and not i = PageSize %> <% i = i + 1 adoRs.MoveNext Loop%> <% If Request.QueryString("HideDesc")="HideDesc" Then %> <%PagingHideDescAdminList()%> <%Else%> <%PagingAdminList()%> <%End IF%>
<% Dim TotalRecords TotalRecords= adoRs.RecordCount response.Write "Il y a " &TotalRecords & " produit(s) dans " & NumOfPages& " page(s) "%>
<% adoRs.Close set adoRs = nothing adoCn.Close set adoCn = nothing %>