%
fDDStr = Request.QueryString("fDD")
fCSStr = Request.QueryString("fCS")
Set objRegExp = New RegExp
With objRegExp
.Pattern = "^\d+-\d+$"
End With
If (fDDStr <> "" And Not objRegExp.Test(fDDStr)) Then
Response.Redirect("/")
End If
If (fCSStr <> "" And Not objRegExp.Test(fCSStr)) Then
Response.Redirect("/")
End If
%>
<%
' These definitions must be included on every page that uses a content window.
' You should also define the INC_* variables as needed throughout the page.
' Encode Email
'----------------------------------------------------------------------------
Dim glbEncodeEmail 'Specify whether or not to encode Email Addresses
glbEmailEncode = 1
' System variables (non-configurable)
'-----------------------------------------------------------------------------
Dim incURL ' URL to the include page (May be deprecated)
Dim iRandom ' Random number (May be deprecated)
Dim objConn1 ' Object to hold primary connection to database
Dim rsTemp1 ' Array for retrieving primary database information
Dim objConn2 ' Object to hold secondary connection to database (may or may not be used)
Dim rsTemp2 ' Array for retrieving secondary database information (may or may not be used)
Dim c_mon ' Today's month, with leading 0
Dim c_day ' Today's day, with leading 0
Dim c_yea ' Today's year
Dim c_tsp ' Today, in database timestamp format
Dim c_short ' Today, in M/D/YYYY format
Dim c_long ' Today, in MMM D, YYYY format
Dim c_full ' Today, in WWWW MMMM, D, YYYY format
Dim objPDF ' Object to hold regular expression to match pdf documents
Dim objHTM ' Object to hold regular expression to match html documents
Dim PU_1, PU_2
Dim egovLink, egovImgs
' Configurable variable to achieve desired output
'-----------------------------------------------------------------------------
Dim INC_cwType ' Indicate the template you want to use from CW_template.html (integer)
Dim INC_department_id ' Limit items returned to these departments (array containing integers, find in manager)
Dim INC_division_id ' Limit items returned to these divisions (array containing integers, find in manager)
Dim INC_category_id ' Limit to a specific category (array containing integers, find in manager)
Dim INC_subcategory_id ' Limit to a specific subcategory (array containing integers, find in manager)
Dim INC_content_type_int ' Limit to a specific content type (array containing integers, find in manager)
Dim INC_content_type ' Limit to content of this type. 0 = webpage (array containing integers (or \d+-\d+), find in feel.pl)
Dim INC_featured ' Limit to featured items if set to 1, otherwise set to 0 or ""
Dim INC_orderBy ' Database field (and direction) on which to order the results
Dim num_department_ids '
Dim num_division_ids '
Dim num_category_ids '
Dim num_subcategory_ids '
Dim num_content_type_ints '
Dim num_content_types '
Dim INC_numItems ' Number of items to return in content window
Dim INC_showDesc ' Show the description of the item. Set to 1 for yes, 0 or "" for none.
Dim GLB_eventPop ' Use pop-up details for events. Set to 1 for yes, 0 or "" for no.
Dim GLB_egovURL ' URL for the egov apps
Dim GLB_dsn ' Database connection string
' Globally Used Variables (configurable)
'-----------------------------------------------------------------------------
GLB_egovURL = "http://www.fortdodgeIndiana.org"
GLB_pop = 0
GLB_dsn = eGovDBAuth()
' Define date values
'-----------------------------------------------------------------------------
c_mon = Right(Cstr(Month(Date)+100),2)
c_day = Right(Cstr(Day(Date)+100),2)
c_yea = Year(Date)
c_tsp = "{ts '" & c_yea & "-"& c_mon & "-" & c_day & " 00:00:00'}"
c_short = Month(Date) & "/" & Day(Date) & "/" & Year(Date)
c_full = formatDateTime(Now(), vbLongDate)
' Establish primary database connection
'-----------------------------------------------------------------------------
set objConn1 = server.createobject("adodb.connection")
objConn1.open GLB_dsn
' Useful functions and regular expressions
' ------------------------------------------------------------------------------
Set objHTM = New RegExp
objHTM.IgnoreCase = True
objHTM.Pattern = "htm$"
Set objDOC = New RegExp
objDOC.IgnoreCase = True
objDOC.Pattern = "doc$"
Function PCase(strInput) ' ---------------------------------------------------
Dim iPosition ' Our current position in the string (First character = 1)
Dim iSpace ' The position of the next space after our iPosition
Dim strOutput ' Our temporary string used to build the function's output
iPosition = 1
Do While InStr(iPosition, strInput, " ", 1) <> 0
iSpace = InStr(iPosition, strInput, " ", 1)
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition))
iPosition = iSpace + 1
Loop
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
PCase = strOutput
End Function ' ---------------------------------------------------------------
Function createSQL() '--------------------------------------------------------
selectSQL = "SELECT a.file_url, a.title, a.date_start, a.date_end, a.description, a.content_id, a.file_date, a.file_size, a.content_type_int, a.content_type, a.file_name " _
& "FROM main_search a " _
& "WHERE a.status = 1 AND " _
& "(a.expire_start IS NULL OR a.expire_start < " & c_tsp & ") AND " _
& "(a.expire_end IS NULL OR a.expire_end > " & c_tsp & ")"
i = 0
temp_sql = ""
For Each id In INC_department_id
temp_sql = temp_sql & "department_id LIKE '%|" & id & "|%' OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
selectSQL = selectSQL & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_department_ids = i
i = 0
temp_sql = ""
For Each id In INC_division_id
temp_sql = temp_sql & "division_id LIKE '%|" & id & "|%' OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
selectSQL = selectSQL & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_division_ids = i
i = 0
temp_sql = ""
For Each id In INC_category_id
temp_sql = temp_sql & "category_id LIKE '%|" & id & "|%' OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
temp_sql = temp_sql & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_category_ids = i
i = 0
temp_sql = ""
For Each id In INC_subcategory_id
temp_sql = temp_sql & "subcategory_id LIKE '%|" & id & "|%' OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
selectSQL = selectSQL & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_subcategory_ids = i
i = 0
temp_sql = ""
For Each id In INC_content_type
temp_sql = temp_sql & "content_type = " & id & " OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
selectSQL = selectSQL & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_content_types = i
i = 0
temp_sql = ""
For Each id In INC_content_type_int
temp_sql = temp_sql & "content_type_int LIKE '%|" & id & "|%' OR "
i = i + 1
Next
If len(temp_sql) > 0 Then
tOffset = len(temp_sql) - 4
selectSQL = selectSQL & " AND (" & Mid(temp_sql, 1, tOffset) & ")"
End If
num_content_type_ints = i
If INC_featured = 1 Then
selectSQL = selectSQL & " AND a.flag_featured = 1"
End If
selectSQL = selectSQL & " AND (a.date_end > " & c_tsp & " OR a.date_end IS NULL)"
If Not INC_orderBy = "" Then
selectSQL = selectSQL & " ORDER BY " & INC_orderBy & ""
ElseIf INC_cwType = 1 Then
selectSQL = selectSQL & " ORDER BY date_start ASC "
Else
selectSQL = selectSQL & " ORDER BY file_date DESC "
End If
createSQL = selectSQL
End Function '----------------------------------------------------------------
Function getFDD() '-----------------------------------------------------------
If num_department_ids = 1 Then
tStr = INC_department_id(0)
If num_division_ids = 1 Then
tStr = tStr & "-" & INC_division_id(0)
Else
tStr = tStr & "-0"
End If
Else
tStr = ""
End If
getFDD = tStr
End Function '----------------------------------------------------------------
Function getFCS() '-----------------------------------------------------------
If num_subcategory_ids = 1 Then
tStr = INC_subcategory_id(0)
If num_category_ids = 1 Then
tStr = tStr & "-" & INC_category_id(0)
Else
tStr = tStr & "-0"
End If
Else
tStr = ""
End If
getFCS = tStr
End Function '----------------------------------------------------------------
Function encodeEmail(rawEmail) '----------------------------------------------
lenEmail = Len(rawEmail)
For i = 1 To lenEmail
encEmail = encEmail & Int(Asc(Mid(rawEmail,i,1))) + lenEmail & "|"
Next
lenEncode = Len(encEmail)
lenEncode = lenEncode - 1
encEmail = Left(encEmail, lenEncode)
encodeEmail = encEmail
End Function '----------------------------------------------------------------
Function jsCheck() '----------------------------------------------------------
set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "JavaScriptEnabled"
bhObj.GetExtPropertiesEx
If Not bhObj.JavaScript Then
jsEnabled = "false"
Else
jsEnabled = "true"
End If
jsCheck = jsEnabled
End Function '----------------------------------------------------------------
Function HH_Message() '---------------------------------------------------------
' ASSUMPTIONS: Someone could pass in no Department ID, no Divison ID
' Division ID of 0,x indicates this is a Department
' If Category, don't use Dept or Div IDs
' Assuming only 1 Dept/Div/Category
eGovMgr_On = Request.Cookies("isAuthd")
eGovMgr_On = "TRUE"
IF (eGovMgr_On = "TRUE") THEN
isDept = 0
isDiv = 0
isCat = 0
If INC_SecondLevelID = 0 Then
isDept = 1
Else
isDiv = 1
End If
ItemCount = 0
If isArray(INC_subcategory_id) Then
If uBound(INC_subCategory_id) > -1 Then
FOR each id in INC_Category_id
isCat = 1
HH_CategoryID = id
ItemCount = ItemCount + 1
NEXT
End If
End If
If ItemCount > 1 Then
CountMsg = " (+)"
End If
ItemCount = 0
If isCat <> 1 Then
If isArray(INC_division_id) Then
If uBound(INC_division_id) > -1 Then
FOR each id in INC_division_id
If id = 0 Then
ItemCount = ItemCount -1
End If
If isDept <> 1 Then
HH_SecondLevelID = id
End If
ItemCount = ItemCount + 1
NEXT
End If
End If
If ItemCount > 1 Then
CountMsg = " (+)"
End If
If isDiv <> 1 Then
ItemCount = 0
If isArray(INC_department_id) Then
If uBound(INC_department_id) > -1 Then
FOR each id in INC_department_id
HH_TopLevelID = id
ItemCount = ItemCount + 1
NEXT
End If
End If
If ItemCount > 1 Then
CountMsg = " (+)"
End If
End If
End If
SELECT CASE HH_Content_Type
Case "DEPARTMENTS"
content_msg = HH_Content_Title
dept_msg = " " & HH_Content_Msg
feat_msg = " FEATURED does not apply "
sort_msg = " Sorted by Order in eGov Manager"
Case "CATEGORIES"
content_msg = HH_Content_Title
dept_msg = " " & HH_Content_Msg
feat_msg = " FEATURED does not apply "
sort_msg = " Sorted by Order in eGov Manager"
Case "CONTACTS"
content_msg = HH_Content_Title
dept_msg = " " & HH_Content_Msg
feat_msg = " " & HH_Feat_Msg
sort_msg = " Directory sorted by Dept Head, then Name"
Case "TEMPLATE"
If isCat = 1 Then
sql2 = "SELECT category FROM main_category WHERE id = " & INC_CategoryID
set rsTemp2 = objConn1.execute(sql2)
content_msg = "STRUCTURE--> CATEGORY"
dept_msg = " Category = " & ucase(rsTemp2(0))
Else
If isDiv = 1 And uBound(INC_division_id) > -1 Then
sql2 = "SELECT division FROM main_division WHERE id = " & INC_SecondLevelID
set rsTemp2 = objConn1.execute(sql2)
content_msg = "STRUCTURE--> DIVISION"
dept_msg = " Division = " & ucase(rsTemp2(0))
Else
If isDept = 1 Then
sql2 = "SELECT b.department FROM main_division a, main_department b WHERE a.department_id = " & HH_TopLevelID & " AND a.department_id = b.id"
set rsTemp2 = objConn1.execute(sql2)
content_msg = "STRUCTURE--> DEPT."
dept_msg = " Department = " & ucase(rsTemp2(0))
Else
dept_msg = " No Department or Division "
End If
End If
End If
feat_msg = " Displaying Title and Description"
sort_msg = ""
Case Else
content_msg = HH_content_type
If isCat Then
sql2 = "SELECT category FROM main_category WHERE id = " & HH_CategoryID
set rsTemp2 = objConn1.execute(sql2)
dept_msg = " Category = " & ucase(rsTemp2(0)) & CountMsg
Else
If isDiv And uBound(INC_division_id) > -1 Then
sql2 = "SELECT division FROM main_division WHERE id = " & HH_SecondLevelID
set rsTemp2 = objConn1.execute(sql2)
dept_msg = " Division = " & ucase(rsTemp2(0)) & CountMsg
Else
If (Not HH_TopLevelID = "") Then
sql2 = "SELECT b.department FROM main_division a, main_department b WHERE a.department_id = " & HH_TopLevelID & " AND a.department_id = b.id"
set rsTemp2 = objConn1.execute(sql2)
dept_msg = " Department = " & ucase(rsTemp2(0)) & CountMsg
Else
dept_msg = " No Department or Division "
End If
End If
End If
doctype_msg = ""
If uBound(INC_content_type_int) > -1 Then
For Each id In INC_content_type_int
sql3 = "SELECT type FROM doc_type WHERE id = " & id
set rsTemp3 = objConn1.execute(sql3)
If doctype_msg = "" Then
doctype_msg = " Document Type is " & ucase(rsTemp3(0)) & " "
Else
doctype_msg = doctype_msg & "or " & ucase(rsTemp3(0)) & " "
End If
Next
End If
If INC_Featured = 1 Then
feat_msg = " FEATURED = 1 "
Else
feat_msg = " FEATURED does not apply "
End If
select case INC_orderBy
case "file_date DESC"
sort_msg = " Sorted by Document Date"
case "date_start ASC"
sort_msg = " Sorted by Event Start Date"
case "modified_on"
sort_msg = " Sorted by Date Modified"
case Else
sort_msg = " Sorted by Default (Item Date)"
end select
END SELECT
title_msg = "CONTENT TYPE: "
msg = "
"
msg = msg & "
" & title_msg & " " & content_msg & "
"
msg = msg & "
" & dept_msg & "
"
If (doctype_msg <> "") AND (HH_content_type = "DOCUMENT CENTER") Then
msg = msg & "
" & doctype_msg & "
"
End If
msg = msg & "
" & feat_msg & "
"
msg = msg & "
" & sort_msg & "
"
msg = msg & "
"
HH_Message = "onmouseover=""return escape('" & msg & "')"""
HH_Content_Type = ""
HH_Content_Msg = ""
HH_Feat_Msg = ""
END IF
End Function'----------------------------------------------------------------
%>
<%
INC_TopLevelID = 1
INC_department_id = array(INC_TopLevelID)
INC_subcategory_id = array() ' must be cleared for CONTACT call to HOVER-HELP
sql = "SELECT a.description, b.department, a.id, a.type_id, a.description_s FROM main_division a, main_department b WHERE a.department_id = " & INC_TopLevelID & " AND flag_dept_home = 1 AND a.department_id = b.id"
set rsTemp = objConn1.execute(sql)
secDesc = rsTemp(0)
secDescShort = rsTemp(4)
secTitle = replace(rsTemp(1)," ", " ")
secID = rsTemp(2)
rsTemp.close
set rsTemp = nothing
%>
City of Winchester, Indiana > <%=secTitle%>