Completed
Push — master ( db7c0d...0a19bb )
by
unknown
02:53
created
views/core/editStaff.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 if ($result_of_query->num_rows > 0) {
6 6
     $user = $result_of_query->fetch_object();
7 7
 	
8
-	if($_SESSION['user_level'] >= $user->user_level) {
8
+    if($_SESSION['user_level'] >= $user->user_level) {
9 9
 
10 10
     if (isset($_POST["staffName"])) {
11 11
         if (formtoken::validateToken($_POST)) {
@@ -14,18 +14,18 @@  discard block
 block discarded – undo
14 14
             $staffPID = $_POST['staffPID'];
15 15
             $permissions = include 'config/permissions.php';
16 16
             if (isset($_POST['ban'])) {
17
-				if ($user->user_level == 5 && $_SESSION['user_level'] < 5) { $staffRank = 5; } else { $staffRank = 0; }
18
-			} else {
19
-				if ($_POST['staffRank'] > $_SESSION['user_level'] || $user->user_level > $_SESSION['user_level']) { $staffRank = $user->user_level; } else { $staffRank = $_POST['staffRank']; }
20
-			}
21
-	    	$userPerms = json_encode($permissions[$staffRank]);
17
+                if ($user->user_level == 5 && $_SESSION['user_level'] < 5) { $staffRank = 5; } else { $staffRank = 0; }
18
+            } else {
19
+                if ($_POST['staffRank'] > $_SESSION['user_level'] || $user->user_level > $_SESSION['user_level']) { $staffRank = $user->user_level; } else { $staffRank = $_POST['staffRank']; }
20
+            }
21
+            $userPerms = json_encode($permissions[$staffRank]);
22 22
 	
23 23
             $sql = "UPDATE `users` SET `user_name`='" . $staffName . "',`user_email`='" . $staffEmail . "',`playerid`='" . $staffPID . "',`user_level`='" . $staffRank . "', `permissions`='" . $userPerms . "' WHERE `user_id` ='" . $uId . "';";
24 24
             $result_of_query = $db_connection->query($sql);
25
-			if ($user->user_level != $_POST['staffRank']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['staff'] . " " . $lang['rank'] . " " . $lang['from'] . " (" . $settings['ranks'][$user->user_level] . ") " . $lang['to'] . " (" . $settings['ranks'][$_POST['staffRank']] . ")", 2);
26
-			if ($user->user_name != $_POST['staffName']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['name']) . " " . $lang['to'] . " " . $_POST['staffName'] . "", 2);
27
-			if ($user->playerid != $_POST['staffPID']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['player'] . " " . $lang['id'] . " " . $lang['from'] . " (" . $user->playerid . ") " . $lang['to'] . " (" . $_POST['staffPID'] . ")", 2);
28
-			if ($user->user_email != $_POST['staffEmail']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['email']) . " " . $lang['from'] . " (" . $user->user_email . ") " . $lang['to'] . " (" . $_POST['staffEmail'] . ")", 2);
25
+            if ($user->user_level != $_POST['staffRank']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['staff'] . " " . $lang['rank'] . " " . $lang['from'] . " (" . $settings['ranks'][$user->user_level] . ") " . $lang['to'] . " (" . $settings['ranks'][$_POST['staffRank']] . ")", 2);
26
+            if ($user->user_name != $_POST['staffName']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['name']) . " " . $lang['to'] . " " . $_POST['staffName'] . "", 2);
27
+            if ($user->playerid != $_POST['staffPID']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['player'] . " " . $lang['id'] . " " . $lang['from'] . " (" . $user->playerid . ") " . $lang['to'] . " (" . $_POST['staffPID'] . ")", 2);
28
+            if ($user->user_email != $_POST['staffEmail']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['email']) . " " . $lang['from'] . " (" . $user->user_email . ") " . $lang['to'] . " (" . $_POST['staffEmail'] . ")", 2);
29 29
 			
30 30
             message(ucfirst($_POST['staffName']) . ' ' . $lang['updated']);
31 31
         } else message($lang['expired']);
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
                 echo "<center>";
105 105
                 echo "<h4>" . $lang['name'] . ":  <input id='staffName' class='form-control' name='staffName' type='text' value='" . $user->user_name . "'></h4>";
