% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Classmates.asp ' ' Written by Brian Balestri ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Call Main '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Sub Main ' ' Processing for this page starts in this routine. It ' contains a dispatcher to call the appropriate routine, ' based on what function was needed. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Dim cnDB ' As ADODB.Connection Set cnDB = OpenDB() CheckCookie Select Case Request(ACTION) Case ACTION_RETRIEVE BuildForm(cnDB) Case Else Retrieve(cnDB) End Select cnDB.Close End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Sub Retrieve ' ' This routine lists all records of this data type. It ' also provides actions to create, retrieve, update, and ' delete records. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Retrieve(cnDB) Dim rsData ' As ADODB.Recordset Dim strSQL ' As String Dim strURL ' As String Dim strGroup Dim strSearch Dim strSearch2 Dim strSearchText Dim i Dim datNewClassmates Dim datModDate datNewClassmates = DateAdd("d", -6, Date()) strSearch2 = "" i = 0 strGroup = Request.querystring("g") '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Check to see if more than one word was passed with the ' search string. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If InStr(Request.querystring("q"), " ") > 0 Then strSearch = Left(Request.querystring("q"), (InStr(Request.querystring("q"), " ")-1)) strSearch2 = Mid(Request.querystring("q"), (InStr(Request.querystring("q"), " ")+1), 50) Else strSearch = Request.querystring("q") strSearch2 = "" End If If strSearch <> "" Then ''''''''''''''''''''''''''''''''''''''''''''''''''' ' Changes the SQL string to select by search text ' based on whether one or two words was entered. ' ''''''''''''''''''''''''''''''''''''''''''''''''''' If strSearch2 <> "" Then strSQL = "SELECT * FROM tblContacts " _ & "WHERE (FirstName Like " & DQ & "%" & strSearch & "%" & DQ _ & "AND LastName Like " & DQ & "%" & strSearch2 & "%" & DQ & ")" _ & "ORDER BY LastName, FirstName" Else strSQL = "SELECT * FROM tblContacts " _ & "WHERE (FirstName Like " & DQ & "%" & strSearch & "%" & DQ _ & "OR LastName Like " & DQ & "%" & strSearch & "%" & DQ _ & "OR CompanyName Like " & DQ & "%" & strSearch & "%" & DQ _ & "OR ContactNotes Like " & DQ & "%" & strSearch & "%" & DQ & ") " _ & "ORDER BY LastName, FirstName" End If Else If strGroup <> "" Then '''''''''''''''''''''''''''''''''''''''''''''' ' changes the SQL string to select by alphabet ' group (A,B,C,etc.) ' '''''''''''''''''''''''''''''''''''''''''''''' strSQL = "SELECT * FROM tblContacts " _ & "WHERE (((Left(Left([tblContacts]![LastName],1)" _ & "& Left([tblContacts]![FirstName],1),1)) Like " _ & DQ & strGroup & DQ & "))" _ & "ORDER BY LastName, FirstName" Else ''''''''''''''''''''''''''''''''''''''''''''''' ' If neither the search box or alphabet group ' has been selected, SELECT Frequently Called ' Contacts ' ''''''''''''''''''''''''''''''''''''''''''''''' strSQL = "SELECT * FROM tblContacts " _ & "ORDER BY LastName, FirstName" End If End If Set rsData = cnDB.Execute(strSQL) PrintHeader "Class of 1982" ''''''''''''''''''''''''''''''''''' ' build search box ' ''''''''''''''''''''''''''''''''''' WL "
" '''''''''''''''''''''''''''''''''''''''''''''''''' ' adds the alphabet groups to the top of the page ' '''''''''''''''''''''''''''''''''''''''''''''''''' WL "" WL "A - " WL "B - " WL "C - " WL "D - " WL "E - " WL "F - " WL "G - " WL "H - " WL "I - " WL "J - " WL "K - " WL "L - " WL "M - " WL "N - " WL "O - " WL "P - " WL "Q - " WL "R - " WL "S - " WL "T - " WL "U - " WL "V - " WL "W - " WL "X - " WL "Y - " WL "Z" WL "
" WL "| New | " WL "High School Name | " WL "Status | " WL "City | " WL "State | " WL "||
|---|---|---|---|---|---|---|
| "
datModDate = rsData("ModDate")
If datModDate > datNewClassmates Then
WL " | "
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Decide whether to display last name, first name
' or company name.
'
'''''''''''''''''''''''''''''''''''''''''''''''''''
WL "" If rsData("LastName") <> "" AND rsData("FirstName") <> "" Then WL "" _ & rsData("LastName") & ", " & rsData("FirstName") _ & "" ElseIf _ (rsData("LastName") = "" _ And rsData("FirstName") <> "") _ Or _ (rsData("LastName") <> "" _ And rsData("FirstName") = "") Then WL "" _ & rsData("LastName") & rsData("FirstName") _ & "" End If WL " | " WL "" & rsData("Status") & " | " WL "" If rsData("KeepPrivate") = "Yes" Then WL "{Private by Request}" Else WL "" & rsData("Email") & "" End If WL " | " WL "" & rsData("City") & " | " WL "" & rsData("State") & " | " WL "|
| " WL "Contact Information" WL " | |
| First Name: | " WL "" & strFirstName & " |
| High School Last Name: | " WL "" & strLastName & " |
| Current Last Name: | " WL "" & strCurrLastName & " |
| Email Address: | " WL "" If strKeepPrivate = "Yes" Then WL "{Private by Request}" Else WL "" & strEmail & "" End If WL " |
| Home Address: | " WL "" & strAddress1 & " |
| " WL " | " & strAddress2 & " |
| City: | " WL "" & strCity & " |
| State: | " WL "" & strState & " |
| Zip Code: | " WL "" & strZipCode & " |
| Home Phone: | " WL "" & strHomePhone & " |
| Website: | " WL "" _ & strWebsite & " |
| " WL "Family Information" WL " | |
| Marital Status: | " WL "" & strMarried & " |
| Number of Kids: | " WL "" & strNoOfKids & " |
| Pets: | " WL "" & strPets & " |
| Hobbies: | " WL "" & strHobbies & " |
| " WL "Career Information" WL " | |
| Job Title: | " WL "" & strJobTitle & " |
| Company Name: | " WL "" & strCompanyName & " |
| Bus. Phone: | " WL "" & strBizPhone & " |
| Industry: | " WL "" & strIndustry & " |
| Job Function: | " WL "" & strJobFunction & " |
| " WL "Reunion Information" WL " | |
| Reunion Status: | " WL "" & strStatus & " |
| Number of high school friends you still see on a regular basis: | " WL "" & strStillFriends & " |
| Who are you hoping to see at the reunion? | " WL "" & strHopingToSee & " |
| Where you are staying for the reunion? | " WL "" & strStaying & " |
| " WL "High School Memories" WL " | |
| Favorite High School Teacher: | " WL "" & strFavTeacher & " |
| Worst High School Teacher: | " WL "" & strWorstTeacher & " |
| Favorite H/S Memory: | " WL ""& strFavMemory & " |
| Worst/Most Embarrassing H/S Memory: | " WL "" & strWorstMemory & " |
| " WL "Miscellaneous Stuff" WL " | |
| Favorite Quote: | " WL "" & strFavQuote & " |
| Favorite Quirky/Off-beat Website: | " WL "" _ & strFavWebsite & " |
| Personal Description / Misc. Notes: | " WL "" & strContactNotes & " |