root/dev/common/system_detail.php @ 190

Revision 190, 3.2 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

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