106 106
                 echo "<h4>" . $lang['emailAdd'] . ": <input id='staffEmail' class='form-control' name='staffEmail' type='text' value='" . $user->user_email . "'></h4>";
107
-				echo "<h4>" . $lang['rank'] . ": ";
108
-				echo "<select id='staffRank' class='form-control' name='staffRank'>";
107
+                echo "<h4>" . $lang['rank'] . ": ";
108
+                echo "<select id='staffRank' class='form-control' name='staffRank'>";
109 109
 				
110
-				for ($lvl = 0; $lvl <= $_SESSION['user_level']; $lvl++) {
111
-					echo '<option value="' . $lvl . '"' . select($lvl, $user->user_level) . '>' . $settings['ranks'][$lvl] . '</option>';
112
-				}
110
+                for ($lvl = 0; $lvl <= $_SESSION['user_level']; $lvl++) {
111
+                    echo '<option value="' . $lvl . '"' . select($lvl, $user->user_level) . '>' . $settings['ranks'][$lvl] . '</option>';
112
+                }
113 113
 				
114 114
                 echo "</select></h4>";
115 115
                 echo "<h4>" . $lang['playerID'] . ":  <input id='staffPID' class='form-control' name='staffPID' type='text' value='" . $user->playerid . "'></h4>";
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
     <?php } ?>
1105 1105
 <?php
1106 1106
 } else {
1107
-	echo '<h3>' . errorMessage(5, $lang) . '</h3>';
1107
+    echo '<h3>' . errorMessage(5, $lang) . '</h3>';
1108 1108
 }
1109 1109
 
1110 1110
 } else {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 if ($result_of_query->num_rows > 0) {
6 6
     $user = $result_of_query->fetch_object();
7 7
 	
8
-	if($_SESSION['user_level'] >= $user->user_level) {
8
+	if ($_SESSION['user_level'] >= $user->user_level) {
9 9
 
10 10
     if (isset($_POST["staffName"])) {
11 11
         if (formtoken::validateToken($_POST)) {
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
             </div>
135 135
             <div class="panel-body">
136 136
 				<?php echo "<form method='post' action='" . $settings['url'] . 'editStaff/' . $uId . "' name='permsUpdate'>";
137
-                $permissions = json_decode($user->permissions,true);
137
+                $permissions = json_decode($user->permissions, true);
138 138
                 ?>
139 139
 				<div class="col-md-4" style='padding-right: 0px; padding-left: 0px;'>
140 140
 					<div class="panel-heading">
141
-						<div class="pull-left"><h5><i class="fa fa-tasks"></i><?php echo ' '.$lang['admin'].' '.$lang['perms']; ?></h5></div>
141
+						<div class="pull-left"><h5><i class="fa fa-tasks"></i><?php echo ' ' . $lang['admin'] . ' ' . $lang['perms']; ?></h5></div>
142 142
 							<br>
143 143
 						</div>
144 144
 						<div class="panel-body">
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,13 +22,23 @@  discard block
 block discarded – undo
22 22
 	
23 23
             $sql = "UPDATE `users` SET `user_name`='" . $staffName . "',`user_email`='" . $staffEmail . "',`playerid`='" . $staffPID . "',`user_level`='" . $staffRank . "', `permissions`='" . $userPerms . "' WHERE `user_id` ='" . $uId . "';";
24 24
             $result_of_query = $db_connection->query($sql);
25
-			if ($user->user_level != $_POST['staffRank']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['staff'] . " " . $lang['rank'] . " " . $lang['from'] . " (" . $settings['ranks'][$user->user_level] . ") " . $lang['to'] . " (" . $settings['ranks'][$_POST['staffRank']] . ")", 2);
26
-			if ($user->user_name != $_POST['staffName']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['name']) . " " . $lang['to'] . " " . $_POST['staffName'] . "", 2);
27
-			if ($user->playerid != $_POST['staffPID']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['player'] . " " . $lang['id'] . " " . $lang['from'] . " (" . $user->playerid . ") " . $lang['to'] . " (" . $_POST['staffPID'] . ")", 2);
28
-			if ($user->user_email != $_POST['staffEmail']) logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['email']) . " " . $lang['from'] . " (" . $user->user_email . ") " . $lang['to'] . " (" . $_POST['staffEmail'] . ")", 2);
25
+			if ($user->user_level != $_POST['staffRank']) {
26
+			    logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['staff'] . " " . $lang['rank'] . " " . $lang['from'] . " (" . $settings['ranks'][$user->user_level] . ") " . $lang['to'] . " (" . $settings['ranks'][$_POST['staffRank']] . ")", 2);
27
+			}
28
+			if ($user->user_name != $_POST['staffName']) {
29
+			    logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['name']) . " " . $lang['to'] . " " . $_POST['staffName'] . "", 2);
30
+			}
31
+			if ($user->playerid != $_POST['staffPID']) {
32
+			    logAction($_SESSION['user_name'], $lang['edited'] . " " . $_POST['staffName'] . "\'s " . $lang['player'] . " " . $lang['id'] . " " . $lang['from'] . " (" . $user->playerid . ") " . $lang['to'] . " (" . $_POST['staffPID'] . ")", 2);
33
+			}
34
+			if ($user->user_email != $_POST['staffEmail']) {
35
+			    logAction($_SESSION['user_name'], $lang['edited'] . " " . $user->user_name . "\'s " . strtolower($lang['email']) . " " . $lang['from'] . " (" . $user->user_email . ") " . $lang['to'] . " (" . $_POST['staffEmail'] . ")", 2);
36
+			}
29 37
 			
