2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/team.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
db_init();
|
2003-03-19 21:01:32 +00:00
|
|
|
init_session();
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2004-05-11 22:49:23 +00:00
|
|
|
$team_name = $_GET["team_name"];
|
2002-08-07 18:56:55 +00:00
|
|
|
$name_lc = strtolower($team_name);
|
2004-08-06 12:12:26 +00:00
|
|
|
$name_lc = escape_pattern($name_lc);
|
2002-08-12 20:16:55 +00:00
|
|
|
|
2004-07-21 21:50:25 +00:00
|
|
|
$query = "select * from team where name like '$name_lc%'";
|
2002-08-07 18:56:55 +00:00
|
|
|
$result_list = mysql_query($query);
|
|
|
|
page_head("Search Results");
|
|
|
|
if ($result_list) {
|
|
|
|
$total = 0;
|
|
|
|
echo "<h2>Search results for '$team_name'</h2>";
|
2002-08-12 20:16:55 +00:00
|
|
|
echo "<p>";
|
|
|
|
echo "You may view these teams' members, statistics, and information.";
|
2002-08-07 18:56:55 +00:00
|
|
|
echo "<ul>";
|
|
|
|
while ($team_possible = mysql_fetch_object($result_list)) {
|
|
|
|
if ($total >= 100) {
|
|
|
|
$too_many = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
echo "<li>";
|
2003-03-21 04:38:55 +00:00
|
|
|
echo "<a href=team_display.php?teamid=$team_possible->id>";
|
2002-08-07 18:56:55 +00:00
|
|
|
echo "$team_possible->name</a></li>";
|
|
|
|
$total++;
|
|
|
|
}
|
|
|
|
echo "</ul>";
|
|
|
|
if ($too_many) {
|
2004-11-21 18:56:30 +00:00
|
|
|
echo "
|
|
|
|
More than 100 teams match your search.
|
|
|
|
The first 100 are shown.<br>
|
|
|
|
";
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "End of results<br>";
|
|
|
|
echo "If you cannot find the team you are looking for, you may create a team ";
|
|
|
|
echo "by clicking <a href=team_create_form.php>here</a>.";
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|