<% Option Explicit %> <% '**************************************************************************************** '** '** '** '** '**************************************************************************************** Dim rsNews 'Database recordset holding the news items Dim intRecordPositionPageNum 'Holds the number of the page the user is on Dim intRecordLoopCounter 'Loop counter to loop through each record in the recordset Dim intTotalNumNewsEntries 'Holds the number of News Items there are in the database Dim intTotalNumNewsPages 'Holds the number of pages the News Items cover Dim intLinkPageNum 'Holds the number of the other pages of news itmes to link to Dim Language Language ="EN" intRecordsPerPage = 20 'If this is the first time the page is displayed then set the record position is set to page 1 If Request.QueryString("PagePosition") = "" Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the news item record postion is set to the Record Position number Else intRecordPositionPageNum = CInt(Request.QueryString("PagePosition")) End If %> Events <% 'Create recorset object Set rsNews = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblEvents.* FROM tblEvents ORDER BY Start_date DESC;" 'Set the cursor type property of the record set to dynamic so we can naviagate through the record set rsNews.CursorType = 3 rsNews.Filter = "Lang = '" & Language & "'" & " and Archives = true and Comments = False" 'Query the database rsNews.Open strSQL, adoCon 'Set the number of records to display on each page by the constant set in the common.asp file rsNews.PageSize = intRecordsPerPage 'Get the record poistion to display from If NOT rsNews.EOF Then rsNews.AbsolutePage = intRecordPositionPageNum 'If there are no rcords in the database display an error message If rsNews.EOF Then 'Tell the user there are no records to show Response.Write "
There are no News Items to read" Response.Write "
Please check back later
" Response.End 'Display the News Items Else 'Count the number of News Items database intTotalNumNewsEntries = rsNews.RecordCount 'Count the number of pages of News Items there are in the database calculated by the PageSize attribute set above intTotalNumNewsPages = rsNews.PageCount 'Display the HTML number number the total number of pages and total number of records %>
SEMIDE/EMWIS

Events                              

Home Events Links Structures Documentations Training News Legislation

There are <% = intTotalNumNewsEntries %> Events in <% = intTotalNumNewsPages %> pages and you are on page number <% = intRecordPositionPageNum %>

<% dim strBorder 'For....Next Loop to display the News Items in the database For intRecordLoopCounter = 1 to intRecordsPerPage if intRecordLoopCounter mod 2 = 0 then strBorder = "#EEF3FB" else strBorder ="#99CCFF" end if 'If there are no records then exit for loop If rsNews.EOF Then Exit For %> > <% 'Move to the next record in the recordset rsNews.MoveNext Next End If 'Display an HTML table with links to the other News Items %>
Date Place Event
<%if (rsNews("End_date")<>"") then%> <% = day(rsNews("Start_date")) %> to <% = FormatDateTime(rsNews("End_date"), vbshortDate) %> <%else%> <% = FormatDateTime(rsNews("Start_date"), vbshortDate) %> <%end if %> <% = rsNews("Coverage") %> " target="_self"> <% = rsNews("Title") %>
<% 'If there are more pages to display then add a title to the other pages If intRecordPositionPageNum > 1 or NOT rsNews.EOF Then Response.Write vbCrLf & " Page: " End If 'If the News Items page number is higher than page 1 then display a back link If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & " << Prev " End If 'If there are more pages to display then display links to all the pages If intRecordPositionPageNum > 1 or NOT rsNews.EOF Then 'Display a link for each page in the News Items For intLinkPageNum = 1 to intTotalNumNewsPages 'If the page to be linked to is the page displayed then don't make it a hyper-link If intLinkPageNum = intRecordPositionPageNum Then Response.Write vbCrLf & " " & intLinkPageNum Else Response.Write vbCrLf & " " & intLinkPageNum & " " End If Next End If 'If it is Not the End of the News Items entries then display a next link for the next News Items page If NOT rsNews.EOF then Response.Write vbCrLf & " Next >>" End If 'Finsh HTML the table %>
<% 'Reset server objects rsNews.Close Set rsNews = Nothing Set strCon = Nothing Set adoCon = Nothing %>
[Home] [Algérie PFN] [Arabe] [Français] [Contact us] [Search]