Example #1
0
  dominated by entries written in languages like
  <a href="http://ai-contest.com/language_profile.php?lang=C%2B%2B">C++</a>,
  Gábor has solidly taken the top spot with an innovative algorithm. His
  entry is one of just 33 submissions written in
  <a href="http://ai-contest.com/language_profile.php?lang=Lisp">Lisp</a>,
  and is entitled <a href="http://ai-contest.com/profile.php?user_id=8565">
  bocsimacko</a>. Congratulations Gábor!</p>
<p>A big congratulations also goes out to the runners up,
  <a href="http://ai-contest.com/profile.php?user_id=7026">_iouri_</a> and
  <a href="http://ai-contest.com/profile.php?user_id=11248">Slin-.-</a>,
  as well as all the finalists in the top 100. With over 4600 submissions
  received, securing a spot in the top 100 was no easy task!</p>
<p>On behalf of <a href="http://www.google.com">Google</a> and the
  <a href="http://csclub.uwaterloo.ca">University of Waterloo Computer
  Science Club</a>, we would like to thank everybody who took part in the
  Google AI Challenge. This term was the best yet, with more than 4600 working
  entries submitted by people from 112 different countries. Thank you!</p>
<p>We would also like to thank all the <a href="thanks.php">people</a>
  who generously volunteered their time and mad skills to make the Google
  AI Challenge happen.</p>
<p>Here are the complete final rankings. These rankings are based on the
  <a href="http://en.wikipedia.org/wiki/Elo_rating_system">Elo rating
  system</a>. Click on any player's name to see their game history. If
  you crave more interesting statistics and rankings, check out the
  <a href="country_rankings.php">country rankings</a> and
  <a href="organization_rankings.php">organization rankings</a>. Also check
  out <a href="http://ai-contest.com/forum/viewtopic.php?f=19&t=1184">
  this cool forum thread</a> for tons of the most interesting game replays!</p>
EOT;
echo getRankingsTableString(1, false, 100, "");
include 'footer.php';
<?php

include 'header.php';
include_once 'rankings_widget.php';
$lang = $_GET["lang"];
$lang_encoded = urlencode($lang);
$lang_display = htmlspecialchars($lang);
echo <<<EOT
<h2><span>{$lang_display}'s User Rankings</span><div class="divider" /></h2>
EOT;
echo getRankingsTableString(1, false, 100, "?lang={$lang_encoded}&page=", 0, "l.name", $lang);
include 'footer.php';
select
    *
from
    countries
where
    country_id = '{$country_id}'
EOT;
$country_result = mysql_query($country_query);
if (!$country_result) {
    echo "<p>Invalid Country ID</p>";
} else {
    $country_data = mysql_fetch_assoc($country_result);
    $country_code = htmlentities($country_data["country_code"]);
    $country_name = htmlentities($country_data["name"]);
    /*
    echo <<<EOT
    <h2>$country_name's Profile</h2>
    EOT;
    
    <h3><span>Country Information</span><div class="divider" /></h3>
    <dl class="userinfo">
    <dt>Country Code:</dt>
    <dd>$country_code</dd>
    </dl>
    */
    echo <<<EOT
<h2><span>{$country_name}'s User Rankings</span><div class="divider" /></h2>
EOT;
    echo getRankingsTableString(1, false, 100, "?country_id={$country_id}&page=", 0, "c.country_id", $country_id);
}
include 'footer.php';
$org_id = $_GET["org_id"];
if (!filter_var($org_id, FILTER_VALIDATE_INT)) {
    $org_id = NULL;
}
// Grab Data
$org_query = <<<EOT
select
    *
from
    organizations
where
    org_id = '{$org_id}'
EOT;
$org_result = mysql_query($org_query);
if (!$org_result) {
    echo "<p>Invalid Organization ID</p>";
    echo $org_id;
} else {
    $org_data = mysql_fetch_assoc($org_result);
    $org_name = htmlentities($org_data["name"]);
    /*
    echo <<<EOT
    <h2>$org_name's Profile</h2>
    EOT;
    */
    echo <<<EOT
<h2><span>{$org_name}'s User Rankings</span><div class="divider" /></h2>
EOT;
    echo getRankingsTableString(1, false, 100, "?org_id={$org_id}&page=", 0, "o.org_id", $org_id);
}
include 'footer.php';