1 | <? |
---|
2 | require_once( "class.page.php" ); |
---|
3 | require_once( "class.box.php" ); |
---|
4 | require_once( "class.corp.php" ); |
---|
5 | require_once( "class.alliance.php" ); |
---|
6 | require_once( "class.killlist.php" ); |
---|
7 | require_once( "class.killlisttable.php" ); |
---|
8 | require_once( "class.killsummarytable.php" ); |
---|
9 | require_once( "class.toplist.php" ); |
---|
10 | |
---|
11 | $week = $_GET['w']; |
---|
12 | $year = $_GET['y']; |
---|
13 | |
---|
14 | if ( $week == "" ) |
---|
15 | $week = date( "W" ); |
---|
16 | |
---|
17 | if ( $year == "" ) |
---|
18 | $year = date( "Y" ); |
---|
19 | |
---|
20 | if ( $week == 52 ) { |
---|
21 | $nweek = 1; |
---|
22 | $nyear = $year + 1; |
---|
23 | } |
---|
24 | else { |
---|
25 | $nweek = $week + 1; |
---|
26 | $nyear = $year; |
---|
27 | } |
---|
28 | if ( $week == "1" ) { |
---|
29 | $pweek = 52; |
---|
30 | $pyear = $year - 1; |
---|
31 | } |
---|
32 | else { |
---|
33 | $pweek = $week - 1; |
---|
34 | $pyear = $year; |
---|
35 | } |
---|
36 | |
---|
37 | $page = new Page( "Losses - Week ".$week ); |
---|
38 | |
---|
39 | $klist = new KillList(); |
---|
40 | $klist->setWeek( $week ); |
---|
41 | $klist->setYear( $year ); |
---|
42 | if ( CORP_ID ) |
---|
43 | $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
44 | if ( ALLIANCE_ID ) |
---|
45 | $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
46 | |
---|
47 | $lslist = new KillList(); |
---|
48 | $lslist->setWeek( $week ); |
---|
49 | $lslist->setYear( $year ); |
---|
50 | if ( CORP_ID ) |
---|
51 | $lslist->addVictimCorp( new Corporation( CORP_ID ) ); |
---|
52 | if ( ALLIANCE_ID ) |
---|
53 | $lslist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
54 | |
---|
55 | $summarytable = new KillSummaryTable( $klist, $lslist ); |
---|
56 | $summarytable->setBreak( 6 ); |
---|
57 | $html .= $summarytable->generate(); |
---|
58 | |
---|
59 | //$html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>"; |
---|
60 | |
---|
61 | // if ( $week != date( "W" ) ) |
---|
62 | // $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]"; |
---|
63 | |
---|
64 | // $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>"; |
---|
65 | |
---|
66 | $llist = new KillList(); |
---|
67 | $llist->setOrdered( true ); |
---|
68 | $llist->setWeek( $week ); |
---|
69 | $llist->setYear( $year ); |
---|
70 | if ( CORP_ID ) |
---|
71 | $llist->addVictimCorp( new Corporation( CORP_ID ) ); |
---|
72 | if ( ALLIANCE_ID ) |
---|
73 | $llist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
74 | if ( $_GET['scl_id'] ) |
---|
75 | $llist->addVictimShipClass( new ShipClass( $_GET['scl_id'] ) ); |
---|
76 | else |
---|
77 | $llist->setPodsNoobShips( false ); |
---|
78 | |
---|
79 | $table = new KillListTable( $llist ); |
---|
80 | $html .= $table->generate(); |
---|
81 | |
---|
82 | $menubox = new MenuBox(); |
---|
83 | $menubox->addCaption( "Navigation" ); |
---|
84 | $menubox->addOption( "Previous week", "?a=losses&w=".$pweek."&y=".$pyear ); |
---|
85 | if ( $week != date( "W" ) ) |
---|
86 | $menubox->addOption( "Next week", "?a=losses&w=".$nweek."&y=".$nyear ); |
---|
87 | $page->addContext( $menubox->generate() ); |
---|
88 | |
---|
89 | $tllist = new TopLossesList(); |
---|
90 | $tllist->setWeek( $week ); |
---|
91 | $tllist->setYear( $year ); |
---|
92 | if ( CORP_ID ) |
---|
93 | $tllist->addVictimCorp( new Corporation( CORP_ID ) ); |
---|
94 | if ( ALLIANCE_ID ) |
---|
95 | $tllist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
96 | |
---|
97 | $tllist->generate(); |
---|
98 | $tlbox = new AwardBox( $tllist, "Top losers", "losses in week ".$week, "losses", "moon" ); |
---|
99 | $page->addContext( $tlbox->generate() ); |
---|
100 | |
---|
101 | $page->setContent( $html ); |
---|
102 | $page->generate(); |
---|
103 | ?> |
---|