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