NOTICEBOARD

<%'################ MAIN CONTENT STARTS ########################%>
<%if request("do")= "del" Then
SQLDel2 = "DELETE FROM Forces_NoticeComments WHERE NoticeID = "&killchars(request("id"))&" "
Set RSDel2 = MyConn.Execute(SQLDel2)
SQLDel = "DELETE FROM Forces_NoticeBoard WHERE NoticeID = "&killchars(request("id"))&" "
Set RSDel = MyConn.Execute(SQLDel)
response.redirect "Noticeboard.asp"
end if%>
| Topic | Posted By/Date/Time | Comments |
|
<%GetBlogs = "SELECT NoticeID, Subject, AccountID, Anonymous,EntryDate FROM Forces_NoticeBoard WHERE Deleted = 'no' ORDER BY AccountID Desc "
Set RSBlogs = MyConn.execute(GetBlogs)
if RSBlogs.EOF Then%>
| No notices currently posted. |
<%else
Do While not RSBlogs.EOF%>
<%GetAdmin = "SELECT Type FROM Forces_Registrants WHERE AccountID = '"&session("AccountID")&"' "
Set RSAdmin = MyConn.execute(GetAdmin)
If RSAdmin("Type") = "admin" then%>
" onclick="if(!confirm('Are you sure you want to delete this record? It will be removed permanently!')) return false;">
<%end if%>
"><%=RSBlogs("Subject")%>
|
<%if RSBlogs("Anonymous") = "yes" then
sayUsername = "Anonymous"
else
GetUserName = "SELECT Username FROM Forces_Registrants WHERE AccountID = '"&RSBlogs("AccountID")&"' "
SET RSUserName = MyConn.execute(GetUserName)
sayUsername = RSUserName("Username")
end if%>
Posted by <%=sayUsername%> (<%=RSBlogs("EntryDate")%>)
<%GetComments = "SELECT count(*) as num FROM Forces_NoticeComments WHERE Deleted = 'no' AND NoticeID = '"&RSBlogs("NoticeID")&"' "
Set RSComments = MyConn.execute(GetComments)
IF RSComments.EOF then
num = "0"
else
num = RSComments("num")
end if%> |
<%=num%> |
<%RSBlogs.Movenext
Loop
end if%>
<%'################ MAIN CONTENT ENDS ###########################%>