Ejemplo n.º 1
0
include_once 'includes/class.pos.php';
include_once 'includes/eveRender.class.php';
include_once 'includes/class.posmailer.php';
$eveRender = new eveRender($config, $mod, false);
$colors = $eveRender->themeconfig;
$eve = new Eve();
$posmgmt = new POSMGMT();
$mail = new posMailer();
$mail->mailinit();
$userinfo = $posmgmt->GetUserInfo();
$eve->SessionSetVar('userlogged', 1);
$access = 5;
$eve->SessionSetVar('access', $access);
$eveRender->Assign('access', $access);
$args['pr'] = 2;
$rows = $posmgmt->GetAllPos2($args);
foreach ($rows as $key => $row) {
    $row2 = $posmgmt->GetLastPosUpdate($row['pos_id']);
    $tower = $posmgmt->GetTowerInfo($row['pos_id']);
    if ($tower) {
        $tower['current_cpu'] = $tower['cpu'];
        $tower['current_pg'] = $tower['powergrid'];
    }
    $charters_needed = $tower['charters_needed'];
    $pos_size = $row['pos_size'];
    $pos_race = $row['pos_race'];
    $systemID = $row['systemID'];
    $allianceid = $row['allianceid'];
    $tower['sovfriendly'] = $posmgmt->getSovereigntyStatus($systemID, $allianceid);
    $row3 = $posmgmt->GetStaticFBTowerInfo(array('pos_race' => $pos_race, 'pos_size' => $pos_size));
    if ($tower['sovfriendly'] == 1) {
            $partial_optimal['total'] = $partial_optimal['optimum_fuelblock'] * $pos_Fbl;
            if ($tower['charters_needed'] == 1) {
                $partial_optimal['total'] = $partial_optimal['total'] + $partial_optimal['optimum_charters'] * $pos_Cha;
            }
        }
        if ($cargosize > 0) {
            $fuel['trips2'] = ceil($optimalDiff['totalDiff'] / $cargosize);
        }
        $eveRender->Assign('optimal', $optimal);
        $eveRender->Assign('optimalDiff', $optimalDiff);
        $eveRender->Assign('partial_optimal', $partial_optimal);
    }
    $eveRender->Assign('pos_id', $pos_id);
    $eveRender->Assign('race_isotope', $race_isotope);
    $eveRender->Assign('fuel', $fuel);
    $eveRender->Assign('hours', $hours);
    $eveRender->Assign('cargosize', $cargosize);
    $eveRender->Assign('pos_to_refuel', $pos_to_refuel);
    $eveRender->Assign('days_to_refuel', $args['days_to_refuel']);
    $eveRender->Assign('display_optimal', $display_optimal);
    $eveRender->Assign('use_current_levels', $use_current_levels);
    $eveRender->Assign('partial_fuelup', $partial_fuelup);
}
$towers = $posmgmt->GetAllPos2();
$opttowers[0] = 'POS List';
foreach ($towers as $tower) {
    $opttowers[$tower['pos_id']] = $tower['MoonName'] . ' - ' . $tower['towerName'];
}
$eveRender->Assign('opttowers', $opttowers);
$eveRender->Display('fuel_calc.tpl');
exit;