Issues (501)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

views/life/editPlayer.php (49 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require_once realpath($settings['url']).'config/carNames.php';
3
require_once realpath($settings['url']).'config/images.php';
4
require_once realpath($settings['url']).'config/license.php';
5
require_once realpath($settings['url']).'config/crimes.php';
6
7
$db_link = serverConnect();
8
9
if (isset($_POST['editType'])) {
10
    if (formtoken::validateToken($_POST)) {
11
        switch ($_POST['editType']) {
12 View Code Duplication
            case 'civ_inv':
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
                $civ_gear_value = $_POST['civ_inv_value'];
14
                $update = "UPDATE `players` SET civ_gear = '$civ_gear_value' WHERE `uid` = '$uID';";
15
                $result_of_query = $db_link->query($update);
16
                logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['civ'].' '.$lang['inventory'], 1);
17
                message($lang['edited'].' '.$lang['civ'].' '.$lang['inventory']);
18
                break;
19
20 View Code Duplication
            case 'cop_inv':
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
                $cop_gear_value = $_POST['cop_inv_value'];
22
                $update = "UPDATE `players` SET cop_gear = '$cop_gear_value' WHERE `uid` = '$uID';";
23
                $result_of_query = $db_link->query($update);
24
                logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cop'].' '.$lang['inventory'], 1);
25
                message($lang['edited'].' '.$lang['cop'].' '.$lang['inventory']);
26
                break;
27
28
            case 'med_inv':
29
                $med_gear_value = $_POST['med_inv_value'];
30
                $update = "UPDATE `players` SET med_gear = '$med_gear_value' WHERE `uid` = '$uID';";
31
                $result_of_query = $db_link->query($update);
32
                logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['medic'].' '.$lang['inventory'], 1);
33
                message($lang['edited'].' '.$lang['medic'].' '.$lang['inventory']);
34
                break;
35
36
            case 'player_edit':
37
                if ($_SESSION['user_level'] >= 4) {
38
                    $coplevel = clean(intval($_POST['player_coplvl']), 'int');
39
                    $mediclevel = clean(intval($_POST['player_medlvl']), 'int');
40
                    $donorlevel = clean(intval($_POST['player_donlvl']), 'int');
41
                    $adminlevel = clean(intval($_POST['player_adminlvl']), 'int');
42
                    $cash = clean(intval($_POST['player_cash']), 'int');
43
                    $bankacc = clean(intval($_POST['player_bank']), 'int');
44
                    $sql = "SELECT *, $playerIdColumn as playerid FROM `players` WHERE `uid` = '$uID';";
45
                    $result = $db_link->query($sql);
46
                    if ($result->num_rows > 0) {
47
                        $player = $result->fetch_object();
48
49 View Code Duplication
                        if ($coplevel != $player->coplevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
50
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cop'].' '.$lang['level'].' '.$lang['from'].' ('.$player->coplevel.') '.$lang['to'].' ('.$coplevel.')', 2);
51
                        }
52 View Code Duplication
                        if ($mediclevel != $player->mediclevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
53
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['medic'].' '.$lang['level'].' '.$lang['from'].' ('.$player->mediclevel.') '.$lang['to'].' ('.$mediclevel.')', 2);
54
                        }
55 View Code Duplication
                        if ($donorlevel != $player->$settings['donorFormat']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
56
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['donator'].' '.$lang['level'].' '.$lang['from'].' ('.$player->$settings['donorFormat'].') '.$lang['to'].' ('.$donorlevel.')', 2);
57
                        }
58 View Code Duplication
                        if ($adminlevel != $player->adminlevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
59
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['admin'].' '.$lang['level'].' '.$lang['from'].' ('.$player->adminlevel.') '.$lang['to'].' ('.$adminlevel.')', 2);
60
                        }
61 View Code Duplication
                        if ($cash != $player->cash) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
62
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cash'].' '.$lang['from'].' ('.$player->cash.') '.$lang['to'].' ('.$cash.')', 2);
63
                        }
64 View Code Duplication
                        if ($bankacc != $player->bankacc) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
65
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['bank'].' '.$lang['from'].' ('.$player->bankacc.') '.$lang['to'].' ('.$bankacc.')', 2);
66
                        }
67
68
                        $update = "UPDATE `players` SET coplevel = '$coplevel', mediclevel = '$mediclevel', ".$settings['donorFormat']."= '$donorlevel', adminlevel = '$adminlevel', cash = '$cash', bankacc = '$bankacc' WHERE `uid` = '$uID';";
69
                        $result_of_query = $db_link->query($update);
70
                        message($lang['edited'].' '.nameID($player->playerid, $db_link));
71
                    } else {
72
                        message('ERROR');
73
                    }
