<% Dim varDiagnostics ' Display diagnostics? varDiagnostics = "N" Dim varHost ' Which host am I on? Const conHostArchtech = "archtech.wellsfargo.com" Dim varDSNcurr ' ODBC DSN for OT driver database Const conDSNprod = "dsn=lehuan.otdriver" Const conDSNtest = "dsn=kmteam" Const conDSNold = "dsn=lehuan.sitedriver" varDSNcurr = conDSNprod Dim selCaller ' Calling page's ID Dim selRegion ' Chosen region Dim selDashLvl ' Traveler's persistent dash-lvl Dim selTraveler ' Traveler's persistent dash-group Dim selWorld ' Traveler's persistent world choice Dim selTextTarget ' Search: Target-text for search Dim selSearchCatg ' Search: Flag: Search Catg? Dim selSearchCaption ' Search: Flag: Search Caption? Dim selSearchURL ' Search: Flag: Search URL? Dim selSearchComments ' Search: Flag: Search Comments? Dim objRSd ' dbase object: Driver Dim varLvlRegion ' dbase: Region's level (0-2 = dash) Dim varDashGrp ' dbase: Which dashboard to use Dim varBGimage ' dbase: Background image Dim varBannerImage ' dbase: Banner image for region page Dim varBannerImgAlt ' dbase: ALT text for banner image Dim varBannerTColor ' dbase: Color of region title text Dim varCatgBColor ' dbase: Color of category hdr background Dim varCatgTColor ' dbase: Color of category header text Dim varCaptBColor ' dbase: Color of caption background Dim varCaptTColor ' dbase: Color of caption text Dim varQuote ' dbase: Quote for region page Dim varSQLtext_d ' dbase: SQL statements for objRSd Dim objRSu ' dbase object: URLs table Dim varCatg ' dbase: Category Dim varCaption ' dbase: Caption Dim varURL ' dbase: URL Dim var00Dash ' dbase: Dash-select: International Dim varUKDash ' dbase: Dash-select: UK Dim varScDash ' dbase: Dash-select: Scotland Dim varComments ' dbase: Comments Dim varImgURL ' dbase: URL for image Dim varSQLtext_u ' SQL statements for objRSu Dim varURLfront ' first 4 chars of URL Dim prevCatg ' category of previous row Dim varLenTot ' Tot length all entries in row Const varLenMax = 200 ' Max allowed before need entire row Dim varColSpan ' Nbr columns needed for this entry Dim var1stCatg Dim varRowFlop Dim varKeyPrefix ' strip sort-forcers off frontend of keys Dim varFlagImg ' Flag: Row has an image? Dim varTemp ' reusable string work area var1stCatg = "0" varRowFlop = "0" Const conNullFlag = "@" ' flag to remember field is null Const litColorWFBred = "AC0039" Const litColorWhite = "FFFFFF" Const litColorBlack = "000000" Const litColorLichen = "C9DDC9" Const litColorDkFern = "225555" Const litColorPlock = "004D21" ' Plockton green Const litColorSpruce = "126755" ' Spruce Const litColorAntGold = "A0F850" ' Antique Gold Const litColorGold = "A3E150" ' Gold Const litColorPlum = "992266" ' Plockton Plum ' *** Set color defaults: litBannerBColor = litColorBlack litBannerTColor = litColorWhite litCatgBColor = litColorPlum litCatgTColor = litColorWhite litCaptBColor = litColorSpruce litCaptTColor = litColorGold ' *** ************************************************************** *** ' *** *** ' *** S T A R T P R O G R A M: *** ' *** *** ' *** ************************************************************** *** ' *** ***************************************************** ' *** *** ' *** S E C T I O N 1 *** ' *** *** ' *** I N I T I A L I Z A T I O N *** ' *** *** ' *** Initial DSN ID's etc *** ' *** Receive and interpret the passed parms *** ' *** *** ' *** ***************************************************** sub1000WhichDSN() ' Choose d'base DSN based on which host sub1050GetIncoming() ' Get/store/prep incoming variables ' *** ***************************************************** ' *** *** ' *** S E C T I O N 2 *** ' *** *** ' *** Get driver parameters for this region *** ' *** *** ' *** ***************************************************** sub1070OpenDriver() ' Make SQL & set/open for driver tbl sub1100StowDriver() ' Stow driver fields sub1200PrepDriver() ' Prep driver fields objRSd.Close Set objRSd = Nothing sub1300ApplyRegion() ' Apply driver's region defaults - color etc. sub2900Bodyparms() ' Write BODY parms ' *** ***************************************************** ' *** *** ' *** S E C T I O N 3 *** ' *** *** ' *** Display the URLs for this region (or dash) *** ' *** *** ' *** *** ' *** ***************************************************** If selCaller = "otsearch" Then sub3040TitleSearch() ' Display title-line for search Else sub3050BanrElems() ' Display banner image and quote End If If selCaller = "otdash" Then sub8100MakeReturn() ' Paint "return" button Else sub8000MakeDashLink() ' Paint link to dashboard End If response.write "
" If selCaller = "otsearch" Then sub3090SQLsearch() ' Build search-version SQL Else If selCaller = "otdash" Then sub3100SQLdash() ' Build dashboard-version SQL Else sub3200SQLregion() ' Build regional-version SQL End If End If varSQLtext_u = varSQLtext_u & " ORDER BY Ot_Catg, Ot_Caption;" If varDiagnostics = "Y" Then Response.Write "
" & varSQLtext_u End If ' *** ***************************************************** ' *** Connect to the MS database ' *** ***************************************************** If varDiagnostics = "Y" Then Response.Write "
Ready to set world-URLs recordset" End If Set objRSu=server.createobject("ADODB.recordset") objRSu.open varSQLtext_u, varDSNcurr ' *** Do this loop for each record: ' *** do while NOT objRSu.EOF sub3500StowRegion() ' Stow and prep region fields If (prevCatg <> varCatg) Then sub4000StartCatg() ' Header for new catg End If prevCatg = varCatg ' ******************* ' *** Has image? *** ' ******************* If IsNull(varImgURL) or varImgURL = "" Then varFlagImg = "N" Else varTemp = Left(varImgURL, 4) If varTemp = "http" Or varTemp = "bin/" or varTemp = "../b" Then varFlagImg = "Y" Else varFlagImg = "N" End If End If ' *********************************** ' *** One cell or 2 for this one? *** ' *********************************** If varFlagImg = "Y" Then varLenTot = varLenMax + 1 Else varLenTot = Len(varCaption) + Len(varComments) End If If varLenTot > varLenMax Then varColSpan = 2 ' *** "0" means cell 1 of 2 has not been completed: ' *** "1" means cell 2 of 2 has not been completed: If varRowFlop = "1" Then response.write "" varRowFlop = "0" End If Else varColSpan = 1 End If ' *** "0" means cell 1 of 2 has not been completed: ' *** "1" means cell 2 of 2 has not been completed: If varRowFlop = "0" Then response.write "" & CHR(10) & CHR(10) End If sub4100StartCell() ' Paint frontend of cell If varFlagImg = "Y" Then Response.Write "

