<% If Session ("PersonID") = "" Then Response.Redirect "login.asp" End If %> <% FUNCTION fixQuotes( theString ) fixQuotes = REPLACE( theString, "'", "''" ) END FUNCTION addArticle = TRIM(Request( "addArticle" ) ) updateArticle = TRIM(Request( "updateArticle" ) ) ArticleID = TRIM( Request( "ArticleID" ) ) ArticleDate = TRIM( Request( "ArticleDate" ) ) ArticleYear= TRIM( Request( "ArticleYear" ) ) ArticleTitle= TRIM( Request( "ArticleTitle" ) ) ExtTitle = TRIM( Request( "ExtTitle" ) ) ArticleAuthor= TRIM( Request( "ArticleAuthor" ) ) ArticleAuthorInfo= TRIM( Request( "ArticleAuthorInfo" ) ) ArticleEmail= TRIM( Request( "ArticleEmail" ) ) AuthorWebSite = TRIM(Request( "AuthorWebSite" ) ) ArticleText= TRIM( Request( "ArticleText" ) ) ArticleBrief= TRIM( Request( "ArticleBrief" ) ) ArticleCategory= TRIM( Request( "ArticleCategory" ) ) FeatureArticle = TRIM( Request( "FeatureArticle" ) ) IF ArticleYear = "" THEN ArticleYear = "" END IF IF ArticleTitle = "" THEN ArticleTitle = "" END IF IF ExtTitle = "" THEN ExtTitle = "" END IF IF ArticleAuthor = "" THEN ArticleAuthor = "" END IF IF ArticleAuthorInfo = "" THEN ArticleAuthorInfo = "" END IF IF ArticleEmail = "" THEN ArticleEmail = "?" END IF IF AuthorWebSite = "" THEN AuthorWebSite = "" END IF IF ArticleText = "" THEN ArticleText = "?" END IF IF ArticleBrief = "" THEN ArticleBrief = "" END IF Set dbConn = Server.CreateObject( "ADODB.Connection" ) dbConn.Open "mdb" %> Manage Articles

View By Month & Year

Year

Manage Records

Add an Article  | Help | HomeLogout

<% IF addArticle <> "" THEN sqlString = "INSERT INTO Article_Index " &_ "( article_date, article_year, article_title, article_ext, article_author, article_authorinfo, article_email, article_website, article_text, article_briefdesc, " &_ "article_category, article_featured ) VALUES ( " &_ " '" & fixQuotes(ArticleDate) & "', " &_ " '" & fixQuotes(ArticleYear) & "', " &_ " '" & fixQuotes(ArticleTitle) & "', " &_ " '" & fixQuotes(ExtTitle) & "', " &_ " '" & fixQuotes(ArticleAuthor) & "', " &_ " '" & fixQuotes(ArticleAuthorInfo) & "', " &_ " '" & fixQuotes(ArticleEmail) & "', " &_ " '" & fixQuotes(AuthorWebSite) & "', " &_ " '" & fixQuotes(ArticleText) & "', " &_ " '" & fixQuotes(ArticleBrief) & "', " &_ " '" & fixQuotes(ArticleCategory) & "', " &_ " '" & fixQuotes(FeatureArticle) & "' " & ")" dbConn.Execute sqlString %>
<%=ArticleTitle%> was added to the database

<% END IF IF updateArticle <> "" THEN sqlString = "UPDATE Article_Index SET " &_ "article_date='" & fixQuotes( ArticleDate ) & "'," &_ "article_year='" & fixQuotes( ArticleYear ) & "'," &_ "article_title='" & fixQuotes( ArticleTitle ) & "'," &_ "article_ext='" & fixQuotes( ExtTitle ) & "'," &_ "article_author='" & fixQuotes( ArticleAuthor ) & "'," &_ "article_authorinfo='" & fixQuotes( ArticleAuthorInfo ) & "'," &_ "article_email='" & fixQuotes( ArticleEmail ) & "'," &_ "article_website='" & fixQuotes( AuthorWebSite ) & "'," &_ "article_text='" & fixQuotes( ArticleText ) & "'," &_ "article_briefdesc='" & fixQuotes( ArticleBrief ) & "'," &_ "article_category='" & fixQuotes( ArticleCategory ) & "', " &_ "article_featured='" & fixQuotes( FeatureArticle ) & "' " & " WHERE " &_ "article_id=" & ArticleID dbConn.Execute sqlString %>

Record # <%=ArticleID%> had been updated

<% END IF %> <% Const intPageSize = 5 Dim intCurrentPage Dim intTotalPages, intI, intP If Request.QueryString = "" Then intCurrentPage = 1 Else intCurrentPage = Cint(Request.QueryString("CurrentPage")) SELECT CASE Request.QueryString("Submit") CASE "Previous" intCurrentPage = intCurrentPage - 1 CASE "Next" intCurrentPage = intCurrentPage + 1 END SELECT END IF SET RS = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = dbConn RS.CursorLocation = adUseClient RS.CursorType = adOpenStatic RS.CacheSize = intPageSize RS.PageSize = intPageSize sqlString = "SELECT article_id, article_date, article_year, article_title, article_ext, article_author, article_authorinfo, " &_ "article_email, article_website, article_text, article_briefdesc, " &_ "article_category, article_featured " &_ "FROM Article_Index " &_ "ORDER BY article_id " RS.Open sqlString IF RS.EOF THEN Response.Write "" &_ "" & " No Records Found! " &_ "" ELSE RS.AbsolutePage = intCurrentPage IF RS.EOF THEN Response.Write "" &_ "" &_ "No Records Remaining On This Page   " & "" &_ "Go To Beginning of Index" & "" & "" & "" ELSE intTotalPages = RS.PageCount %>

Page, <%=intCurrentPage%> of <%=intTotalPages%>

<% For intI = 1 to RS.PageSize %>
RECORD # <%=RS( "article_id" )%> "> Modify ')" onMouseOver="window.status='Delete';return true" onMouseOut="window.status='';return true"> Delete
Article Date: <%=RS( "article_date" )%>  <%=RS( "article_year")%>
Title: <%=RS( "article_title" )%>
Ext Title: <%=RS( "article_ext" )%>
Author: <%=RS( "article_author" )%>
Author Info: <%=RS( "article_authorinfo" )%>
Email: <%=RS( "article_email" )%>
Web Site: <%=RS( "article_website" )%>
Article Text: <%=RS( "article_text" )%>
Category: <%=RS( "article_category" )%>
Featured: <%=RS( "article_featured" )%>

<% RS.MoveNext If RS.EOF Then Exit For Next %> <% RS.Close %> <% dbConn.Close %>

   
<% END IF IF intCurrentPage <> intTotalPages Then %>
<% IF intCurrentPage > 1 Then %>

Previous

 

Next

<% END IF %>

Page, <%=intCurrentPage%> of <%=intTotalPages%>

<% END IF %> <% END IF %>