Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.

Commit 472b659

Browse files
author
Cammygames
committed
Some Small Fixes
1 parent e4e7439 commit 472b659

File tree

3 files changed

+49
-22
lines changed

3 files changed

+49
-22
lines changed

views/editPlayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ class="glyphicon glyphicon-pencil"></span><?php echo " " . $lang['edit'] . " " .
858858
if ($_SESSION['user_level'] >= P_EDIT_ADMINS) {
859859
echo "<h4>" . $lang['admin'] . ": ";
860860
echo "<select id='player_adminlvl' name='player_adminlvl'>";
861-
for ($lvl = 1; $lvl <= lvladmin; $lvl++) {
861+
for ($lvl = 0; $lvl <= lvladmin; $lvl++) {
862862
echo '<option value="' . $lvl . '"' . select($lvl, $row['adminlevel']) . '>' . $lvl . '</option>';
863863
}
864864
echo "</select>";

views/players.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
<?php echo $lang['players']; ?>
4141
<small><?php echo " " . $lang['overview']; ?></small>
4242
</h1>
43-
4443
</div>
4544
</div>
4645
<!-- /.row -->
@@ -54,10 +53,10 @@
5453
<form style="float:right;" method='post' action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"
5554
name='searchPlayer'>
5655
<input id='searchText' type='text' name='searchText'>
57-
<input class='btn btn-sm btn-primary' type='submit' name='pid'
58-
value='<?php echo $lang['search'] . " " . $lang['PID']; ?>'>
5956
<input class='btn btn-sm btn-primary' type='submit' name='name'
6057
value='<?php echo $lang['search'] . " " . $lang['name']; ?>'>
58+
<input class='btn btn-sm btn-primary' type='submit' name='pid'
59+
value='<?php echo $lang['search'] . " " . $lang['PID']; ?>'>
6160
</form>
6261
</div>
6362
</h4>

views/vehicles.php

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,53 @@
9797
$result_of_query = $db_connection->query($sql);
9898
$total_records = mysqli_num_rows($result_of_query);
9999
$total_pages = ceil($total_records / $page_rows);
100-
if ($total_pages > 1) {
101-
echo "<center><a class='btn btn-primary' href='vehicles.php?page=1'>" . $lang['first'] . "</a> ";
102-
?>
103-
<div class="btn-group">
104-
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
105-
<?php echo $lang['page'] . " " ?><span class="caret"></span>
106-
</button>
107-
<ul class="dropdown-menu scrollable-menu" role="menu">
108-
<?php
109-
for ($i = 1; $i <= $total_pages; $i++) {
110-
?>
111-
<li><?php echo "<a href='vehicles.php?page=" . $i . "'>" . $i . "</a> "; ?></li>
112-
<?php }; ?>
113-
</ul>
114-
</div>
100+
if ($total_pages > 1)
101+
{
102+
if (isset($_GET['ID']))
103+
{
104+
$fixingthis = $_GET['ID'];
105+
echo "<center><a class='btn btn-primary' href='vehicles.php?page=1&ID=" . $fixingthis . "'>" . $lang['first'] . "</a> ";
106+
?>
107+
<div class="btn-group">
108+
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
109+
<?php echo $lang['page'] . " " ?><span class="caret"></span>
110+
</button>
111+
112+
<ul class="dropdown-menu scrollable-menu" role="menu">
113+
<?php
114+
for ($i = 1; $i <= $total_pages; $i++) {
115+
?>
116+
<li><?php echo "<a href='vehicles.php?page=" . $i . "&ID=" . $fixingthis . "'>" . $i . "</a> "; ?></li>
117+
<?php }; ?>
118+
</ul>
119+
</div>
120+
121+
<?php
122+
echo "<a class='btn btn-primary' href='vehicles.php?page=$total_pages&ID=" . $fixingthis . "'>" . $lang['last'] . "</a></center>";
123+
}
124+
else
125+
{
126+
echo "<center><a class='btn btn-primary' href='vehicles.php?page=1'>" . $lang['first'] . "</a> ";
127+
?>
128+
<div class="btn-group">
129+
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
130+
<?php echo $lang['page'] . " " ?><span class="caret"></span>
131+
</button>
132+
133+
<ul class="dropdown-menu scrollable-menu" role="menu">
134+
<?php
135+
for ($i = 1; $i <= $total_pages; $i++) {
136+
?>
137+
<li><?php echo "<a href='vehicles.php?page=" . $i . "'>" . $i . "</a> "; ?></li>
138+
<?php }; ?>
139+
</ul>
140+
</div>
115141

116-
<?php
117-
echo "<a class='btn btn-primary' href='vehicles.php?page=$total_pages'>" . $lang['last'] . "</a></center>";
118-
} ?>
142+
<?php
143+
echo "<a class='btn btn-primary' href='vehicles.php?page=$total_pages'>" . $lang['last'] . "</a></center>";
144+
}
145+
}
146+
?>
119147
<br>
120148
</tbody>
121149
</table>

0 commit comments

Comments
 (0)