October
Schedule of Events
Rules and Times are subject to change.
0) // if a matching record was found { $r = mysql_fetch_array($result); // break the result into an array in order to access individual attributes $day1 = $r[day1]; // store the first day of the festival into $day1 variable $day2 = $r[day2]; // store the second day of the festival into $day2 variable $day3 = $r[day3]; // store the third day of the festival into $day3 variable $day4 = $r[day4]; // store the fourth day of the festival into $day4 variable $day5 = $r[day5]; // store the fifth day of the festival into $day5 variable // one or more of these days (except day4 and day5) may be null. These cases are handled later. Day 4 and 5 are the main days of the festival. The number of days may vary from year to year but will always be 2 or more. $query2 = "SELECT * FROM `events` WHERE year = '$selectYear'"; // query string to get the events for the current year specified $result2 = mysql_query($query2); // perform query and store results in $results2 variable $numFound2 = mysql_num_rows($result2); // get the number of records found $i = 0; // counter, start at 0 $tot = 5; // the total number of days is 5 $firstDay = 0; // variable to store which day is the first to be visible on the web page (database holds valid entries) $r2 = mysql_fetch_array($result2); // break results into an array echo ""; // end the JavaScript echo '
    '; // this starts the horizontal menu of day tabs if ($day1 != "" && $day1 != "0") // if the first day is to be shown { if ($i == 0) { // print the first day as a tab that is selected echo "
  • October $day1
  • "; if ($firstDay == 0) { $firstDay = 1; } } else { // print the first day as a tab that is not selected echo "
  • October $day1
  • "; } $i++; } else // else the first day is not to be shown { echo ""; $tot--; } if ($day2 != "" && $day2 != "0") // if the second day is to be shown { if ($i == 0) { // print the second day as a tab that is selected echo "
  • October $day2
  • "; if ($firstDay == 0) { $firstDay = 2; } } else { // print the second day as a tab that is not selected echo "
  • October $day2
  • "; } $i++; } else // else the second day is not be shown { echo ""; $tot--; } if ($day3 != "" && $day3 != "0") // if the third day is to be shown { if ($i == 0) { // print the third day as a tab that has been selected echo "
  • October $day3
  • "; if ($firstDay == 0) { $firstDay = 3; } } else { // print the third day as a tab that is not selected echo "
  • October $day3
  • "; } $i++; } else // else the third day is not to be shown { echo ""; $tot--; } if ($day4 != "" && $day4 != "0") // if the fourth day is to be shown { if ($i == 0) { // print the fourth day as tab that is selected echo "
  • October $day4
  • "; if ($firstDay == 0) { $firstDay = 4; } } else { // print the fourth day as a tab that is not selected echo "
  • October $day4
  • "; } $i++; } else // else the fourth day is not to be shown { echo ""; $tot--; } if ($day5 != "" && $day5 != "0") // if the fifth day is to be shown { if ($i == 0) { // print the fifth day as a tab that has been selected echo "
  • October $day5
  • "; if ($firstDay == 0) { $firstDay = 5; } } else { // print the fifth day as a tab that has not been selected echo "
  • October $day5
  • "; } $i++; } else // else the fifth day is not to be shown { echo ""; $tot--; } echo '
'; echo ""; // print a div for each day in the festival for ($i = 1; $i < 6; $i++) { echo ""; // end the div } if ($firstDay != 0) { echo ""; // end the JavaScript } } else { echo "Currently, there are no Events for $selectYear"; // there are no events in the database for the specified year } } else { echo "There is no information for $selectYear."; // there is no information in the database corresponding to the specified year } mysql_close($mysql_link); // close the database connection ?>