<%@Language=VBScript%> <% Response.Buffer = True dim MyConn ' Database connection object dim RS ' Recordset object dim Fld ' Field object dim Connect_String ' ADO Connection String dim SQL ' SQL Statement dim Page_Size ' Number of records per page dim StartPage ' The page that we are starting on dim Current_Page ' The current page that we are on dim Page_Count ' Total pages dim CssClass ' Style Sheet file dim CellValue ' data value dim intRowCount ' Total rows dim i dim j dim sPos dim iData dim iRealData dim iStrData dim iOpt dim Qry_String dim NavQry_String dim Filter_String dim Err_String dim SearchArray dim SearchIndex dim MultiSearch dim QuoteChar dim QuoteDate dim Fields dim NextSorting dim StdSearchOpt dim SearchEndKey dim FldCount dim ItemValue dim CurrentRow_String dim StartStrData dim EndStrData dim StrKeyWord dim PageSecureLevel dim SortString dim submiturl dim backurl Redim ArryItemValue(21) Redim ArryOpt(21) Redim ArryAndOrOpt(2) %> <% Err_String = "" Session("Admin_Donations_RedirectURL") = "./admin_donations_search.asp" On Error Resume next '=====Check security login====== PageSecureLevel = 9 if (UCASE(request.QueryString("Logout")) ="Y") then Session("Admin_Donations_UserLevel") = 0 Session("Admin_Donations_Logon") = "FALSE" Session("Admin_Donations_UserLogon") = "" Session("Admin_Donations_RedirectURL") = Session("FirstRedirectURL") Response.Clear Response.Redirect("./Admin_Donations_login.asp") QSDestroySession() end if if Session("Admin_Donations_Logon") <> "TRUE" Then Session("Admin_Donations_RedirectURL") = "./admin_donations_search.asp?" & request.ServerVariables("QUERY_STRING") Response.Clear Response.Redirect("./Admin_Donations_login.asp") end if if (Session("Admin_Donations_UserLevel") = "") Then Session("Admin_Donations_UserLevel") = 0 end if if (cint(Session("Admin_Donations_UserLevel"))< PageSecureLevel) then Session("Admin_Donations_Logon") = "FALSE" Session("Admin_Donations_RedirectURL") = "./admin_donations_search.asp?" & request.ServerVariables("QUERY_STRING") Response.Redirect("./Admin_Donations_login.asp") end if '============================== set MyConn=Server.CreateObject("ADODB.Connection") set RS=Server.CreateObject("ADODB.Recordset") MyConn.Open Connect_String if err <> 0 then Err_String = Err_String& "Error:while connecting to database
" Err_String = Err_String& "Description" & err.description & "
" err = 0 end if SQL = "" SQL = SQL & " Select" & vbCrLf SQL = SQL & " `Donation Summary`.`ID`," & vbCrLf SQL = SQL & " `Donation Summary`.`Donating_Company`," & vbCrLf SQL = SQL & " `Donation Summary`.`Contact_Name`," & vbCrLf SQL = SQL & " `Donation Summary`.`Company_Address1`," & vbCrLf SQL = SQL & " `Donation Summary`.`Company_Address2`," & vbCrLf SQL = SQL & " `Donation Summary`.`City`," & vbCrLf SQL = SQL & " `Donation Summary`.`State`," & vbCrLf SQL = SQL & " `Donation Summary`.`Zip`," & vbCrLf SQL = SQL & " `Donation Summary`.`Phone`," & vbCrLf SQL = SQL & " `Donation Summary`.`Fax`," & vbCrLf SQL = SQL & " `Donation Summary`.`email_address`," & vbCrLf SQL = SQL & " `Donation Summary`.`Status`," & vbCrLf SQL = SQL & " `Donation Summary`.`Brochure_Mail`," & vbCrLf SQL = SQL & " `Donation Summary`.`Brochure_Email`," & vbCrLf SQL = SQL & " `Donation Summary`.`Date_Contacted`," & vbCrLf SQL = SQL & " `Donation Summary`.`Donation`," & vbCrLf SQL = SQL & " `Donation Summary`.`Earned_Compensation`," & vbCrLf SQL = SQL & " `Donation Summary`.`Donation Paid Check #`," & vbCrLf SQL = SQL & " `Donation Summary`.`Check Issue Date`," & vbCrLf SQL = SQL & " `Donation Summary`.`KenMat Rep`," & vbCrLf SQL = SQL & " `Donation Summary`.`Comments`" & vbCrLf SQL = SQL & " From" & vbCrLf SQL = SQL & " `Donation Summary` `Donation Summary`" & vbCrLf RS.Open SQL, MyConn, 3, 1, 1 if request.Form("act") = "n" then session.contents.remove("admin_donations_admin_donations") if err <> 0 then Err_String = Err_String& "Error:While opening recordset.
" Err_String = Err_String& "Description" & err.description & "
" err = 0 end if Qry_String = "" i = 0 for each Fld in RS.Fields session.contents.remove("admin_donations_search_fd"&i) session.contents.remove("admin_donations_multisearch_fd"&i) session.contents.remove("admin_donations_search_fd_"&i) if (request("search_fd"&i) <> "") and (request("search_fd"&i) <> "*") then iData = request("search_fd"&i) if Len(iData) > 1 then sPos = InStr(2,iData,"*",1) if sPos > 1 then iData = Left(iData,Len(iData) - (Len(iData) - sPos + 1)) end if end if iRealData = iData if (request("search_optfd"&i) <> "") then iData = request("search_optfd"&i) & iData end if iOpt = Left(iData,2) if (iOpt = "<=") or (iOpt = "=<") then iOpt = "<=" iRealData = Right(iData,Len(iData) - 2) elseif (iOpt = ">=") or (iOpt = "=>") then iOpt = ">=" iRealData = Right(iData,Len(iData) - 2) elseif iOpt = "==" then iOpt = "=" iRealData = Right(iData,Len(iData) - 2) elseif iOpt = "<>" then iRealData = Right(iData,Len(iData) - 2) elseif iOpt = "^^" then ' Contain Case iOpt = "*" iData = iOpt & iRealData & iOpt elseif iOpt = "^*" then ' Start With Case iOpt = "*" iData = iRealData & iOpt elseif iOpt = "*^" then ' End With Case iOpt = "*" iData = iOpt & iRealData else iOpt = Left(iData,1) if (iOpt = "<") or (iOpt = ">") or (iOpt = "=") then iRealData = Right(iData,Len(iData) - 1) else iOpt = "=" end if end if if (request("andor_optfd"&i) <> "") then iData = request("andor_optfd"&i) & iData end if if Lcase(iData) = "{current date and time}" then iData = Now elseif Lcase(iData) = "{current date}" then iData = Date elseif Lcase(iData) = "{current time}" then iData = Time end if select case Fld.Type case adBoolean if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if case adLongVarBinary 'noop case adDBDate, adDBTime, adDate, adDBTimeStamp, adFileTime if isDate(iRealData) then if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if else Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description: Invalid DateTime.
" end if case adBigInt, adUnsignedBigInt, adTinyInt, adSmallInt, adError, adInteger, adUnsignedInt, adUnsignedTinyInt, adUnsignedSmallInt, adDecimal, adNumeric, adVarNumeric if isNumeric(iRealData) then if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if else Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description: Type mismatch.
" end if case adSingle, adDouble, adCurrency if isNumeric(iRealData) then if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if else Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description: Type mismatch.
" end if case adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if case else if Qry_String = "" Then Qry_String = "search_fd"&i&"=" & iData else Qry_String = Qry_String & "&search_fd"&i&"=" & iData end if end select if (request("multisearch_fd"&i) <> "") then if Qry_String = "" Then Qry_String = "multisearch_fd"&i&"=" & request("multisearch_fd"&i) else Qry_String = Qry_String & "&multisearch_fd"&i&"=" & request("multisearch_fd"&i) end if end if if err <> 0 then Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description" & err.description & "
" err = 0 end if end if if (request("search_fd_"&i) <> "") and (request("search_fd_"&i) <> "*") then iData = request("search_fd_"&i) if Len(iData) > 1 then sPos = InStr(2,iData,"*",1) if sPos > 1 then iData = Left(iData,Len(iData) - (Len(iData) - sPos + 1)) end if end if iRealData = iData if (request("search_optfd_"&i) <> "") then iData = request("search_optfd_"&i) & iData end if select case Fld.Type case adDBDate, adDBTime, adDate, adDBTimeStamp, adFileTime if isDate(iRealData) then if Qry_String = "" Then Qry_String = "search_fd_"&i&"=" & iData else Qry_String = Qry_String & "&search_fd_"&i&"=" & iData end if else Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description: Invalid DateTime.
" end if case adBigInt, adUnsignedBigInt, adTinyInt, adSmallInt, adError, adInteger, adUnsignedInt, adUnsignedTinyInt, adUnsignedSmallInt, adDecimal, adNumeric, adVarNumeric, adSingle, adDouble, adCurrency if isNumeric(iRealData) then if Qry_String = "" Then Qry_String = "search_fd_"&i&"=" & iData else Qry_String = Qry_String & "&search_fd_"&i&"=" & iData end if else Err_String = Err_String& "Error:while searching." & Fld.name & ".
" Err_String = Err_String& "Description: Type mismatch.
" end if end select end if i = i + 1 next if err <> 0 then Err_String = Err_String& "Error:while searching.
" Err_String = Err_String& "Description" & err.description & "
" err = 0 end if if (request("search_sort") <> "") then SortString = request("search_sort") end if if request("Page_Size") <> "" Then Page_Size = CInt(request("Page_Size")) end if '----get submit url page---- submiturl = "./admin_donations.asp?" RS.Close set RS = Nothing MyConn.Close set MyConn = Nothing if Err_String = "" then Response.Clear Response.Redirect(submiturl&Qry_String) end if else FldCount = RS.Fields.Count Redim ArryItemValue(21) Redim ArryOpt(21) Redim ArryAndOrOpt(21) SortString = "" if (Session("SortField") <> "") then SortString = "&SortField=" & Session("SortField") & "&SortBy=" & Session("SortBy") end if if request("Page_Size") <> "" Then Page_Size = CInt(request("Page_Size")) end if i=0 Do While (i<=FldCount) if isEmpty(request("search_fd" & i)) then ArryItemValue(i) = "" ArryOpt(i) ="" else iData = request("search_fd" & i) iCon = "" if Left(request("search_fd" & i),2) = "||" then iCon = "||" iData = Right(iData,Len(iData) - 2) end if iOpt = Left(iData,2) ' Check value for advance search if (iOpt = "<=") or (iOpt = "=<") then iOpt = "<=" StrKeyWord = Right(iData,Len(iData) - 2) elseif (iOpt = ">=") or (iOpt = "=>") then iOpt = ">=" StrKeyWord = Right(iData,Len(iData) - 2) elseif (iOpt = "==") then iOpt = "==" StrKeyWord = Right(iData,Len(iData) - 2) elseif (iOpt = "<>") then StrKeyWord = Right(iData,Len(iData) - 2) else ' Check Contain StartStrData = Mid(iData,1,1) ' Get starting string EndStrData = Mid(iData, Len(iData)) ' Get last string if ((StartStrData <> "*" ) AND (EndStrData <> "*")) then if ((StartStrData = "<") OR (StartStrData = ">") OR (StartStrData = "=")) then if (StartStrData = "<") then StrKeyWord = Replace(iData,"<","",1,1,1) iOpt = "<" elseif (StartStrData = ">") then StrKeyWord = Replace(iData,">","",1,1,1) iOpt = ">" else StrKeyWord = Replace(iData,"=","",1,1,1) iOpt = "=" end if else StrKeyWord = iData end if else if ((StartStrData = "*" ) AND (EndStrData = "*")) then StartStrData = Replace(iData,"*","",1,1,1) StrKeyWord = Mid(StartStrData,1, Len(StartStrData)-1) iOpt = "^^" elseif ((StartStrData <> "*" ) AND (EndStrData = "*")) then ' Start With Case xx* StrKeyWord = Mid(iData,1, Len(iData)-1) iOpt = "^*" elseif ((StartStrData = "*" ) AND (EndStrData <> "*")) then ' End With Case *xx StartStrData = Replace(iData,"*","",1,1,1) StrKeyWord = StartStrData iOpt = "*^" end if end if ' end of check 1 character end if ' end of check 2 first character ArryOpt(i) = iOpt ArryItemValue(i) = StrKeyWord ArryAndOrOpt(i) = iCon end if i = i+1 Loop RS.Close set RS = Nothing MyConn.Close set MyConn = Nothing end if %> Find Donor
Find Donor

