-
Notifications
You must be signed in to change notification settings - Fork 0
/
pro15.php
74 lines (64 loc) · 2.31 KB
/
pro15.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
require_once(dirname(__FILE__) . '/lib/config.php');
require_once(dirname(__FILE__) . '/lib/function.php');
function Html_Body()
{
$pdo = new PDO(MySQL_PDO_Connect(), MySQL_Base::UserName, MySQL_Base::PassWord);
$tmp = menu('pro15', h($_GET['map']));
if(!empty($_GET['map'])) {
$tmp .= ' <table class="table table-condensed table-hover">
<thead><tr><th>#</th><th>Name</th><th>AuthID</th><th>Time</th><th>Date</th><th>Weapon</th></tr></thead>
<tbody>' . "\n";
$sth = $pdo->prepare('SELECT * FROM `' . MySQL_Base::RankPro . '` WHERE ' . MySQL_Column_Pro::MapName . ' = :map ORDER BY ' . MySQL_Column_Pro::Time . ', ' . MySQL_Column_Pro::Name . ' LIMIT 15');
$sth->bindValue(':map', h($_GET['map']), PDO::PARAM_STR);
$sth->execute();
$i = 0;
foreach ($sth->fetchAll() as $key => $a) {
$i++;
if ($i == 1 OR $i == 2 OR $i == 3) {
$r_rank = '<img src="' . MainSetting::CupImages . $i . '.gif">';
} else {
$r_rank = $i;
}
$r_authid = $a[MySQL_Column_Pro::AuthID];
$iMin = floor(floor($a[MySQL_Column_Pro::Time])/60);
$iSec = $a[MySQL_Column_Pro::Time] - (60 * $iMin);
$r_time = sprintf('%02d:%s%.2f', $iMin, $iSec < 10 ? '0': '', $iSec);
$r_name = h($a[MySQL_Column_Pro::Name]);
$r_flag = strtolower(empty($a[MySQL_Column_Pro::Country]) ? 'err' : $a[MySQL_Column_Pro::Country]);
$r_weapon = $a[MySQL_Column_Pro::Weapon];
$r_date = $a[MySQL_Column_Pro::Date];
$tmp .= ' <tr>
<td>' . $r_rank . '</td>
<td><img src="' . MainSetting::FlagImages . $r_flag . '.gif"> <a href="player.php?authid=' . $r_authid . '">' . $r_name . '</a></td>
<td>' . $r_authid . '</td>
<td>' . $r_time . '</td>
<td>' . $r_date . '</td>
<td><img src="' . MainSetting::WeaponImages . $r_weapon . '"></td>
</tr>' . "\n";
}
$pdo = null;
$tmp .= ' </tbody>
</table>' . "\n";
return $tmp;
}
}
?>
<!DOCTYPE html>
<html lang="<?php echo MainSetting::Language ?>">
<head>
<?php echo Html_Header() ?>
</head>
<body>
<?php echo Html_BodyHeader(null) ?>
<div class="container">
<div class="row">
<div class="col-xs-12">
<?php echo Html_Body() ?>
</div>
</div>
</div>
<?php echo Html_BodyFooter() ?>
<?php echo Html_Footer() ?>
</body>
</html>