22) { $monstr = "WHERE ((month=$month && (abs(day-".$day."))<11) || (month=".($month+1)." && day<".($day-22)."))"; } elseif ($day < 12 && $month!=1) { $monstr = "WHERE ((month=$month && (abs(day-".$day."))<11) || (month=".($month-1)." && day>".($day+17)."))"; } else { $monstr = "WHERE ((month=$month && (abs(day-".$day."))<11))"; } } else { $monstr = "WHERE month=$month"; } if ($year != 0) { $monstr .= " && year=$year"; } } $sql = "SELECT * FROM race_details $monstr ORDER BY year,month,day,gender,race"; $results = mysql_query($sql); $lastmeet = ""; $meetcount = 0; while ($row = mysql_fetch_array($results)) { if ($lastmeet != $row['month'] . $row['day'] . $row['year'] . $row['gender'] . $row['race'] && $meetcount < 100) { if ($row['gender'] == "M") {$race = "Mens' ";} else {$race = "Womens' ";} if ($row['race'] == "V") {$race .= "Varsity";} else {$race .= $row['race'];} echo $row['month']."/".$row['day']."/".(substr($row['year'],2)). " - ". $row['meet']." @ ".$row['location']." ($race)
\n"; $meetcount++; } $lastmeet = $row['month'] . $row['day'] . $row['year'] . $row['gender'] . $row['race']; } if ($meetcount >= 100) { echo "

There were more than 100 results to your query. If you do not see a meet you want, try narrowing your criteria."; } elseif (mysql_num_rows($results) == 0) { echo "

There were no results to your query."; } mysql_free_result($results); exit(); } elseif ($search_type=meet_display) { $sql = "SELECT * FROM race_details WHERE year=$year && month=$month && day=$day && gender='$gender' && race='$race' ORDER BY place"; $results = mysql_query($sql); $headerprinted = 0; $teamplace = array(); while ($row = mysql_fetch_array($results)) { if ($headerprinted == 0) { echo "

".$row['meet']." @ ".$row['location']."
".$row['month']."/".$row['day']."/".(substr($row['year'],2))."

"; if ($row['gender'] == "M") {echo "Mens' ";} else {echo "Womens' ";} if ($row['race'] == "V") {echo "Varsity";} else {echo $row['race'];} echo " ".$length_value." ".$length_suffix."
Conditions:"; $conarray = split(" ",$row['conditions']); $firstcond = 1; for (reset($conarray); $cond = current($conarray); next($conarray)) { if ($firstcond != 1) {echo ", ";} else {$firstcond = 0;} echo ucfirst($cond); } echo "


"; $headerprinted = 1; } if ($row['school'] == "Wesleyan") {$tmpstr = "";} else {$tmpstr = "";} echo " "; if (! $teamplace[$row['team_place']]) {$teamplace[$row['team_place']] = $row['school'];} } echo "
Place  Runner   School Time
$tmpstr".$row['place']." $tmpstr".$row['fname']." ".$row['lname']."    $tmpstr".$row['school']."    $tmpstr".$row['minutes'].":".$row['seconds']."


Team results:

"; for ($i = 1; $i<=sizeof($teamplace); $i++) { if ($teamplace[$i] == "Wesleyan") {echo "$i. ".$teamplace[$i]."
\n";} elseif ($teamplace[$i]) {echo "$i. ".$teamplace[$i]."
\n";} } echo "
"; } } else { echo " Which type of search so you want to perform?

Find a single meet on or around:    



"; }