示例#1
0
 /**
  * Build a new summary table for a pilot.
  *
  * @param integer $plt_id
  * @return boolean Returns false on error.
  */
 private static function buildSummary($plt_id)
 {
     $plt_id = (int) $plt_id;
     if (!$plt_id) {
         return false;
     }
     $qry = DBFactory::getDBQuery();
     $qry->autocommit(false);
     $klist = new KillList();
     $klist->addInvolvedPilot($plt_id);
     $klist->getAllKills();
     $kpoints = $klist->getPoints();
     unset($klist);
     $llist = new KillList();
     $llist->addVictimPilot($plt_id);
     $llist->getAllKills();
     $lpoints = $llist->getPoints();
     unset($llist);
     $qry->execute("UPDATE kb3_pilots SET plt_kpoints = {$kpoints},\n\t\t\t plt_lpoints = {$lpoints} WHERE plt_id = {$plt_id}");
     $qry->autocommit(true);
     return;
 }
示例#2
0
 /**
  * Return the html for the known members of this corp.
  * @param pCorpDetail $home 
  * @return string 
  */
 public static function view($home)
 {
     if (config::get('mod_knownmembers_own')) {
         if (array_search($home->alliance->getID(), config::get('cfg_allianceid')) !== false) {
             $can_view = 1;
         } else {
             if (array_search($home->crp_id, config::get('cfg_corpid')) !== false) {
                 $can_view = 1;
             }
         }
     }
     if ($can_view == 1) {
         $html .= "Cannot View this corps Member List";
     } else {
         $query = "SELECT * FROM `kb3_pilots`  WHERE plt_crp_id =" . $home->crp_id . " ORDER BY `plt_name` ASC";
         $qry = DBFactory::getDBQuery();
         $qry->execute($query);
         $cnt = $qry->recordCount();
         $html .= "<div class=block-header2>Known Pilots (" . $cnt . ")</div>";
         $html .= "<table class=kb-table align=center>";
         $html .= '<tr class=kb-table-header>';
         if (config::get('mod_knownmembers_img')) {
             $html .= '<td class=kb-table-header align="center"></td>';
         }
         $html .= '<td class=kb-table-header align="center">Pilot</td>';
         if (config::get('mod_knownmembers_kllpnts')) {
             $html .= '<td class=kb-table-header align="center">Kill Points</td>';
         }
         if (config::get('mod_knownmembers_dmgdn')) {
             $html .= '<td class=kb-table-header align="center">Dmg Done (isk)</td>';
         }
         if (config::get('mod_knownmembers_dmgrcv')) {
             $html .= '<td class=kb-table-header align="center">Dmg Received (isk)</td>';
         }
         if (config::get('mod_knownmembers_eff')) {
             $html .= '<td class=kb-table-header align="center">Efficiency</td>';
         }
         if ($home->page->isAdmin()) {
             $html .= '<td class=kb-table-header align="center">Admin - Move</td>';
         }
         $html .= '</tr>';
         while ($data = $qry->getRow()) {
             $pilot = new Pilot($data['plt_id']);
             $plist = new KillList();
             $plist->addInvolvedPilot($pilot);
             $plist->getAllKills();
             $points = $plist->getPoints();
             $pllist = new KillList();
             $pllist->addVictimPilot($pilot);
             $pllist->getAllKills();
             $plistisk = $plist->getISK();
             $pllistisk = $pllist->getISK();
             if ($plistisk == 0) {
                 $plistisk = 1;
                 //Remove divide by 0
             }
             if ($pllistisk == 0) {
                 $pllistisk = 1;
                 //Remove divide by 0
             }
             $efficiency = round($plistisk / ($plistisk + $pllistisk) * 100, 2);
             if (!$odd) {
                 $odd = true;
                 $class = 'kb-table-row-odd';
             } else {
                 $odd = false;
                 $class = 'kb-table-row-even';
             }
             $html .= "<tr class=" . $class . " style=\"height: 32px;\">";
             if (config::get('mod_knownmembers_img')) {
                 $html .= '<td width="64" align="center"><img src=' . $pilot->getPortraitURL(32) . '></td>';
             }
             $html .= '<td align="center"><a href=?a=pilot_detail&plt_id=' . $pilot->getID() . '>' . $pilot->getName() . '</a></td>';
             if (config::get('mod_knownmembers_kllpnts')) {
                 $html .= '<td align="center">' . $points . '</td>';
             }
             if (config::get('mod_knownmembers_dmgdn')) {
                 $html .= '<td align="center">' . round($plist->getISK(), 2) / 1000000 . 'M</td>';
             }
             if (config::get('mod_knownmembers_dmgrcv')) {
                 $html .= '<td align="center">' . round($pllist->getISK(), 2) / 1000000 . 'M</td>';
             }
             if (config::get('mod_knownmembers_eff')) {
                 $html .= '<td align="center">' . $efficiency . '%</td>';
             }
             if ($home->page->isAdmin()) {
                 $html .= "<td align=center><a href=\"javascript:openWindow('?a=admin_move_pilot&plt_id=" . $data['plt_id'] . "', null, 500, 500, '' )\">Move</a></td>";
             }
             $html .= '</tr>';
         }
         $html .= '</table>';
     }
     return $html;
 }
示例#3
0
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
$grey_trans = imagecolorallocatealpha($im, 50, 50, 50, 50);
$grey_transblue = imagecolorallocatealpha($im, 50, 50, 110, 10);
$grey_transbluel = imagecolorallocatealpha($im, 50, 50, 110, 100);
$name = strtoupper($pilot->getName());
$list = new KillList();
$list->setOrdered(true);
$list->setPodsNoobships(false);
$list->addInvolvedPilot($pilot);
$kill = $list->getKill();
$list->getallKills();
imagefttext($im, FSIZE, 0, 80, 21, $grey_trans, MFONT, $name);
imagefttext($im, FSIZE, 0, 80, 20, $white, MFONT, $name, array('hdpi' => 200));
$no = $list->getCount();
$string = 'KILL# ' . $no . '     TOTAL POINTS ' . $list->getPoints();
imagettftext($im, FSIZE, 0, 80, 41, $grey_trans, MFONT, $string);
imagettftext($im, FSIZE, 0, 80, 40, $white, MFONT, $string);
$string = strtoupper($kill->getVictimName() . ' ' . $kill->getVictimCorpName());
$box = imagettfbbox(FSIZE, 0, MFONT, $string);
$width = $box[4];
imagettftext($im, FSIZE, 0, 349 - $width, 21, $grey_trans, MFONT, $string);
imagettftext($im, FSIZE, 0, 349 - $width, 20, $white, MFONT, $string);
$string = strtoupper($kill->getVictimShipName());
$box = imagettfbbox(FSIZE, 0, MFONT, $string);
$width = $box[4];
imagettftext($im, FSIZE, 0, 349 - $width, 41, $grey_trans, MFONT, $string);
imagettftext($im, FSIZE, 0, 349 - $width, 40, $white, MFONT, $string);
$string = $kill->getSolarSystemName();
$box = imagettfbbox(FSIZE, 0, MFONT, $string);
$width = $box[4];