root/dev/common/kills.php @ 188

Revision 188, 3.0 KB (checked in by exi, 14 years ago)

Changed default td width for options to 160px.
Added the appropiate timeframe to the fast contractlisttable.
Events now can also return a reference to a variable containing additional information.
Killlists now return a non formatted isk-value for losses/kills, please report any errors on other pages.
Added a custom user menu, able to be shownon every page.
Added some code for user logins, please ignore it for now.
Added a small battle statistics frame to the battle overview.
To login as admin now just leave user blank and use the admin password.

Line 
1<?php
2require_once("class.page.php");
3require_once("class.box.php");
4require_once("class.corp.php");
5require_once("class.alliance.php");
6require_once("class.killlist.php");
7require_once("class.ship.php");
8require_once("class.killlisttable.php");
9require_once("class.killsummarytable.php");
10require_once("class.toplist.php");
11
12$week = $_GET['w'];
13$year = $_GET['y'];
14
15if ($week == "")
16    $week = date("W");
17
18if ($year == "")
19    $year = date("Y");
20
21if ($week == 52)
22{
23    $nweek = 1;
24    $nyear = $year + 1;
25    $pyear = $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("Kills - Week ".$week);
44
45$kslist = new KillList();
46$kslist->setWeek($week);
47$kslist->setYear($year);
48if (CORP_ID)
49    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
50if (ALLIANCE_ID)
51    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
52
53$llist = new KillList();
54$llist->setWeek($week);
55$llist->setYear($year);
56if (CORP_ID)
57    $llist->addVictimCorp(new Corporation(CORP_ID));
58if (ALLIANCE_ID)
59    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
60
61$summarytable = new KillSummaryTable($kslist, $llist);
62$summarytable->setBreak(6);
63$html .= $summarytable->generate();
64
65$klist = new KillList();
66$klist->setOrdered(true);
67$klist->setWeek($week);
68$klist->setYear($year);
69if (CORP_ID)
70    $klist->addInvolvedCorp(new Corporation(CORP_ID));
71if (ALLIANCE_ID)
72    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
73if ($_GET['scl_id'])
74    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
75else
76    $klist->setPodsNoobShips(false);
77
78$table = new KillListTable($klist);
79$html .= $table->generate();
80
81$page->setContent($html);
82$menubox = new box("Menu");
83$menubox->setIcon("menu-item.gif");
84$menubox->addOption("caption", "Navigation");
85$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear);
86if ($week != date("W"))
87{
88    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
89}
90$page->addContext($menubox->generate());
91
92$tklist = new TopKillsList();
93$tklist->setWeek($week);
94$tklist->setYear($year);
95if (CORP_ID)
96    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
97if (ALLIANCE_ID)
98    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
99
100$tklist->generate();
101$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
102$page->addContext($tkbox->generate());
103
104if (config::get('kill_points'))
105{
106    $tklist = new TopScoreList();
107    $tklist->setWeek($week);
108    $tklist->setYear($year);
109    if (CORP_ID)
110        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
111    if (ALLIANCE_ID)
112        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
113
114    $tklist->generate();
115    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
116    $page->addContext($tkbox->generate());
117}
118
119$page->generate();
120?>
Note: See TracBrowser for help on using the browser.