%
Dim totalPage, totalRecords, displayRecords
If Not Sess_Array(48) = Session.SessionID then
UpdateSessions False
Response.Redirect "default.asp"
End If
msgNomarkes = "
There are no replies to users ads found.
RESET "
Select Case Request.Form("act")
Case "delete"
flag = CLng(Request.Form("C1"))
dateRange = CLng(Request.Form("D1"))
If dateRange > 0 then
setLocale server_locale
sdd = dd(objConn)
baseDate = Date - dateRange
baseDate = ConvDate(baseDate)
strCondition = " WHERE rdate < " & sdd & baseDate & sdd
If flag = 1 then strCondition = strCondition & " AND flag = 0 "
ElseIf dateRange = 0 Then
If flag = 1 then strCondition = " WHERE flag = 0 "
End If
strSQL = "DELETE FROM " & tablPfx & "Reply " & strCondition & ";"
objConn.Execute(strSQL)
UpdateSessions False
Response.Redirect "admin_replies.asp?" & Request.Querystring
End select
If Len(Request("id")) > 0 And isNumeric(Request("id")) then
strFilter = " AND " & tablPfx & "Reply.userID = " & CLng(Request("id"))
isUserOnly = True
End If
strSQL = "SELECT " & tablPfx & "Reply.*," & tablUPfx & "User.nick FROM " & tablPfx & "Reply, " & tablUPfx & "User "
strSQL = strSQL & "WHERE " & tablUPfx & "User.userID = " & tablPfx & "Reply.userID " & strFilter & " ORDER BY rdate DESC;"
set rs = objConn.Execute(strSQL)
If not rs.EOF then
%>
Replies to Users Ads
<%
If isUserOnly = True then Response.Write "SHOW ALL
"
nPage = Sess_Array(21)
URLlink = "admin_replies.asp?" & Server.URLEncode(Request.Querystring)
pageType = 31
strPaging = buildPages(nPage, URLlink, pageType) '## paging built in libraries.asp
Response.Write strPaging
Response.Write "Total Pages: " & totalPage & "
"
Response.Write "Total Replies: " & totalRecords & "
"
%>
*Flag: REMOVE means user removed this reply from
an account. KEEP means user is still keeping this reply in the list.
NOTE: When user removes a reply from the list, the message
is not actually deleted from database but rather gets a REMOVE flag instead.
<%
Else: Response.Write msgNomarkes
End If
rs.close
%>