root/dev/common/system_detail.php @ 206

Revision 206, 3.2 KB (checked in by ralle030583, 16 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.system.php');
3require_once('common/includes/class.killlist.php');
4require_once('common/includes/class.killlisttable.php');
5require_once('common/includes/class.killsummarytable.php');
6
7$sys_id = intval($_GET['sys_id']);
8
9if (!$sys_id)
10{
11    echo 'no valid id supplied<br/>';
12    exit;
13}
14$system = new SolarSystem($sys_id);
15
16$page = new Page('System details - '.$system->getName());
17
18$html .= "<table border=\"0\" class=\"kb-table\"><tr class=\"kb-table-header\"><td colspan=\"3\">Graphical Overview</td></tr><tr>";
19$html .= "<td><img src=\"?a=mapview&sys_id=".$sys_id."&mode=map&size=250\" border=\"0\" width=\"250\" height=\"250\"></td>";
20$html .= "<td><img src=\"?a=mapview&sys_id=".$sys_id."&mode=region&size=250\" border=\"0\" width=\"250\" height=\"250\"></td>";
21$html .= "<td><img src=\"?a=mapview&sys_id=".$sys_id."&mode=cons&size=250\" border=\"0\" width=\"250\" height=\"250\"></td>";
22$html .= "</tr></table><br/>";
23
24$kslist = new KillList();
25if (CORP_ID)
26    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
27if (ALLIANCE_ID)
28    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
29$kslist->addSystem($system);
30
31$lslist = new KillList();
32if (CORP_ID)
33    $lslist->addVictimCorp(new Corporation(CORP_ID));
34if (ALLIANCE_ID)
35    $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID));
36$lslist->addSystem($system);
37
38$summarytable = new KillSummaryTable($kslist, $lslist);
39$summarytable->setBreak(6);
40$html .= $summarytable->generate();
41
42$klist = new KillList();
43$klist->setOrdered(true);
44if ($_GET['view'] == 'losses')
45{
46    if (CORP_ID)
47        $klist->addVictimCorp(new Corporation(CORP_ID));
48    if (ALLIANCE_ID)
49        $klist->addVictimAlliance(new Alliance(ALLIANCE_ID));
50}
51else
52{
53    if (CORP_ID)
54        $klist->addInvolvedCorp(new Corporation(CORP_ID));
55    if (ALLIANCE_ID)
56        $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
57}
58$klist->addSystem($system);
59if ($_GET['scl_id'])
60    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
61else
62    $klist->setPodsNoobShips(false);
63
64if ($_GET['view'] == 'recent' || !isset($_GET['view']))
65{
66    $html .= "<div class=kb-kills-header>20 most recent kills</div>";
67    $klist->setLimit(20);
68}
69else
70{
71    if ($_GET['view'] == 'losses')
72    {
73        $html .= "<div class=kb-kills-header>All losses</div>";
74    }
75    else
76    {
77        $html .= "<div class=kb-kills-header>All kills</div>";
78    }
79    $pagesplitter = new PageSplitter($klist->getCount(), 20);
80    $klist->setPageSplitter($pagesplitter);
81}
82
83$table = new KillListTable($klist);
84$html .= $table->generate();
85if (is_object($pagesplitter))
86{
87    $html .= $pagesplitter->generate();
88}
89
90$page->setContent($html);
91$menubox = new box("Menu");
92$menubox->setIcon("menu-item.gif");
93$menubox->addOption("caption","Navigation");
94$menubox->addOption("link","All kills", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=kills");
95$menubox->addOption("link","All losses", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=losses");
96$menubox->addOption("link","Recent Activity", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=recent");
97$page->addContext($menubox->generate());
98
99$page->generate();
100?>
Note: See TracBrowser for help on using the browser.