<% if (SortSring <> "") then response.Write "" end if if (Page_Size <> "") then response.Write "" end if %> <%CssClass = """TrOdd"""%> <% if Err_String <> "" then Response.Write "" Response.Write "" Response.Write "" Response.Write "" end if %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd0")) then ItemValue = "" else ItemValue = ArryItemValue(0) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd1")) then ItemValue = "" else ItemValue = ArryItemValue(1) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd2")) then ItemValue = "" else ItemValue = ArryItemValue(2) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd3")) then ItemValue = "" else ItemValue = ArryItemValue(3) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd4")) then ItemValue = "" else ItemValue = ArryItemValue(4) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd5")) then ItemValue = "" else ItemValue = ArryItemValue(5) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd6")) then ItemValue = "" else ItemValue = ArryItemValue(6) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd7")) then ItemValue = "" else ItemValue = ArryItemValue(7) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd8")) then ItemValue = "" else ItemValue = ArryItemValue(8) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd9")) then ItemValue = "" else ItemValue = ArryItemValue(9) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd10")) then ItemValue = "" else ItemValue = ArryItemValue(10) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd11")) then ItemValue = "" else ItemValue = ArryItemValue(11) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd12")) then ItemValue = "" else ItemValue = ArryItemValue(12) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd13")) then ItemValue = "" else ItemValue = ArryItemValue(13) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd14")) then ItemValue = "" else ItemValue = ArryItemValue(14) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd15")) then ItemValue = "" else ItemValue = ArryItemValue(15) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd16")) then ItemValue = "" else ItemValue = ArryItemValue(16) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd17")) then ItemValue = "" else ItemValue = ArryItemValue(17) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd18")) then ItemValue = "" else ItemValue = ArryItemValue(18) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd19")) then ItemValue = "" else ItemValue = ArryItemValue(19) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% CellValue = "" ItemValue = "" if isEmpty(request("search_fd20")) then ItemValue = "" else ItemValue = ArryItemValue(20) end if CellValue = "" & "" if CellValue = "" then CellValue = " " end if Response.Write "" %> <% '-----get back url page---- backurl = "./admin_donations.asp?" %>
Find Donor
Error: " &Err_String& "
ID" &CellValue& "
Donating Company" &CellValue& "
Contact Name" &CellValue& "
Company Address 1" &CellValue& "
Company Address 2" &CellValue& "
City" &CellValue& "
State" &CellValue& "
Zip" &CellValue& "
Phone" &CellValue& "
Fax" &CellValue& "
Email address" &CellValue& "
Status" &CellValue& "
Brochure Mail" &CellValue& "
Brochure Email" &CellValue& "
Date Contacted" &CellValue& "
Donation" &CellValue& "
Earned Compensation" &CellValue& "
Donation Paid Check #" &CellValue& "
Check Issue Date" &CellValue& "
Ken Mat Rep" &CellValue& "
Comments" &CellValue& "