Example #1
0
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  *
  */
 function start()
 {
     $this->page = new Page('Related kills & losses');
     $this->page->addHeader('<meta name="robots" content="index, nofollow" />');
     $this->kll_id = (int) edkURI::getArg('kll_id', 1);
     if (!$this->kll_id) {
         $this->kll_external_id = (int) edkURI::getArg('kll_ext_id');
         if (!$this->kll_external_id) {
             // internal and external ids easily overlap so we can't guess which
             $this->kll_id = (int) edkURI::getArg(null, 1);
             $this->kill = Kill::getByID($this->kll_id);
         } else {
             $this->kill = new Kill($this->kll_external_id, true);
             $this->kll_id = $this->kill->getID();
         }
     } else {
         $this->kill = Kill::getByID($this->kll_id);
     }
     $this->adjacent = edkURI::getArg('adjacent');
     $this->scl_id = (int) edkURI::getArg('scl_id');
     $this->menuOptions = array();
     if (!$this->kll_id || !$this->kill->exists()) {
         echo 'No valid kill id specified';
         exit;
     }
     if ($this->kill->isClassified()) {
         Header("Location: " . htmlspecialchars_decode(edkURI::page('kill_detail', $this->kll_id, 'kll_id')));
         die;
     }
     //		$this->getInvolved();
     //		$this->buildStats();
 }
Example #2
0
 /**
  * Return the raw killmail for this kill.
  *
  * @return string
  */
 function getRawMail()
 {
     $kill = Kill::getByID($this->id);
     return $kill->getRawMail();
 }
Example #3
0
/**
 * @package EDK
 */
$page = new Page();
$page->setAdmin();
$kll_id = (int) edkURI::getArg('kll_id', 1);
$page->setTitle('Administration - Deletion of Kill ID "' . $kll_id . '"');
if (isset($_GET['confirm'])) {
    $kill = Kill::getByID($kll_id);
    $kill->remove(true, false);
    $html .= "Kill ID \"" . $kll_id . "\" deleted!";
    $html .= "<br><br><a href=\"javascript:window.close();\">[close]</a>";
} else {
    if (isset($_GET['permanent'])) {
        $kill = Kill::getByID($kll_id);
        $kill->remove(true, true);
        $html .= "Kill ID \"" . $kll_id . "\" deleted!";
        $html .= "<br><br><a href=\"javascript:window.close();\">[close]</a>";
    } else {
        $cargs = array();
        $cargs[] = array("a", "admin_kill_delete", true);
        $cargs[] = array("kll_id", $kll_id, true);
        $pargs = $cargs;
        $cargs[] = array("confirm", "yes", false);
        $pargs[] = array("permanent", "yes", false);
        $html .= "Delete Kill ID \"" . $kll_id . "\": ";
        $html .= "<button onClick=\"window.location.href='" . edkURI::build($cargs) . "'\">Yes</button><br />";
        $html .= "Delete and prevent reposting: ";
        $html .= "<button onClick=\"window.location.href='" . edkURI::build($pargs) . "'\">Yes</button><br />";
        $html .= "Abort deletion and return: ";
Example #4
0
 /**
  * Update the stored value of an item and the total value of this kill.
  *
  * Input values are taken from the query string.
  */
 private function updatePrices()
 {
     if (config::get('item_values')) {
         if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') {
             // Send new value for item to the database
             $qry = DBFactory::getDBQuery();
             $qry->autocommit(false);
             if (isset($_POST['SID'])) {
                 $SID = intval($_POST['SID']);
                 $Val = preg_replace('/[^0-9]/', '', $_POST[$SID]);
                 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('" . $SID . "', '" . $Val . "') ON DUPLICATE KEY UPDATE price = '" . $Val . "'");
                 Ship::delCache($this->kill->getVictimShip());
             } else {
                 $IID = intval($_POST['IID']);
                 $Val = preg_replace('/[^0-9]/', '', $_POST[$IID]);
                 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('" . $IID . "', '" . $Val . "') ON DUPLICATE KEY UPDATE price = '" . $Val . "'");
                 Item::delCache(Item::getByID($IID));
             }
             Kill::delCache($this->kill);
             $this->kill = Kill::getByID($this->kill->getID());
             $this->kill->calculateISKLoss(true);
             $qry->autocommit(true);
         }
     }
 }
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  *
  */
 function start()
 {
     // set some directory paths for this mod first
     $this->modDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
     $this->includeDir = $this->modDir . 'include' . DIRECTORY_SEPARATOR;
     $this->cssDir = config::get("cfg_kbhost") . '/mods/' . basename(dirname(__FILE__)) . '/css/';
     $this->templateDir = $this->modDir . 'template' . DIRECTORY_SEPARATOR;
     $this->jsDir = config::get("cfg_kbhost") . '/mods/' . basename(dirname(__FILE__)) . '/js/';
     $this->imgDir = config::get("cfg_kbhost") . '/mods/' . basename(dirname(__FILE__)) . '/img/';
     $this->page = new Page('Related kills & losses');
     $this->page->addHeader('<meta name="robots" content="index, nofollow" />');
     $this->isFixed = FALSE;
     $this->kll_id = (int) edkURI::getArg('kll_id', 1);
     if (!$this->kll_id) {
         $this->kll_external_id = (int) edkURI::getArg('kll_ext_id');
         if (!$this->kll_external_id) {
             // internal and external ids easily overlap so we can't guess which
             $this->kll_id = (int) edkURI::getArg(null, 1);
             $this->kill = Kill::getByID($this->kll_id);
         } else {
             $this->kill = new Kill($this->kll_external_id, true);
             $this->kll_id = $this->kill->getID();
         }
     } else {
         $this->kill = Kill::getByID($this->kll_id);
     }
     // read url parameters
     $this->adjacent = (bool) edkURI::getArg('adjacent');
     $this->scl_id = (int) edkURI::getArg('scl_id');
     $this->displayingBattle = (bool) edkURI::getArg('battle');
     $this->menuOptions = array();
     if (!$this->kll_id || !$this->kill->exists()) {
         echo 'No valid kill id specified';
         exit;
     }
     if ($this->kill->isClassified()) {
         Header("Location: " . KB_HOST . "/?a=kill_detail&kll_id=" . $this->kll_id);
         die;
     }
     // set javascript headers
     $this->page->addHeader("<link rel=\"stylesheet\" href=\"" . $this->cssDir . "tabber.css\" TYPE=\"text/css\" MEDIA=\"screen\">");
     $this->page->addHeader("<script type=\"text/javascript\">var fleetBattlesLoadingImage = '" . $this->imgDir . "loading.gif';</script>");
     $this->page->addHeader("<script type=\"text/javascript\" src=\"" . $this->jsDir . "entity.js\"></script>");
     $this->page->addHeader("<script type=\"text/javascript\" src=\"" . $this->jsDir . "fleetBattles.js\"></script>");
     $this->page->addHeader("<script type=\"text/javascript\" src=\"" . $this->jsDir . "tabber.js\"></script>");
     $this->page->addHeader('<link rel="stylesheet" type="text/css" href="' . $this->cssDir . 'style.css">');
     // include helpers
     include_once $this->includeDir . "class.helpers.php";
 }