1
|
|
|
<?php |
2
|
|
|
if (isset($_GET["page"])) { |
3
|
|
|
$page = $_GET["page"]; |
4
|
|
|
} else { |
5
|
|
|
$page = 1; |
6
|
|
|
} |
7
|
|
|
|
8
|
|
|
$max = ' LIMIT ' . ($page - 1) * $_SESSION['items'] . ',' . $_SESSION['items']; |
9
|
|
|
|
10
|
|
|
if (isset($search)) { |
11
|
|
|
logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['database'], 1); |
12
|
|
|
$sql = "SELECT * FROM `db` WHERE `dbid` LIKE '" . $search . "' OR `type` LIKE '%" . $search . "%';"; //todo: name searching |
|
|
|
|
13
|
|
|
$result_of_query = $db_connection->query($sql); |
14
|
|
|
$total_records = mysqli_num_rows($result_of_query); |
15
|
|
|
$sql = "SELECT * FROM `db` WHERE `dbid` LIKE '" . $search . "' OR `type` LIKE '%" . $search . "%'" . $max . " ;"; |
16
|
|
|
} else { |
17
|
|
|
$sql = "SELECT * FROM `db` " . $max . " ;"; |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
$result_of_query = $db_connection->query($sql); |
21
|
|
|
if ($result_of_query->num_rows > 0) { |
22
|
|
|
?> |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
<div class="row"> |
26
|
|
|
<div class="col-lg-12"> |
27
|
|
|
<h1 class="page-header"> |
28
|
|
|
<?php echo $lang['wantList']; ?> |
29
|
|
|
</h1> |
30
|
|
|
</div> |
31
|
|
|
</div> |
32
|
|
|
|
33
|
|
|
<div class="content-panel"> |
34
|
|
|
<table class="table table-striped table-advance table-hover"> |
35
|
|
|
<h4> |
36
|
|
|
<i class="fa fa-sitemap"></i> |
37
|
|
|
<?php echo " " . $lang['wantList']; ?> |
38
|
|
|
|
39
|
|
|
</h4> |
40
|
|
|
<hr class="hidden-xs"> |
41
|
|
|
<thead> |
42
|
|
|
<tr> |
43
|
|
|
<th class="hidden-xs"><i class="fa fa-eye"></i> <?php echo $lang['id']; ?></th> |
44
|
|
|
<th><i class="fa fa-user"></i> <?php echo $lang['name']; ?></th> |
45
|
|
|
<th><i class="fa fa-user"></i> <?php echo $lang['crimes']; ?></th> |
46
|
|
|
<th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['bounty']; ?></th> |
47
|
|
|
<th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['active']; ?></th> |
48
|
|
|
<th> <?php echo $lang['edit'] ?></th> |
49
|
|
|
</tr> |
50
|
|
|
</thead> |
51
|
|
|
<tbody> |
52
|
|
|
<?php |
53
|
|
|
while ($row = mysqli_fetch_assoc($result_of_query)) { |
54
|
|
|
echo "<tr>"; |
55
|
|
|
echo "<td class='hidden-xs'>" . $row["wantedID"] . "</td>"; |
56
|
|
|
echo "<td>" . $row["wantedName"] . "</td>"; |
57
|
|
|
echo "<td class='hidden-xs'>" . $row["wantedBounty"] . "</td>"; |
58
|
|
|
echo "<td class='hidden-xs'>" . yesNo($row["active"], $lang) . "</td>"; |
59
|
|
|
echo "<td><a class='btn btn-primary btn-xs' href='editWanted/" . $row["wantedID"] . "'>"; |
60
|
|
|
echo "<i class='fa fa-pencil'></i></a></td>"; |
61
|
|
|
echo "</tr>"; |
62
|
|
|
}; |
63
|
|
|
echo "</tbody></table>"; |
64
|
|
|
?> |
65
|
|
|
</tbody> |
66
|
|
|
<br> |
67
|
|
|
</table> |
68
|
|
|
</div> |
69
|
|
|
</div> |
70
|
|
|
<?php |
71
|
|
|
} else echo errorMessage(3, $lang); |