74
                } elseif ($_SESSION['user_level'] >= 3) {
75
                    $coplevel = intval($_POST['player_coplvl']);
76
                    $mediclevel = intval($_POST['player_medlvl']);
77
                    $cash = intval($_POST['player_cash']);
78
                    $bankacc = intval($_POST['player_bank']);
79
                    $donorlevel = isset($_POST['player_donlvl']) ? intval($_POST['player_donlvl']) : null;
80
                    $sql = "SELECT *, $playerIdColumn as playerid FROM `players` WHERE `uid` = '$uID';";
81
                    $result = $db_link->query($sql);
82
                    if ($result->num_rows > 0) {
83
                        $player = $result->fetch_object();
84
                        if (is_null($donorlevel)) {
85
                            $donorlevel = $player->$settings['donorFormat'];
86
                        }
87 View Code Duplication
                        if ($coplevel != $player->coplevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
88
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cop'].' '.$lang['level'].' '.$lang['from'].' ('.$player->coplevel.') '.$lang['to'].' ('.$coplevel.')', 2);
89
                        }
90 View Code Duplication
                        if ($mediclevel != $player->mediclevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
91
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['medic'].' '.$lang['level'].' '.$lang['from'].' ('.$player->mediclevel.') '.$lang['to'].' ('.$mediclevel.')', 2);
92
                        }
93 View Code Duplication
                        if ($donorlevel != $player->$settings['donorFormat']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
94
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['donator'].' '.$lang['level'].' '.$lang['from'].' ('.$player->$settings['donorFormat'].') '.$lang['to'].' ('.$donorlevel.')', 2);
95
                        }
96 View Code Duplication
                        if ($cash != $player->cash) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
97
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cash'].' '.$lang['from'].' ('.$player->cash.') '.$lang['to'].' ('.$cash.')', 2);
98
                        }
99 View Code Duplication
                        if ($bankacc != $player->bankacc) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
100
                            logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['bank'].' '.$lang['from'].' ('.$player->bankacc.') '.$lang['to'].' ('.$bankacc.')', 2);
101
                        }
102
103
                        $update = "UPDATE `players` SET coplevel = '$coplevel', mediclevel = '$mediclevel', ".$settings['donorFormat']."= '$donorlevel', cash = '$cash', bankacc = '$bankacc' WHERE `uid` = '$uID';";
104
                        $result_of_query = $db_link->query($update);
105
                        logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['levels'], 2);
106
                        message($lang['edited'].' '.nameID($player->playerid, $db_link));
107
                    } else {
108
                        message('ERROR');
109
                    }
110
                } elseif ($_SESSION['user_level'] >= 2) {
111
                    $coplevel = intval($_POST['player_coplvl']);
112
                    $mediclevel = intval($_POST['player_medlvl']);
113 View Code Duplication
                    if ($coplevel != $player->coplevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
114
                        logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['cop'].' '.$lang['level'].' '.$lang['from'].' ('.$player->coplevel.') '.$lang['to'].' ('.$coplevel.')', 2);
115
                    }
116 View Code Duplication
                    if ($mediclevel != $player->mediclevel) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
117
                        logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['medic'].' '.$lang['level'].' '.$lang['from'].' ('.$player->mediclevel.') '.$lang['to'].' ('.$mediclevel.')', 2);
118
                    }
119
120
                    $update = "UPDATE `players` SET coplevel = '$coplevel', mediclevel = '$mediclevel' WHERE `uid` = '$uID';";
121
                    $result_of_query = $db_link->query($update);
122
                    logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['levels'], 2);
123
                    message($lang['edited'].' '.nameID($player->playerid, $db_link));
124
                }
125
                break;
126
            case 'add_note':
127
                $note_text = $_POST['note_text'];
128
                $update = "INSERT INTO `notes` (`uid`, `staff_name`, `note_text`, `note_updated`) VALUES ('$uID', '".$_SESSION['user_name']."', '$note_text', CURRENT_TIMESTAMP);";
129
                $result_of_query = $db_link->query($update);
130
                logAction($_SESSION['user_name'], $lang['edited'].' '.nameID($player->playerid, $db_link).'('.$player->playerid.') '.$lang['notes'], 1);
131
                message($lang['edited'].' '.$lang['notes']);
132
                break;
133
        }
134
    } else {
135
        message($lang['expired']);
136
    }
137
}
138
139
$sql = "SELECT *, $playerIdColumn as playerid FROM `players` WHERE `uid` = '$uID'";
140
$result = $db_link->query($sql);
141
if ($result->num_rows > 0) {
142
    $player = $result->fetch_object();
143
144
    $temp = '';
145
    $pGID = $player->playerid;
146 View Code Duplication
    for ($i = 0; $i < 8; ++$i) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
147
        $temp .= chr($pGID & 0xFF);
148
        $pGID >>= 8;
149
    }
150
    $pGID = md5('BE'.$temp); ?>
151
    <div class="col-md-3" style="float:left;  padding-top:20px;">
152
        <div class="panel panel-default">
153
            <div class="panel-heading">
154
                <h2 class="panel-title"><i class="fa fa-child fa-fw"></i><?php echo $player->name; ?></h2>
155
            </div>
156
157
            <div class="panel-body">
158
                <?php
159
                $alias = str_replace('"[`', '', $player->aliases);
160
                $alias = str_replace('`]"', '', $alias);
161
162
                echo '<center><img alt="'.$alias.'" src="'.$settings['url'].skinImage($player->civ_gear).'">';
163
                echo "<h5 style='word-wrap: break-word; '> <a href='http://webinterface.playerindex.de/default.aspx?id=".$pGID."' class='btn btn-xs btn-warning' target='_blank' role='button'>Check Playerindex Ban </a></h5>";
164
                if ($_SESSION['permissions']['view']['steam'] && $settings['vacTest']) {
165
                    echo '<div id="vacBan"></div>';
166
                }
167
                echo '<h4>'.$lang['aliases'].': '.$alias.'</h4>';
168
                echo '<h4>'.$lang['uid'].': '.$player->uid.'</h4>';
169
                echo '<h4>'.$lang['playerID'].': '.$player->playerid.'</h4>';
170
                echo "<h4 style='word-wrap: break-word;'>".$lang['GUID'].': '.$pGID.'</h4>'; ?>
