Example #1
0
 function reverse_ids()
 {
     if (!is_null($this->pilot_id)) {
         $this->pilot = get_pilot_name($this->pilot_id);
     }
     if (!is_null($this->alliance_id)) {
         $this->alliance = get_alliance_name($this->alliance_id);
     }
     if (!is_null($this->corp_id)) {
         $this->corp = get_corp_name($this->corp_id);
         $this->corp_ticker = get_corp_ticker($this->corp_id, 1);
     }
     if (!is_null($this->ship_id)) {
         $this->ship = get_item_name($this->ship_id);
     }
     if (!is_null($this->group_id)) {
         $this->group = get_group_name($this->group_id);
     }
     if (!is_null($this->weapon_id)) {
         $this->weapon = get_item_name($this->weapon_id);
     }
 }
# load this complex
$plex = load_complex($id);
if (is_null($plex)) {
    return $ft->igberrorpage('Sorry, that complex was not found.');
}
# validate their id
$dayid = $_GET['dayid'] + 0;
$slotid = $_GET['slotid'] + 0;
$time = slot_to_date($dayid);
if (is_null($time) || $time <= 0 || $slotid <= 0) {
    return $ft->igberrorpage('Sorry, that does not appear to be a valid dayid and/or slotid.');
}
# get run information
$run = load_run($id, $dayid, $slotid);
if ($run) {
    return $ft->igberrorpage('Sorry, that run is already scheduled by <font color="#ff0000">' . get_corp_name($run->corpid) . '</font>.');
}
# see if they are allowed to reserve spots
# FIXME: implement
if (0) {
    return $ft->igberrorpage('Sorry, you must be an accountant or director in your corporation in order to schedule a run.');
}
# store output here
$out = "<center><b><font color='#ffff00'>Plexer - The Complex Scheduler</font></b><br />";
$out .= "<font color='#ff0000'><b>{$plex->name}</b> in <b>{$plex->system}</b> rated <b>{$plex->rating}/10</b></font><br />";
$out .= "[ <a href='{$_WEB_URL}/'>Back to Top</a> ] [ <a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>Back to Complex</a> ]";
$out .= "</center><br />";
# if they're trying to confirm
if ($_GET['confirm'] == 1) {
    # okay, set the confirmation
    $run = submit_schedule($id, $dayid, $slotid, get_corp_id($ft->eve->CorpName), get_pilot_id($ft->eve->CharName));
Example #3
0
function get_corp_link($corpid)
{
    global $_WEB_URL;
    $url = $_WEB_URL . "/show.php?corpid=" . $corpid;
    return "<a href='{$url}'>" . get_corp_name($corpid) . "</a>";
}
Example #4
0
<?php

include 'lib/fortissimo.php';
# figure out what they want to filter on
$corpid = $_GET['corpid'];
if (!$corpid) {
    return $ft->errorpage('Sorry, you got to this page in an invalid way.');
}
# load the pilot
$corp = get_corp_name($corpid);
if (!$corp) {
    return $ft->errorpage('Sorry, that corporation does not seem to exist.');
}
# now get some interesting stats
$stats = array();
$get = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
foreach ($get as $when => $val) {
    $st = $ft->dbh->_select_row_as_assoc('SELECT * FROM tbl:stats WHERE type = "corp" AND var1 = ? AND dtype = ? AND var2 = ?', array($corpid, $when, $val));
    $stats[$when] = $st;
}
# get various top 10s
$ft->assign('t10weapons', get_top10('corp', $corpid, 'weapon'));
$ft->assign('t10shipslost', get_top10('corp', $corpid, 'ship_lost'));
$ft->assign('t10shipsdestroyed', get_top10('corp', $corpid, 'ship_killed'));
$ft->assign('t10systems', get_top10('corp', $corpid, 'system'));
$ft->assign('t10targets', get_top10('corp', $corpid, 'pilot'));
$ft->assign('t10shipsflown', get_top10('corp', $corpid, 'ship_flown'));
# get the last 50 final blows
#    $fbids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "kill" ' .
#                                      'ORDER BY killtime DESC LIMIT 10', array($pilotid));
#    $fbs = load_kills_by_id($fbids);
Example #5
0
        $id = get_corp_id_fuzzy($what);
        if (is_array($id)) {
            # okay, show the list
            $list = array();
            foreach ($id as $cid) {
                array_push($list, "<a href='/search.php?{$querystring}&oid={$cid}'>" . get_corp_name($cid) . "</a>");
            }
            $ft->assign('list', $list);
            return $ft->errorpage('Found multiple corporations.  Please select one below.', 'search');
        }
        if ($what && !$id) {
            return $ft->errorpage('The corporation does not seem valid.  Have they ever shown up on this killboard?', 'search');
        }
    }
    $what = get_corp_name($id);
    $term = 'corporation <strong>' . get_corp_name($id) . '</strong>';
    $col = 'corpid';
}
$ft->assign('search_term', $term);
$ft->assign('what', $what);
# if we're doing indivuals, limit
$limit = 300;
if ($output == 'kills') {
    $limit = 300;
}
# if we're searching by something...
$bind = array();
$colx = "";
if ($col && $id > 0) {
    $colx = "{$col} = ? AND ";
    array_push($bind, $id);
 $slot = $d[1];
 $inpast = $d[2];
 $slotid = $slot->slotid;
 $out .= "<li>";
 $out .= stddate(slot_to_date($dayid));
 $out .= " - " . $slot->name;
 if ($scheds[$dayid][$slotid]) {
     $schedid = $scheds[$dayid][$slotid]->schedid;
     # setup tags we want
     $tag = "";
     if (!is_null($scheds[$dayid][$slotid]->ranattime)) {
         $tag = "<font color='#00ff00'>(DONE)</font> ";
     }
     # now let's print out basic information
     $out .= " - {$tag}<font color='#ff0000'>";
     $out .= "<b>" . get_corp_name($scheds[$dayid][$slotid]->corpid) . "</b></font>";
     # FIXME: access restrictions here please
     if (1) {
         $out .= " [ <b><a href='{$_WEB_URL}/igb-scheduleinfo.php?id={$id}&schedid={$schedid}'>See Run Information</a></b> ]";
     }
     # show comments
     $ccount = get_comment_count($schedid);
     if ($ccount > 0) {
         $out .= " <font color='green'><b>({$ccount} comments)</b></font>";
     }
 } else {
     $out .= " - <font color='#ffff00'>unreserved</font>";
     # FIXME: access restrictions here please
     if ($inpast) {
         # meh, say something?
     } else {
if (is_null($plex)) {
    return $ft->igberrorpage('Sorry, that complex was not found.');
}
# validate their id
$schedid = $_GET['schedid'] + 0;
$run = load_run_schedid($id, $schedid);
if (!$run) {
    return $ft->igberrorpage('Sorry, that run was not found.');
}
# store output here
$out = "<center><b><font color='#ffff00'>Plexer - The Complex Scheduler</font></b><br />";
$out .= "<font color='#ff0000'><b>{$plex->name}</b> in <b>{$plex->system}</b> rated <b>{$plex->rating}/10</b></font><br />";
$out .= "[ <a href='{$_WEB_URL}/'>Back to Top</a> ] [ <a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>Back to Complex</a> ]";
$out .= "</center><br />";
# dump the information
$info = array("Complex" => "<a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>{$plex->name}</a> (" . $plex->rating . "/10)", "System" => $plex->system . " (" . $plex->region . ")", "1" => "-", "Date" => stddate(slot_to_date($run->dayid)), "Name" => get_complex_slot_name($id, $run->slotid), "Description" => get_complex_slot_desc($id, $run->slotid), "2" => "-", "Reserved for corp" => get_corp_name($run->corpid), "Reserved by pilot" => get_pilot_name($run->pilotid), "3" => "-", "Was ran at" => is_null($run->ranattime) ? "not run yet" : stddate($run->ranattime));
foreach ($info as $k => $v) {
    if ($v == "-") {
        $out .= "<br />";
        continue;
    }
    $out .= " &bull; <font color='#ffff00'>{$k}:</font> {$v}<br />";
}
# set some flags
$is_corp_mgr = $run->corpid == get_corp_id($ft->eve->CorpName) ? 1 : 0;
$is_site_mgr = $obj->manager();
$is_mgr = $is_corp_mgr || $is_site_mgr;
# now give them some commands
if ($is_mgr) {
    $out .= "<br />";
    if (is_null($run->ranattime)) {
Example #8
0
    array_push($criteria, 'regionid = ?');
    array_push($bind, $regionid);
    array_push($args, "regionid={$regionid}");
    array_push($message, "in <strong>" . EVERegion::getName($regionid) . "</strong>");
}
if (is_numeric($groupid) && $groupid > 0) {
    array_push($criteria, '(v_groupid = ? OR k_groupid = ?)');
    array_push($bind, $groupid, $groupid);
    array_push($args, "groupid={$groupid}");
    array_push($message, "by group <strong>" . get_group_name($groupid) . "</strong>");
}
if (is_numeric($corpid) && $corpid > 0) {
    array_push($criteria, '(v_corpid = ? OR k_corpid = ?)');
    array_push($bind, $corpid, $corpid);
    array_push($args, "corpid={$corpid}");
    array_push($message, "by corp <strong>" . get_corp_name($corpid) . " [" . get_corp_ticker($corpid) . "]</strong>");
}
if (is_numeric($allianceid) && $allianceid > 0) {
    array_push($criteria, '(v_allianceid = ? OR k_allianceid = ?)');
    array_push($bind, $allianceid, $allianceid);
    array_push($args, "allianceid={$allianceid}");
    array_push($message, "by alliance <strong>" . get_alliance_name($allianceid) . "</strong>");
}
if (is_numeric($shipid) && $shipid > 0) {
    array_push($criteria, '(v_shipid = ? OR k_shipid = ?)');
    array_push($bind, $shipid, $shipid);
    array_push($args, "shipid={$shipid}");
    array_push($message, "with a <strong>" . get_item_name($shipid) . "</strong>");
}
if (is_numeric($pilotid) && $pilotid > 0) {
    array_push($criteria, '(v_pilotid = ? OR k_pilotid = ?)');