root/dev/common/losses.php @ 296

Revision 289, 2.5 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.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$table = new KillListTable($llist);
73$html .= $table->generate();
74
75$menubox = new box("Menu");
76$menubox->setIcon("menu-item.gif");
77$menubox->addOption("caption", "Navigation");
78$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear);
79if ($week != kbdate("W"))
80{
81    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear);
82}
83$page->addContext($menubox->generate());
84
85$tllist = new TopLossesList();
86$tllist->setWeek($week);
87$tllist->setYear($year);
88involved::load($tllist,'loss');
89
90$tllist->generate();
91$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon");
92$page->addContext($tlbox->generate());
93
94$page->setContent($html);
95$page->generate();
96?>
Note: See TracBrowser for help on using the browser.