Upcoming Fairs & Festivals!
2011 \n"; } else { // Figure out how many pages to display $ratio = $count / $results_per_page; $num_pages = floor($ratio); // Add a page if necessary if ($num_pages < $ratio) { $num_pages++; } // See if we're already on a page. $current_page = $_GET['page']; if (!(is_numeric($current_page)) || ($current_page < 0) || ($current_page > ($num_pages - 1))) { $current_page = 0; } $offset = $current_page * $results_per_page; // Get records for current page if ($sortby == "") { $sortby = "sort_date"; } $sql2 = "SELECT * FROM $events_table WHERE month = '$month' AND verify = 0 ORDER BY sort_date LIMIT $offset, $results_per_page"; $result2 = mysql_query($sql2) or die ("Query failed: ".$sql2); $cur_month = -1; $cur_event_count = 0; echo "\n"; while ($row = mysql_fetch_array($result2)) { $month = $row['month']; $cur_event_count++; // Add header row as needed if (($cur_event_count % 2) == 0) { $bgcolor = "#D4F2F2"; } else { $bgcolor = "#C0DFDF"; } // Display event name, hyperlinked if necessary $url = $row['url']; echo ""; echo "\n"; // Other event info if ($row['location'] > "") { echo ""; echo "\n"; } echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; $url = $row['url']; echo ""; echo "\n"; echo "\n"; } } ?>


1) { echo ""; } ?>
No records returned."; $month = !isset($_POST['month'])? $month : $_POST['month']; // MONTHS DROPDOWN echo "
Month: "; $month = !isset($_POST['month'])? $month : $_POST['month']; // MONTHS DROPDOWN echo "
"; echo ""; if ($url > "") { echo ""; } echo stripslashes($row['event']); if ($url > "") { echo ""; } echo "
".$row['location']."
".$row['town']."
".stripslashes($row['telephone'])."
".stripslashes($row['dates']).", ".$row['year']."
".stripslashes($row['time'])."
".stripslashes($row['cost'])."
".stripslashes($row['descr'])."
"; if ($url > "") { echo ""; } echo stripslashes($row['url']); if ($url > "") { echo ""; } echo "
"; echo "

Event dates subject to change. Please confirm date prior to the event.
Have an event that we should know about? Submit your info here!
"; // Previous link if ($current_page > 0) { echo "< Previous"; } // Loop over page numbers, adding links except for this one for ($k = 0; $k < $num_pages; $k++) { echo " "; if ($k != $current_page) { echo ""; } echo $k+1; if ($k != $current_page) { echo ""; } echo " "; } // Next link if ($current_page < $num_pages - 1) { echo "Next >"; } echo "

"; //echo $offset."
"; //echo $current_page."
"; //echo $results_per_page."
"; //echo $_GET['page']."
"; //echo $num_pages."
"; //echo $sortby."
"; //echo $count."
"; //echo $ratio."
"; ?>