"; ?>
 
Index : = 1) { $inumpages = explode (".", $numpages); $numpages = $inumpages[0]+1; } // get theme ID information $query = mysql_query("SELECT theme, title, DOC_date_modified, publication, author, pub_date, refnum, additional_info, type, docID, username FROM themes, docs, doc_types, users WHERE themes.themeID=$themeid AND docs.themeID=$themeid AND doc_types.typeID=docs.typeID AND users.userID=docs.userID LIMIT $startpoint,$numitems"); // the number of items read from the database $numrows = mysql_num_rows($query); $result = ("$query"); $r = mysql_fetch_array($query); // print the theme name $theme = $r["theme"]; print "$theme
"; print "

$theme
"; print "
"; print "Documents:"; // print a description of the documents if ($result) { print "
    "; for ($i=0; $i<$numrows; $i++) { $title = $r["title"]; $date_modified = $r["DOC_date_modified"]; $publication = $r["publication"]; $author = $r["author"]; $pub_date = $r["pub_date"]; $refnum = $r["refnum"]; $additional_info = $r["additional_info"]; $type = $r["type"]; $username = $r["username"]; $docID = $r["docID"]; // reformat the date modified $date = format_mysql_date($date_modified); // reformat the publication date $pdate = format_mysql_date2($pub_date); print "

    "; print "

  • $title
    \n"; print "Modified: $date | Archivist: $username
    \n"; print "Publication: $publication"; print " | "; print "Author: $author Date: "; print "$pdate
    "; print " Type of Document: $type | Reference Number: "; print "$refnum
    "; print "Abstract: $additional_info"; print "
  • "; $r = mysql_fetch_array($query); } print "
"; if ($numpages > 1) { print "
"; // additional pages available Print " Pages:   "; // previous pages if ($numpages > 10) { print ""; if ($page > 10) { $pagenum = $page-10; if ($pagenum < 1) $pagenum = 1; print "[Prev10]  "; } else { print "[Prev10]  "; } print ""; } print ""; if ($page > 1) { $pagenum = $page - 1; print "[Prev<<]  | "; } else { print "[Prev<<]  | "; } print ""; // determine the page range to display for the previous and next pages numbers $pageRange = page_range($page, $numpages); $range = explode("!", $pageRange); $startpage = $range[0]; $endpage = $range[1]; for ($i=$startpage; $i<=$endpage; $i++) { if ($i == $page) { print "$i | "; } else { print "$i | "; } } // more pages print ""; if ($page < $numpages) { $pagenum = $page + 1; print " [>>Next]"; } else { print " [>>Next]"; } print ""; if ($numpages > 10) { print ""; if ($page <= 10) { $pagenum = $page+10; if ($pagenum > $numpages) $pagenum = $numpages; print "  [Next10]"; } else { print "  [Next10]"; } print ""; } } } else { print "No data."; } print "