|
<%
' 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.
' 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
Dim GLB_pop
' Globally Used Variables (configurable)
'-----------------------------------------------------------------------------
GLB_egovURL = "http://cityofnovi.org/"
GLB_pop = 0
GLB_dsn = "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=mi_novi; UID=mi_novi; PWD=_H&sayEy?B"
' 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 objPDF = New RegExp
objPDF.IgnoreCase = True
objPDF.Pattern = "^pdf$"
Set objHTM = New RegExp
objHTM.IgnoreCase = True
objHTM.Pattern = "^htm"
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 " _
& "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 & ""
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_category_ids = 1 Then
tStr = INC_category_id(0)
If num_subcategory_ids = 1 Then
tStr = tStr & "-" & INC_subcategory_id(0)
Else
tStr = tStr & "-0"
End If
Else
tStr = ""
End If
getFCS = tStr
End Function '----------------------------------------------------------------
%>
 

|
 |
 |
|
|
|
|
|
|

|
|

|

Be A Prepared Citizen! Click here for more
information.
|
|
|
|
|
|
|
 |
You are in the driver’s seat….Be prepared and Be safe
January 2007
Winter is a great season for vacations, offering wonderful
opportunities for weekend getaways, downhill and cross-country
skiing, and visiting friends and relatives during winter break. But
winter travel can quickly become winter trauma if you are not
prepared for the extra challenges of winter driving.
Winter weather can make road conditions unpredictable, and
sometimes treacherous. The sight of snow is a stark reminder of
Michigan’s unpredictable weather and the importance of staying
alert, slowing down, and staying in control when taking to the
roadways. While the City of Novi prides itself on quickly clearing
the roadways and bridges of snow and ice during and after storms,
the winter season does impose special conditions on motorists, their
driving habits and their vehicles. Safe winter driving requires a
balance of common sense and preparation.
The leading cause of death during
winter storms is motor vehicle accidents. The best advice for
driving in inclement weather is to not drive at all. If you can
avoid it, stay put. But for those that must venture out in bad
weather, one of the most important things to remember is to slow
down. If you have to drive, drive slower and allow yourself extra
time to reach your destination.
Allowing more distance to stop is another essential practice to
adhere to. Motorists need to remember that even if you have a
four-wheel or all-wheel drive vehicle that doesn’t translate to
quicker stopping. In fact, because of their weight, large trucks and
SUVs may require longer distance to stop than a car on ice or snow.
If you must travel through snow or icy conditions, also remember
these important safety tips:
Brake gently to avoid skidding. If your wheels start to lock
up, ease off the brake.
Turn on your lights to increase your visibility to other
motorists.
Keep your lights and windshield clean.
Use low gears to keep traction, especially on hills.
Don't use cruise control on icy roads.
Be especially careful on bridges and overpasses as these areas
will typically freeze first. Even at temperatures above freezing,
if the conditions are wet, you might encounter ice in shady areas
or on exposed roadways, such as bridges.
Don't pass snow plows and salt trucks. The drivers have
limited visibility, and you're likely to find the road in front of
them worse than the road behind.
Don't assume your vehicle can handle all conditions. Even
four-wheel and front-wheel drive vehicles can encounter trouble on
winter roads.
Prepare your vehicle for winter – check your tires,
antifreeze, defroster, brakes, windshield wipers and windshield
washer fluid.
Store emergency items in vehicle to include small tools,
battery cables, matches, extra blankets, non-perishable food and
water, extra gloves, socks and a first aid kit in case of an
accident.
Now that you reviewed these winter driving tips and techniques,
you’re ready to explore Michigan’s winter wonderland. Drive
carefully and pay attention to other drivers; not everyone is as
well-prepared for winter driving. If you have any questions or
require further information, please do not hesitate to contact the
Novi Police Department at 248-348-7100.
|

|
|
|
|

|