" End If If varURLfront = "http" Or varURLfront = "Regi" Or varURLfront = "../b" Then response.write "" & varCaption & "" Else response.write "" & varCaption & "" If varURL <> conNullFlag Then response.write "
" & varURL End If End If If varFlagImg = "Y" Then Response.Write "

" End If If varComments <> conNullFlag Then Response.Write "
" & varComments & "" End If If varFlagImg = "Y" Then Response.Write "


" End If Response.Write "" & CHR(10) ' *** "0" means cell 1 of 2 has not been completed: If varRowFlop = "1" Or varColSpan = 2 Then ' *** Cell 2 of 2 has now been completed: varRowFlop = "0" response.write "
" Else ' *** Cell 1 of 2 has now been completed: varRowFlop = "1" End If objRSu.MoveNext Loop '*** *********************** *** '*** END OF FILE *** '*** *********************** *** ' *** ***************************************************** ' *** END LOOP: All rows have been read and *** ' *** displayed. Close the HTML for the *** ' *** table and close the file. *** ' *** ***************************************************** If varRowFlop = "1" Then response.write "" End If response.write "




" & CHR(10) & CHR(10) If selCaller = "otdash" Then sub8100MakeReturn() ' Paint "return" button Else sub8000MakeDashLink() ' Paint link to dashboard End If 'Close and dereference database objects objRSu.Close Set objRSu = Nothing ' *** ************************************************************** *** ' *** *** ' *** E N D P R O G R A M. *** ' *** *** ' *** ************************************************************** *** ' *** *********************************************** *** ' *** *** ' *** S T A R T S U B R O U T I N E S *** ' *** *** ' *** *********************************************** *** ' *** ************************** *** ' *** sub1000WhichDSN: *** ' *** Set DSN based on host *** ' *** ************************** *** Sub sub1000WhichDSN() varHost = Request.ServerVariables("HTTP_HOST") If varHost = conHostArchtech Then varDSNcurr = conDSNtest Else varDSNcurr = conDSNprod End If End Sub ' *** ************************************** *** ' *** sub1050GetIncoming: *** ' *** Get/store/prep incoming variables *** ' *** ************************************** *** Sub sub1050GetIncoming() If varDiagnostics = "Y" Then for i = 1 to Request.QueryString.Count Response.Write "
1050 querystring(" & Request.QueryString( i ) & ")" next End If ' *** First, check the URL tail: selCaller = Request.QueryString("selCaller") selRegion = Request.QueryString("selRegion") selDashLvl = Request.QueryString("selDashLvl") selTraveler = Request.QueryString("selTraveler") selWorld = Request.QueryString("selWorld") selTextTarget = Request.QueryString("selTextTarget") selSearchCatg = Request.QueryString("selSearchCatg") selSearchCaption = Request.QueryString("selSearchCaption") selSearchURL = Request.QueryString("selSearchURL") selSearchComments = Request.QueryString("selSearchComments") ' *** If tail is empty, check FORM input: If IsNull(selCaller) or selCaller = "" Then set selCaller = Request.Form("selCaller") set selRegion = Request.Form("selRegion") set selDashLvl = Request.Form("selDashLvl") set selTraveler = Request.Form("selTraveler") set selWorld = Request.Form("selWorld") End If If IsNull(selTextTarget) or selTextTarget = "" Then set selTextTarget = Request.Form("selTextTarget") set selSearchCatg = Request.Form("selSearchCatg") set selSearchCaption = Request.Form("selSearchCaption") set selSearchURL = Request.Form("selSearchURL") set selSearchComments = Request.Form("selSearchComments") End If If IsNull(selCaller) or selCaller = "" Then selCaller = conNullFlag End If If IsNull(selRegion) or selRegion = "" Then selRegion = conNullFlag End If If IsNull(selDashLvl) or selDashLvl = "" Then selDashLvl = 0 End If If IsNull(selTraveler) or selTraveler = "" Then selTraveler = "00" End If If IsNull(selWorld) or selWorld = "" Then selWorld = "none" End If If IsNull(selTextTarget) or selTextTarget = "" Then selTextTarget = conNullFlag End If If IsNull(selSearchCatg) or selSearchCatg = "" Then selSearchCatg = conNullFlag End If If IsNull(selSearchCaption) or selSearchCaption = "" Then selSearchCaption = conNullFlag End If If IsNull(selSearchURL) or selSearchURL = "" Then selSearchURL = conNullFlag End If If IsNull(selSearchComments) or selSearchComments = "" Then selSearchComments = conNullFlag End If If selCaller = "otsearch" then selRegion = "Scotland" End If ' *** If neither FORM nor URL carries input parms, bounce: If selRegion = conNullFlag Then Response.write "
Warning! No selection has been made. Return to the selection process." End If If varDiagnostics = "Y" Then Response.Write "
1050: " sub9000DiagParms() ' Display passed variables End If End Sub ' *** ************************************ *** ' *** sub1070OpenDriver: *** ' *** SQL and set/open for driver tbl *** ' *** ************************************ *** Sub sub1070OpenDriver() If varDiagnostics = "Y" Then Response.Write "
Ready to set driver recordset" End If Set objRSd=server.createobject("ADODB.recordset") varSQLtext_d="SELECT * FROM Tbl_Ot_Driver WHERE (OtDr_Region = '" & selRegion & "');" If varDiagnostics = "Y" Then Response.Write "
Ready to open driver" Response.Write "
" & varSQLtext_d End If objRSd.open varSQLtext_d, varDSNcurr End Sub ' *** ************************** *** ' *** sub1100StowDriver: *** ' *** Store driver fields *** ' *** ************************** *** Sub sub1100StowDriver() varLvlRegion = objRSd("OtDr_Lvl_Region") varDashGrp = objRSd("OtDr_Dash_Grp") varBGimage = objRSd("OtDr_BG_Image") varBannerImage = objRSd("OtDr_Banner_Image") varBannerImgAlt = objRSd("OtDr_Banner_Img_Alt") varBannerTColor = objRSd("OtDr_Banner_TColor") varCatgBColor = objRSd("OtDr_Catg_BColor") varCatgTColor = objRSd("OtDr_Catg_TColor") varCaptBColor = objRSd("OtDr_Capt_BColor") varCaptTColor = objRSd("OtDr_Capt_TColor") varQuote = objRSd("OtDr_Quote") End Sub ' *** *********************** *** ' *** sub1200PrepDriver: *** ' *** Prep driver fields *** ' *** *********************** *** Sub sub1200PrepDriver() If varDiagnostics = "Y" Then Response.Write "
Reached sub1200PrepDriver" End If If IsNull(varLvlRegion) Or varLvlRegion = "" Then varLvlRegion = conNullFlag End If If IsNull(varDashGrp) Or varDashGrp = "" Then varDashGrp = conNullFlag End If If IsNull(varBannerImage) Or varBannerImage = "" Then varBannerImage = conNullFlag End If If IsNull(varBannerImgAlt) Or varBannerImgAlt = "" Then varBannerImgAlt = conNullFlag End If If IsNull(varBGimage) Or varBGimage = "" Then varBGimage = conNullFlag End If If varDiagnostics = "Y" Then Response.Write "
varBannerImage(" & varBannerImage & ")" End If End Sub ' *** ********************************* *** ' *** sub1300ApplyRegion: *** ' *** Apply driver's region defaults *** ' *** ********************************* *** Sub sub1300ApplyRegion() If varDiagnostics = "Y" Then Response.Write "
At start-1300 apply: varBannerImage(" & varBannerImage & ")" End If If varLvlRegion >= selDashLvl Then selDashLvl = varLvlRegion selTraveler = varDashGrp selWorld = varRegion End If If IsNull(varBannerBColor) or varBannerBColor = "" Then varBannerBColor = litBannerBColor End If If IsNull(varBannerTColor) or varBannerTColor = "" Then varBannerTColor = litBannerTColor End If If IsNull(varCatgBColor) or varCatgBColor = "" Then varCatgBColor = litCatgBColor End If If IsNull(varCatgTColor) or varCatgTColor = "" Then varCatgTColor = litCatgTColor End If If IsNull(varCaptBColor) or varCaptBColor = "" Then varCaptBColor = litCaptBColor End If If IsNull(varCaptTColor) or varCaptTColor = "" Then varCaptTColor = litCaptTColor End If End Sub ' *** ************************** *** ' *** sub2900Bodyparms: *** ' *** Write BODY parms *** ' *** ************************** *** Sub sub2900Bodyparms() Response.write " conNullFlag Then Response.Write " BACKGROUND=""" & varBGimage & """" End If Response.Write ">" Response.Write "" End Sub ' *** ************************** *** ' *** sub3040TitleSearch: *** ' *** Paint title for search *** ' *** ************************** *** Sub sub3040TitleSearch() Response.Write "
" Response.Write "

Search Other Worlds

" & CHR(10) & CHR(10) End Sub ' *** ************************** *** ' *** sub3050BanrElems: *** ' *** Display banner image *** ' *** ************************** *** Sub sub3050BanrElems() If varDiagnostics = "Y" Then Response.Write "
At 3050 banr: varBannerImage(" & varBannerImage & ")" End If If selRegion = "All" Then varTemp = "Traveler's Dashboard" Else If selCaller = "otdash" Then varTemp = selRegion & " Dashboard" Else varTemp = "The Magic of " & selRegion End If End If Response.Write "
" Response.Write "" If varDiagnostics = "Y" Then Response.Write "
At banner image: varBannerImage(" & varBannerImage & ")" End If If varBannerImage = conNullFlag Or selCaller = "otdash" Then Response.Write "

" & varTemp & "

" Else Response.Write "

" & varTemp & "


" If varQuote <> conNullFlag Then Response.Write "

" & varQuote & "
" End If End If Response.Write "
" End Sub ' *** ********************** *** ' *** sub3090SQLsearch *** ' *** SEARCH-request SQL: *** ' *** ********************** *** Sub sub3090SQLsearch() varTemp = "N" ' Flag: Had previous WHERE? varSQLtext_u = "SELECT * FROM Tbl_Otherworlds_URLs WHERE" If selSearchCatg <> conNullFlag Then varSQLtext_u = varSQLtext_u & " (Ot_Catg LIKE '%" & selTextTarget & "%')" varTemp = "Y" End If If selSearchCaption <> conNullFlag Then If varTemp = "Y" Then varSQLtext_u = varSQLtext_u & " OR " End If varSQLtext_u = varSQLtext_u & " (Ot_Caption LIKE '%" & selTextTarget & "%')" varTemp = "Y" End If If selSearchURL <> conNullFlag Then If varTemp = "Y" Then varSQLtext_u = varSQLtext_u & " OR " End If varSQLtext_u = varSQLtext_u & " (Ot_URL LIKE '%" & selTextTarget & "%')" varTemp = "Y" End If If selSearchComments <> conNullFlag Then If varTemp = "Y" Then varSQLtext_u = varSQLtext_u & " OR " End If varSQLtext_u = varSQLtext_u & " (Ot_Comments LIKE '%" & selTextTarget & "%')" varTemp = "Y" End If If varTemp <> "Y" Then varSQLtext_u = varSQLtext_u & " ( Ot_Caption = 'yyGeneral Guides')" End If End Sub ' *** ********************************** *** ' *** sub3100SQLdash *** ' *** DASHBOARD SQL: *** ' *** ... WHERE Ot_Region = selRegion *** ' *** OR OT_Dash_xx = "Y"... *** ' *** ********************************** *** Sub sub3100SQLdash() If varDiagnostics = "Y" Then Response.Write "
sub3100SQLdash: varDashGrp(" & varDashGrp & ")" End If varSQLtext_u="SELECT * FROM Tbl_Otherworlds_URLs WHERE Ot_Region = '" & selRegion & "'" If varDashGrp = "Sc" Then varTemp = "Ot_Sc_Dash" Else If varDashGrp = "UK" Then varTemp = "Ot_UK_Dash" Else varTemp = "Ot_00_Dash" End If End If varSQLtext_u = varSQLtext_u & " OR " & varTemp & " = 'Y'" End Sub ' *** ********************************************* *** ' *** WRITE SQL FOR REGION-SPECIFIC CALLS *** ' *** *** ' *** ... WHERE (Ot_Region = 'selRegion')... *** ' *** *** ' *** ********************************************* *** Sub sub3200SQLregion() If varDiagnostics = "Y" Then Response.Write "
sub3200SQLregion" End If varSQLtext_u="SELECT * FROM Tbl_Otherworlds_URLs WHERE (Ot_Region = '" & selRegion & "')" End Sub ' *** ************************** *** ' *** sub3500StowRegion: *** ' *** Store region fields *** ' *** ************************** *** Sub sub3500StowRegion() varCatg = objRSu("Ot_Catg") varCaption = objRSu("Ot_Caption") varComments = objRSu("Ot_Comments") varURL = objRSu("Ot_URL") varImgURL = objRSu("Ot_Image_URL") If IsNull(varURL) or varURL = "" Then varURL = conNullFlag End If If IsNull(varComments) or varComments = "" Then varComments = conNullFlag End If If IsNull(varImgURL) or varImgURL = "" Then varImgURL = conNullFlag End If If varURL = conNullFlag Then varURLfront = conNullFlag Else varURLfront = Left(varURL, 4) End If If not IsNull(varCatg) Then varKeyPrefix = Left(varCatg, 2) If varKeyPrefix = "aa" or varKeyPrefix = "bb" or varKeyPrefix = "ww" or varKeyPrefix = "xx" or varKeyPrefix = "yy" or varKeyPrefix = "zz" Then varCatg = Mid(varCatg, 3) End If End If If not IsNull(varCaption) Then varKeyPrefix = Left(varCaption, 2) If varKeyPrefix = "aa" or varKeyPrefix = "bb" or varKeyPrefix = "ww" or varKeyPrefix = "xx" or varKeyPrefix = "yy" or varKeyPrefix = "zz" Then varCaption = Mid(varCaption, 3) End If End If End Sub ' *** ************************** *** ' *** sub4000StartCatg: *** ' *** - Finish prev catg *** ' *** - Start new catg *** ' *** ************************** *** Sub sub4000StartCatg() ' *** "1" means the last row of the previous *** ' *** catg had only 1 of the 2 cells: *** If varRowFlop = "1" Then response.write "
" End If var1stCatg = "1" response.write "
" response.write "" response.write "" response.write varCatg & "" ' *** "0" means cell 1 of 2 has not been completed: varRowFlop = "0" End Sub ' *** *********************** *** ' *** sub4100StartCell: *** ' *** Start cell *** ' *** *********************** *** Sub sub4100StartCell() Response.write "" End Sub ' *** *************************** *** ' *** sub8000MakeDashLink: *** ' *** Setup link to dashboard *** ' *** *************************** *** Sub sub8000MakeDashLink() response.write "
" varTemp = "Also: Check out The Dashboard for a broader region
and more generalized features and tools." Response.Write "

" & varTemp & "

" & CHR(10) & CHR(10) End Sub ' *** ************************** *** ' *** sub8100MakeReturn: *** ' *** Setup URL to return *** ' *** to originating page *** ' *** ************************** *** Sub sub8100MakeReturn() response.write "
" & CHR(10) Response.Write "" If (selRegion = "All") Or (selCaller = "otdash" And (selWorld = conNullFlag Or selWorld = "none")) Then Response.Write "" Else varTemp = Replace(selRegion, " ", "+") Response.Write "" End If Response.Write "


" & CHR(10) If varDiagnostics = "Y" Then Response.Write "
8100: " sub9000DiagParms() ' Display passed variables End If '8100: selCaller(otdash), selRegion(Plockton), selDashLvl(3), selTraveler(Sc), ' selWorld(none) If selTraveler = "00" Then sub8110WorldChoices() ' Choices other than 'World' Else If selTraveler = "UK" Then sub8120UKchoices() ' Choices other than 'UK' Else If selTraveler = "Sc" THen sub8130ScotChoices() ' Choices other than 'Scotland' End If End If End If Response.Write "

   Choose a World    

   Return to the Magic of " & selRegion & "   

" & CHR(10) & CHR(10) End Sub ' *** ****************************** *** ' *** sub8110WorldChoices: *** ' *** Setup buttons if at World *** ' *** ****************************** *** Sub sub8110WorldChoices() Response.Write "" Response.Write "" Response.Write "" End Sub ' *** *************************** *** ' *** sub8120UKchoices: *** ' *** Setup buttons if at UK *** ' *** *************************** *** Sub sub8120UKchoices() Response.Write "" Response.Write "" Response.Write "" End Sub ' *** ******************************** *** ' *** sub8130ScotChoices: *** ' *** Setup buttons if at Scotland *** ' *** ******************************** *** Sub sub8130ScotChoices() Response.Write "" Response.Write "" Response.Write "" End Sub ' *** **************************** *** ' *** sub9000DiagParms: *** ' *** Display passed variables *** ' *** **************************** *** Sub sub9000DiagParms() response.write "
selCaller(" & selCaller & ")" response.write ", selRegion(" & selRegion & ")" response.write ", selDashLvl(" & selDashLvl & ")" response.write ", selTraveler(" & selTraveler & ")" response.write ", selWorld(" & selWorld & ")" response.write ", selTextTarget(" & selTextTarget & ")" response.write ", selSearchCatg(" & selSearchCatg & ")" response.write ", selSearchCaption(" & selSearchCaption & ")" response.write ", selSearchURL(" & selSearchURL & ")" response.write ", selSearchComments(" & selSearchComments & ")" End Sub ' *** *********************************************** *** ' *** *** ' *** E N D S U B R O U T I N E S *** ' *** *** ' *** *********************************************** *** %>