<%
' 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 '----------------------------------------------------------------
%>
With warm weather and the summer months upon us, many Novi
community members are flocking to cooler venues, such as our lakes,
waterways, and local pools for relaxing relief. When most people
think of Novi, very few would say Walled Lake or water sporting
activity. When in reality, two-thirds of Walled Lake is actually in
Novi, and there are several other opportunities for outdoor water
activity. That is why I chose Water Safety for this edition of Off
the Cuff.
Earlier
this year, an unfortunate young man drowned in our community,
possibly, because he was unaware of lake conditions and the hazards
of swimming in restricted areas. And, numerous boaters take to our
lakes every day and this provides a venue in which to remind the
community of important safety tips.
One of the many simple ways to prevent accidents from happening
in and around water is learning to swim. The National Safety Council
(NSC) reports drowning claims more than 3,000 lives each year. Most
water-related injuries happen when parents take their eyes off
children. Whether you are heading to the local beach, a neighborhood
pool, or just out the backdoor to your own pool, following these
important water safety tips from the American Red Cross are a must
and can prevent a deadly tragedy:
Never leave a child alone or unattended near the water. Even
though a trained lifeguard may be present, all parents should
practice "reach supervision," which means to be within arm's
length of a child in case an emergency occurs.
Children who are not strong enough to swim on their own should
use U.S. Coast Guard-approved personal flotation devices (PFDs).
However, remember that PFDs cannot replace parental supervision.
All people (and especially children) should always swim with a
buddy and be knowledgeable of the water environment, taking notice
of deep and shallow areas, currents, exit areas and obstructions.
Watch your children for signs of the dangerous "toos"- too
tired, too cold, too far from safety, too much sun and too much
strenuous activity.
Water safety
starts with your head, not your arms and legs. You can prevent many
accidents from occurring by observing common-sense precautions and
making sure you’re prepared before you reach the water:
Read and obey all posted signs and rules.
Do not mix alcohol with swimming, diving or boating. Alcohol
impairs your judgment, balance, and coordination, affects your
swimming and diving skills, and reduces your body's ability to
stay warm.
Pay attention to local weather conditions and forecasts. Stop
swimming at the first indication of bad weather.
Pack a safety bag for a day at the beach or pool. Be sure to
include waterproof sunscreen, a hat, sunglasses, water shoes to
keep feet safe from the heat and sharp objects on land and plenty
of water for everyone to keep hydrated. All containers should be
plastic to prevent injuries from breaking glass.
Carry a cellular telephone.
Know your location in the event have to dial 9-1-1.
Learn CPR.
When talking about water safety, one must not forget about
boating safety. In recent weeks in the metropolitan Detroit area, we
have seen several deaths attributed to boaters who failed to adhere
to basic boat safety practices. Unfortunately, the consequences were
deadly.
No matter how much experience you have, it’s always a good idea
for everyone to review boating safety rules before departures. The
following 10 safety tips are offered by Discover Boating, a
boater’s enthusiast’s website.
Be Weather-wise
Always check local weather conditions for boating safety before
departure- TV and radio forecasts can be a good source of
information. If you notice darkening clouds, volatile and rough
changing winds, or sudden drops in temperature, play it safe by
getting off the water.
Follow a Pre-Departure Checklist
Proper boating safety means being prepared for any possibility on
the water. From compliance with fire safety regulations to tips
for fueling up, following a pre-departure checklist is the best
way to make sure no boating safety rules or precautions have been
forgotten.
Use Common Sense
One of the most important parts of boating safety is to use your
common sense. This means operating at a safe speed at all times,
especially in crowded areas. Be alert at all times, and steer
clear of large vessels and watercraft that can be restricted in
their ability to stop or turn. Also be respectful of buoys and
other navigational aids, all of which have been placed there for
one reason only- to ensure your own boating safety.
Designate an Assistant Skipper
Make sure more than only one person on board is familiar with all
aspects of your boat’s handling, operations, and other boating
safety tips. If the primary navigator is injured or incapacitated
in any way, it’s important to make sure someone else can follow
the proper boating safety rules to get everyone else back to
shore.
Develop a Float Plan
Whether you choose to inform a family member or staff at your
local marina, always be sure let someone else know your float plan
in terms of where you’re going and how long you’re going to be
gone.
A float plan can include the following information: name, address,
and phone number of trip leader: name and number of all
passengers; boat type and registration information; trip
itinerary; types of communication and signal equipment onboard.
Make Proper Use of Lifejackets
Did you know that the majority of drowning victims as the result
of boating accidents were found not to be wearing a Lifejacket?
Make sure that your family and friends aren’t part of this
statistic by assigning and fitting each member of your onboard
team with a Lifejacket-prior to departure.
Avoid Alcohol
Practice boating safety at all times by saving the alcohol for
later. The probability of being involved in a boating accident
doubles when alcohol is involved, and studies have also shown that
the affect of alcohol is exacerbated by external effects such as
sun and wind.
Learn to Swim
If you’re going to be in and around the water, proper boating
safety means knowing how to swim. Local organizations such as the
American Red Cross and others offer training for all ages and
abilities- check to see what classes are offered in your area!
Take a Boating Course
Beginning boaters and experienced experts alike need be familiar
with boating safety rules of operation. You can learn boating
safety rules by taking a local community course offered by the
Oakland County Sheriff’s Office-Marine Division. Please refer to
their website for a complete schedule.
Always carry distress signals on board your watercraft.
In the event you are out on the water and find yourself in
distress, it is helpful for emergency responders to locate you if
you have items such as emergency flares on board.
Copyright 2008, City of Novi, Michigan
The City of Novi, Michigan, 45175 West 10 Mile Road,
Novi, Michigan 48375, 248-347-0456
Hours of Operation: Monday - Friday, 8:00am - 5:00pm