root/dev/common/kills.php @ 289

Revision 289, 2.6 KB (checked in by exi, 14 years ago)

Added the change from ticket:54 - customizable rowcount on KillSummaryTable?.
Added the change from ticket:55 - ship classes shouldnt wrap anymore.
Added the fix from ticket:56 - proper png output by the signature generator.

Line 
1<?php
2require_once('common/includes/class.corp.php');
3require_once('common/includes/class.alliance.php');
4require_once('common/includes/class.killlist.php');
5require_once('common/includes/class.ship.php');
6require_once('common/includes/class.killlisttable.php');
7require_once('common/includes/class.killsummarytable.public.php');
8require_once('common/includes/class.toplist.php');
9
10$week = $_GET['w'];
11$year = $_GET['y'];
12
13if ($week == '')
14    $week = kbdate('W');
15
16if ($year == '')
17    $year = kbdate('Y');
18
19if ($week == 52)
20{
21    $nweek = 1;
22    $nyear = $year + 1;
23    $pyear = $year - 1;
24}
25else
26{
27    $nweek = $week + 1;
28    $nyear = $year;
29}
30if ($week == 1)
31{
32    $pweek = 52;
33    $pyear = $year - 1;
34}
35else
36{
37    $pweek = $week - 1;
38    $pyear = $year;
39}
40
41$page = new Page("Kills - Week ".$week);
42
43$kslist = new KillList();
44$kslist->setWeek($week);
45$kslist->setYear($year);
46involved::load($kslist,'kill');
47
48if (config::get('public_summarytable')){
49        $summarytable = new KillSummaryTablePublic($kslist);
50}
51else
52{
53        $llist = new KillList();
54        $llist->setWeek($week);
55        $llist->setYear($year);
56        involved::load($llist,'loss');
57        $summarytable = new KillSummaryTable($kslist, $llist);
58}
59$summarytable->setBreak(config::get('summarytable_rowcount'));
60$html .= $summarytable->generate();
61
62$klist = new KillList();
63$klist->setOrdered(true);
64$klist->setWeek($week);
65$klist->setYear($year);
66involved::load($klist,'kill');
67if ($_GET['scl_id'])
68    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
69else
70    $klist->setPodsNoobShips(false);
71
72$table = new KillListTable($klist);
73$html .= $table->generate();
74
75$page->setContent($html);
76$menubox = new box("Menu");
77$menubox->setIcon("menu-item.gif");
78$menubox->addOption("caption", "Navigation");
79$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear);
80if ($week != kbdate("W"))
81{
82    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
83}
84$page->addContext($menubox->generate());
85
86$tklist = new TopKillsList();
87$tklist->setWeek($week);
88$tklist->setYear($year);
89involved::load($tklist,'kill');
90
91$tklist->generate();
92$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
93$page->addContext($tkbox->generate());
94
95if (config::get('kill_points'))
96{
97    $tklist = new TopScoreList();
98    $tklist->setWeek($week);
99    $tklist->setYear($year);
100    involved::load($tklist,'kill');
101
102    $tklist->generate();
103    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
104    $page->addContext($tkbox->generate());
105}
106
107$page->generate();
108?>
Note: See TracBrowser for help on using the browser.