-
Notifications
You must be signed in to change notification settings - Fork 8
/
criminal.php
46 lines (45 loc) · 1.26 KB
/
criminal.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
declare(strict_types=1);
/**
* MCCodes v2 by Dabomstew & ColdBlooded
*
* Repository: https://github.com/davemacaulay/mccodesv2
* License: MIT License
*/
$macropage = 'criminal.php';
global $db, $ir, $h;
require_once('globals.php');
if ($ir['jail'] || $ir['hospital'])
{
die('This page cannot be accessed while in jail or hospital.');
}
$crimes = [];
$q2 =
$db->query(
'SELECT `crimeGROUP`, `crimeNAME`, `crimeBRAVE`, `crimeID`
FROM `crimes`
ORDER BY `crimeBRAVE` ASC');
while ($r2 = $db->fetch_row($q2))
{
$crimes[] = $r2;
}
$db->free_result($q2);
$q =
$db->query(
'SELECT `cgID`, `cgNAME` FROM `crimegroups` ORDER BY `cgORDER` ASC');
echo "<h3>Criminal Centre</h3><br />
<table width='75%' cellspacing='1' class='table'><tr><th>Crime</th><th>Cost</th><th>Do</th></tr>";
while ($r = $db->fetch_row($q))
{
echo "<tr><td colspan='3' class='h'>{$r['cgNAME']}</td></tr>";
foreach ($crimes as $v)
{
if ($v['crimeGROUP'] == $r['cgID'])
{
echo "<tr><td>{$v['crimeNAME']}</td><td>{$v['crimeBRAVE']} Brave</td><td><a href='docrime.php?c={$v['crimeID']}'>Do</a></td></tr>";
}
}
}
$db->free_result($q);
echo '</table>';
$h->endpage();