30 38
             message(ucfirst($_POST['staffName']) . ' ' . $lang['updated']);
31
-        } else message($lang['expired']);
39
+        } else {
40
+            message($lang['expired']);
41
+        }
32 42
     }
33 43
     if (isset($_POST["viewPlayer"])) {
34 44
         if (formtoken::validateToken($_POST)) {
@@ -80,7 +90,9 @@  discard block
 block discarded – undo
80 90
             message("Permissions Updated");
81 91
             session_destroy();
82 92
             session_start();
83
-        } else message($lang['expired']);
93
+        } else {
94
+            message($lang['expired']);
95
+        }
84 96
     }
85 97
     ?>
86 98
     <div class="row">
Please login to merge, or discard this patch.
views/core/staff.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@
 block discarded – undo
63 63
                     echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editStaff/" . $row["user_id"] . "'>";
64 64
                     echo "<i class='fa fa-pencil'></i></a></td>";
65 65
                 } else {
66
-					echo "<td></td>";
67
-				}
66
+                    echo "<td></td>";
67
+                }
68 68
                 echo "</tr>";
69 69
             };
70 70
             echo "</tbody></table>";
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,14 +7,18 @@  discard block
 block discarded – undo
7 7
     $sql = "SELECT `uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '" . $search . "' OR `playerid` LIKE '" . $search . "';";
8 8
     $result_of_query = $db_link->query($sql);
9 9
     $total_records = mysqli_num_rows($result_of_query);
10
-    if ($pageNum > $total_records) $pageNum = $total_records;
10
+    if ($pageNum > $total_records) {
11
+        $pageNum = $total_records;
12
+    }
11 13
     $sql = "SELECT `playerid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '" . $search . "' OR `playerid` LIKE '" . $search . "'" . $max . " ;";
12 14
     logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['players'], 1);
13 15
 } else {
14 16
     $sql = "SELECT `uid` FROM `players`;";
15 17
     $result_of_query = $db_link->query($sql);
16 18
     $total_records = mysqli_num_rows($result_of_query);
17
-    if ($pageNum > $total_records) $pageNum = $total_records;
19
+    if ($pageNum > $total_records) {
20
+        $pageNum = $total_records;
21
+    }
18 22
     $sql = "SELECT `playerid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` " . $max . " ;";
19 23
 }
20 24
 
@@ -107,4 +111,6 @@  discard block
 block discarded – undo
107 111
                 ?>
108 112
         </div>
109 113
 <?php
110
-} else echo '<h3>' . errorMessage(36, $lang) . '</h3>';
111 114
\ No newline at end of file
115
+} else {
116
+    echo '<h3>' . errorMessage(36, $lang) . '</h3>';
117
+}
Please login to merge, or discard this patch.