171
                <i class="fa fa-2x fa-money"></i>
172
                <h4><?php echo $lang['cash'].': '.$player->cash; ?> </h4>
173
                <i class="fa fa-2x fa-bank"></i>
174
                <h4> <?php echo $lang['bank'].': '.$player->bankacc; ?> </h4>
175
                <?php
176 View Code Duplication
                if ($player->arrested == 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
177
                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>".$lang['not'].' '.$lang['arrested'].'</button></h4>';
178
                } else {
179
                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>".$lang['arrested'].'</button></h4>';
180
                }
181
182 View Code Duplication
                if ($player->blacklist == 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
183
                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>".$lang['not'].' '.$lang['blacklisted'].'</button></h4>';
184
                } else {
185
                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>".$lang['blacklisted'].'</button></h4>';
186
                }
187
188
                if ($settings['wanted'] && ($_SESSION['permissions']['view']['wanted'] || $player->playerid == $_SESSION['playerid'])) {
189
                    $sql = "SELECT `active` FROM `wanted` WHERE `wantedID` = '".$player->playerid."'";
190
                    $result_of_query = $db_link->query($sql);
191
                    if ($result_of_query->num_rows > 0) {
192
                        while ($row = mysqli_fetch_assoc($result_of_query)) {
193
                            if ($row['active'] == 1) {
194
                                echo "<h4><a href='".$settings['url'].'editwanted/'.$player->playerid."' class='label label-danger'>".$lang['wanted'].'</span></h4>';
195
                            } else {
196
                                echo "<h4><span class='label label-success'>".$lang['not'].' '.$lang['wanted'].'</span></h4>';
197
                            }
198
                        }
199
                    } else {
200
                        echo "<h4><span class='label label-success'>".$lang['not'].' '.$lang['wanted'].'</span></h4>';
201
                    }
202
                }
203
204
                if ($_SESSION['permissions']['edit']['player']) {
205
                    echo '<a data-toggle="modal" href="#edit_player" class="btn btn-primary btn-xs" style="float: right;">';
206
                    echo '<i class="fa fa-pencil"></i>';
207
                    echo '</a>';
208
                }
209
                echo '</center>'; ?>
210
            </div>
211
        </div>
212
    </div>
213
214
    <!-- Right Container -->
215
    <div class="col-md-9" style="float:right; padding-top:20px;">
216
        <div class="row mtbox">
217
            <div class="col-md-2 col-sm-2 col-md-offset-1 box0">
218
                <div class="box1">
219
                    <span class="fa fa-3x fa-taxi"></span>
220
                    <h3> <?php echo $lang['police'].': '.$player->coplevel; ?> </h3>
221
                </div>
222
            </div>
223
            <div class="col-md-2 col-sm-2 box0">
224
                <div class="box1">
225
                    <span class="fa fa-3x fa-ambulance"></span>
226
                    <h3> <?php echo $lang['medic'].': '.$player->mediclevel; ?> </h3>
227
                </div>
228
            </div>
229
            <div class="col-md-2 col-sm-2 box0">
230
                <div class="box1">
231
                    <span class="fa fa-3x fa-usd"></span>
232
                    <h3> <?php echo $lang['donator'].': '.$player->$settings['donorFormat']; ?> </h3>
233
                </div>
234
            </div>
235
            <div class="col-md-2 col-sm-2 box0">
236
                <div class="box1">
237
                    <span class="fa fa-3x fa-group"></span>
238
                    <h3> <?php echo $lang['admin'].': '.$player->adminlevel; ?> </h3>
239
                </div>
240
            </div>
241
            <?php
242 View Code Duplication
            if ($_SESSION['permissions']['view']['steam'] || $player->playerid == $_SESSION['playerid']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
243
                echo '<div class="col-md-2 col-sm-2 box0">';
244
                echo '<a href="http://steamcommunity.com/profiles/'.$player->playerid.'"';
245
                echo 'target="_blank">';
246
                echo '<div class="box1">';
247
                echo '<span class="fa fa-3x fa-steam"></span>';
248
                echo '<h3>Steam</h3>';
249
                echo '</div>';
250
                echo '</div></a>';
251
            } ?>
252
        </div>
253
254
        <div class="panel panel-default" style="float:left; width:100%; margin:0 auto;">
255
            <ul id="myTab" class="nav nav-tabs">
256
                <li class="dropdown active">
257
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $lang['licenses']; ?> <b
258
                            class="caret"></b></a>
259
                    <ul class="dropdown-menu">
260
                        <li><a href="#civ_lic" data-toggle="tab"><?php echo $lang['civil']; ?></a></li>
261
                        <li><a href="#medic_lic" data-toggle="tab"><?php echo $lang['medic']; ?></a></li>
262
                        <li><a href="#police_lic" data-toggle="tab"><?php echo $lang['police']; ?></a></li>
263
                    </ul>
264
                </li>
265
                <li class="dropdown">
266
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $lang['inventory']; ?> <b
267
                            class="caret"></b></a>
268
                    <ul class="dropdown-menu">
269
                        <li><a href="#civ_inv" data-toggle="tab"><?php echo $lang['civil']; ?></a></li>
270
                        <li><a href="#medic_inv" data-toggle="tab"><?php echo $lang['medic']; ?></a></li>
271
                        <li><a href="#police_inv" data-toggle="tab"><?php echo $lang['police']; ?></a></li>
272
                    </ul>
273
                </li>
274
                <?php
