<% ' ' Filename: English_DestinationsNewZealand.asp ' Generated with CodeCharge 2.0.5 ' ASP 2.0 & Templates.ccp build 11/30/2001 ' '------------------------------- ' English_DestinationsNewZealand CustomIncludes begin %> <% ' English_DestinationsNewZealand CustomIncludes end '------------------------------- '=============================== ' Save Page and File Name available into variables '------------------------------- sFileName = "English_DestinationsNewZealand.asp" sTemplateFileName = "English_DestinationsNewZealand.html" '=============================== '=============================== ' English_DestinationsNewZealand PageSecurity begin ' English_DestinationsNewZealand PageSecurity end '=============================== '=============================== ' English_DestinationsNewZealand Open Event begin ' English_DestinationsNewZealand Open Event end '=============================== '=============================== ' English_DestinationsNewZealand OpenAnyPage Event begin ' English_DestinationsNewZealand OpenAnyPage Event end '=============================== '=============================== 'Save the name of the form and type of action into the variables '------------------------------- sAction = GetParam("FormAction") sForm = GetParam("FormName") '=============================== ' English_DestinationsNewZealand Show begin '=============================== ' Display page '------------------------------- ' Load HTML template for this page '------------------------------- LoadTemplate sAppPath & sTemplateFileName, "main" '------------------------------- ' Load HTML template of Header and Footer '------------------------------- '------------------------------- SetVar "FileName", sFileName '------------------------------- ' Step through each form '------------------------------- English_Destinations_Show '------------------------------- ' Process page templates '------------------------------- Parse "main", False '------------------------------- ' Output the page to the browser '------------------------------- Response.write PrintVar("main") ' English_DestinationsNewZealand Show end '------------------------------- ' Destroy all object variables '------------------------------- ' English_DestinationsNewZealand Close Event begin ' English_DestinationsNewZealand Close Event end cn.Close Set cn = Nothing UnloadTemplate '=============================== '=============================== ' Display Grid Form '------------------------------- Sub English_Destinations_Show() '------------------------------- ' Initialize variables '------------------------------- Dim rs Dim sWhere : sWhere = "" Dim sOrder : sOrder = "" Dim sSQL : sSQL = "" Dim sFormTitle: sFormTitle = "Our New Zealand Destinations" Dim HasParam : HasParam = false Dim iRecordsPerPage : iRecordsPerPage = 20 Dim iCounter : iCounter = 0 Dim iPage : iPage = 0 Dim bEof : bEof = False SetVar "TransitParams", "" SetVar "FormParams", "" sWhere = " WHERE active = true and destination = 'New Zealand'" '------------------------------- ' Build ORDER BY statement '------------------------------- sOrder = " order by E.Location Asc" '------------------------------- ' Build base SQL statement '------------------------------- sSQL = "select [E].[Active] as E_Active, " & _ "[E].[DNr] as E_DNr, " & _ "[E].[Describtion] as E_Describtion, " & _ "[E].[Destination] as E_Destination, " & _ "[E].[Location] as E_Location " & _ " from [English_Destinations] E " '------------------------------- '------------------------------- ' English_Destinations Open Event begin ' English_Destinations Open Event end '------------------------------- '------------------------------- ' Assemble full SQL statement '------------------------------- sSQL = sSQL & sWhere & sOrder '------------------------------- SetVar "FormTitle", sFormTitle '------------------------------- ' Open the recordset '------------------------------- openStaticRS rs, sSQL '------------------------------- '------------------------------- ' Process empty recordset '------------------------------- if rs.eof then set rs = nothing SetVar "DListEnglish_Destinations", "" Parse "English_DestinationsNoRecords", False SetVar "English_DestinationsNavigator", "" Parse "FormEnglish_Destinations", False exit sub end if '------------------------------- '------------------------------- ' Initialize page counter and records per page '------------------------------- iRecordsPerPage = 20 iCounter = 0 '------------------------------- '------------------------------- ' Process page scroller '------------------------------- iPage = GetParam("FormEnglish_Destinations_Page") if IsEmpty(iPage) then iPage = 1 else iPage = CLng(iPage) while not rs.eof and iCounter < (iPage-1)*iRecordsPerPage rs.movenext iCounter = iCounter + 1 wend iCounter = 0 '------------------------------- '------------------------------- ' Display grid based on recordset '------------------------------- while not rs.EOF and iCounter < iRecordsPerPage '------------------------------- ' Create field variables based on database fields '------------------------------- fldField1_URLLink = "English_Hotels_NewZealand.asp" fldField1_Location = GetValue(rs, "E_Location") fldField2_URLLink = "English_Optional_NewZealand.asp" fldField2_Location = GetValue(rs, "E_Location") fldActive = GetValue(rs, "E_Active") fldDescribtion = GetValue(rs, "E_Describtion") fldDestination = GetValue(rs, "E_Destination") fldDNr = GetValue(rs, "E_DNr") fldLocation = GetValue(rs, "E_Location") fldField1= "Hotels" fldField2= "Optional" '------------------------------- ' English_Destinations Show begin '------------------------------- '------------------------------- ' English_Destinations Show Event begin ' English_Destinations Show Event end '------------------------------- '------------------------------- ' Replace Template fields with database values '------------------------------- SetVar "DNr", ToHTML(fldDNr) SetVar "Destination", ToHTML(fldDestination) SetVar "Location", ToHTML(fldLocation) SetVar "Describtion", ToHTML(fldDescribtion) SetVar "Active", ToHTML(fldActive) SetVar "Field1", ToHTML(fldField1) SetVar "Field1_URLLink", fldField1_URLLink SetVar "PrmField1_Location", ToURL(fldField1_Location) SetVar "Field2", ToHTML(fldField2) SetVar "Field2_URLLink", fldField2_URLLink SetVar "PrmField2_Location", ToURL(fldField2_Location) Parse "DListEnglish_Destinations", True '------------------------------- ' English_Destinations Show end '------------------------------- '------------------------------- ' Move to the next record and increase record counter '------------------------------- rs.MoveNext iCounter = iCounter + 1 wend '------------------------------- '------------------------------- ' English_Destinations Navigation begin '------------------------------- bEof = rs.eof if rs.eof and iPage = 1 then SetVar "English_DestinationsNavigator", "" else if bEof then SetVar "English_DestinationsNavigatorLastPage", "_" else SetVar "NextPage", (iPage + 1) end if if iPage = 1 then SetVar "English_DestinationsNavigatorFirstPage", "_" else SetVar "PrevPage", (iPage - 1) end if SetVar "English_DestinationsCurrentPage", iPage Parse "English_DestinationsNavigator", False end if '------------------------------- ' English_Destinations Navigation end '------------------------------- '------------------------------- ' Finish form processing '------------------------------- set rs = nothing SetVar "English_DestinationsNoRecords", "" Parse "FormEnglish_Destinations", False '------------------------------- ' English_Destinations Close Event begin ' English_Destinations Close Event end '------------------------------- End Sub '=============================== %>