" & vbCrLf, 1, -1, 1)
strTemp = Replace(strTemp, "<i>", "", 1, -1, 1)
strTemp = Replace(strTemp, "</i>", "", 1, -1, 1)
strTemp = Replace(strTemp, "<b>", "", 1, -1, 1)
strTemp = Replace(strTemp, "</b>", "", 1, -1, 1)
strTemp = Replace(strTemp, "<u>", "", 1, -1, 1)
strTemp = Replace(strTemp, "</u>", "", 1, -1, 1)
strTemp = Replace(strTemp, "<br>", " ", 1, -1, 1)
strTemp = Replace(strTemp, "&", "&", 1, -1, 1)
FormatMessage = strTemp
End Function
Function TitleCase(xStr)
Dim tcTmp, tcStr, tcIndex, tcLength
tcStr = " "
tcTmp = " " & Trim(xStr) & " "
tcLength = Len(tcTmp)
tcIndex = 1
Do While tcIndex < tcLength
tcIndex = tcIndex + 1
Select Case Mid(tcTmp,tcIndex-1,1)
Case " "
tcStr = tcStr & Ucase(Mid(tcTmp,tcIndex,1))
Case "("
tcStr = tcStr & Ucase(Mid(tcTmp,tcIndex,1))
Case "I"
If tcIndex > 2 AND UCase(Mid(tcTmp,tcIndex,1)) = "I" Then
tcStr = tcStr & Ucase(Mid(tcTmp,tcIndex,1))
Else
tcStr = tcStr & Lcase(Mid(tcTmp,tcIndex,1))
End If
Case Else
tcStr = tcStr & Lcase(Mid(tcTmp,tcIndex,1))
End Select
Loop
TitleCase = Trim(tcStr)
End Function
Function strReplace(strValue)
If not IsNull(strValue) or Trim(strValue) <> "" then
strReplace = Replace(strValue, "'"," ")
end if
End function
%>
<%
' This function accepts a string variable and verifies if it is in
' the proper format for an e-mail address or not.
' The function returns true if the format is valid, false if not.
Function isEmaila(email)
Dim invalidChars, badChar, lengthOfEmail, Pos, i
invalidChars = " ~\'^`""*+=|][(){}$&!#%/:,;"
isEmaila = True
' Check for null
If email = "" Then
isEmaila = False
Else
' Must be length 5 or more (a@b.c)
If Len(email) < 5 Then
isEmaila = False
Else
' Check for invalid characters as defined above
For i=1 to Len(invalidChars)
badChar = Mid(invalidChars,i,1)
If InStr(email, badChar) > 0 Then
isEmaila = False
End If
Next
End If
End If
End Function
function isEmail(email)
Dim Pos, i
email = Trim(Lcase(" " & email))
' Check for null and bad characters
isEmail = True
If isEmaila(email) Then
lengthOfEmail = Len(email)
' No period in either of last two places
If (Right(email,1) = ".") OR (Mid(email,lengthOfEmail - 1,1) = ".") Then
isEmail = False
Else
' There must be at least one @ symbol but not first
' Also no @ in last 3 characters
Pos = InStr(email, "@")
If (Pos < 2) OR (Pos > (lengthOfEmail - 3)) Then
isEmail = False
Else
' Must be 1 period after the @ but not next to it
i = InStr(Right(email,lengthOfEmail - Pos), ".")
If i < 2 Then
isEmail = False
End If
End If
End If
Else
isEmail = False
End If
End Function
%>
<%
Function SendEMail(CDOTo, CDOSubject, CDOBody, CDOType)
Dim CDOEmsg
CDOEmsg = ""
IF CDOTo > " " Then
If isEmail(CDOTo) Then
Dim objMail
set objMail = Server.CreateObject("CDO.Message")
objMail.from = DomainAdmin
objMail.to = CDOTo
objMail.subject = CDOSubject
If UCase(CDOType) = "HTML" Then
objMail.HTMLBody = CDOBody
Else
objMail.TextBody = CDOBody
End If
On Error Resume Next
objMail.Send
If Err.Number <> 0 Then
CDOEmsg = "An error ocurred: " & Err.Description
End If
Set objMail= Nothing
Else
CDOEmsg = "Invalid Email Address"
End If
End If
SendEmail = CDOEmsg
End Function
%>
<%
Function Send2Member (sEmail, sSubject, sBody, sType)
' assumes the calling program has included function.asp
Dim s2mErr
s2mErr = "Send Mail To Member (" & sEmail & ")" & VBCRLF
s2mErr = s2mErr & VBCRLF & SendEmail(sEmail1, sSubjet, sBody, sType)
Send2Member = s2mErr
End Function
%>
<%
Function strFixQuote(strValue)
If not IsNull(strValue) or Trim(strValue) <> "" then
strReplace = Replace(strValue, "'","''")
end if
End function
%>
<%
sql = "select * from Members ORDER BY LastName, FirstName"
Call OpenDataConnection
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open sql, gbConn, adOpenKeyset , adLockOptimistic
%>
Members Roster
TRSAR Roster
<% If RS.EOF THEN %>
Sorry there are no Member records to display.
<% End If %>
<%
Do while NOT RS.EOF
strID = RS("ID")
strLastName = RS("LastName")
strFirstName = RS("FirstName")
strMemberID = RS("MemberID")
strMemberStatus = RS("MemberStatus")
strMemberPix = RS("MemberPix")
If Len(RS("MemberPix")) > 4 Then
strMemberPix = RS("MemberPix")
Else
strMemberPix = "pix/nopix.jpg"
End If
strMLevel = RS("Level")
strTitle = RS("Title")
Select Case strTitle
Case "BM": strTitle = "Board Member"
Case "MBR": strTitle = ""
Case "GCSO": strTitle = "SAR Coordinator"
Case "CMDR": strTitle = "Commander"
Case "VCMDR": strTitle = "Vice Commander"
Case "SCRTRY": strTitle = "Secretary"
Case "TRSR": strTitle = "Treasurer"
Case "WM": strTitle = "Web Master"
Case Else: strTitle = ""
End Select
strEmail = RS("Email")
%>
<%=strLastName%>, <%=strFirstName%> <%=strMemberID%><%=strMemberStatus%> <%=strTitle%>
<% If (Session("TheLevel") = "9") OR ((Session("TheLevel") = "8") AND (strMLevel < "9")) Then %>
Picture: [<%=strMemberPix%>]
<% If isEmail(strEmail) Then %>
Email Info To Member Email Message To Member
<% End If %>
<% Else %>
<% End If %>
<%
RS.MoveNext
If NOT RS.EOF Then
strID = RS("ID")
strLastName = RS("LastName")
strFirstName = RS("FirstName")
strMemberID = RS("MemberID")
strMemberStatus = RS("MemberStatus")
If Len(RS("MemberPix")) > 4 Then
strMemberPix = RS("MemberPix")
Else
strMemberPix = "nopix.jpg"
End If
strMLevel = RS("Level")
strTitle = RS("Title")
Select Case strTitle
Case "BM": strTitle = "Board Member"
Case "MBR": strTitle = ""
Case "GCSO": strTitle = "SAR Coordinator"
Case "CMDR": strTitle = "Commander"
Case "VCMDR": strTitle = "Vice Commander"
Case "SCRTRY": strTitle = "Secretary"
Case "TRSR": strTitle = "Treasurer"
Case "WM": strTitle = "Web Master"
Case Else: strTitle = ""
End Select
strEmail = RS("Email")
%>
<%=strLastName%>, <%=strFirstName%> <%=strMemberID%><%=strMemberStatus%> <%=strTitle%>
<% If (Session("TheLevel") = "9") OR ((Session("TheLevel") = "8") AND (strMLevel < "9")) Then %>
Picture: [<%=strMemberPix%>]
<% If isEmail(strEmail) Then %>
Email Info To Member Email Message To Member
<% End If %>
<% Else %>
<% End If %>
<%
RS.MoveNext
End If
%>
<%
If NOT RS.EOF Then
strID = RS("ID")
strLastName = RS("LastName")
strFirstName = RS("FirstName")
strMemberID = RS("MemberID")
strMemberStatus = RS("MemberStatus")
If Len(RS("MemberPix")) > 4 Then
strMemberPix = RS("MemberPix")
Else
strMemberPix = "nopix.jpg"
End If
strMLevel = RS("Level")
strTitle = RS("Title")
Select Case strTitle
Case "BM": strTitle = "Board Member"
Case "MBR": strTitle = ""
Case "GCSO": strTitle = "SAR Coordinator"
Case "CMDR": strTitle = "Commander"
Case "VCMDR": strTitle = "Vice Commander"
Case "SCRTRY": strTitle = "Secretary"
Case "TRSR": strTitle = "Treasurer"
Case "WM": strTitle = "Web Master"
Case Else: strTitle = ""
End Select
strEmail = RS("Email")
%>
<%=strLastName%>, <%=strFirstName%> <%=strMemberID%><%=strMemberStatus%> <%=strTitle%>
<% If (Session("TheLevel") = "9") OR ((Session("TheLevel") = "8") AND (strMLevel < "9")) Then %>
Picture: [<%=strMemberPix%>]
<% If isEmail(strEmail) Then %>
Email Info To Member Email Message To Member
<% End If %>
<% Else %>
<% End If %>
<%
RS.MoveNext
End If
%>
<%
Loop
RS.Close
gbConn.Close
If Session("TheLevel") > "7" Then
%>