root/dev/common/system_detail.php

Revision 463, 3.0 KB (checked in by kovell, 13 years ago)

Fixes: pilot and system detail correctly filter by ship class.

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$scl_id = intval($_GET['scl_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();
26involved::load($kslist,'kill');
27$kslist->addSystem($system);
28if(config::get('kill_classified')) $kslist->setEndDate(gmdate('Y-m-d H:i',strtotime('now - '.(config::get('kill_classified')*3600).' hours')));
29
30$lslist = new KillList();
31involved::load($lslist,'loss');
32$lslist->addSystem($system);
33if(config::get('kill_classified')) $lslist->setEndDate(gmdate('Y-m-d H:i',strtotime('now - '.(config::get('kill_classified')*3600).' hours')));
34
35$summarytable = new KillSummaryTable($kslist, $lslist);
36$summarytable->setBreak(config::get('summarytable_rowcount'));
37$html .= $summarytable->generate();
38
39$klist = new KillList();
40$klist->setOrdered(true);
41if ($_GET['view'] == 'losses')
42{
43        involved::load($klist,'loss');
44}
45else
46{
47   involved::load($klist,'kill');
48}
49$klist->addSystem($system);
50if ($scl_id)
51    $klist->addVictimShipClass($scl_id);
52else
53    $klist->setPodsNoobShips(false);
54
55if ($_GET['view'] == 'recent' || !isset($_GET['view']))
56{
57    $html .= "<div class=kb-kills-header>20 most recent kills</div>";
58    $klist->setLimit(20);
59}
60else
61{
62    if ($_GET['view'] == 'losses')
63    {
64        $html .= "<div class=kb-kills-header>All losses</div>";
65    }
66    else
67    {
68        $html .= "<div class=kb-kills-header>All kills</div>";
69    }
70    $pagesplitter = new PageSplitter($klist->getCount(), 20);
71    $klist->setPageSplitter($pagesplitter);
72}
73
74$table = new KillListTable($klist);
75$html .= $table->generate();
76if (is_object($pagesplitter))
77{
78    $html .= $pagesplitter->generate();
79}
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","All kills", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=kills");
86$menubox->addOption("link","All losses", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=losses");
87$menubox->addOption("link","Recent Activity", "?a=system_detail&amp;sys_id=".$sys_id."&amp;view=recent");
88$page->addContext($menubox->generate());
89
90$page->generate();
91?>
Note: See TracBrowser for help on using the browser.