275
                if ($_SESSION['permissions']['edit']['houses']) {
276
                    echo '<li><a href="#house" data-toggle="tab">'.$lang['houses'].'</a></li>';
277
                }
278 View Code Duplication
                if ($_SESSION['permissions']['edit']['vehicles']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
279
                    echo '<li><a href="#veh" data-toggle="tab">'.$lang['vehicles'].'</a></li>';
280
                }
281
                if ($_SESSION['permissions']['edit']['notes']) {
282
                    echo '<li><a href="#notes" data-toggle="tab"> Notes</a></li>';
283
                }
284
                if ($_SESSION['permissions']['view']['wanted'] && $settings['wanted']) {
285
                    echo '<li><a href="#wanted" data-toggle="tab">'.$lang['wanted'].'</a></li>';
286
                } ?>
287
            </ul>
288
            <div class="panel-body">
289
                <div id="myTabContent" class="tab-content">
290
                    <?php if ($_SESSION['permissions']['view']['licences'] || $player->playerid == $_SESSION['playerid']) {
291
                        ?>
292
                        <div class="tab-pane fade in active well" id="civ_lic">
293
                            <?php
294 View Code Duplication
                            if ($player->civ_licenses !== '"[]"' && $player->civ_licenses !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
295
                                echo '<h4 style="centred">'.$lang['civil'].' '.$lang['licenses'].'</h4>';
296
                                $return = stripArray($player->civ_licenses, 0);
297
                                foreach ($return as $value) {
0 ignored issues
show
The expression $return of type array|null is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
298
                                    if (strpos($value, '1') == true) {
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing strpos($value, '1') of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.
Loading history...
299
                                        $name = before(',', $value);
300
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
301
                                    } else {
302
                                        $name = before(',', $value);
303
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
304
                                    }
305
                                }
306
                            } else {
307
                                echo '<h4>'.errorMessage(371, $lang).'</h4>';
308
                            } ?>
309
                        </div>
310
                        <div class="tab-pane well fade" id="medic_lic">
311
                            <?php
312 View Code Duplication
                            if ($player->med_licenses !== '"[]"' && $player->med_licenses !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
313
                                echo '<h4 style="centred">'.$lang['medic'].' '.$lang['licenses'].'</h4>';
314
                                $return = stripArray($player->med_licenses, 0);
315
                                foreach ($return as $value) {
0 ignored issues
show
The expression $return of type array|null is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
316
                                    if (strpos($value, '1') == true) {
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing strpos($value, '1') of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.
Loading history...
317
                                        $name = before(',', $value);
318
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
319
                                    } else {
320
                                        $name = before(',', $value);
321
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
322
                                    }
323
                                }
324
                            } else {
325
                                echo '<h4>'.errorMessage(372, $lang).'</h4>';
326
                            } ?>
327
                        </div>
328
                        <div class="tab-pane well fade" id="police_lic">
329
                            <?php
330 View Code Duplication
                            if ($player->cop_licenses !== '"[]"' && $player->cop_licenses !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
331
                                $return = stripArray($player->cop_licenses, 0);
332
                                echo '<h4 style="centred">'.$lang['cop'].' '.$lang['licenses'].'</h4>';
333
                                foreach ($return as $value) {
0 ignored issues
show
The expression $return of type array|null is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
334
                                    if (strpos($value, '1') == true) {
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing strpos($value, '1') of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.
Loading history...
335
                                        $name = before(',', $value);
336
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
337
                                    } else {
338
                                        $name = before(',', $value);
339
                                        echo "<button type='button' id=".$name." class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license).'</button> ';
340
                                    }
341
                                }
342
                            } else {
343
                                echo '<h4>'.errorMessage(373, $lang).'</h4>';
344
                            } ?>
345
                        </div>
346
                        <?php
347
                    }
348
                    if ($_SESSION['permissions']['edit']['inventory']) {
349
                        ?>
350
                        <div class="tab-pane fade well" id="civ_inv">
351
                            <?php
352 View Code Duplication
                            if ($player->civ_gear !== '"[]"' && $player->civ_gear !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
353
                                echo '<h4 style="centred">'.$lang['civil'].' '.$lang['gear'].'</h4>';
354
                                echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>".$player->civ_gear.'</textarea><br>';
355
356
                                if ($_SESSION['permissions']['edit']['inventory']) {
357
                                    echo '<a data-toggle="modal" href="#edit_civ_inv" class="btn btn-primary btn-xs" style="float: right;">';
358
                                    echo '<i class="fa fa-pencil"></i></a>';
359
                                }
360
                            } else {
361
                                echo '<h4>'.errorMessage(381, $lang).'</h4>';
362
                            } ?>
363
                        </div>
364
                        <div class="tab-pane fade well" id="police_inv">
365
                            <?php
366 View Code Duplication
                            if ($player->cop_gear !== '"[]"' && $player->cop_gear !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
367
                                echo '<h4 style="centred">'.$lang['cop'].' '.$lang['gear'].'</h4>';
368
                                echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='cop_gear' name='cop_gear'>".$player->cop_gear.'</textarea><br>';
369
                                if ($_SESSION['permissions']['edit']['inventory']) {
370
                                    echo '<a data-toggle="modal" href="#edit_cop_inv" class="btn btn-primary btn-xs" style="float: right;">';
371
                                    echo '<i class="fa fa-pencil"></i></a>';
372
                                }
373
                            } else {
374
                                echo '<h4>'.errorMessage(383, $lang).'</h4>';
375
                            } ?>
376
                        </div>
377
                        <div class="tab-pane fade well" id="medic_inv">
378
                            <?php
379 View Code Duplication
                            if ($player->med_gear !== '"[]"' && $player->med_gear !== '') {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
380
                                echo '<h4 style="centred">'.$lang['medic'].' '.$lang['gear'].'</h4>';
381
                                echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='med_gear' name='med_gear'>".$player->med_gear.'</textarea><br>';
382
                                if ($_SESSION['permissions']['edit']['inventory']) {
383
                                    echo '<a data-toggle="modal" href="#edit_med_inv" class="btn btn-primary btn-xs" style="float: right;">';
384
                                    echo '<i class="fa fa-pencil"></i></a>';
385
                                }
386
                            } else {
387
                                echo '<h4>'.errorMessage(382, $lang).'</h4>';
388
                            } ?>
389
                        </div>
390
                        <?php
391
                    }
