root/dev/common/kills.php @ 240

Revision 240, 2.5 KB (checked in by ralle030583, 15 years ago)

Implemented exi's involvedloader class

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.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
48$llist = new KillList();
49$llist->setWeek($week);
50$llist->setYear($year);
51involved::load($llist,'loss');
52
53$summarytable = new KillSummaryTable($kslist, $llist);
54$summarytable->setBreak(5);
55$html .= $summarytable->generate();
56
57$klist = new KillList();
58$klist->setOrdered(true);
59$klist->setWeek($week);
60$klist->setYear($year);
61involved::load($klist,'kill');
62if ($_GET['scl_id'])
63    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
64else
65    $klist->setPodsNoobShips(false);
66
67$table = new KillListTable($klist);
68$html .= $table->generate();
69
70$page->setContent($html);
71$menubox = new box("Menu");
72$menubox->setIcon("menu-item.gif");
73$menubox->addOption("caption", "Navigation");
74$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear);
75if ($week != kbdate("W"))
76{
77    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
78}
79$page->addContext($menubox->generate());
80
81$tklist = new TopKillsList();
82$tklist->setWeek($week);
83$tklist->setYear($year);
84involved::load($tklist,'kill');
85
86$tklist->generate();
87$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
88$page->addContext($tkbox->generate());
89
90if (config::get('kill_points'))
91{
92    $tklist = new TopScoreList();
93    $tklist->setWeek($week);
94    $tklist->setYear($year);
95    involved::load($tklist,'kill');
96
97    $tklist->generate();
98    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
99    $page->addContext($tkbox->generate());
100}
101
102$page->generate();
103?>
Note: See TracBrowser for help on using the browser.