root/dev/common/awards.php @ 240

Revision 240, 3.8 KB (checked in by ralle030583, 15 years ago)

Implemented exi's involvedloader class

Line 
1<?php
2require_once('common/includes/class.toplist.php');
3
4$page = new Page('Awards');
5
6$month = $_GET['m'];
7$year = $_GET['y'];
8
9if ($month == '')
10    $month = kbdate('m') - 1;
11
12if ($year == '')
13    $year = kbdate('Y');
14
15if ($month == 0)
16{
17    $month = 12;
18    $year = $year - 1;
19}
20
21if ($month == 12)
22{
23    $nmonth = 1;
24    $nyear = $year + 1;
25}
26else
27{
28    $nmonth = $month + 1;
29    $nyear = $year;
30}
31if ($month == 1)
32{
33    $pmonth = 12;
34    $pyear = $year - 1;
35}
36else
37{
38    $pmonth = $month - 1;
39    $pyear = $year;
40}
41
42$monthname = kbdate("F", strtotime("2000-".$month."-2"));
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);
51involved::load($tklist,'kill');
52
53$tklist->generate();
54$tkbox = new AwardBox($tklist, "Top killers", "kills", "kills", "eagle");
55$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
56// top scorers
57if (config::get('kill_points'))
58{
59    $tklist = new TopScoreList();
60    $tklist->setMonth($month);
61    $tklist->setYear($year);
62    involved::load($tklist,'kill');
63
64    $tklist->generate();
65    $tkbox = new AwardBox($tklist, "Top scorers", "points", "points", "redcross");
66    $html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
67}
68// top solo killers
69$tklist = new TopSoloKillerList();
70$tklist->setMonth($month);
71$tklist->setYear($year);
72involved::load($tklist,'kill');
73
74$tklist->generate();
75$tkbox = new AwardBox($tklist, "Top solokillers", "solo kills", "kills", "cross");
76$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
77// top damage dealers
78$tklist = new TopDamageDealerList();
79$tklist->setMonth($month);
80$tklist->setYear($year);
81involved::load($tklist,'kill');
82
83$tklist->generate();
84$tkbox = new AwardBox($tklist, "Top damagedealers", "kills w/ most damage", "kills", "wing1");
85$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
86
87$html .= "</tr><tr>";
88// top final blows
89$tklist = new TopFinalBlowList();
90$tklist->setMonth($month);
91$tklist->setYear($year);
92involved::load($tklist,'kill');
93
94$tklist->generate();
95$tkbox = new AwardBox($tklist, "Top finalblows", "final blows", "kills", "skull");
96$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
97// top podkillers
98$tklist = new TopPodKillerList();
99$tklist->setMonth($month);
100$tklist->setYear($year);
101involved::load($tklist,'kill');
102
103$tklist->generate();
104$tkbox = new AwardBox($tklist, "Top podkillers", "podkills", "kills", "globe");
105$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
106// top griefers
107$tklist = new TopGrieferList();
108$tklist->setMonth($month);
109$tklist->setYear($year);
110involved::load($tklist,'kill');
111
112$tklist->generate();
113$tkbox = new AwardBox($tklist, "Top griefers", "carebear kills", "kills", "star");
114$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
115// top capital killers
116$tklist = new TopCapitalShipKillerList();
117$tklist->setMonth($month);
118$tklist->setYear($year);
119involved::load($tklist,'kill');
120
121$tklist->generate();
122$tkbox = new AwardBox($tklist, "Top ISK killers", "capital shipkills", "kills", "wing2");
123$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
124
125$html .= "</td></tr></table>";
126
127$menubox = new Box("Menu");
128$menubox->setIcon("menu-item.gif");
129$menubox->addOption("caption", "Navigation");
130$menubox->addOption("link", "Previous month ", "?a=awards&m=".$pmonth."&y=".$pyear);
131if (! ($month == kbdate("m") - 1 && $year == kbdate("Y")))
132    $menubox->addOption("link", "Next month", "?a=awards&m=".$nmonth."&y=".$nyear);
133$page->addContext($menubox->generate());
134
135$page->setContent($html);
136$page->generate();
137?>
Note: See TracBrowser for help on using the browser.