<?
/*
//||||||||||||||||||||||||||||||||||||||||||||||||\\
\\*          SUPER HERO MOD WEB STATS 3.0         //
//                                                \\
\\  Written By ShadowLeader aka 123 (Tim Hansen)  //
//                                                \\
\\              http://SH-MOD.TK                  //
//          Email: shadowleader@jubii.dk          \\
\\          MSN: shadowleader11@hotmail.com       //
//                                                \\
\\   You are allowed to edit anything in these    //
//     files, as long as these lines remain.      \\
\\                                                //
//   If you have any trouble with the system,     \\
\\       go to www.SH-MOD.TK to get help.         //
//                                                \\
\\   Thanks to:                                   //
//   AlleyKat - Help with Template system         \\
\\   MajesticM00se - A little code                //
//   Vittu - Finding bugs                         \\
\\||||||||||||||||||||||||||||||||||||||||||||||||//
*/

require "include/header.php";

dbconn(true);

stdhead();
/////////START/////////
?>
<? 
if (!$_GET["seek"]) {?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>?table=$_POST[table]" method="get">
Search: <input class="input" type="text" name="seek"> 
<select class="input" name="table" id="table">
  <option value="hero">Heroes</option>
  <option value="player">Players</option>
  <option value="steamid">SteamID</option>
</select> 
<input type="submit" class="input" name="sog" value="Search">
</form>
<?
}
if ($_GET["seek"]) {
$seek = $_GET["seek"];
if($_GET["table"] == "hero"){
$result = mysql_query("select * from sh_hero_database where sh_name LIKE '%$seek%' ORDER by sh_name") or die(mysql_error());
}elseif($_GET["table"] == "player"){
$result = mysql_query("select * from sh_savexp where PLAYER_NAME LIKE '%$seek%' ORDER by PLAYER_NAME") or die(mysql_error());
}elseif($_GET["table"] == "steamid"){
$result = mysql_query("select * from sh_savexp where SH_KEY LIKE '%$seek%' ORDER by SH_KEY") or die(mysql_error());
}
$number = mysql_num_rows($result);
if ($number > 0) {
if($number == "1"){
echo"<b>$number</b> result - <a href=\"sh_search.php\">New Search</a><br>";
}else{
echo"<b>$number</b> results - <a href=\"sh_search.php\">New Search</a><br>";
}
echo"<ol>";
while ($row = mysql_fetch_array($result)) {
if($_GET["table"] == "hero"){
echo"<li><a href=\"sh_hero.php?hero=$row[sh_name]\">$row[sh_name]</a></li>";
}
if($_GET["table"] == "player"){
echo"<li><a href=\"sh_user.php?id=$row[SH_KEY]\">$row[PLAYER_NAME]</a></li>";
}
if($_GET["table"] == "steamid"){
echo"<li><a href=\"sh_user.php?id=$row[SH_KEY]\">$row[SH_KEY]</a></li>";
}
}
echo"</ol>";
} else {
print "<b>No Results Found!!</b> - <a href=\"sh_search.php\">New Search</a>";
}}
?>
<?
/////////END/////////
stdfoot();
?>