392
                    if ($_SESSION['permissions']['view']['houses'] || $player->playerid == $_SESSION['playerid']) {
393
                        ?>
394
                        <div class="tab-pane fade" id="house">
395
                            <div class="table-responsive">
396
                                <?php
397
                                $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8";
398
                                $result_of_query = $db_link->query($sql);
399
                                if ($result_of_query->num_rows > 0) {
400
                                    ?>
401
                                    <table class="table table-bordered table-hover table-striped" style="margin-bottom: 0px;">
402
                                        <thead>
403
                                        <tr>
404
                                            <th><?php echo $lang['position']; ?></th>
405
                                            <th><?php echo $lang['edit']; ?></th>
406
                                        </tr>
407
                                        </thead>
408
                                        <tbody>
409
                                        <?php
410 View Code Duplication
                                        while ($row = mysqli_fetch_assoc($result_of_query)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
411
                                            echo '<tr>';
412
                                            echo '<td>'.substr($row['pos'], 1, -1).'</td>';
413
                                            echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url'].'editHouse/'.$row['id']."'>";
414
                                            echo "<i class='fa fa-pencil'></i></a></td>";
415
                                            echo '</tr>';
416
                                        } ?>
417
                                        </tbody>
418
                                    </table>
419
                                    <?php echo '<a style="float: right;" href="'.$settings['url'].'houses/'.$player->playerid.'"><h4>'.$lang['more'].' <i class="fa fa-arrow-circle-right"></i></h4></a>';
420
                                } else {
421
                                    echo '<h4>'.errorMessage(31, $lang).'</h4>';
422
                                } ?>
423
                            </div>
424
                        </div>
425
                        <?php
426
                    }
427
                    if ($_SESSION['permissions']['view']['vehicles'] || $player->playerid == $_SESSION['playerid']) {
428
                        ?>
429
                        <div class="tab-pane fade" id="veh">
430
                            <div class="table-responsive">
431
                                <?php
432
                                $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8";
433
                                $result_of_query = $db_link->query($sql);
434
                                if ($result_of_query->num_rows > 0) {
435
                                    $veh = $result_of_query->fetch_object();
436
                                    echo '<table class="table table-bordered table-hover table-striped" style="margin-bottom: 0px;">';
437
                                    echo '<thead><tr>';
438
                                    echo '<th>'.$lang['class'].'</th>';
439
                                    echo '<th class="hidden-xs">'.$lang['type'].'</th>';
440
                                    echo '<th class="hidden-xs">'.$lang['plate'].'</th>';
441 View Code Duplication
                                    if ($_SESSION['permissions']['edit']['vehicles']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
442
                                        echo '<th>'.$lang['edit'].'</th>';
443
                                    }
444
                                    echo '</tr></thead><tbody';
445
                                    echo '<tr>';
446
                                    echo '<td>'.carName($veh->classname).'</td>';
447
                                    echo '<td class="hidden-xs">'.carType($veh->type, $lang).'</td>';
448
                                    echo '<td class="hidden-xs">'.$veh->plate.'</td>';
449
450
                                    if ($_SESSION['permissions']['edit']['vehicles']) {
451
                                        echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url'].'editVeh/'.$veh->id."'>";
452
                                        echo "<i class='fa fa-pencil'></i></a></td>";
453
                                    }
454
455
                                    while ($row = mysqli_fetch_assoc($result_of_query)) {
456
                                        echo '<tr>';
457
                                        echo '<td>'.carName($row['classname']).'</td>';
458
                                        echo "<td class='hidden-xs'> ".carType($row['type'], $lang).'</td>';
459
                                        echo "<td class='hidden-xs'> ".$row['plate'].'</td>';
460
                                        if ($_SESSION['permissions']['edit']['vehicles']) {
461
                                            echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url'].'editVeh/'.$row['id']."'>";
462
                                            echo "<i class='fa fa-pencil'></i></a></td>";
463
                                        }
464
                                        echo '</tr>';
465
                                    }
466
467
                                    echo '</tr></tbody></table>';
468
                                    echo '<a style="float: right; padding-right:15px;" href="'.$settings['url'].'vehicles/'.$player->playerid.'"><h4>'.$lang['more'].' <i class="fa fa-arrow-circle-right"></i></h4></a>';
469
                                } else {
470
                                    echo '<h4>'.errorMessage(32, $lang).'</h4>';
471
                                } ?>
472
                            </div>
473
                        </div>
474
                        <?php
475
                    }
