root/dev/common/kills.php @ 325

Revision 323, 2.8 KB (checked in by ralle030583, 14 years ago)

- DB Update004 wasn't active
- pageslitter was missing in kills / losses page
- parser fix for german killmails (Allianz : Nichts)
- Update from history.xml for history mod...

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$pagesplitter = new PageSplitter($klist->getCount(), 30);   
73$klist->setPageSplitter($pagesplitter);
74$table = new KillListTable($klist);
75$html .= $table->generate();
76$html .= $pagesplitter->generate();
77
78$page->setContent($html);
79$menubox = new box("Menu");
80$menubox->setIcon("menu-item.gif");
81$menubox->addOption("caption", "Navigation");
82$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear);
83if ($week != kbdate("W"))
84{
85    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
86}
87$page->addContext($menubox->generate());
88
89$tklist = new TopKillsList();
90$tklist->setWeek($week);
91$tklist->setYear($year);
92involved::load($tklist,'kill');
93
94$tklist->generate();
95$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
96$page->addContext($tkbox->generate());
97
98if (config::get('kill_points'))
99{
100    $tklist = new TopScoreList();
101    $tklist->setWeek($week);
102    $tklist->setYear($year);
103    involved::load($tklist,'kill');
104
105    $tklist->generate();
106    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
107    $page->addContext($tkbox->generate());
108}
109
110$page->generate();
111?>
Note: See TracBrowser for help on using the browser.