root/dev/common/kills.php @ 206

Revision 206, 3.1 KB (checked in by ralle030583, 15 years ago)

-bugfix in Known Member mod corp detail
-deleted includes(db.php/class.page.php/class.killboard.php) which arent needed anymore everywhere cause of the include in the common/index.php

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