476
                    if ($_SESSION['permissions']['view']['notes']) {
477
                        ?>
478
                        <div class="tab-pane fade" id="notes">
479
                            <div class="table-responsive">
480
                                <?php
481
                                $sql = 'SELECT * FROM `notes` WHERE `uid` = "'.$uID.'" ORDER BY `note_updated` DESC LIMIT 10';
482
                                $result_of_query = $db_link->query($sql);
483
                                if ($result_of_query->num_rows > 0) {
484
                                    ?>
485
                                    <table class="table table-bordered table-hover table-striped">
486
                                        <thead>
487
                                        <tr>
488
                                            <th><?php echo $lang['owner']; ?></th>
489
                                            <th><?php echo $lang['note']; ?></th>
490
                                        </tr>
491
                                        </thead>
492
                                        <tbody>
493
                                        <?php
494
                                        while ($row = mysqli_fetch_assoc($result_of_query)) {
495
                                            echo '<tr>';
496
                                            echo '<td>'.$row['staff_name'].'</td>';
497
                                            echo '<td>'.$row['note_text'].'</td>';
498
                                            echo '</tr>';
499
                                        } ?>
500
                                        </tbody>
501
                                    </table>
502
                                    <?php
503
                                    if ($_SESSION['permissions']['edit']['notes']) {
504
                                        echo '<a data-toggle="modal" href="#add_note" class="btn btn-primary btn-xs" style="float: right; margin-right:5px; margin-bottom:5px;">
505
                                                    <i class="fa fa-file-o"></i></a>';
506
                                    }
507
                                } else {
508
                                    echo '<h1>'.$lang['noNotes'].'</h1>';
509
                                    if ($_SESSION['permissions']['edit']['notes']) {
510
                                        echo '<a data-toggle="modal" href="#add_note" class="btn btn-primary btn-xs" style="float: right; margin-right:5px; margin-bottom:5px;">
511
                                                    <i class="fa fa-file-o"></i></a>';
512
                                    }
513
                                } ?>
514
                            </div>
515
                        </div>
516
                        <?php
517
                    }
518
                    if ($_SESSION['permissions']['view']['wanted'] && $settings['wanted']) {
519
                        ?>
520
                        <div class="tab-pane fade well" id="wanted">
521
                            <div class="table-responsive">
522
                                <?php
523
                                $sql = "SELECT `wantedCrimes` FROM `wanted` WHERE `wantedID`='".$player->playerid."'";
524
                                $result_of_query = $db_link->query($sql);
525
                                if ($result_of_query->num_rows > 0) {
526
                                    echo '<h3>'.$lang['crimes'].'</h3>';
527
                                    while ($row = mysqli_fetch_assoc($result_of_query)) {
528
                                        if ($row['wantedCrimes'] !== '[]') {
529
                                            $return = stripArray($row['wantedCrimes'], 3);
530
                                            foreach ($return as $value) {
0 ignored issues
show
The expression $return of type array|null is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
531
                                                echo "<button type='button' id=".$value." class='wanted btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".crimeName($value).'</button> ';
532
                                            }
533
                                        } else {
534
                                            echo '<h3>'.errorMessage(34, $lang).'</h3>';
535
                                        }
536
                                    }
537
                                } else {
538
                                    echo '<h3>'.errorMessage(34, $lang).'</h3>';
539
                                } ?>
540
541
                            </div>
542
                        </div>
543
                        <?php
544
                    } ?>
545
546
                </div>
547
            </div>
548
        </div>
549
    </div>
550
551
    <div class="modal fade" id="edit_civ_inv" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
552
         aria-hidden="true">
553
        <div class="modal-dialog">
554
            <div class="modal-content">
555
                <div class="modal-header">
556
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
557
                    <h4 class="modal-title"><i class="fa fa-pencil"></i>
558
                        <?php echo $lang['edit'].' '.$lang['civ'].' '.$lang['inventory']; ?>
559
                    </h4>
560
                </div>
561 View Code Duplication
                <?php if ($_SESSION['permissions']['edit']['inventory']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
562
                    ?>
563
                    <form method="post" action="<?php echo $settings['url'].'editPlayer/'.$uID; ?>" role="form">
564
                        <?php echo formtoken::getField() ?>
565
                        <div class="modal-body">
566
                            <div class="form-group">
567
                                <input type="hidden" name="editType" value="civ_inv"/>
568
569
                                <div class="row">
570
                                <textarea class="form-control" rows="10"
571
                                          name="civ_inv_value"><?php echo $player->civ_gear; ?></textarea>
572
                                </div>
573
                            </div>
574
                        </div>
575
                        <div class="modal-footer">
576
                            <button class="btn btn-default" data-dismiss="modal" type="reset">Close</button>
577
                            <button class="btn btn-primary" type="submit"><?php echo $lang['subChange']; ?></button>
578
                        </div>
579
                    </form>
580
                    <?php
581
                } else {
582
                    errorMessage(5, $lang);
0 ignored issues
show
The call to the function errorMessage() seems unnecessary as the function has no side-effects.
Loading history...
583
                } ?>
584
            </div>
585
        </div>
586
    </div>
587
588
    <div class="modal fade" id="edit_med_inv" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
589
         aria-hidden="true">
590
        <div class="modal-dialog">
591
            <div class="modal-content">
592
                <div class="modal-header">
593
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
594
                    <h4 class="modal-title"><i class="fa fa-pencil"></i>
595
                        <?php echo $lang['edit'].' '.$lang['medic'].' '.$lang['inventory']; ?>
596
                    </h4>
597
                </div>
