1<?php
2/**
3 * Kill statistics.
4 *
5 * Prepared by killers.php:
6 * $killersMode 'modern' (TFS 1.x / 0.2 / OTHire), 'legacy' (TFS 0.3), or 'unsupported'
7 * $killers biggest murderers [modern]
8 * $victims biggest victims [modern]
9 * $latests 20 most recent kills [modern]
10 * $deaths 30 most recent deaths [legacy]
11 *
12 * Each of the four is false when there is nothing to show.
13 */
14?>
15
16<div class="znx-acct">
17
18<?php if ($killersMode === 'modern'): ?>
19
20 <div class="znx-acct-head"><?= t('killers.biggest_murders') ?></div>
21 <?php if ($killers): ?>
22 <div class="znx-acct-table-wrap">
23 <table id="killersTable" class="znx-acct-table">
24 <tr class="yellow">
25 <th><?= t('common.name') ?></th>
26 <th><?= t('killers.kills') ?></th>
27 </tr>
28 <?php foreach ($killers as $killer): ?>
29 <tr>
30 <td width="70%">
31 <a href="characterprofile.php?name=<?= urlencode($killer['killed_by']) ?>"><?= htmlspecialchars($killer['killed_by'], ENT_QUOTES, 'UTF-8') ?></a>
32 </td>
33 <td width="30%"><?= (int)$killer['kills'] ?></td>
34 </tr>
35 <?php endforeach; ?>
36 </table>
37 </div>
38 <?php else: ?>
39 <div class="znx-empty-box"><?= t('killers.no_kills') ?></div>
40 <?php endif; ?>
41
42 <div class="znx-acct-head"><?= t('killers.biggest_victims') ?></div>
43 <?php if ($victims): ?>
44 <div class="znx-acct-table-wrap">
45 <table id="victimsTable" class="znx-acct-table">
46 <tr class="yellow">
47 <th><?= t('common.name') ?></th>
48 <th><?= t('killers.deaths') ?></th>
49 </tr>
50 <?php foreach ($victims as $victim): ?>
51 <tr>
52 <td width="70%">
53 <a href="characterprofile.php?name=<?= urlencode($victim['name']) ?>"><?= htmlspecialchars($victim['name'], ENT_QUOTES, 'UTF-8') ?></a>
54 </td>
55 <td width="30%"><?= (int)$victim['Deaths'] ?></td>
56 </tr>
57 <?php endforeach; ?>
58 </table>
59 </div>
60 <?php else: ?>
61 <div class="znx-empty-box"><?= t('killers.no_kills') ?></div>
62 <?php endif; ?>
63
64 <div class="znx-acct-head"><?= t('killers.latest_kills') ?></div>
65 <?php if ($latests): ?>
66 <div class="znx-acct-table-wrap">
67 <table id="killersTable" class="znx-acct-table">
68 <tr class="yellow">
69 <th><?= t('killers.killer') ?></th>
70 <th><?= t('common.time') ?></th>
71 <th><?= t('killers.victim') ?></th>
72 </tr>
73 <?php foreach ($latests as $last): ?>
74 <tr>
75 <td width="35%">
76 <a href="characterprofile.php?name=<?= urlencode($last['killed_by']) ?>"><?= htmlspecialchars($last['killed_by'], ENT_QUOTES, 'UTF-8') ?></a>
77 </td>
78 <td width="30%"><?= htmlspecialchars(getClock($last['time'], true), ENT_QUOTES, 'UTF-8') ?></td>
79 <td width="35%">
80 <a href="characterprofile.php?name=<?= urlencode($last['victim']) ?>"><?= htmlspecialchars($last['victim'], ENT_QUOTES, 'UTF-8') ?></a>
81 </td>
82 </tr>
83 <?php endforeach; ?>
84 </table>
85 </div>
86 <?php else: ?>
87 <div class="znx-empty-box"><?= t('killers.no_kills') ?></div>
88 <?php endif; ?>
89
90<?php elseif ($killersMode === 'legacy'): ?>
91
92 <?php if ($deaths): ?>
93 <div class="znx-acct-head"><?= t('killers.latest') ?></div>
94 <div class="znx-acct-table-wrap">
95 <table id="deathsTable" class="znx-acct-table">
96 <tr class="yellow">
97 <th><?= t('killers.killer') ?></th>
98 <th><?= t('common.time') ?></th>
99 <th><?= t('killers.victim') ?></th>
100 </tr>
101 <?php foreach ($deaths as $death): ?>
102 <tr>
103 <td>
104 <a href="characterprofile.php?name=<?= urlencode($death['killed_by']) ?>"><?= htmlspecialchars($death['killed_by'], ENT_QUOTES, 'UTF-8') ?></a>
105 </td>
106 <td><?= htmlspecialchars(getClock($death['time'], true), ENT_QUOTES, 'UTF-8') ?></td>
107 <td>
108 <?= t('deaths.at_level', ['level' => (int)$death['level']]) ?>
109 <a href="characterprofile.php?name=<?= urlencode($death['victim']) ?>"><?= htmlspecialchars($death['victim'], ENT_QUOTES, 'UTF-8') ?></a>
110 </td>
111 </tr>
112 <?php endforeach; ?>
113 </table>
114 </div>
115 <?php else: ?>
116 <div class="znx-empty-box"><?= t('killers.no_deaths') ?></div>
117 <?php endif; ?>
118
119<?php endif; ?>
120
121</div><!-- .znx-acct -->
122