print ""; print ""; print "
"; print ""; print " | Click here to contact the Louisiana Cemetery Board"; print " |
";
print " Navigation ";
print " | ";
print "";
print " News ";
print " | ";
print "
"; print ""; print ""; print " | "; print "";
print " "; print "LOUISIANA CEMETERY BOARD "; print "3445 N. Causeway Boulevard, Suite 700 "; print "Metairie, Louisiana 70002 "; print "Telephone (504) 838-5267 "; print "Toll Free (866) 488-5267 "; print "Fax (504) 838-5289 Welcome to the Louisiana Cemetery Board Announcements Page. Check here to find important announcements concerning the Board."; print ""; // If $offset is set below zero (invalid) or empty, set to zero if (empty($offset) || $offset < 0) { $offset=0; } // Connect to database $db = @mysql_connect("mysql1.myregisteredsite.com", "47182_us21691b", "lcboard"); @mysql_select_db("47182_db21691a"); // Set $limit. $limit = Max number of results per 'page' // Set $totalrows = total number of rows that unlimited query would return // (total number of records to display across all pages) $limit = 5; $numresults = mysql_query("SELECT * FROM news", $db); $totalrows = mysql_num_rows($numresults); // Set $begin and $end to record range of the current page $begin =($offset+1); $end = ($begin+($limit-1)); if ($end > $totalrows) { $end = $totalrows; } // Now retrieve records for current page $query = "SELECT title,time,body from news order by time desc limit $offset,$limit"; $result = mysql_query($query, $db); print "
"; // Begin Prev/Next Links // use urlencode to allow prev/next buttons to work in Netscape $par_new=urlencode($par); // Don't display PREV link if on first page if ($offset!=0) { $prevoffset=$offset-$limit; echo "PREV $limit \n"; } // Calculate total number of pages in result $pages = intval($totalrows/$limit); // $pages now contains total number of pages needed unless there is a remainder from division if ($totalrows%$limit) { // has remainder so add one page $pages++; } // Now loop through the pages to create numbered links // ex. 1 2 3 4 5 NEXT for ($i=1;$i<=$pages;$i++) { // Check if on current page if (($offset/$limit) == ($i-1)) { // $i is equal to current page, so don't display a link echo "$i "; } else { // $i is NOT the current page, so display a link to page $i $newoffset=$limit*($i-1); echo "$i \n"; } } // Check to see if current page is last page if (!((($offset/$limit)+1)==$pages) && $pages!=1) { // Not on the last page yet, so display a NEXT Link $newoffset=$offset+$limit; echo "NEXT $limit \n"; } print ""; print " "; print " |
";
print " | ";
print " Copyright";
print "© 2000 Louisiana Cemetery Board All Rights Reserved "; print "Contact the Louisiana Cemetery Board"; print ""; print " |
"; print ""; print ""; ?>