1 | <? |
---|
2 | require_once( "class.page.php" ); |
---|
3 | require_once( "class.box.php" ); |
---|
4 | require_once( "class.toplist.php" ); |
---|
5 | |
---|
6 | $page = new Page( "Awards" ); |
---|
7 | |
---|
8 | $month = $_GET['m']; |
---|
9 | $year = $_GET['y']; |
---|
10 | |
---|
11 | if ( $month == "" ) |
---|
12 | $month = date( "m" ) - 1; |
---|
13 | |
---|
14 | if ( $year == "" ) |
---|
15 | $year = date( "Y" ); |
---|
16 | |
---|
17 | if ( $month == 0 ) { |
---|
18 | $month = 12; |
---|
19 | $year = $year - 1; |
---|
20 | } |
---|
21 | |
---|
22 | if ( $month == 12 ) { |
---|
23 | $nmonth = 1; |
---|
24 | $nyear = $year + 1; |
---|
25 | } |
---|
26 | else { |
---|
27 | $nmonth = $month + 1; |
---|
28 | $nyear = $year; |
---|
29 | } |
---|
30 | if ( $month == 1 ) { |
---|
31 | $pmonth = 12; |
---|
32 | $pyear = $year - 1; |
---|
33 | } |
---|
34 | else { |
---|
35 | $pmonth = $month - 1; |
---|
36 | $pyear = $year; |
---|
37 | } |
---|
38 | |
---|
39 | $monthname = date( "F", strtotime( "2000-".$month."-1" ) ); |
---|
40 | |
---|
41 | $html .= "<div class=block-header2>Awards for ".$monthname." ".$year."</div>"; |
---|
42 | |
---|
43 | // main table |
---|
44 | $html .= "<table height=600 width=\"100%\"><tr>"; |
---|
45 | |
---|
46 | // top killers |
---|
47 | $tklist = new TopKillsList(); |
---|
48 | $tklist->setMonth( $month ); |
---|
49 | $tklist->setYear( $year ); |
---|
50 | if ( CORP_ID ) |
---|
51 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
52 | if ( ALLIANCE_ID ) |
---|
53 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
54 | |
---|
55 | $tklist->generate(); |
---|
56 | $tkbox = new AwardBox( $tklist, "Top killers", "kills", "kills", "eagle" ); |
---|
57 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
58 | |
---|
59 | // top scorers |
---|
60 | $killboard = $page->killboard_; |
---|
61 | $config = $killboard->getConfig(); |
---|
62 | if ( $config->getKillPoints() ) { |
---|
63 | $tklist = new TopScoreList(); |
---|
64 | $tklist->setMonth( $month ); |
---|
65 | $tklist->setYear( $year ); |
---|
66 | if ( CORP_ID ) |
---|
67 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
68 | if ( ALLIANCE_ID ) |
---|
69 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
70 | |
---|
71 | $tklist->generate(); |
---|
72 | $tkbox = new AwardBox( $tklist, "Top scorers", "points", "points", "redcross" ); |
---|
73 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
74 | } |
---|
75 | |
---|
76 | // top solo killers |
---|
77 | $tklist = new TopSoloKillerList(); |
---|
78 | $tklist->setMonth( $month ); |
---|
79 | $tklist->setYear( $year ); |
---|
80 | if ( CORP_ID ) |
---|
81 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
82 | if ( ALLIANCE_ID ) |
---|
83 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
84 | |
---|
85 | $tklist->generate(); |
---|
86 | $tkbox = new AwardBox( $tklist, "Top solokillers", "solo kills", "kills", "cross" ); |
---|
87 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
88 | |
---|
89 | // top damage dealers |
---|
90 | $tklist = new TopDamageDealerList(); |
---|
91 | $tklist->setMonth( $month ); |
---|
92 | $tklist->setYear( $year ); |
---|
93 | if ( CORP_ID ) |
---|
94 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
95 | if ( ALLIANCE_ID ) |
---|
96 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
97 | |
---|
98 | $tklist->generate(); |
---|
99 | $tkbox = new AwardBox( $tklist, "Top damagedealers", "kills w/ most damage", "kills", "wing1" ); |
---|
100 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
101 | |
---|
102 | $html .= "</tr><tr>"; |
---|
103 | |
---|
104 | // top final blows |
---|
105 | $tklist = new TopFinalBlowList(); |
---|
106 | $tklist->setMonth( $month ); |
---|
107 | $tklist->setYear( $year ); |
---|
108 | if ( CORP_ID ) |
---|
109 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
110 | if ( ALLIANCE_ID ) |
---|
111 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
112 | |
---|
113 | $tklist->generate(); |
---|
114 | $tkbox = new AwardBox( $tklist, "Top finalblows", "final blows", "kills", "skull" ); |
---|
115 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
116 | |
---|
117 | // top podkillers |
---|
118 | $tklist = new TopPodKillerList(); |
---|
119 | $tklist->setMonth( $month ); |
---|
120 | $tklist->setYear( $year ); |
---|
121 | if ( CORP_ID ) |
---|
122 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
123 | if ( ALLIANCE_ID ) |
---|
124 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
125 | |
---|
126 | $tklist->generate(); |
---|
127 | $tkbox = new AwardBox( $tklist, "Top podkillers", "podkills", "kills", "globe" ); |
---|
128 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
129 | |
---|
130 | // top griefers |
---|
131 | $tklist = new TopGrieferList(); |
---|
132 | $tklist->setMonth( $month ); |
---|
133 | $tklist->setYear( $year ); |
---|
134 | if ( CORP_ID ) |
---|
135 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
136 | if ( ALLIANCE_ID ) |
---|
137 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
138 | |
---|
139 | $tklist->generate(); |
---|
140 | $tkbox = new AwardBox( $tklist, "Top griefers", "carebear kills", "kills", "star" ); |
---|
141 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
142 | |
---|
143 | // top capital killers |
---|
144 | $tklist = new TopCapitalShipKillerList(); |
---|
145 | $tklist->setMonth( $month ); |
---|
146 | $tklist->setYear( $year ); |
---|
147 | if ( CORP_ID ) |
---|
148 | $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
149 | if ( ALLIANCE_ID ) |
---|
150 | $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
151 | |
---|
152 | $tklist->generate(); |
---|
153 | $tkbox = new AwardBox( $tklist, "Top ISK killers", "capital shipkills", "kills", "wing2" ); |
---|
154 | $html .= "<td align=center>".$tkbox->generate()."</td>"; |
---|
155 | |
---|
156 | $html .= "</td></tr></table>"; |
---|
157 | |
---|
158 | $menubox = new MenuBox(); |
---|
159 | $menubox->addCaption( "Navigation" ); |
---|
160 | $menubox->addOption( "Previous month ", "?a=awards&m=".$pmonth."&y=".$pyear ); |
---|
161 | if ( ! ($month == date( "m" ) - 1 && $year == date( "Y" ) ) ) |
---|
162 | $menubox->addOption( "Next month", "?a=awards&m=".$nmonth."&y=".$nyear ); |
---|
163 | $page->addContext( $menubox->generate() ); |
---|
164 | |
---|
165 | $page->setContent( $html ); |
---|
166 | $page->generate(); |
---|
167 | ?> |
---|