%@ Language=VBScript %> <% thispage="coveragerequests.asp" halfpage = false if fmembersonly then checksecurity dim allowedit, editing, singleuser, casestatement allowedit = false editing = false singleevent = false when = request("when") uid = request("uid") cat = request("cat") ob = request("ob") search = request("search") constrain = request("constrain") cstate = request("cstate") if len(ob) = 0 then ob = "date ASC" casestatement = "" if request("id") <> "" then casestatement = "id = '" & request("id") & "'" singleevent = true end if if cat <> "" then casestatement = "type = '" & cat & "'" if len(uid) <> "0" then singleuser = true if casestatement = "" then casestatement = "uid = '" & uid & "'" else casestatement = casestatement & "AND uid = '" & uid & "'" end if end if '---------------when stuff--------- ' whenclause = "" select case when case "today" whenclause = "(date = CURRENT_DATE())" case "tomorrow" whenclause = "(date = date_add(CURRENT_DATE(), INTERVAL 1 DAY))" case else if isdate(when) then whenclause = "(date = '" & when & "')" end select if whenclause = "" then whenclause = "(date >= CURRENT_DATE())" '----------------------------------------------- '--------------------SEARCH STUFF--------------- if len(request("search")) <> "0" then searchterm = request("search") newsearchterm = "" ' replace(searchterm,chr(34)&chr(34),chr(34)) '- handle quote-marks dim quotearray() quotecount = 0 i = 1 do i = 1 i2 = 0 i = instr(i, searchterm, chr(34)) if i > 0 then if i > 1 then newsearchterm = newsearchterm & " " & trim(mid(searchterm, 1, i-1)) i2 = instr(i+1, searchterm, chr(34)) if i2 <> 0 then redim preserve quotearray(quotecount) quotearray(quotecount) = mid(searchterm, i+1, i2-i-1) searchterm = mid(searchterm, i2+1) quotecount = quotecount + 1 end if end if loop while i2 <> 0 searchterm = newsearchterm & " " & searchterm 'response.write searchterm if searchterm <> "" then SearchTermArray=Split(trim(searchterm)," ") NumSearchTerms=ubound(SearchTermArray) else dim searchtermarray() NumSearchTerms= -1 end if if quotecount > 0 then for i = 0 to ubound(quotearray) redim preserve searchtermarray(NumSearchTerms + i + 1) searchtermarray(NumSearchTerms + i + 1) = quotearray(i) next end if NumSearchTerms=ubound(SearchTermArray) if constrain ="on" then if cstate <> "" then casestatement = cstate & " AND " else casestatement = "" end if subcasestatement = "name LIKE '%" & replace(SearchTermArray(0), "'", "'") & "%' " for i = 1 to NumSearchTerms if SearchTermArray(i) <> "" then subcasestatement = subcasestatement & "AND name LIKE '%" & replace(SearchTermArray(i), "'", "'") & "%' " next casestatement = casestatement & "(" & subcasestatement subcasestatement = "subtype LIKE '%" & replace(SearchTermArray(0), "'", "'") & "%' " for i = 1 to NumSearchTerms if SearchTermArray(i) <> "" then subcasestatement = subcasestatement & "AND subtype LIKE '%" & replace(SearchTermArray(i), "'", "'") & "%' " next casestatement = casestatement & " or " & subcasestatement subcasestatement = "description LIKE '%" & replace(SearchTermArray(0), "'", "'") & "%' " for i = 1 to NumSearchTerms if SearchTermArray(i) <> "" then subcasestatement = subcasestatement & "AND description LIKE '%" & replace(SearchTermArray(i), "'", "'") & "%' " next casestatement = casestatement & "or " & subcasestatement & ")" end if '---------------end search------------------------- '--------------------------------------------------- dim objConn ' Our Connection Object dim rsCateg 'as ADODB.Recordset Set objConn = CreateObject("ADODB.Connection") set rsCateg = Server.CreateObject("ADODB.Recordset") objConn.open connStr Response.Buffer = True 'On Error Resume Next '---------------this is where we delete an event record if request("del") <> "" then 'first delete file set objRS1 = objConn.Execute("DELETE FROM events WHERE id = '" & request("del") & "' AND UID ='" & uid & "'") end if if editing then if Request.ServerVariables("REQUEST_METHOD") = "POST" then set objRS1 = objConn.Execute("UPDATE content SET title = '" & replace(replace(request("title"), "'", "'"), "%34", """) & "', description = '" & replace(replace(request("description"), "'", "'"), "%34", """) & "', artist = '" & replace(replace(request("artist"), "'", "'"), "%34", """) & "', type = '" & request("cat") & "' where id = '" & request("id") & "' AND uid = '" & uid & "'") end if end if ' here we retrieve the column names set objRS1 = objConn.Execute("SHOW columns FROM coverage") If Not objRS1.EOF then datArray = objRS1.GetRows End if colLength = ubound(datArray,2) dim nameArray() redim nameArray(colLength) dim typeArray() redim typeArray(colLength) for i = 0 to colLength nameArray(i) = datArray(0,i) typeArray(i) = datArray(1,i) 'set some preset valz if datArray(0,i) = "id" then iid = i if datArray(0,i) = "uid" then iuid = i if datArray(0,i) = "description" then idescription = i if datArray(0,i) = "name" then iname = i if datArray(0,i) = "date" then idate = i if datArray(0,i) = "subdate" then isubdate = i if datArray(0,i) = "compensation" then icompensation = i if datArray(0,i) = "zip" then izip = i if datArray(0,i) = "media1" then imedia1 = i if datArray(0,i) = "media2" then imedia2 = i next ' and now the media dim norezult norezult = false ob = " ORDER BY " & ob strSQL = "SELECT * FROM coverage WHERE " & whenclause if casestatement <> "" then strSQL = strSQL & "AND " & casestatement strSQL = strSQL & ob 'response.write strSQL set objRS1 = objConn.Execute(strSQL) If Not objRS1.EOF then theArray = objRS1.GetRows arrayLength = ubound(theArray,2) else norezult = true End if %>
<% dim filesysx Set filesysx = CreateObject("Scripting.FileSystemObject") fileext = Server.MapPath("eventsbin") if singleevent then i = 0 '-------Single Event Mode----- if lcase(thearray(iuid,i)) = lcase(session("memberuid")) and thearray(iuid,i) <> "" then allowedit = true %>
<%
set objRS1 = objConn.Execute("SELECT id FROM members WHERE uid = '" & thearray(iuid,i) & "'")
if filesysx.FileExists(Server.MapPath("memberpics") & servPRESETslash & objRS1("id") & ".jpg") then%>
<%else %>
<%end if%>
|
UID: <%=thearray(iuid,i)%>
Title: <%=thearray(iname,i)%> Date: <% if date = DateSerial(year(thearray(idate,i)), month(thearray(idate,i)), day(thearray(idate,i))) then response.write "Today" else if 1 = DateDiff("d", Date, DateSerial(year(thearray(idate,i)), month(thearray(idate,i)), day(thearray(idate,i)))) then response.write "Tomorrow" else if year(thearray(idate,i)) = year(date)then response.write month(thearray(idate,i)) & "/" & day(thearray(idate,i)) else response.write month(thearray(idate,i)) & "/" & day(thearray(idate,i)) & "/" & year(thearray(idate,i)) end if end if end if %> Compensation: <%=thearray(icompensation,i)%> Location Zip: <% for counter = len(cstr(thearray(izip,i))) to 4 response.write "0" next response.write thearray(izip,i) %> RESPOND! <% ' this is the attached media stuff disabled = true ' (for now this feature is disabled) if not disabled then if allowedit then %> Change/add Related Media: <% if thearray(imedia1,i) <> "" then colon = instr(thearray(imedia1,i),":") desc = mid(thearray(imedia1,i), 1, colon - 1) filename = mid(thearray(imedia1,i), colon + 1)%> <%=desc%> <% else%> add <% end if if thearray(imedia2,i) <> "" then colon = instr(thearray(imedia2,i),":") desc = mid(thearray(imedia2,i), 1, colon - 1) filename = mid(thearray(imedia2,i), colon + 1)%> , <%=desc%> <% else%> , add <% end if else %> <%if session("memberuid") <> "" then %> <%end if%> Related Media: <% related = false if thearray(imedia1,i) <> "" then colon = instr(thearray(imedia1,i),":") desc = mid(thearray(imedia1,i), 1, colon - 1) filename = mid(thearray(imedia1,i), colon + 1) related = true%> <%=desc%> <% end if if thearray(imedia2,i) <> "" then colon = instr(thearray(imedia2,i),":") desc = mid(thearray(imedia2,i), 1, colon - 1) filename = mid(thearray(imedia2,i), colon + 1) related = true%> , <%=desc%> <% if related = false then %> None <% end if end if end if end if%> |
|
<%
if date = DateSerial(year(thearray(idate,i)), month(thearray(idate,i)), day(thearray(idate,i))) then
DateGroup = "Today"
else
if 1 = DateDiff("d", Date, DateSerial(year(thearray(idate,i)), month(thearray(idate,i)), day(thearray(idate,i)))) then
DateGroup = "Tomorrow"
else
if year(thearray(idate,i)) = year(date)then
DateGroup = month(thearray(idate,i)) & "/" & day(thearray(idate,i))
else
DateGroup = month(thearray(idate,i)) & "/" & day(thearray(idate,i)) & "/" & year(thearray(idate,i))
end if
end if
end if
if dateGroup <> lastDateGroup then
lastDateGroup = DateGroup
%>
<%response.write dateGroup%> (click on picture for details/to respond) | |||
<%end if%>
|