diff --git a/Admin/Templates/ban.tpl b/Admin/Templates/ban.tpl index deb323be..6da0a50b 100644 --- a/Admin/Templates/ban.tpl +++ b/Admin/Templates/ban.tpl @@ -1,128 +1,248 @@ - -
+$error = ''; +$success = ''; -dblink, " + SELECT id, username + FROM ".TB_PREFIX."users + WHERE id = $uid + LIMIT 1 + "); + + if(!$userCheck || mysqli_num_rows($userCheck) == 0) + { + $error = "This user does not exist!"; + } + else + { + // ========================= + // ❌ CHECK ALREADY BANNED + // ========================= + $check = mysqli_query($database->dblink, " + SELECT id + FROM ".TB_PREFIX."banlist + WHERE uid = $uid + AND active = 1 + LIMIT 1 + "); + + if(mysqli_num_rows($check) > 0) + { + $error = "User is already banned!"; + } + else + { + $user = mysqli_fetch_assoc($userCheck); + $name = $user['username']; + + $end = ($time > 0) ? (time() + $time) : 0; + + mysqli_query($database->dblink, " + INSERT INTO ".TB_PREFIX."banlist + (uid,name,reason,time,end,admin,active) + VALUES + ($uid,'$name','$reason',".time().",$end,0,1) + "); + + $success = "User has been banned successfully!"; + } + } + } +} + +// ========================= +// BAN LIST +// ========================= $bannedUsers = $admin->search_banned(); ?> + + + + + + + + + + + + + + +| Bannned Players () | -|||||
|---|---|---|---|---|---|
| Username | -Length (from/to) | -Reason | -- | ||
| '.$link.' | -'.date("d.m.y H:i",$bannedUsers[$i]['time']).' - '.$end.' | -'.$bannedUsers[$i]['reason'].' | -![]() |
- ||
| No Players are Banned | |||||
| Banned Players () | +|||||
| Username | +Length | +Reason | ++ | ||
| '.$link.' | +'.date("d.m.y H:i",$bannedUsers[$i]['time']).' - '.$end.' | +'.$bannedUsers[$i]['reason'].' | +
+
+
+
+ |
+ ||
| No Players are Banned | |||||