/** * Build the summary table showing all kills and losses for this corporation. */ function summaryTable() { if ($this->view != '' && $this->view != 'kills' && $this->view != 'losses') { return ''; } return $this->kill_summary->generate(); }
/** * adds meta tags for Twitter Summary Card and OpenGraph tags * to the HTML header */ function metaTags() { $referenceSystem = SolarSystem::getByID(reset($this->systems)); // meta tag: title $metaTagTitle = $referenceSystem->getName() . " | " . $referenceSystem->getRegionName() . " | Battle Report"; $this->page->addHeader('<meta name="og:title" content="' . $metaTagTitle . '">'); $this->page->addHeader('<meta name="twitter:title" content="' . $metaTagTitle . '">'); // build description $date = gmdate("Y-m-d", strtotime($this->firstts)); $startTime = gmdate("H:i", strtotime($this->firstts)); $endTime = gmdate("H:i", strtotime($this->lastts)); $totalIskDestroyedM = round(($this->summaryTable->getTotalKillISK() + $this->summaryTable->getTotalLossISK()) / 1000000, 2); $metaTagDescription = "Battle Report for " . $referenceSystem->getName() . " (" . $referenceSystem->getRegionName() . ") from " . $date . " (" . $startTime . " - " . $endTime . "): "; $metaTagDescription .= "Involved Pilots: " . (count($this->pilots['a']) + count($this->pilots['e'])) . ", Total ISK destroyed: " . $totalIskDestroyedM . "M ISK"; $this->page->addHeader('<meta name="description" content="' . $metaTagDescription . '">'); $this->page->addHeader('<meta name="og:description" content="' . $metaTagDescription . '">'); // meta tag: image $this->page->addHeader('<meta name="og:image" content="' . imageURL::getURL('Type', 3802, 64) . '">'); $this->page->addHeader('<meta name="twitter:image" content="' . imageURL::getURL('Type', 3802, 64) . '">'); $this->page->addHeader('<meta name="og:site_name" content="EDK - ' . config::get('cfg_kbtitle') . '">'); // meta tag: URL $this->page->addHeader('<meta name="og:url" content="' . edkURI::build(array('kll_id', $this->kll_id, true)) . '">'); // meta tag: Twitter summary $this->page->addHeader('<meta name="twitter:card" content="summary">'); }
/** * 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')); }
/** * Display the summary table showing all kills and losses for this alliance. * * @return string */ function summaryTable() { if ($this->view != '' && $this->view != 'recent_activity' && $this->view != 'kills' && $this->view != 'losses') { return ''; } // The summary table is also used by the stats. Whichever is called // first generates the table. return $this->kill_summary->generate(); }
/** * Build the killlists that are needed for the options selected. */ function killList() { if (isset($this->viewList[$this->view])) { return call_user_func_array($this->viewList[$this->view], array(&$this)); } $scl_id = (int) edkURI::getArg('scl_id'); global $smarty; $html = ''; $smarty->assign('view', $this->view); switch ($this->view) { case "": $targets = array(); $curtarget = array(); while ($target =& $this->contract->getContractTarget()) { $kl =& $target->getKillList(); $ll =& $target->getLossList(); $summary = new KillSummaryTable($kl, $ll); $summary->setVerbose(true); $summary->setView('combined'); $curtargets['type'] = $target->getType(); $curtargets['id'] = $target->getID(); $curtargets['name'] = $target->getName(); $curtargets['summary'] = $summary->generate(); if ($summary->getTotalKillISK()) { $curtargets['efficiency'] = round($summary->getTotalKillISK() / ($summary->getTotalKillISK() + $summary->getTotalLossISK()) * 100, 2); } else { $curtargets['efficiency'] = 0; } $curtargets['total_kills'] = $summary->getTotalKills(); $curtargets['total_losses'] = $summary->getTotalLosses(); $curtargets['total_kill_isk'] = round($summary->getTotalKillISK() / 1000000000, 2); $curtargets['total_loss_isk'] = round($summary->getTotalLossISK() / 1000000000, 2); $bar = new BarGraph($curtargets['efficiency'], 100, 120); $curtargets['bar'] = $bar->generate(); $targets[] = $curtargets; } $smarty->assignByRef('targets', $targets); $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false); $html .= $smarty->fetch(get_tpl('cc_detail_lists')); break; case "recent_activity": $this->contract = new Contract($this->ctr_id); $klist = $this->contract->getKillList(); $klist->setOrdered(true); if ($scl_id) { $klist->addVictimShipClass($scl_id); } else { $klist->setPodsNoobShips(config::get('podnoobs')); } $table = new KillListTable($klist); $table->setLimit(10); $smarty->assign('killtable', $table->generate()); $llist = $this->contract->getLossList(); $llist->setOrdered(true); if ($scl_id) { $llist->addVictimShipClass($scl_id); } else { $llist->setPodsNoobShips(config::get('podnoobs')); } $table = new KillListTable($llist); $table->setLimit(10); $smarty->assign('losstable', $table->generate()); $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false); $html .= $smarty->fetch(get_tpl('cc_detail_lists')); break; case "kills": $this->contract = new Contract($this->ctr_id); $list = $this->contract->getKillList(); $list->setOrdered(true); if ($scl_id) { $list->addVictimShipClass($scl_id); } else { $list->setPodsNoobShips(config::get('podnoobs')); } $list->setPageSplit(config::get('killcount')); $pagesplitter = new PageSplitter($list->getCount(), config::get('killcount')); $table = new KillListTable($list); $smarty->assign('killtable', $table->generate()); $smarty->assign('splitter', $pagesplitter->generate()); $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false); $html .= $smarty->fetch(get_tpl('cc_detail_lists')); break; case "losses": $this->contract = new Contract($this->ctr_id); $llist = $this->contract->getLossList(); $llist->setOrdered(true); if ($scl_id) { $llist->addVictimShipClass($scl_id); } else { $llist->setPodsNoobShips(config::get('podnoobs')); } $llist->setPageSplit(config::get('killcount')); $pagesplitter = new PageSplitter($llist->getCount(), config::get('killcount')); $table = new KillListTable($llist); $smarty->assign('losstable', $table->generate()); $smarty->assign('splitter', $pagesplitter->generate()); $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false); $html .= $smarty->fetch(get_tpl('cc_detail_lists')); break; } return $html; }
// we got 2 resulting timestamps $firstts = array_shift($times); $lastts = array_pop($times); $kslist = new KillList(); $kslist->setOrdered(true); $kslist->addSystem($system); $kslist->setStartDate($firstts); $kslist->setEndDate($lastts); involved::load($kslist, 'kill'); $lslist = new KillList(); $lslist->setOrdered(true); $lslist->addSystem($system); $lslist->setStartDate($firstts); $lslist->setEndDate($lastts); involved::load($lslist, 'loss'); $killsummary = new KillSummaryTable($kslist, $lslist); $killsummary->setBreak(6); $name = $system->getName() . " " . substr($firstts, 0, 16) . " " . substr($lastts, -8, 5); } ?> <form> <table class="popup-table" height="100%" width="355px"> <tr> <td align="center"><strong>Forum Post</strong></td> </tr> <tr> <td align="center"><input type="button" value="Close" onClick="ReverseContentDisplay('popup');"></td> </tr> <tr> <td valign="top" align="center"> <textarea class="killmail" name="killmail" cols="100" rows="30" readonly="readonly">
/** * * @return string HTML for the summary table. */ public function summaryTable() { $this->kslist->rewind(); $this->lslist->rewind(); $summarytable = new KillSummaryTable($this->kslist, $this->lslist); return $summarytable->generate(); }