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%> <%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%> <%else Do While not RSBlogs.EOF%> <%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%> <%RSBlogs.Movenext Loop end if%>
TopicPosted By/Date/TimeComments
No notices currently posted.
<%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;">delete  <%end if%> "><%=RSBlogs("Subject")%> 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%>
<%'################ MAIN CONTENT ENDS ###########################%>