598 View Code Duplication
                <?php if ($_SESSION['permissions']['edit']['inventory']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
599
                    ?>
600
                    <form method="post" action="<?php echo $settings['url'].'editPlayer/'.$uID; ?>" role="form">
601
                        <?php echo formtoken::getField() ?>
602
                        <div class="modal-body">
603
                            <div class="form-group">
604
                                <input type="hidden" name="editType" value="med_inv"/>
605
606
                                <div class="row">
607
                                <textarea class="form-control" rows="10"
608
                                          name="med_inv_value"><?php echo $player->med_gear; ?></textarea>
609
                                </div>
610
                            </div>
611
                        </div>
612
                        <div class="modal-footer">
613
                            <button class="btn btn-default" data-dismiss="modal" type="reset">Close</button>
614
                            <button class="btn btn-primary" type="submit"><?php echo $lang['subChange']; ?></button>
615
                        </div>
616
                    </form>
617
                    <?php
618
                } else {
619
                    errorMessage(5, $lang);
0 ignored issues
show
The call to the function errorMessage() seems unnecessary as the function has no side-effects.
Loading history...
620
                } ?>
621
            </div>
622
        </div>
623
    </div>
624
625
    <div class="modal fade" id="edit_cop_inv" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
626
         aria-hidden="true">
627
        <div class="modal-dialog">
628
            <div class="modal-content">
629
                <div class="modal-header">
630
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
631
                    <h4 class="modal-title"><i class="fa fa-pencil"></i>
632
                        <?php echo $lang['edit'].' '.$lang['police'].' '.$lang['inventory']; ?>
633
                    </h4>
634
                </div>
635 View Code Duplication
                <?php if ($_SESSION['permissions']['edit']['inventory']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
636
                    ?>
637
                    <form method="post" action="<?php echo $settings['url'].'editPlayer/'.$uID; ?>" role="form">
638
                        <?php echo formtoken::getField() ?>
639
                        <div class="modal-body">
640
                            <div class="form-group">
641
                                <input type="hidden" name="editType" value="cop_inv"/>
642
643
                                <div class="row">
644
                                <textarea class="form-control" rows="10"
645
                                          name="cop_inv_value"><?php echo $player->cop_gear; ?></textarea>
646
                                </div>
647
                            </div>
648
                        </div>
649
                        <div class="modal-footer">
650
                            <button class="btn btn-default" data-dismiss="modal" type="reset">Close</button>
651
                            <button class="btn btn-primary" type="submit"><?php echo $lang['subChange']; ?></button>
652
                        </div>
653
                    </form>
654
                    <?php
655
                } else {
656
                    errorMessage(5, $lang);
0 ignored issues
show
The call to the function errorMessage() seems unnecessary as the function has no side-effects.
Loading history...
657
                } ?>
658
            </div>
659
        </div>
660
    </div>
661
662
    <div class="modal fade" id="add_note" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
663
        <div class="modal-dialog">
664
            <div class="modal-content">
665
                <div class="modal-header">
666
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
667
                    <h4 class="modal-title"><i class="fa fa-pencil"></i>
668
                        <?php echo $lang['new'].' '.$lang['note']; ?>
669
                    </h4>
670
                </div>
671 View Code Duplication
                <?php if ($_SESSION['permissions']['edit']['notes']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
672
                    ?>
673
                    <form method="post" action="<?php echo $settings['url'].'editPlayer/'.$uID; ?>" role="form">
674
                        <div class="modal-body">
675
                            <?php echo formtoken::getField() ?>
676
                            <div class="form-group">
677
                                <input type="hidden" name="editType" value="add_note"/>
678
679
                                <div class="row">
680
                                    <div class="form-group">
681
                                        <textarea class="form-control" rows="8" name="note_text"></textarea>
682
                                    </div>
683
                                </div>
684
                            </div>
685
                        </div>
686
                        <div class="modal-footer">
687
                            <button class="btn btn-default" data-dismiss="modal" type="reset">Close</button>
688
                            <button class="btn btn-primary" type="submit"><?php echo $lang['subChange']; ?></button>
689
                        </div>
690
                    </form>
691
                    <?php
692
                } else {
693
                    errorMessage(5, $lang);
0 ignored issues
show
The call to the function errorMessage() seems unnecessary as the function has no side-effects.
Loading history...
694
                } ?>
695
            </div>
696
        </div>
697
    </div>
698
699
    <div class="modal fade" id="edit_player" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
700
         aria-hidden="true">
701
        <div class="modal-dialog">
702
            <div class="modal-content">
703
                <div class="modal-header">
704
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
705
                    <h4 class="modal-title"><i class="fa fa-pencil"></i>
706
                        <?php echo $lang['edit'].' '.$lang['player']; ?>
707
                    </h4>
708
                </div>
