$eve->SessionSetVar('statusmsg', 'All Silos updated');
            $eve->RedirectUrl('viewpos.php?i=' . $pos_id);
        }
        break;
    case 'Assign As Fuel Tech':
        $newowner = $eve->VarCleanFromInput('newowner');
        $args = array('pos_id' => $pos_id, 'newowner_id' => $newowner);
        $posmgmt->updateOwner($args, $backup = false);
        break;
    case 'Assign As Backup Fuel Tech':
        $newowner = $eve->VarCleanFromInput('newowner');
        $args = array('pos_id' => $pos_id, 'newowner_id' => $newowner);
        $posmgmt->updateOwner($args, $backup = true);
        break;
}
$tower = $posmgmt->GetTowerInfo($pos_id);
if ($tower) {
    $current_fuelblock = $tower['fuelblock'];
    $outpost_id = $tower['outpost_id'];
    $outpost_name = $tower['outpost_name'];
    $current_strontium = $tower['strontium'];
    $current_charters = $tower['charters'];
    $pos_size = $tower['pos_size'];
    $pos_race = $tower['pos_race'];
    $towerName = $tower['towerName'];
    $systemID = $tower['systemID'];
    $location = $tower['moonName'];
    $tower_cpu = $tower['cpu'];
    $tower_pg = $tower['powergrid'];
    $status = $tower['status'];
    $systemName = $posmgmt->getSystemName($systemID);
$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) {
        $tower['hasSov'] = 0.75;
    } else {
        $tower['hasSov'] = 1;
 $args['use_current_levels'] = $use_current_levels;
 $args['display_optimal'] = $display_optimal;
 $args['calc_fuel'] = 1;
 $bill = $posmgmt->GetFuelBill($args);
 $tower = $bill[$pos_to_refuel];
 $system = $tower['system'];
 $pos_id = $tower['pos_id'];
 $pos_race = $tower['pos_race'];
 $locationName = $tower['locationName'];
 $tower['regionName'] = $posmgmt->getRegionNameFromMoonID($locationName);
 $fuel = $tower;
 if ($cargosize > 0) {
     $fuel['trips'] = ceil($fuel['total_volume'] / $cargosize);
 }
 if ($display_optimal == 1) {
     $tower = $posmgmt->GetTowerInfo($pos_to_refuel);
     if ($tower) {
         $pos_size = $tower['pos_size'];
         $pos_race = $tower['pos_race'];
         $tower_pg = $tower['powergrid'];
         $tower_cpu = $tower['cpu'];
         $systemID = $tower['systemID'];
         $location = $tower['moonName'];
         $tower['sovereignty'] = $posmgmt->getSovereignty($systemID);
         $allianceid = $tower['allianceid'];
         $tower['sovfriendly'] = $posmgmt->getSovereigntyStatus($systemID, $allianceid);
         $charters_needed = $tower['charters_needed'];
     }
     $row = $posmgmt->GetStaticFBTowerInfo(array('pos_race' => $pos_race, 'pos_size' => $pos_size));
     if ($tower['sovfriendly'] == 1) {
         $tower['hasSov'] = 0.75;