1 | <?php |
---|
2 | require_once('common/includes/class.corp.php'); |
---|
3 | require_once('common/includes/class.alliance.php'); |
---|
4 | require_once('common/includes/class.killlist.php'); |
---|
5 | require_once('common/includes/class.killlisttable.php'); |
---|
6 | require_once('common/includes/class.killsummarytable.php'); |
---|
7 | require_once('common/includes/class.toplist.php'); |
---|
8 | |
---|
9 | if (!$all_id = intval($_GET['all_id'])) |
---|
10 | { |
---|
11 | if (ALLIANCE_ID) |
---|
12 | { |
---|
13 | $all_id = ALLIANCE_ID; |
---|
14 | } |
---|
15 | else |
---|
16 | { |
---|
17 | echo 'no valid alliance id specified<br/>'; |
---|
18 | return; |
---|
19 | } |
---|
20 | } |
---|
21 | $alliance = new Alliance($all_id); |
---|
22 | $page = new Page('Alliance details - '.$alliance->getName()); |
---|
23 | |
---|
24 | $html .= "<table class=kb-table width=\"100%\" border=\"0\" cellspacing=1><tr class=kb-table-row-even><td rowspan=8 width=128 align=center bgcolor=black>"; |
---|
25 | |
---|
26 | if (file_exists("img/alliances/".$alliance->getUnique().".png")) |
---|
27 | { |
---|
28 | $html .= "<img src=\"".IMG_URL."/alliances/".$alliance->getUnique().".png\" border=\"0\"></td>"; |
---|
29 | } |
---|
30 | else |
---|
31 | { |
---|
32 | $html .= "<img src=\"".IMG_URL."/alliances/default.gif\" border=\"0\"></td>"; |
---|
33 | } |
---|
34 | $kill_summary = new KillSummaryTable(); |
---|
35 | $kill_summary->addInvolvedAlliance($alliance); |
---|
36 | $kill_summary->setBreak(config::get('summarytable_rowcount')); |
---|
37 | $summary_html = $kill_summary->generate(); |
---|
38 | |
---|
39 | $html .= "<td class=kb-table-cell width=180><b>Kills:</b></td><td class=kl-kill>".$kill_summary->getTotalKills()."</td></tr>"; |
---|
40 | $html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Losses:</b></td><td class=kl-loss>".$kill_summary->getTotalLosses()."</td></tr>"; |
---|
41 | $html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Damage done (ISK):</b></td><td class=kl-kill>".round($kill_summary->getTotalKillISK()/1000000, 2)."M</td></tr>"; |
---|
42 | $html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Damage received (ISK):</b></td><td class=kl-loss>".round($kill_summary->getTotalLossISK()/1000000, 2)."M</td></tr>"; |
---|
43 | if ($kill_summary->getTotalKillISK()) |
---|
44 | { |
---|
45 | $efficiency = round($kill_summary->getTotalKillISK() / ($kill_summary->getTotalKillISK() + $kill_summary->getTotalLossISK()) * 100, 2); |
---|
46 | } |
---|
47 | else |
---|
48 | { |
---|
49 | $efficiency = 0; |
---|
50 | } |
---|
51 | |
---|
52 | $html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Efficiency:</b></td><td class=kb-table-cell><b>" . $efficiency . "%</b></td></tr>"; |
---|
53 | |
---|
54 | $html .= "</table>"; |
---|
55 | $html .= "<br/>"; |
---|
56 | |
---|
57 | if ($_GET['view'] == "" || $_GET['view'] == "kills" || $_GET['view'] == "losses") |
---|
58 | { |
---|
59 | $html .= $summary_html; |
---|
60 | } |
---|
61 | |
---|
62 | switch ($_GET['view']) |
---|
63 | { |
---|
64 | case "": |
---|
65 | $html .= "<div class=kb-kills-header>10 Most recent kills</div>"; |
---|
66 | |
---|
67 | $list = new KillList(); |
---|
68 | $list->setOrdered(true); |
---|
69 | $list->setLimit(10); |
---|
70 | $list->setPodsNoobships(true); |
---|
71 | $list->addInvolvedAlliance($alliance); |
---|
72 | if ($_GET['scl_id']) |
---|
73 | $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); |
---|
74 | |
---|
75 | $ktab = new KillListTable($list); |
---|
76 | $ktab->setLimit(10); |
---|
77 | $ktab->setDayBreak(false); |
---|
78 | $html .= $ktab->generate(); |
---|
79 | |
---|
80 | $html .= "<div class=kb-losses-header>10 Most recent losses</div>"; |
---|
81 | |
---|
82 | $list = new KillList(); |
---|
83 | $list->setOrdered(true); |
---|
84 | $list->setLimit(10); |
---|
85 | $list->setPodsNoobships(true); |
---|
86 | $list->addVictimAlliance($alliance); |
---|
87 | if ($_GET['scl_id']) |
---|
88 | $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); |
---|
89 | |
---|
90 | $ltab = new KillListTable($list); |
---|
91 | $ltab->setLimit(10); |
---|
92 | $ltab->setDayBreak(false); |
---|
93 | $html .= $ltab->generate(); |
---|
94 | |
---|
95 | break; |
---|
96 | case "kills": |
---|
97 | $html .= "<div class=kb-kills-header>All kills</div>"; |
---|
98 | |
---|
99 | $list = new KillList(); |
---|
100 | $list->setOrdered(true); |
---|
101 | $list->addInvolvedAlliance($alliance); |
---|
102 | if ($_GET['scl_id']) |
---|
103 | $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); |
---|
104 | $pagesplitter = new PageSplitter($list->getCount(), 30); |
---|
105 | $list->setPageSplitter($pagesplitter); |
---|
106 | $table = new KillListTable($list); |
---|
107 | $table->setDayBreak(false); |
---|
108 | $html .= $table->generate(); |
---|
109 | $html .= $pagesplitter->generate(); |
---|
110 | |
---|
111 | break; |
---|
112 | case "losses": |
---|
113 | $html .= "<div class=kb-losses-header>All losses</div>"; |
---|
114 | |
---|
115 | $list = new KillList(); |
---|
116 | $list->setOrdered(true); |
---|
117 | $list->setPodsNoobships(true); |
---|
118 | $list->addVictimAlliance($alliance); |
---|
119 | if ($_GET['scl_id']) |
---|
120 | $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); |
---|
121 | $pagesplitter = new PageSplitter($list->getCount(), 30); |
---|
122 | $list->setPageSplitter($pagesplitter); |
---|
123 | |
---|
124 | $table = new KillListTable($list); |
---|
125 | $table->setDayBreak(false); |
---|
126 | $html .= $table->generate(); |
---|
127 | $html .= $pagesplitter->generate(); |
---|
128 | |
---|
129 | break; |
---|
130 | case "corp_kills": |
---|
131 | $html .= "<div class=block-header2>Top killers</div>"; |
---|
132 | |
---|
133 | $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; |
---|
134 | $html .= "<div class=block-header>This month</div>"; |
---|
135 | |
---|
136 | $list = new TopCorpKillsList(); |
---|
137 | $list->addInvolvedAlliance($alliance); |
---|
138 | $list->setPodsNoobShips(false); |
---|
139 | $list->setMonth(kbdate("m")); |
---|
140 | $list->setYear(kbdate("Y")); |
---|
141 | $table = new TopCorpTable($list, "Kills"); |
---|
142 | $html .= $table->generate(); |
---|
143 | |
---|
144 | $html .= "</td><td valign=top width=400>"; |
---|
145 | $html .= "<div class=block-header>All time</div>"; |
---|
146 | |
---|
147 | $list = new TopCorpKillsList(); |
---|
148 | $list->addInvolvedAlliance($alliance); |
---|
149 | $list->setPodsNoobShips(false); |
---|
150 | $table = new TopCorpTable($list, "Kills"); |
---|
151 | $html .= $table->generate(); |
---|
152 | |
---|
153 | $html .= "</td></tr></table>"; |
---|
154 | |
---|
155 | break; |
---|
156 | case "corp_kills_class": |
---|
157 | $html .= "<div class=block-header2>Destroyed ships</div>"; |
---|
158 | |
---|
159 | // Get all ShipClasses |
---|
160 | $sql = "select scl_id, scl_class from kb3_ship_classes |
---|
161 | where scl_class not in ('Drone','Unknown') order by scl_class"; |
---|
162 | |
---|
163 | $qry = new DBQuery(); |
---|
164 | $qry->execute($sql); |
---|
165 | while ($row = $qry->getRow()) |
---|
166 | { |
---|
167 | $shipclass[] = new Shipclass($row['scl_id']); |
---|
168 | } |
---|
169 | $html .= "<table class=kb-subtable>"; |
---|
170 | $html .= "<tr>"; |
---|
171 | $newrow = true; |
---|
172 | |
---|
173 | foreach ($shipclass as $shp){ |
---|
174 | if ($newrow){ |
---|
175 | $html .= '</tr><tr>'; |
---|
176 | } |
---|
177 | $list = new TopCorpKillsList(); |
---|
178 | $list->addInvolvedAlliance($alliance); |
---|
179 | $list->addVictimShipClass($shp); |
---|
180 | $table = new TopCorpTable($list, "Kills"); |
---|
181 | $content = $table->generate(); |
---|
182 | if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>'){ |
---|
183 | $html .= "<td valign=top width=440>"; |
---|
184 | $html .= "<div class=block-header>".$shp->getName()."</div>"; |
---|
185 | $html .= $content; |
---|
186 | $html .= "</td>"; |
---|
187 | $newrow = !$newrow; |
---|
188 | } |
---|
189 | |
---|
190 | } |
---|
191 | $html .= "</tr></table>"; |
---|
192 | |
---|
193 | break; |
---|
194 | case "kills_class": |
---|
195 | $html .= "<div class=block-header2>Destroyed ships</div>"; |
---|
196 | |
---|
197 | // Get all ShipClasses |
---|
198 | $sql = "select scl_id, scl_class from kb3_ship_classes |
---|
199 | where scl_class not in ('Drone','Unknown') order by scl_class"; |
---|
200 | |
---|
201 | $qry = new DBQuery(); |
---|
202 | $qry->execute($sql); |
---|
203 | while ($row = $qry->getRow()) |
---|
204 | { |
---|
205 | $shipclass[] = new Shipclass($row['scl_id']); |
---|
206 | } |
---|
207 | $html .= "<table class=kb-subtable>"; |
---|
208 | $html .= "<tr>"; |
---|
209 | $newrow = true; |
---|
210 | |
---|
211 | foreach ($shipclass as $shp){ |
---|
212 | if ($newrow){ |
---|
213 | $html .= '</tr><tr>'; |
---|
214 | } |
---|
215 | $list = new TopKillsList(); |
---|
216 | $list->addInvolvedAlliance($alliance); |
---|
217 | $list->addVictimShipClass($shp); |
---|
218 | $table = new TopPilotTable($list, "Kills"); |
---|
219 | $content = $table->generate(); |
---|
220 | if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>'){ |
---|
221 | $html .= "<td valign=top width=440>"; |
---|
222 | $html .= "<div class=block-header>".$shp->getName()."</div>"; |
---|
223 | $html .= $content; |
---|
224 | $html .= "</td>"; |
---|
225 | $newrow = !$newrow; |
---|
226 | } |
---|
227 | |
---|
228 | } |
---|
229 | $html .= "</tr></table>"; |
---|
230 | |
---|
231 | break; |
---|
232 | case "corp_losses_class": |
---|
233 | $html .= "<div class=block-header2>Lost ships</div>"; |
---|
234 | |
---|
235 | // Get all ShipClasses |
---|
236 | $sql = "select scl_id, scl_class from kb3_ship_classes |
---|
237 | where scl_class not in ('Drone','Unknown') order by scl_class"; |
---|
238 | |
---|
239 | $qry = new DBQuery(); |
---|
240 | $qry->execute($sql); |
---|
241 | while ($row = $qry->getRow()) |
---|
242 | { |
---|
243 | $shipclass[] = new Shipclass($row['scl_id']); |
---|
244 | } |
---|
245 | $html .= "<table class=kb-subtable>"; |
---|
246 | $html .= "<tr>"; |
---|
247 | $newrow = true; |
---|
248 | |
---|
249 | foreach ($shipclass as $shp){ |
---|
250 | if ($newrow){ |
---|
251 | $html .= '</tr><tr>'; |
---|
252 | } |
---|
253 | $list = new TopCorpLossesList(); |
---|
254 | $list->addVictimAlliance($alliance); |
---|
255 | $list->addVictimShipClass($shp); |
---|
256 | $table = new TopCorpTable($list, "Losses"); |
---|
257 | $content = $table->generate(); |
---|
258 | if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>'){ |
---|
259 | $html .= "<td valign=top width=440>"; |
---|
260 | $html .= "<div class=block-header>".$shp->getName()."</div>"; |
---|
261 | $html .= $content; |
---|
262 | $html .= "</td>"; |
---|
263 | $newrow = !$newrow; |
---|
264 | } |
---|
265 | } |
---|
266 | $html .= "</tr></table>"; |
---|
267 | |
---|
268 | break; |
---|
269 | case "losses_class": |
---|
270 | $html .= "<div class=block-header2>Lost ships</div>"; |
---|
271 | |
---|
272 | // Get all ShipClasses |
---|
273 | $sql = "select scl_id, scl_class from kb3_ship_classes |
---|
274 | where scl_class not in ('Drone','Unknown') order by scl_class"; |
---|
275 | |
---|
276 | $qry = new DBQuery(); |
---|
277 | $qry->execute($sql); |
---|
278 | while ($row = $qry->getRow()) |
---|
279 | { |
---|
280 | $shipclass[] = new Shipclass($row['scl_id']); |
---|
281 | } |
---|
282 | $html .= "<table class=kb-subtable>"; |
---|
283 | $html .= "<tr>"; |
---|
284 | $newrow = true; |
---|
285 | |
---|
286 | foreach ($shipclass as $shp){ |
---|
287 | if ($newrow){ |
---|
288 | $html .= '</tr><tr>'; |
---|
289 | } |
---|
290 | $list = new TopLossesList(); |
---|
291 | $list->addVictimAlliance($alliance); |
---|
292 | $list->addVictimShipClass($shp); |
---|
293 | $table = new TopPilotTable($list, "Losses"); |
---|
294 | $content = $table->generate(); |
---|
295 | if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>'){ |
---|
296 | $html .= "<td valign=top width=440>"; |
---|
297 | $html .= "<div class=block-header>".$shp->getName()."</div>"; |
---|
298 | $html .= $content; |
---|
299 | $html .= "</td>"; |
---|
300 | $newrow = !$newrow; |
---|
301 | } |
---|
302 | } |
---|
303 | $html .= "</tr></table>"; |
---|
304 | |
---|
305 | break; |
---|
306 | case "corp_losses": |
---|
307 | $html .= "<div class=block-header2>Top losers</div>"; |
---|
308 | |
---|
309 | $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; |
---|
310 | $html .= "<div class=block-header>This month</div>"; |
---|
311 | |
---|
312 | $list = new TopCorpLossesList(); |
---|
313 | $list->addVictimAlliance($alliance); |
---|
314 | $list->setPodsNoobShips(false); |
---|
315 | $list->setMonth(kbdate("m")); |
---|
316 | $list->setYear(kbdate("Y")); |
---|
317 | $table = new TopCorpTable($list, "Losses"); |
---|
318 | $html .= $table->generate(); |
---|
319 | |
---|
320 | $html .= "</td><td valign=top width=400>"; |
---|
321 | $html .= "<div class=block-header>All time</div>"; |
---|
322 | |
---|
323 | $list = new TopCorpLossesList(); |
---|
324 | $list->addVictimAlliance($alliance); |
---|
325 | $list->setPodsNoobShips(false); |
---|
326 | $table = new TopCorpTable($list, "Losses"); |
---|
327 | $html .= $table->generate(); |
---|
328 | |
---|
329 | $html .= "</td></tr></table>"; |
---|
330 | |
---|
331 | break; |
---|
332 | case "pilot_kills": |
---|
333 | $html .= "<div class=block-header2>Top killers</div>"; |
---|
334 | |
---|
335 | $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; |
---|
336 | $html .= "<div class=block-header>This month</div>"; |
---|
337 | |
---|
338 | $list = new TopKillsList(); |
---|
339 | $list->addInvolvedAlliance($alliance); |
---|
340 | $list->setPodsNoobShips(false); |
---|
341 | $list->setMonth(kbdate("m")); |
---|
342 | $list->setYear(kbdate("Y")); |
---|
343 | $table = new TopPilotTable($list, "Kills"); |
---|
344 | $html .= $table->generate(); |
---|
345 | |
---|
346 | $html .= "</td><td valign=top width=400>"; |
---|
347 | $html .= "<div class=block-header>All time</div>"; |
---|
348 | |
---|
349 | $list = new TopKillsList(); |
---|
350 | $list->addInvolvedAlliance($alliance); |
---|
351 | $list->setPodsNoobShips(false); |
---|
352 | $table = new TopPilotTable($list, "Kills"); |
---|
353 | $html .= $table->generate(); |
---|
354 | |
---|
355 | $html .= "</td></tr></table>"; |
---|
356 | |
---|
357 | break; |
---|
358 | case "pilot_scores": |
---|
359 | $html .= "<div class=block-header2>Top scorers</div>"; |
---|
360 | |
---|
361 | $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; |
---|
362 | $html .= "<div class=block-header>This month</div>"; |
---|
363 | |
---|
364 | $list = new TopScoreList(); |
---|
365 | $list->addInvolvedAlliance($alliance); |
---|
366 | $list->setPodsNoobShips(true); |
---|
367 | $list->setMonth(kbdate("m")); |
---|
368 | $list->setYear(kbdate("Y")); |
---|
369 | $table = new TopPilotTable($list, "Points"); |
---|
370 | $html .= $table->generate(); |
---|
371 | |
---|
372 | $html .= "</td><td valign=top width=400>"; |
---|
373 | $html .= "<div class=block-header>All time</div>"; |
---|
374 | |
---|
375 | $list = new TopScoreList(); |
---|
376 | $list->addInvolvedAlliance($alliance); |
---|
377 | $list->setPodsNoobShips(true); |
---|
378 | $table = new TopPilotTable($list, "Points"); |
---|
379 | $html .= $table->generate(); |
---|
380 | |
---|
381 | $html .= "</td></tr></table>"; |
---|
382 | |
---|
383 | break; |
---|
384 | case "pilot_losses": |
---|
385 | $html .= "<div class=block-header2>Top losers</div>"; |
---|
386 | |
---|
387 | $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; |
---|
388 | $html .= "<div class=block-header>This month</div>"; |
---|
389 | |
---|
390 | $list = new TopLossesList(); |
---|
391 | $list->addVictimAlliance($alliance); |
---|
392 | $list->setPodsNoobShips(false); |
---|
393 | $list->setMonth(kbdate("m")); |
---|
394 | $list->setYear(kbdate("Y")); |
---|
395 | $table = new TopPilotTable($list, "Losses"); |
---|
396 | $html .= $table->generate(); |
---|
397 | |
---|
398 | $html .= "</td><td valign=top width=400>"; |
---|
399 | $html .= "<div class=block-header>All time</div>"; |
---|
400 | |
---|
401 | $list = new TopLossesList(); |
---|
402 | $list->addVictimAlliance($alliance); |
---|
403 | $list->setPodsNoobShips(false); |
---|
404 | $table = new TopPilotTable($list, "Losses"); |
---|
405 | $html .= $table->generate(); |
---|
406 | |
---|
407 | $html .= "</td></tr></table>"; |
---|
408 | |
---|
409 | break; |
---|
410 | case "ships_weapons": |
---|
411 | $html .= "<div class=block-header2>Ships & weapons used</div>"; |
---|
412 | |
---|
413 | $html .= "<table class=kb-subtable><tr><td valign=top width=400>"; |
---|
414 | $shiplist = new TopShipList(); |
---|
415 | $shiplist->addInvolvedAlliance($alliance); |
---|
416 | $shiplisttable = new TopShipListTable($shiplist); |
---|
417 | $html .= $shiplisttable->generate(); |
---|
418 | $html .= "</td><td valign=top align=right width=400>"; |
---|
419 | |
---|
420 | $weaponlist = new TopWeaponList(); |
---|
421 | $weaponlist->addInvolvedAlliance($alliance); |
---|
422 | $weaponlisttable = new TopWeaponListTable($weaponlist); |
---|
423 | $html .= $weaponlisttable->generate(); |
---|
424 | $html .= "</td></tr></table>"; |
---|
425 | |
---|
426 | break; |
---|
427 | case 'violent_systems': |
---|
428 | $html .= "<div class=block-header2>Most violent systems</div>"; |
---|
429 | $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; |
---|
430 | |
---|
431 | $html .= "<div class=block-header>This month</div>"; |
---|
432 | $html .= "<table class=kb-table>"; |
---|
433 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center >Kills</td></tr>"; |
---|
434 | |
---|
435 | $sql = "select sys.sys_name, sys.sys_sec, sys.sys_id, count(distinct kll.kll_id) as kills |
---|
436 | from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv |
---|
437 | where kll.kll_system_id = sys.sys_id |
---|
438 | and inv.ind_kll_id = kll.kll_id"; |
---|
439 | |
---|
440 | if ($crp_id) |
---|
441 | $sql .= " and inv.ind_crp_id in (".$crp_id.")"; |
---|
442 | if ($all_id) |
---|
443 | $sql .= " and inv.ind_all_id = ".$all_id; |
---|
444 | |
---|
445 | $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".kbdate("m")." |
---|
446 | and date_format( kll.kll_timestamp, \"%Y\" ) = ".kbdate("Y")." |
---|
447 | group by sys.sys_name |
---|
448 | order by kills desc |
---|
449 | limit 25"; |
---|
450 | |
---|
451 | $qry = new DBQuery(); |
---|
452 | $qry->execute($sql); |
---|
453 | $odd = false; |
---|
454 | $counter = 1; |
---|
455 | while ($row = $qry->getRow()) |
---|
456 | { |
---|
457 | if (!$odd) |
---|
458 | { |
---|
459 | $odd = true; |
---|
460 | $rowclass = 'kb-table-row-odd'; |
---|
461 | } |
---|
462 | else |
---|
463 | { |
---|
464 | $odd = false; |
---|
465 | $rowclass = 'kb-table-row-even'; |
---|
466 | } |
---|
467 | |
---|
468 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; |
---|
469 | $counter++; |
---|
470 | } |
---|
471 | |
---|
472 | $html .= "</table>"; |
---|
473 | |
---|
474 | $html .= "</td><td align=center valign=top>"; |
---|
475 | $html .= "<div class=block-header>All-Time</div>"; |
---|
476 | $html .= "<table class=kb-table>"; |
---|
477 | $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center>Kills</td></tr>"; |
---|
478 | |
---|
479 | $sql = "select sys.sys_name, sys.sys_id, sys.sys_sec, count(distinct kll.kll_id) as kills |
---|
480 | from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv |
---|
481 | where kll.kll_system_id = sys.sys_id |
---|
482 | and inv.ind_kll_id = kll.kll_id"; |
---|
483 | |
---|
484 | if ($crp_id) |
---|
485 | $sql .= " and inv.ind_crp_id in (".$crp_id.")"; |
---|
486 | if ($all_id) |
---|
487 | $sql .= " and inv.ind_all_id = ".$all_id; |
---|
488 | |
---|
489 | $sql .= " group by sys.sys_name |
---|
490 | order by kills desc |
---|
491 | limit 25"; |
---|
492 | |
---|
493 | $qry = new DBQuery(); |
---|
494 | $qry->execute($sql); |
---|
495 | $odd = false; |
---|
496 | $counter = 1; |
---|
497 | while ($row = $qry->getRow()) |
---|
498 | { |
---|
499 | if (!$odd) |
---|
500 | { |
---|
501 | $odd = true; |
---|
502 | $rowclass = 'kb-table-row-odd'; |
---|
503 | } |
---|
504 | else |
---|
505 | { |
---|
506 | $odd = false; |
---|
507 | $rowclass = 'kb-table-row-even'; |
---|
508 | } |
---|
509 | |
---|
510 | $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; |
---|
511 | $counter++; |
---|
512 | } |
---|
513 | $html .= "</table>"; |
---|
514 | $html .= "</td></tr></table>"; |
---|
515 | break; |
---|
516 | } |
---|
517 | |
---|
518 | $menubox = new Box("Menu"); |
---|
519 | $menubox->setIcon("menu-item.gif"); |
---|
520 | $menubox->addOption("caption","Kills & losses"); |
---|
521 | $menubox->addOption("link","Recent activity", "?a=alliance_detail&all_id=" . $alliance->getID()); |
---|
522 | $menubox->addOption("link","Kills", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=kills"); |
---|
523 | $menubox->addOption("link","Losses", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=losses"); |
---|
524 | $menubox->addOption("caption","Corp statistics"); |
---|
525 | $menubox->addOption("link","Top killers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=corp_kills"); |
---|
526 | $menubox->addOption("link","Top losers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=corp_losses"); |
---|
527 | $menubox->addOption("link","Destroyed ships", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=corp_kills_class"); |
---|
528 | $menubox->addOption("link","Lost ships", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=corp_losses_class"); |
---|
529 | $menubox->addOption("caption","Pilot statistics"); |
---|
530 | $menubox->addOption("link","Top killers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=pilot_kills"); |
---|
531 | if (config::get('kill_points')) |
---|
532 | { |
---|
533 | $menubox->addOption('link', "Top scorers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=pilot_scores"); |
---|
534 | } |
---|
535 | $menubox->addOption("link","Top losers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=pilot_losses"); |
---|
536 | $menubox->addOption("link","Destroyed ships", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=kills_class"); |
---|
537 | $menubox->addOption("link","Lost ships", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=losses_class"); |
---|
538 | $menubox->addOption("caption","Global statistics"); |
---|
539 | $menubox->addOption("link","Ships & weapons", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=ships_weapons"); |
---|
540 | $menubox->addOption("link","Most violent systems", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=violent_systems"); |
---|
541 | $page->addContext($menubox->generate()); |
---|
542 | |
---|
543 | $page->setContent($html); |
---|
544 | $page->generate(); |
---|
545 | ?> |
---|