% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% If Not IsLoggedIn And Request.Cookies(ewProjectName)("autologin") = "autologin" And Request.Cookies(ewProjectName)("password") <> "" Then Response.Redirect "login.asp" Call LoadUserLevel() If IsLoggedIn Then ewCurSec = CurrentUserLevelPriv("chapter") Else ewCurSec = GetAnonymousPriv("chapter") End If If (ewCurSec And ewAllowList) <> ewAllowList Then Response.Redirect "login.asp" If IsLoggedIn And CurrentUserID = "" Then Session(ewSessionMessage) = "You do not have the right permission to view the page" Response.Redirect "login.asp" End If %> <% ' Initialize common variables x_chapter_pkey = Null: ox_chapter_pkey = Null: z_chapter_pkey = Null x_chapter_FFAid = Null: ox_chapter_FFAid = Null: z_chapter_FFAid = Null x_chapter_schoolname = Null: ox_chapter_schoolname = Null: z_chapter_schoolname = Null x_chapter_schooladdress1 = Null: ox_chapter_schooladdress1 = Null: z_chapter_schooladdress1 = Null x_chapter_schooladdress2 = Null: ox_chapter_schooladdress2 = Null: z_chapter_schooladdress2 = Null x_chapter_schooladdress3 = Null: ox_chapter_schooladdress3 = Null: z_chapter_schooladdress3 = Null x_chapter_schoolcity = Null: ox_chapter_schoolcity = Null: z_chapter_schoolcity = Null x_chapter_schoolstate = Null: ox_chapter_schoolstate = Null: z_chapter_schoolstate = Null x_chapter_schoolzipcode = Null: ox_chapter_schoolzipcode = Null: z_chapter_schoolzipcode = Null x_chapter_schoolzipcode4 = Null: ox_chapter_schoolzipcode4 = Null: z_chapter_schoolzipcode4 = Null x_chapter_schooladvisor = Null: ox_chapter_schooladvisor = Null: z_chapter_schooladvisor = Null x_chapter_region = Null: ox_chapter_region = Null: z_chapter_region = Null x_chapter_website = Null: ox_chapter_website = Null: z_chapter_website = Null x_chapter_email = Null: ox_chapter_email = Null: z_chapter_email = Null x_chapter_picture = Null: ox_chapter_picture = Null: z_chapter_picture = Null fs_x_chapter_picture = 0: fn_x_chapter_picture = "": ct_x_chapter_picture = "" wd_x_chapter_picture = 0: ht_x_chapter_picture = 0: a_x_chapter_picture = "" x_chapter_picturename = Null: ox_chapter_picturename = Null: z_chapter_picturename = Null fs_x_chapter_picturename = 0: fn_x_chapter_picturename = "": ct_x_chapter_picturename = "" wd_x_chapter_picturename = 0: ht_x_chapter_picturename = 0: a_x_chapter_picturename = "" x_chapter_picturetype = Null: ox_chapter_picturetype = Null: z_chapter_picturetype = Null x_chapter_theme = Null: ox_chapter_theme = Null: z_chapter_theme = Null x_chapter_bio = Null: ox_chapter_bio = Null: z_chapter_bio = Null x_chapter_links = Null: ox_chapter_links = Null: z_chapter_links = Null x_chapter_officers = Null: ox_chapter_officers = Null: z_chapter_officers = Null x_chapter_advisors = Null: ox_chapter_advisors = Null: z_chapter_advisors = Null x_chapter_courses = Null: ox_chapter_courses = Null: z_chapter_courses = Null x_chapter_news = Null: ox_chapter_news = Null: z_chapter_news = Null x_chapter_events = Null: ox_chapter_events = Null: z_chapter_events = Null x_memberid = Null: ox_memberid = Null: z_memberid = Null %> <% sExport = Request.QueryString("export") ' Load Export Request If sExport = "html" Then ' Printer Friendly End If If sExport = "excel" Then Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment; filename=" & ewTblVar & ".xls" End If If sExport = "word" Then Response.ContentType = "application/vnd.ms-word" Response.AddHeader "Content-Disposition:", "attachment; filename=" & ewTblVar & ".doc" End If %> <% nStartRec = 0 nStopRec = 0 nTotalRecs = 0 nRecCount = 0 nRecActual = 0 sDbWhereMaster = "" sDbWhereDetail = "" sSrchAdvanced = "" psearch = "" psearchtype = "" sSrchBasic = "" sSrchWhere = "" sDbWhere = "" sOrderBy = "" sSqlMaster = "" sDeleteConfirmMsg = "Do you want to delete the selected records?" nDisplayRecs = 20 nRecRange = 10 ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str ' Handle Reset Command ResetCmd() ' Get Search Criteria for Advanced Search SetUpAdvancedSearch() ' Get Search Criteria for Basic Search SetUpBasicSearch() ' Build Search Criteria If sSrchAdvanced <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchAdvanced & ")" End If If sSrchBasic <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchBasic & ")" End If ' Save Search Criteria If sSrchWhere <> "" Then Session(ewSessionTblSearchWhere) = sSrchWhere nStartRec = 1 ' reset start record counter Session(ewSessionTblStartRec) = nStartRec Else sSrchWhere = Session(ewSessionTblSearchWhere) Call RestoreSearch() End If ' Build Filter condition sDbWhere = "" If (ewCurSec And ewAllowList) <> ewAllowList Then sDbWhere = "(0=1)" End If If CurrentUserID <> "-1" And CurrentUserID <> "" Then ' Non system admin If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " '*** sDbWhere = sDbWhere & Replace(ewSqlUserIDFilter, "#UserID", AdjustSql(CurrentUserID)) sDbWhere = sDbWhere & ewSqlUserIDFilter sDbWhere = Replace(sDbWhere, "#Key", "[memberid]") sDbWhere = Replace(sDbWhere, "#UserID", AdjustSql(CurrentUserID)) End If If sDbWhereDetail <> "" Then If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " sDbWhere = sDbWhere & "(" & sDbWhereDetail & ")" End If If sSrchWhere <> "" Then If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " sDbWhere = sDbWhere & "(" & sSrchWhere & ")" End If ' Set Up Sorting Order sOrderBy = "" SetUpSortOrder() ' Set up SQL sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sDbWhere, sOrderBy) 'Response.Write sSql ' Uncomment to show SQL for debugging %> <% If sExport <> "word" And sExport <> "excel" Then %> <% End If %> <% ' Set up Record Set Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 2 rs.Open sSql, conn, 1, 2 nTotalRecs = rs.RecordCount If nDisplayRecs <= 0 Then ' Display All Records nDisplayRecs = nTotalRecs End If nStartRec = 1 SetUpStartRec() ' Set Up Start Record Position %>
TABLE: chapter <% If sExport = "" Then %> Printer Friendly Export to Excel Export to Word <% End If %>
<% If sExport = "" Then %> <% End If %> <% If (ewCurSec And ewAllowAdd) = ewAllowAdd Then %> <% If sExport = "" Then %>| Add |
<% End If %> <% End If %> <% If Session(ewSessionMessage) <> "" Then %>
<%= Session(ewSessionMessage) %>
<% Session(ewSessionMessage) = "" ' Clear message End If %> <% If nTotalRecs > 0 Then %> <% End If %> <% ' Close recordset and connection rs.Close Set rs = Nothing conn.Close Set conn = Nothing %> <% If sExport = "" Then %> <% End If %> <% If sExport = "" Then %> <% End If %> <% If sExport <> "word" And sExport <> "excel" Then %> <% End If %> <% '------------------------------------------------------------------------------- ' Function SetUpAdvancedSearch ' - Set up Advanced Search parameter based on querystring parameters from Advanced Search Page ' - Variables setup: sSrchAdvanced Sub SetUpAdvancedSearch() Dim arrFldOpr, arrFldOpr2, sSrchStr ' Field chapter_pkey sSrchStr = "" x_chapter_pkey = Request.QueryString("x_chapter_pkey") z_chapter_pkey = Request.QueryString("z_chapter_pkey") arrFldOpr = Split(z_chapter_pkey, ",") If x_chapter_pkey <> "" And IsNumeric(x_chapter_pkey) And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_pkey] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_pkey) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_FFAid sSrchStr = "" x_chapter_FFAid = Request.QueryString("x_chapter_FFAid") z_chapter_FFAid = Request.QueryString("z_chapter_FFAid") arrFldOpr = Split(z_chapter_FFAid, ",") If x_chapter_FFAid <> "" And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_FFAid] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_FFAid) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_schoolname sSrchStr = "" x_chapter_schoolname = Request.QueryString("x_chapter_schoolname") z_chapter_schoolname = Request.QueryString("z_chapter_schoolname") arrFldOpr = Split(z_chapter_schoolname, ",") If x_chapter_schoolname <> "" And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_schoolname] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_schoolname) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_schooladdress1 sSrchStr = "" x_chapter_schooladdress1 = Request.QueryString("x_chapter_schooladdress1") z_chapter_schooladdress1 = Request.QueryString("z_chapter_schooladdress1") arrFldOpr = Split(z_chapter_schooladdress1, ",") If x_chapter_schooladdress1 <> "" And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_schooladdress1] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_schooladdress1) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_schooladdress2 sSrchStr = "" x_chapter_schooladdress2 = Request.QueryString("x_chapter_schooladdress2") z_chapter_schooladdress2 = Request.QueryString("z_chapter_schooladdress2") arrFldOpr = Split(z_chapter_schooladdress2, ",") If x_chapter_schooladdress2 <> "" And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_schooladdress2] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_schooladdress2) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_schooladdress3 sSrchStr = "" x_chapter_schooladdress3 = Request.QueryString("x_chapter_schooladdress3") z_chapter_schooladdress3 = Request.QueryString("z_chapter_schooladdress3") arrFldOpr = Split(z_chapter_schooladdress3, ",") If x_chapter_schooladdress3 <> "" And IsValidOpr(arrFldOpr) Then sSrchStr = sSrchStr & "[chapter_schooladdress3] " & arrFldOpr(0) & " " & _ arrFldOpr(1) & AdjustSql(x_chapter_schooladdress3) & arrFldOpr(2) End If If sSrchStr <> "" Then If sSrchAdvanced <> "" Then sSrchAdvanced = sSrchAdvanced & " AND " sSrchAdvanced = sSrchAdvanced & "(" & sSrchStr & ")" End If ' Field chapter_schoolcity sSrchStr = "" x_chapter_schoolcity = Request.QueryString("x_chapter_schoolcity") z_chapter_schoolcity = Request.QueryString("z_chapter_schoolcity") arrFldOpr = Split(z_chapter_schoolcity, ",") If x_chapter_schoolcity <> "" And IsValidOpr <% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% If Not IsLoggedIn And Request.Cookies(ewProjectName)("autologin") = "autologin" And Request.Cookies(ewProjectName)("password") <> "" Then Response.Redirect "login.asp" Call LoadUserLevel() If IsLoggedIn Then ewCurSec = CurrentUserLevelPriv("chapter") Else ewCurSec = GetAnonymousPriv("chapter") End If If (ewCurSec And ewAllowList) <> ewAllowList Then Response.Redirect "login.asp" If IsLoggedIn And CurrentUserID = "" Then Session(ewSessionMessage) = "You do not have the right permission to view the page" Response.Redirect "login.asp" End If %> <% ' Initialize common variables x_chapter_pkey = Null: ox_chapter_pkey = Null: z_chapter_pkey = Null x_chapter_FFAid = Null: ox_chapter_FFAid = Null: z_chapter_FFAid = Null x_chapter_schoolname = Null: ox_chapter_schoolname = Null: z_chapter_schoolname = Null x_chapter_schooladdress1 = Null: ox_chapter_schooladdress1 = Null: z_chapter_schooladdress1 = Null x_chapter_schooladdress2 = Null: ox_chapter_schooladdress2 = Null: z_chapter_schooladdress2 = Null x_chapter_schooladdress3 = Null: ox_chapter_schooladdress3 = Null: z_chapter_schooladdress3 = Null x_chapter_schoolcity = Null: ox_chapter_schoolcity = Null: z_chapter_schoolcity = Null x_chapter_schoolstate = Null: ox_chapter_schoolstate = Null: z_chapter_schoolstate = Null x_chapter_schoolzipcode = Null: ox_chapter_schoolzipcode = Null: z_chapter_schoolzipcode = Null x_chapter_schoolzipcode4 = Null: ox_chapter_schoolzipcode4 = Null: z_chapter_schoolzipcode4 = Null x_chapter_schooladvisor = Null: ox_chapter_schooladvisor = Null: z_chapter_schooladvisor = Null x_chapter_region = Null: ox_chapter_region = Null: z_chapter_region = Null x_chapter_website = Null: ox_chapter_website = Null: z_chapter_website = Null x_chapter_email = Null: ox_chapter_email = Null: z_chapter_email = Null x_chapter_picture = Null: ox_chapter_picture = Null: z_chapter_picture = Null fs_x_chapter_picture = 0: fn_x_chapter_picture = "": ct_x_chapter_picture = "" wd_x_chapter_picture = 0: ht_x_chapter_picture = 0: a_x_chapter_picture = "" x_chapter_picturename = Null: ox_chapter_picturename = Null: z_chapter_picturename = Null fs_x_chapter_picturename = 0: fn_x_chapter_picturename = "": ct_x_chapter_picturename = "" wd_x_chapter_picturename = 0: ht_x_chapter_picturename = 0: a_x_chapter_picturename = "" x_chapter_picturetype = Null: ox_chapter_picturetype = Null: z_chapter_picturetype = Null x_chapter_theme = Null: ox_chapter_theme = Null: z_chapter_theme = Null x_chapter_bio = Null: ox_chapter_bio = Null: z_chapter_bio = Null x_chapter_links = Null: ox_chapter_links = Null: z_chapter_links = Null x_chapter_officers = Null: ox_chapter_officers = Null: z_chapter_officers = Null x_chapter_advisors = Null: ox_chapter_advisors = Null: z_chapter_advisors = Null x_chapter_courses = Null: ox_chapter_courses = Null: z_chapter_courses = Null x_chapter_news = Null: ox_chapter_news = Null: z_chapter_news = Null x_chapter_events = Null: ox_chapter_events = Null: z_chapter_events = Null x_memberid = Null: ox_memberid = Null: z_memberid = Null %> <% sExport = Request.QueryString("export") ' Load Export Request If sExport = "html" Then ' Printer Friendly End If If sExport = "excel" Then Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment; filename=" & ewTblVar & ".xls" End If If sExport = "word" Then Response.ContentType = "application/vnd.ms-word" Response.AddHeader "Content-Disposition:", "attachment; filename=" & ewTblVar & ".doc" End If %> <% nStartRec = 0 nStopRec = 0 nTotalRecs = 0 nRecCount = 0 nRecActual = 0 sDbWhereMaster = "" sDbWhereDetail = "" sSrchAdvanced = "" psearch = "" psearchtype = "" sSrchBasic = "" sSrchWhere = "" sDbWhere = "" sOrderBy = "" sSqlMaster = "" sDeleteConfirmMsg = "Do you want to delete the selected records?" nDisplayRecs = 20 nRecRange = 10 ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str ' Handle Reset Command ResetCmd() ' Get Search Criteria for Advanced Search SetUpAdvancedSearch() ' Get Search Criteria for Basic Search SetUpBasicSearch() ' Build Search Criteria If sSrchAdvanced <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchAdvanced & ")" End If If sSrchBasic <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchBasic & ")" End If ' Save Search Criteria If sSrchWhere <> "" Then Session(ewSessionTblSearchWhere) = sSrchWhere nStartRec = 1 ' reset start record counter Session(ewSessionTblStartRec) = nStartRec Else sSrchWhere = Session(ewSessionTblSearchWhere) Call RestoreSearch() End If ' Build Filter condition sDbWhere = "" If (ewCurSec And ewAllowList) <> ewAllowList Then sDbWhere = "(0=1)" End If If CurrentUserID <> "-1" And CurrentUserID <> "" Then ' Non system admin If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " '*** sDbWhere = sDbWhere & Replace(ewSqlUserIDFilter, "#UserID", AdjustSql(CurrentUserID)) sDbWhere = sDbWhere & ewSqlUserIDFilter sDbWhere = Replace(sDbWhere, "#Key", "[memberid]") sDbWhere = Replace(sDbWhere, "#UserID", AdjustSql(CurrentUserID)) End If If sDbWhereDetail <> "" Then If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " sDbWhere = sDbWhere & "(" & sDbWhereDetail & ")" End If If sSrchWhere <> "" Then If sDbWhere <> "" Then sDbWhere = sDbWhere & " AND " sDbWhere = sDbWhere & "(" & sSrchWhere & ")" End If ' Set Up Sorting Order sOrderBy = "" SetUpSortOrder() ' Set up SQL sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sDbWhere, sOrderBy) 'Response.Write sSql ' Uncomment to show SQL for debugging %> <% If sExport <> "word" And sExport <> "excel" Then %> <% End If %> <% ' Set up Record Set Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 2 rs.Open sSql, conn, 1, 2 nTotalRecs = rs.RecordCount If nDisplayRecs <= 0 Then ' Display All Records nDisplayRecs = nTotalRecs End If nStartRec = 1 SetUpStartRec() ' Set Up Start Record Position %>TABLE: chapter <% If sExport = "" Then %> Printer Friendly Export to Excel Export to Word <% End If %>
<% If sExport = "" Then %> <% End If %> <% If (ewCurSec And ewAllowAdd) = ewAllowAdd Then %> <% If sExport = "" Then %>| Add |
<% End If %> <% End If %> <% If Session(ewSessionMessage) <> "" Then %>
<%= Session(ewSessionMessage) %>
<% Session(ewSessionMessage) = "" ' Clear message End If %> <% If nTotalRecs > 0 Then %>