<% iCatID = Request.Querystring("CatID") 'gsConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("..\auction.MDB") OpenDBConn iPageSize = 10 If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If Call DoPageHeader Set GobjConnect = server.createobject("ADODB.Connection") GobjConnect.open gsConnect ' Create recordset Set objPagingRS = Server.CreateObject("ADODB.Recordset") ' Set cursor location and pagesize objPagingRS.CursorLocation = adUseClient objPagingRS.PageSize = iPageSize gsSQL = "" gsSQL = gsSQL & "SELECT * FROM Auctions WHERE CategoryID = " & SQLVal(iCatID) & " " gsSQL = gsSQL & " AND AvailDate <= " & SQLDate(NOW) gsSQL = gsSQL & " And Ended = false " gsSQL = gsSQL & " ORDER BY CloseDate " 'Response.Write gsSQL objPagingRS.Open gsSQL, GobjConnect, adOpenStatic, adLockReadOnly, adCmdText tSQL = "" tSQL = tSQL & "SELECT ID, CategoryName FROM Categories WHERE ID = " & SQLVal(iCatID) Set Categoryrs = GobjConnect.Execute(tSQL) iPageCount = objPagingRS.PageCount If 1 > iPageCurrent Then iPageCurrent = 1 If iPageCurrent > iPageCount Then iPageCurrent = iPageCount Response.Write("") Response.Write("

" & Categoryrs.Fields("CategoryName") & "

") Response.Write("

") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") If objPagingRS.eof then Response.Write("") Else ' Move to the selected page objPagingRS.AbsolutePage = iPageCurrent iswitch = TRUE Do While objPagingRS.AbsolutePage = iPageCurrent And Not objPagingRS.EOF If iswitch = TRUE then scolor = "#E9E9E9" iswitch = False Else scolor = "#FFFFFF" iswitch = TRUE End If bidsSQL = "" bidsSQL = bidsSQL & "SELECT COUNT(*) as Total FROM Bids Where ItemID = " & SQLVal(objPagingRS.Fields("ItemID")) Set BidCountRS = GobjConnect.Execute(bidsSQL) Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") BidCountRS.Close Set BidCountRS = Nothing objPagingRS.MoveNext Loop objPagingRS.close Set objPagingRS = Nothing End If Response.Write("") Response.Write("") Response.Write("
TítuloData de fecho (Mês-Dia-Ano)OfertasActual Oferta
") Response.Write("NÃO EXISTEM LEILÕES NESTA CATEGORIA") Response.Write("
" & objPagingRS.Fields("ItemTitle") & "") If Len(Trim(objPagingRS.Fields("ImageURL"))) > 0 Then Response.Write("") End If If BidCountRS.Fields("Total") >= iHotItemCount Then Response.Write("") End If Response.Write("" & objPagingRS.Fields("CloseDate") & "" & BidCountRS.Fields("Total") & "" & FormatNumber(objPagingRS.Fields("CurrentBid"), 2) & " Euros
") Call AuctionNavigation Response.Write("
") Call PageNavigation Call DoPageFooter Call CloseDBConn Sub PageNavigation Response.Write("
") If iPageCurrent <> 1 AND iPageCurrent <> 0 Then Response.Write ("Anterior" & vbCrLf ' Spacer - inside the if so we don't get it unless needed Else Response.Write("Anterior") End If Response.Write "   Página " Response.Write iPageCurrent Response.Write " de " Response.Write iPageCount Response.Write "    " If iPageCurrent < iPageCount Then Response.Write ("Próxima" & vbCrLf Else Response.Write("Próxima") End If Response.Write("
") End Sub %>