root/dev/common/losses.php @ 323

Revision 323, 2.6 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.killlisttable.php');
6require_once('common/includes/class.killsummarytable.php');
7require_once('common/includes/class.toplist.php');
8
9if (config::get('public_losses')){
10        die('Forbidden');
11}
12
13$week = $_GET['w'];
14$year = $_GET['y'];
15
16if ($week == '')
17    $week = kbdate('W');
18
19if ($year == '')
20    $year = kbdate('Y');
21
22if ($week == 52)
23{
24    $nweek = 1;
25    $nyear = $year + 1;
26}
27else
28{
29    $nweek = $week + 1;
30    $nyear = $year;
31}
32if ($week == "1")
33{
34    $pweek = 52;
35    $pyear = $year - 1;
36}
37else
38{
39    $pweek = $week - 1;
40    $pyear = $year;
41}
42
43$page = new Page("Losses - Week ".$week);
44
45$klist = new KillList();
46$klist->setWeek($week);
47$klist->setYear($year);
48involved::load($klist,'kill');
49
50$lslist = new KillList();
51$lslist->setWeek($week);
52$lslist->setYear($year);
53involved::load($lslist,'loss');
54
55$summarytable = new KillSummaryTable($klist, $lslist);
56$summarytable->setBreak(config::get('summarytable_rowcount'));
57$html .= $summarytable->generate();
58// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>";
59// if ( $week != kbdate( "W" ) )
60// $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]";
61// $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>";
62$llist = new KillList();
63$llist->setOrdered(true);
64$llist->setWeek($week);
65$llist->setYear($year);
66involved::load($llist,'loss');
67if ($_GET['scl_id'])
68    $llist->addVictimShipClass(new ShipClass($_GET['scl_id']));
69else
70    $llist->setPodsNoobShips(false);
71
72$pagesplitter = new PageSplitter($llist->getCount(), 30);   
73$llist->setPageSplitter($pagesplitter);
74$table = new KillListTable($llist);
75$html .= $table->generate();
76$html .= $pagesplitter->generate();
77
78$menubox = new box("Menu");
79$menubox->setIcon("menu-item.gif");
80$menubox->addOption("caption", "Navigation");
81$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear);
82if ($week != kbdate("W"))
83{
84    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear);
85}
86$page->addContext($menubox->generate());
87
88$tllist = new TopLossesList();
89$tllist->setWeek($week);
90$tllist->setYear($year);
91involved::load($tllist,'loss');
92
93$tllist->generate();
94$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon");
95$page->addContext($tlbox->generate());
96
97$page->setContent($html);
98$page->generate();
99?>
Note: See TracBrowser for help on using the browser.