709
                <?php if ($_SESSION['permissions']['edit']['player']) {
710
                    ?>
711
                    <form method="post" action="<?php echo $settings['url'].'editPlayer/'.$uID; ?>" role="form">
712
                        <div class="modal-body">
713
                            <?php echo formtoken::getField() ?>
714
                            <div class="form-group">
715
                                <input type="hidden" name="editType" value="player_edit"/>
716
717
                                <div class="row">
718
                                    <center>
719
                                        <?php if ($_SESSION['permissions']['edit']['bank']) {
720
                                            echo '<h4>'.$lang['cash'].":    <input id='player_cash' name='player_cash' type='number' value='".$player->cash."'>";
721
                                            echo '<h4>'.$lang['bank'].":    <input id='player_bank' name='player_bank' type='number' value='".$player->bankacc."'>";
722
                                        } ?>
723
                                        <?php if ($_SESSION['permissions']['edit']['ranks']) {
724
                                            echo '<h4>'.$lang['cop'].': ';
725
                                            echo "<select id='player_coplvl' name='player_coplvl'>";
726 View Code Duplication
                                            for ($lvl = 0;
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
727
                                                 $lvl <= $settings['maxLevels']['cop'];
728
                                                 ++$lvl) {
729
                                                echo '<option value="'.$lvl.'"'.select($lvl, $player->coplevel).'>'.$lvl.'</option>';
730
                                            }
731
                                            echo '</select>';
732
                                            echo '<h4>'.$lang['medic'].': ';
733
                                            echo "<select id='player_medlvl' name='player_medlvl'>";
734 View Code Duplication
                                            for ($lvl = 0;
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
735
                                                 $lvl <= $settings['maxLevels']['medic'];
736
                                                 ++$lvl) {
737
                                                echo '<option value="'.$lvl.'"'.select($lvl, $player->mediclevel).'>'.$lvl.'</option>';
738
                                            }
739
                                            echo '</select>';
740
741
                                            if ($_SESSION['permissions']['edit']['ignLVL']) {
742
                                                echo '<h4>'.$lang['admin'].': ';
743
                                                echo "<select id='player_adminlvl' name='player_adminlvl'>";
744 View Code Duplication
                                                for ($lvl = 0;
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
745
                                                     $lvl <= $settings['maxLevels']['admin'];
746
                                                     ++$lvl) {
747
                                                    echo '<option value="'.$lvl.'"'.select($lvl, $player->adminlevel).'>'.$lvl.'</option>';
748
                                                }
749
                                                echo '</select>';
750
                                                echo '<h4>'.$lang['donator'].': ';
751
                                                echo "<select id='player_donlvl' name='player_donlvl'>";
752 View Code Duplication
                                                for ($lvl = 0;
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
753
                                                     $lvl <= $settings['maxLevels']['donator'];
754
                                                     ++$lvl) {
755
                                                    echo '<option value="'.$lvl.'"'.select($lvl, $player->$settings['donorFormat']).'>'.$lvl.'</option>';
756
                                                }
757
                                                echo '</select>';
758
                                            }
759
                                        } ?>
760
                                    </center>
761
                                </div>
762
                            </div>
763
                        </div>
764
                        <div class="modal-footer">
765
                            <button class="btn btn-default" data-dismiss="modal" type="reset">Close</button>
766
                            <button class="btn btn-primary" type="submit"><?php echo $lang['subChange']; ?></button>
767
                        </div>
768
                    </form>
769
                    <?php
770
                } else {
771
                    '<h1>'.errorMessage(5, $lang).'/<h1>';
772
                } ?>
773
            </div>
774
        </div>
775
    </div>
776
777
    <script>
778
      $(document).ready(function () {
779 View Code Duplication
          <?php if ($_SESSION['permissions']['edit']['licences']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
780
          ?>
781
        $(".license").click(function () {
782
          $(this).toggleClass('btn-success btn-theme01');
783
          $.post("<?php echo $settings['url'] ?>hooks/license.php", {id: this.id, player: "<?php echo $uID ?>"});
784
        });
785
          <?php
786
          }
787
          if ($_SESSION['permissions']['edit']['player']) {
788
          ?>
789
        $(".arrest").click(function () {
790
          $(this).toggleClass('btn-success btn-theme01');
791
          $.post("<?php echo $settings['url'] ?>hooks/arrest.php", {id: this.id, player: "<?php echo $uID ?>"});
792
        });
793
          <?php
794
          }
795
          if ($_SESSION['permissions']['edit']['wanted']) {
796
          ?>
797
        $(".wanted").click(function () {
798
          $(this).toggleClass('btn-success btn-theme01');
799
          $.post("<?php echo $settings['url'] ?>hooks/wanted.php", {id: this.id, player: "<?php echo $uID ?>"});
800
        });
801
          <?php
802
          }
803
          if (($_SESSION['permissions']['view']['steam'] || $player->playerid == $_SESSION['playerid']) && $settings['vacTest']) {
804
          ?>
805
        $.ajax({
806
          url: "https://steamrep.com/api/beta3/reputation/<?php echo $player->playerid ?>?json=1&extended=1",
807
          dataType: 'json',
808
          success: function (data) {
809
            if (data['steamrep']['vacban'] == "1") {
810
              $('#vacBan').html('<h4><span class="label label-danger" style="margin-left:3px; line-height:2;">VAC BANNED</span></h4>');
811
            }
812
          }
813
        });
814
          <?php
815
          }
816
          if ($_SESSION['permissions']['view']['steam'] && $settings['vacTest']) {
817
          ?>
818
        $.ajax({
819
          url: "http://bans.itsyuka.tk/api/bans/player/id/6e96f18ddaaa2dadcc32482b2d6a0593/format/json/key/<?php echo $settings['communityBansAPI'] ?>",
820
          dataType: 'json',
821
          success: function (data) {
822
            if (data['level'] == '2') {
823
              $('#communityBanned').html('<h4><span class="label label-danger" style="margin-left:3px; line-height:2;">Community Banned</span></h4>');
824
            }
825
          }
826
        });
827
          <?php
828
          } ?>
829
      });
830
    </script>
831
832
    <?php
833
} else {
834
    echo '<h1>'.errorMessage(36, $lang).'</h1>';
835
}
0 ignored issues
show
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
836