diff --git a/Admin/Templates/player.tpl b/Admin/Templates/player.tpl
index d282948d..32f2d1df 100644
--- a/Admin/Templates/player.tpl
+++ b/Admin/Templates/player.tpl
@@ -21,20 +21,14 @@ if(isset($id))
$varray = $database->getProfileVillages($id);
$refreshiconfrm = "../img/admin/refresh.png";
$refreshicon = "
";
- if($user)
- {
+ if($user){
$totalpop = 0;
- foreach($varray as $vil)
- {
- $totalpop += $vil['pop'];
- }
+ foreach($varray as $vil) $totalpop += $vil['pop'];
+
include('search2.tpl');
echo "
";
$deletion = false;
- if($deletion)
- {
- include("playerdeletion.tpl");
- }
+ if($deletion) include("playerdeletion.tpl");
include("playerinfo.tpl");
include("playerheroinfo.tpl");
@@ -88,9 +82,6 @@ if(isset($id))
\ No newline at end of file
diff --git a/Admin/Templates/playermedals.tpl b/Admin/Templates/playermedals.tpl
index 86d8c003..11c62108 100644
--- a/Admin/Templates/playermedals.tpl
+++ b/Admin/Templates/playermedals.tpl
@@ -1,6 +1,3 @@
-
\ No newline at end of file
diff --git a/GameEngine/Admin/Mods/medals.php b/GameEngine/Admin/Mods/medals.php
index 2328084c..34294590 100755
--- a/GameEngine/Admin/Mods/medals.php
+++ b/GameEngine/Admin/Mods/medals.php
@@ -24,23 +24,19 @@ for ($i = 0; $i < 5; $i++) {
include_once($autoprefix."GameEngine/Database.php");
-if (!isset($_SESSION)) session_start();
-if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
+if(isset($_POST['medalid']) && !empty($_POST['medalid']) && is_numeric($_POST['medalid'])){
+ $medalID = (int) $_POST['medalid'];
+ mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."medal set del = 1 WHERE id = ".$medalID."");
+}
+elseif(isset($_POST['userid']) && !empty($_POST['userid']) && is_numeric($_POST['userid'])){
+ $userID = (int) $_POST['userid'];
+ mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."medal set del = 1 WHERE userid = ".$userID."");
+}
-$medalid = (int) $_POST['medalid'];
-$uid = (int) $_POST['uid'];
-$admid = (int) $_POST['admid'];
+$admidID = (int) $_SESSION['id'];
+$name = $database->getUserField($adminID, "name", 0);
+//TODO: Make a dedicated method for logging
+mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."admin_log values (0, $admid, 'Deleted medal id [#".$medalid."] from the user $name ',".time().")");
-mysqli_query($GLOBALS["link"], "UPDATE ".TB_PREFIX."medal set del = 1 WHERE id = ".$medalid."");
-
-$name = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT name FROM ".TB_PREFIX."users WHERE id= ".$uid.""), MYSQLI_ASSOC);
-$name = $name['name'];
-
-mysqli_query($GLOBALS["link"], "Insert into ".TB_PREFIX."admin_log values (0,$admid,'Deleted medal id [#".$medalid."] from the user $name ',".time().")");
-
-
-$deleteweek = (int) $_POST['medalweek'];
-mysqli_query($GLOBALS["link"], "UPDATE ".TB_PREFIX."medal set del = 1 WHERE week = ".$deleteweek."");
-
-header("Location: ../../../Admin/admin.php?p=player&uid=".$uid."");
+header("Location: ../../../Admin/admin.php?p=player&uid=".$_POST['uid']."");
?>
\ No newline at end of file