function do_search($name, $search_aliases = false) { global $currentconfig; global $currentconfignumber; global $coddb; global $t; global $text; $count = 0; $link = baselink(); $query = "SELECT {$t['b3_clients']}.name, {$t['players']}.id, {$t['players']}.fixed_name,\n {$t['players']}.hide \n FROM {$t['b3_clients']}, {$t['players']}\n WHERE ({$t['b3_clients']}.id = {$t['players']}.client_id)\n AND ( \n ({$t['b3_clients']}.name LIKE \"%{$name}%\")\n OR\n ({$t['players']}.fixed_name LIKE \"%{$name}%\")\n )\n AND {$t['players']}.hide = 0"; $result = $coddb->sql_query($query); opentablerow('100'); echo "<td>" . $text["currentplnames"] . "<td></tr><tr>"; while ($row = $coddb->sql_fetchrow($result)) { opentablecell('100'); if ($row['fixed_name'] == "") { echo "<a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">" . htmlspecialchars(utf2iso($row['name'])) . "</a><br/>"; $count++; } else { if (stristr($row['fixed_name'], $name)) { echo "<a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">" . htmlspecialchars(utf2iso($row['fixed_name'])) . "</a><br/>"; $count++; } } closetablecell(); echo "</tr><tr>"; } closetablerow(); if ($search_aliases == "true") { $query = "SELECT {$t['b3_aliases']}.alias, {$t['b3_clients']}.name, {$t['players']}.id\n FROM {$t['b3_aliases']}, {$t['b3_clients']}, {$t['players']}\n WHERE ({$t['b3_aliases']}.alias LIKE \"%{$name}%\")\n AND {$t['b3_aliases']}.client_id = {$t['b3_clients']}.id\n AND {$t['b3_clients']}.id = {$t['players']}.client_id\n AND {$t['players']}.hide = 0\n AND {$t['players']}.fixed_name = '' "; $result = $coddb->sql_query($query); if ($coddb->sql_numrows($result) > 0) { echo "Alias results:<br/>"; } opentablerow('100'); echo "<td>Search results (aliase -> current playername)<td></tr><tr>"; while ($row = $coddb->sql_fetchrow($result)) { opentablecell('100'); echo "{$row['alias']} -> <a href=\"{$link}?func=player&playerid={$row['id']}&config={$currentconfignumber}\">{$row['name']}</a><br/>"; $count++; closetablecell(); echo "</tr><tr>"; } closetablerow(); } return $count; }
function player_compare($myplayerid, $playerid) { global $ccounter1; global $ccounter2; $ccounter1 = 0; $ccounter2 = 0; // load the two players in arrays $player1 = player_short_comparison($myplayerid); $player2 = player_short_comparison($playerid); opentablerow(100); echo "<td align=\"center\">Player Comparison Chart. Comparing " . htmlspecialchars(utf2iso($player1['name'])) . " to " . htmlspecialchars(utf2iso($player2['name'])) . "</td></tr><tr>"; closetablecell(); closetablerow(); echo "<br>"; echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\"><tr>"; echo "<td width=\"25%\">"; player_compare_item($player1, $player2, $citem = "playerrank", $cbar = false, $switchwinner = true, $columns = 4); echo "</td><td width=\"25%\">"; player_compare_item($player1, $player2, $citem = "country", $cbar = false, $switchwinner = true, $columns = 4); echo "</td><td width=\"25%\">"; player_compare_item($player1, $player2, $citem = "connections", $cbar = false, $switchwinner = false, $columns = 4); echo "</td><td width=\"25%\">"; player_compare_item($player1, $player2, $citem = "rounds", $cbar = false, $switchwinner = false, $columns = 4); echo "</td></tr></table>"; echo "<br>"; echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\"><tr>"; echo "<td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "skill", $cbar = true, $switchwinner = false, $columns = 2); echo "<br>"; echo "</td><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "ratio", $cbar = true, $switchwinner = false, $columns = 2); echo "<br>"; echo "</td></tr><tr><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "kills", $cbar = true, $switchwinner = false, $columns = 2); echo "<br>"; echo "</td><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "deaths", $cbar = true, $switchwinner = true, $columns = 2); echo "<br>"; echo "</td></tr><tr><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "winstreak", $cbar = true, $switchwinner = false, $columns = 2); echo "<br>"; echo "</td><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "losestreak", $cbar = true, $switchwinner = true, $columns = 2); echo "<br>"; echo "</td></tr><tr><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "teamkills", $cbar = true, $switchwinner = true, $columns = 2); echo "<br>"; echo "</td><td width=\"50%\">"; player_compare_item($player1, $player2, $citem = "teamdeaths", $cbar = true, $switchwinner = true, $columns = 2); echo "<br>"; echo "</td></tr></table>"; opentablerow(100); echo "<td align=\"center\">Comparison Count and Conclusion</td></tr><tr>"; opentablecell(100); $ctotal = $ccounter1 + $ccounter2; if ($ccounter2 > $ccounter1) { echo "We can conclude that " . htmlspecialchars(utf2iso($player1['name'])) . " ownes " . htmlspecialchars(utf2iso($player2['name'])) . " in " . $ccounter2 . " of " . $ctotal . " total comparison sections!"; } if ($ccounter1 > $ccounter2) { echo "We can conclude that " . htmlspecialchars(utf2iso($player2['name'])) . " ownes " . htmlspecialchars(utf2iso($player1['name'])) . " in " . $ccounter1 . " of " . $ctotal . " total comparison sections!"; } closetablecell(); closetablerow(); }
$in_c == 3 ? "selected" : ""; ?> >3</option> <option value="4" <?php $in_c == 4 ? "selected" : ""; ?> >4</option> </select> </p> <p><span class="style1">Width-Height: (max 500x200)</span><br> <input name="w" type="text" id="w" size="6" value="<?php $in_w; ?> "> <input name="h" type="text" id="h" size="6" value="<?php $in_h; ?> "> </p> --> <p> <input type="submit" name="submit" value="Build"> </p> </form> <?php closetablecell(); closetablerow(); displaysimplefooter(1);