<% if request.form <>"" then finalStartDate = request.form("startYear")&"-"&LeadingZero(request.form("startMonth"))&"-"&LeadingZero(request.form("startDay"))&" "&LeadingZero(request.form("starHour"))&":00:00" finalEndDate = request.form("endYear")&"-"&LeadingZero(request.form("endMonth"))&"-"&LeadingZero(request.form("endDay"))&" "&LeadingZero(request.form("endHour"))&":00:00" if Trim(request("subject"))<>"" and Trim(request("body"))<>"" and isDate(finalStartDate) and isDate(finalEndDate) then Dim finalTitle, finalBody, finalStartDate, finalEndDate finalTitle = SQLin(request.form("subject")) finalBody = SQLin(request.form("body")) ' response.write(finalTitle&"
") ' response.write(finalBody&"
") ' response.write(finalStartDate&"
") ' response.write(finalEndDate&"
") ' response.end Dim objCom Dim modeId:modeId = 1 Dim newsId:newsId = request.form("id") if request.form("mode")="add" then modeId = 0 newsId = 0 end if Set objCom = server.createobject("adodb.command") with objCom .activeconnection = datastore '.commandTimeout = 200 .commandText = dbOwnerPrefix&"spInsertUpdateAnouncement" .commandType = adCmdStoredProc .Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0 ) .Parameters.Append .Createparameter("@finalTitle", adVarChar, adParamInput, 100, finalTitle) .Parameters.Append .Createparameter("@finalBody", adVarChar, adParamInput, 2147483647, finalBody) .Parameters.Append .Createparameter("@finalStartDate", adDBTimeStamp, adParamInput, 0, finalStartDate) .Parameters.Append .Createparameter("@finalEndDate", adDBTimeStamp, adParamInput, 0, finalEndDate) .Parameters.Append .Createparameter("@id", adSmallInt, adParamInput, 0, newsId) .Parameters.Append .Createparameter("@type", adInteger, adParamInput, 0, modeId) .execute , , adExecuteNoRecords end with Set objCom = nothing else response.redirect ("admin_news.asp?done=no") end if response.clear response.redirect ("admin_news.asp?done=yes") end if %> News Management <%= OutputCSS() %>
News Announcement :       Help
<% Dim title, body, i, mode, objCon, objRS, id, startDate, endDate, timeoffset mode = request.queryString ("mode") id = request.querystring("id") timeoffset = Application(dbName&"timeoffset") if mode = "" then mode = "add" if mode = "add" then startDate = SQLMediumDate(DateAdd("h",timeoffset,SQLNowDate())) endDate = startDate elseif mode = "edit" then set objRS = server.createobject("adodb.recordset") with objRS .open "SELECT title, body, startdate, enddate FROM pgd_announcement WHERE id = "&id, datastore, , , adCmdText If not (.EOF or .BOF) then title = SQLout(.fields(0)) body = SQLOut(.fields(1)) startDate = .fields(2) endDate = .fields(3) End if .close end with set objRS=nothing elseif mode = "delete" then SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute "DELETE FROM pgd_announcement WHERE id = "&id, , adExecuteNoRecords + adCmdtext .close end with Set objCon = nothing response.redirect ("admin_news.asp?done=yes") end if if request("done")<>"" then response.write ("
News Announcement Edited Successfully !") %>
News Announcement Configuration:
class="cat" colspan=2>Announcement Title : (For display on the top of the main page)
colspan=2>
class="cat" colspan=2>Announcement Body : (content of announcement, feel free to use PGDCode)
colspan=2> <% call pgdCodes %>
<%= pgdBodyArea(body, 15) %>

* NOTE : Both Fields are required for News Announcement to be displayed on the main page
> Start Date width="90%"> Day Month Year Hour
> End Date width="90%"> Day Month Year Hour

<% if mode="add" then %>   <% elseif mode = "edit" then %> <% end if %>    <% if mode="add" then %> <% elseif mode = "edit" then %> <% End If %>
<% Dim allData set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 150 .open "SELECT id, title, startdate, enddate FROM pgd_announcement order by startdate desc;", datastore, , , adCmdText If not (.EOF or .BOF) then allData = .getrows End if .close end with set objRS=nothing %>
<% If isArray(allData) then %> <% for i = 0 to ubound(allData,2) %> > <% next %> <% End If %>
All Announcements:
Edit this Announcement Delete this Announcement <%= SQLout(allData(1,i)) %> <%= SQLDate(SQLMediumDate(allData(2,i)),0,true) %> ~ <%= SQLDate(SQLMediumDate(allData(3,i)),0,true) %>
<% call pgdResize(550,"body") %>