/** * Show the overall statistics for this corporation. */ function stats() { global $smarty; // The summary table is also used by the stats. Whichever is called // first generates the table. $this->page->setTitle('Corporation details - ' . $this->corp->getName() . " [" . $this->corp->getShortName() . "]"); $smarty->registerObject('Corp', $this->corp); $smarty->assign('portrait_url', $this->corp->getPortraitURL(128)); if ($this->alliance->getName() == "None") { $smarty->assign('alliance_url', false); } else { if ($this->alliance->getExternalID()) { $smarty->assign('alliance_url', edkURI::build(array('a', 'alliance_detail', true), array('all_ext_id', $this->alliance->getExternalID(), true))); } else { $smarty->assign('alliance_url', edkURI::build(array('a', 'alliance_detail', true), array('all_id', $this->alliance->getID(), true))); } } $smarty->assign('alliance_name', $this->alliance->getName()); $smarty->assign('kill_count', $this->kill_summary->getTotalKills()); $smarty->assign('loss_count', $this->kill_summary->getTotalLosses()); $smarty->assign('damage_done', number_format($this->kill_summary->getTotalKillISK() / 1000000000, 2)); $smarty->assign('damage_received', number_format($this->kill_summary->getTotalLossISK() / 1000000000, 2)); if ($this->kill_summary->getTotalKillISK()) { $smarty->assign('efficiency', number_format(100 * $this->kill_summary->getTotalKillISK() / ($this->kill_summary->getTotalKillISK() + $this->kill_summary->getTotalLossISK()), 2)); } else { $smarty->assign('efficiency', 0); } $smarty->assign('ceo_url', edkURI::build(array('a', 'pilot_detail', true), array('plt_ext_id', $this->corp->getCeoID(), true))); $pilot = new Pilot(0, $this->corp->getCeoID()); $smarty->assign('ceo_name', $pilot->getName()); return $smarty->fetch(get_tpl('corp_detail_stats')); }