<?
/*
//||||||||||||||||||||||||||||||||||||||||||||||||\\
\\*          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($thestring OR $CURUSER['class'] >= UC_ADMINISTRATOR){
?>
<table align="center" width="85%" cellpadding="3" cellspacing="1" border="0">

 <?PHP
if($_GET[mode] != "add"){
?>
<form action="<? echo"".$_SERVER['PHP_SELF'].""; ?>?mode=add" method="post" enctype="multipart/form-data">
<tr>
 <td><span class=genmed>SteamID: </span></td><td><input name=steamid class=input type=text size=20></td>
</tr>
<tr>
 <td><span class=genmed>XP: </span></td>
 <td><select name="xp_to_do" class=input>
    <option value="set" selected>Set</option>
	<option value="+">+</option>
    <option value="-">-</option>
	<option value="*">*</option>
	<option value="/">/</option>
  </select> <input name=xp class=input type=text size=5></td>
</tr>
<tr>
<td colspan="2"><input name="post" id="post" class=input type="submit" value="Go!"></td>
</tr>
</form>

<?PHP
}
if($_GET[mode] == "add"){
$theid = "$_POST[steamid]";
$thetodo = "$_POST[xp_to_do]";
$thexp = "$_POST[xp]";


$cursteamids = mysql_query("select * from sh_savexp WHERE  SH_KEY = '$theid'") or die(mysql_error());
while($get = mysql_fetch_array($cursteamids)) {
$cur_id = "$get[SH_KEY]";
$cur_xp = "$get[XP]";
}
if($thetodo == "-"){
$resu = $cur_xp-$thexp;
}elseif($thetodo == "+"){
$resu = $cur_xp+$thexp;
}elseif($thetodo == "*"){
$resu = $cur_xp*$thexp;
}elseif($thetodo == "/"){
$resu = $cur_xp/$thexp;
}elseif($thetodo == "set"){
$resu = $thexp;
}
$realres = round($resu,0);
$time = time();
mysql_query("UPDATE sh_savexp SET XP = '$resu' WHERE SH_KEY = '$theid'") or die(mysql_error());
echo"<tr><td>$cur_id: $resu XP</td></tr>";
}
?>

</table>
<?
}else{
echo"You do not have access to this page.";
} ?>
<?
/////////END/////////
stdfoot();
?>