Show
Ignore:
Timestamp:
12/15/06 17:13:13 (16 years ago)
Author:
exi
Message:

Added option to paint systems on maps based on security rating.
Added most violent systems statistic to corp and alliance details.
Some fixes for files with short php tags.
Fixed a bug which prevented sql errors to halt page generation if enabled in config.
Added system details as whole page instead of a js popup for maps.
Battle summaries should now work if the hour of the kill is less than 10.
Removed obsolete stats.php.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/system_detail.php

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