示例#1
0
 public static function ShowFleetPage()
 {
     global $USER, $PLANET, $reslist, $resource, $db, $LNG, $ExtraDM;
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDB();
     $parse = $LNG;
     $FleetID = request_var('fleetid', 0);
     $GetAction = request_var('action', "");
     $template = new template();
     $template->loadscript('flotten.js');
     if (!empty($FleetID)) {
         switch ($GetAction) {
             case "sendfleetback":
                 parent::SendFleetBack($USER, $FleetID);
                 break;
             case "getakspage":
                 $template->assign_vars(parent::GetAKSPage($USER, $PLANET, $FleetID));
                 break;
         }
     }
     $MaxExpedition = $USER[$resource[124]];
     if ($MaxExpedition >= 1) {
         $ExpeditionEnCours = parent::GetCurrentFleets($USER['id'], 15);
         $EnvoiMaxExpedition = floor(sqrt($MaxExpedition));
     } else {
         $ExpeditionEnCours = 0;
         $EnvoiMaxExpedition = 0;
     }
     $MaxFlottes = parent::GetMaxFleetSlots($USER);
     $galaxy = request_var('galaxy', $PLANET['galaxy']);
     $system = request_var('system', $PLANET['system']);
     $planet = request_var('planet', $PLANET['planet']);
     $planettype = request_var('planettype', $PLANET['planet_type']);
     $target_mission = request_var('target_mission', 0);
     $CurrentFleets = $db->query("SELECT * FROM " . FLEETS . " WHERE `fleet_owner` = '" . $USER['id'] . "' AND `fleet_mission` <> 10 ORDER BY `fleet_end_time` ASC;");
     $CountCurrentFleets = $db->num_rows($CurrentFleets);
     while ($CurrentFleetsRow = $db->fetch_array($CurrentFleets)) {
         $fleet = explode(";", $CurrentFleetsRow['fleet_array']);
         foreach ($fleet as $ShipID => $ShipCount) {
             if (empty($ShipCount)) {
                 continue;
             }
             $a = explode(",", $ShipCount);
             $FleetList[$CurrentFleetsRow['fleet_id']][$LNG['tech'][$a[0]]] = pretty_number($a[1]);
         }
         $FlyingFleetList[] = array('id' => $CurrentFleetsRow['fleet_id'], 'mission' => $CurrentFleetsRow['fleet_mission'], 'missionname' => $LNG['type_mission'][$CurrentFleetsRow['fleet_mission']], 'way' => $CurrentFleetsRow['fleet_mess'], 'start_galaxy' => $CurrentFleetsRow['fleet_start_galaxy'], 'start_system' => $CurrentFleetsRow['fleet_start_system'], 'start_planet' => $CurrentFleetsRow['fleet_start_planet'], 'start_time' => date(TDFORMAT, $CurrentFleetsRow['fleet_start_time']), 'end_galaxy' => $CurrentFleetsRow['fleet_end_galaxy'], 'end_system' => $CurrentFleetsRow['fleet_end_system'], 'end_planet' => $CurrentFleetsRow['fleet_end_planet'], 'end_time' => date(TDFORMAT, $CurrentFleetsRow['fleet_end_time']), 'amount' => pretty_number($CurrentFleetsRow['fleet_amount']), 'backin' => pretty_time(floor($CurrentFleetsRow['fleet_end_time'] - TIMESTAMP)), 'FleetList' => $FleetList[$CurrentFleetsRow['fleet_id']]);
     }
     $db->free_result($CurrentFleets);
     foreach ($reslist['fleet'] as $FleetID) {
         if ($PLANET[$resource[$FleetID]] > 0) {
             $FleetsOnPlanet[] = array('id' => $FleetID, 'name' => $LNG['tech'][$FleetID], 'speed' => parent::GetFleetMaxSpeed($FleetID, $USER), 'count' => pretty_number($PLANET[$resource[$FleetID]]));
         }
     }
     $template->assign_vars(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'fl_number' => $LNG['fl_number'], 'fl_mission' => $LNG['fl_mission'], 'fl_ammount' => $LNG['fl_ammount'], 'fl_beginning' => $LNG['fl_beginning'], 'fl_departure' => $LNG['fl_departure'], 'fl_destiny' => $LNG['fl_destiny'], 'fl_objective' => $LNG['fl_objective'], 'fl_arrival' => $LNG['fl_arrival'], 'fl_order' => $LNG['fl_order'], 'fl_new_mission_title' => $LNG['fl_new_mission_title'], 'fl_ship_type' => $LNG['fl_ship_type'], 'fl_ship_available' => $LNG['fl_ship_available'], 'fl_fleets' => $LNG['fl_fleets'], 'fl_expeditions' => $LNG['fl_expeditions'], 'fl_speed_title' => $LNG['fl_speed_title'], 'fl_max' => $LNG['fl_max'], 'fl_no_more_slots' => $LNG['fl_no_more_slots'], 'fl_continue' => $LNG['fl_continue'], 'fl_no_ships' => $LNG['fl_no_ships'], 'fl_select_all_ships' => $LNG['fl_select_all_ships'], 'fl_remove_all_ships' => $LNG['fl_remove_all_ships'], 'fl_acs' => $LNG['fl_acs'], 'fl_send_back' => $LNG['fl_send_back'], 'fl_returning' => $LNG['fl_returning'], 'fl_r' => $LNG['fl_r'], 'fl_onway' => $LNG['fl_onway'], 'fl_a' => $LNG['fl_a'], 'fl_info_detail' => $LNG['fl_info_detail'], 'fl_bonus' => $LNG['fl_bonus'], 'fl_bonus_attack' => $LNG['fl_bonus_attack'], 'fl_bonus_defensive' => $LNG['fl_bonus_defensive'], 'fl_bonus_shield' => $LNG['fl_bonus_shield'], 'bonus_comp' => $LNG['tech'][115], 'bonus_impul' => $LNG['tech'][117], 'bonus_hyper' => $LNG['tech'][118], 'galaxy' => $galaxy, 'system' => $system, 'planet' => $planet, 'planettype' => $planettype, 'target_mission' => $target_mission, 'envoimaxexpedition' => $EnvoiMaxExpedition, 'expeditionencours' => $ExpeditionEnCours, 'flyingfleets' => $CountCurrentFleets, 'maxfleets' => $MaxFlottes, 'target_mission' => $target_mission, 'currentexpeditions' => $ExpeditionEnCours, 'maxexpeditions' => $EnvoiMaxExpedition, 'slots_available' => $MaxFlottes <= $MaxFlyingFleets - $MaxFlyingRaks ? false : true, 'AKSPage' => $AKSPage, 'bonus_attack' => $USER[$resource[109]] * 10 + (TIMESTAMP - $USER[$resource[700]] <= 0 ? 100 * $ExtraDM[700]['add'] : 0) * 5, 'bonus_defensive' => $USER[$resource[110]] * 10 + (TIMESTAMP - $USER[$resource[701]] <= 0 ? 100 * $ExtraDM[701]['add'] : 0) * 5, 'bonus_shield' => $USER[$resource[111]] * 10 + (TIMESTAMP - $USER[$resource[700]] <= 0 ? 100 * $ExtraDM[700]['add'] : 0) * 5, 'bonus_combustion' => $USER[$resource[115]] * 10 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0), 'bonus_impulse' => $USER[$resource[117]] * 20 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0), 'bonus_hyperspace' => $USER[$resource[118]] * 30 + (TIMESTAMP - $USER[$resource[706]] <= 0 ? 100 * $ExtraDM[706]['add'] : 0)));
     $template->show('fleet_table.tpl');
 }
示例#2
0
function DeleteSelectedPlanet($planetID)
{
    $planetData = $GLOBALS['DATABASE']->getFirstRow("SELECT planet_type FROM " . PLANETS . " WHERE id = " . $planetID . " AND id NOT IN (SELECT id_planet FROM " . USERS . ");");
    if (empty($planetData)) {
        return false;
    }
    $fleetData = $GLOBALS['DATABASE']->query("SELECT fleet_id FROM " . FLEETS . " WHERE fleet_end_id = " . $planetID . ";");
    while ($FleetID = $GLOBALS['DATABASE']->fetch_array($fleetData)) {
        FleetFunctions::SendFleetBack(${$planetID}, $FleetID['fleet_id']);
    }
    $GLOBALS['DATABASE']->free_result($fleetData);
    if ($planetData['planet_type'] == 3) {
        $GLOBALS['DATABASE']->multi_query("DELETE FROM " . PLANETS . " WHERE id = " . $planetID . ";UPDATE " . PLANETS . " SET id_luna = 0 WHERE id_luna = " . $planetID . ";");
    } else {
        $GLOBALS['DATABASE']->query("DELETE FROM " . PLANETS . " WHERE id = " . $planetID . " OR id_luna = " . $planetID . ";");
    }
}
 public function show()
 {
     global $USER, $PLANET, $reslist, $resource, $LNG;
     $acsData = array();
     $FleetID = HTTP::_GP('fleetID', 0);
     $GetAction = HTTP::_GP('action', "");
     $db = Database::get();
     $this->tplObj->loadscript('flotten.js');
     if (!empty($FleetID) && !IsVacationMode($USER)) {
         switch ($GetAction) {
             case "sendfleetback":
                 FleetFunctions::SendFleetBack($USER, $FleetID);
                 break;
             case "acs":
                 $acsData = $this->getACSPageData($FleetID);
                 break;
         }
     }
     $techExpedition = $USER[$resource[124]];
     if ($techExpedition >= 1) {
         $activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15, true);
         $maxExpedition = floor(sqrt($techExpedition));
     } else {
         $activeExpedition = 0;
         $maxExpedition = 0;
     }
     $maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
     $targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
     $targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
     $targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
     $targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
     $targetMission = HTTP::_GP('target_mission', 0);
     $sql = "SELECT * FROM %%FLEETS%% WHERE fleet_owner = :userID AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;";
     $fleetResult = $db->select($sql, array(':userID' => $USER['id']));
     $activeFleetSlots = $db->rowCount();
     $FlyingFleetList = array();
     foreach ($fleetResult as $fleetsRow) {
         $FleetList[$fleetsRow['fleet_id']] = FleetFunctions::unserialize($fleetsRow['fleet_array']);
         if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
             $returnTime = $fleetsRow['fleet_start_time'];
         } else {
             $returnTime = $fleetsRow['fleet_end_time'];
         }
         $FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
     }
     $FleetsOnPlanet = array();
     foreach ($reslist['fleet'] as $FleetID) {
         if ($PLANET[$resource[$FleetID]] == 0) {
             continue;
         }
         $FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
     }
     $this->assign(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'activeExpedition' => $activeExpedition, 'maxExpedition' => $maxExpedition, 'activeFleetSlots' => $activeFleetSlots, 'maxFleetSlots' => $maxFleetSlots, 'targetGalaxy' => $targetGalaxy, 'targetSystem' => $targetSystem, 'targetPlanet' => $targetPlanet, 'targetType' => $targetType, 'targetMission' => $targetMission, 'acsData' => $acsData, 'isVacation' => IsVacationMode($USER), 'bonusAttack' => $USER[$resource[109]] * 10 + (1 + abs($USER['factor']['Attack'])) * 100, 'bonusDefensive' => $USER[$resource[110]] * 10 + (1 + abs($USER['factor']['Defensive'])) * 100, 'bonusShield' => $USER[$resource[111]] * 10 + (1 + abs($USER['factor']['Shield'])) * 100, 'bonusCombustion' => $USER[$resource[115]] * 10, 'bonusImpulse' => $USER[$resource[117]] * 20, 'bonusHyperspace' => $USER[$resource[118]] * 30));
     $this->display('page.fleetTable.default.tpl');
 }
示例#4
0
 public static function deletePlanet($planetId)
 {
     $db = Database::get();
     $sql = 'SELECT id_owner, planet_type FROM %%PLANETS%% WHERE id = :planetId AND id NOT IN (SELECT id_planet FROM %%USERS%%);';
     $planetData = $db->selectSingle($sql, array(':planetId' => $planetId));
     if (empty($planetType)) {
         return false;
     }
     $sql = 'SELECT fleet_id FROM %%FLEETS%% WHERE fleet_end_id = :planetId;';
     $fleetIds = $db->select($sql, array(':planetId' => $planetId));
     foreach ($fleetIds as $fleetId) {
         FleetFunctions::SendFleetBack($planetData['id_owner'], $fleetId);
     }
     if ($planetData['planet_type'] == 3) {
         $sql = 'DELETE FROM %%PLANETS%% WHERE id = :planetId;';
         $db->delete($sql, array(':planetId' => $planetId));
         $sql = 'UPDATE %%PLANETS%% SET id_luna = :resetId WHERE id_luna = :planetId;';
         $db->update($sql, array(':resetId' => 0, ':planetId' => $planetId));
     } else {
         $sql = 'DELETE FROM %%PLANETS%% WHERE id = :planetId; OR id_luna = :planetId;';
         $db->delete($sql, array(':planetId' => $planetId));
     }
     return true;
 }
示例#5
0
 public static function deletePlanet($planetId)
 {
     $db = Database::get();
     $sql = 'SELECT id_owner, planet_type, id_luna FROM %%PLANETS%% WHERE id = :planetId AND id NOT IN (SELECT id_planet FROM %%USERS%%);';
     $planetData = $db->selectSingle($sql, array(':planetId' => $planetId));
     if (empty($planetData)) {
         throw new Exception("Can not found planet #" . $planetId . "!");
     }
     $sql = 'SELECT fleet_id FROM %%FLEETS%% WHERE fleet_end_id = :planetId OR (fleet_end_type = 3 AND fleet_end_id = :moondId);';
     $fleetIds = $db->select($sql, array(':planetId' => $planetId, ':moondId' => $planetData['id_luna']));
     foreach ($fleetIds as $fleetId) {
         FleetFunctions::SendFleetBack(array('id' => $planetData['id_owner']), $fleetId['fleet_id']);
     }
     if ($planetData['planet_type'] == 3) {
         $sql = 'DELETE FROM %%PLANETS%% WHERE id = :planetId;';
         $db->delete($sql, array(':planetId' => $planetId));
         $sql = 'UPDATE %%PLANETS%% SET id_luna = :resetId WHERE id_luna = :planetId;';
         $db->update($sql, array(':resetId' => 0, ':planetId' => $planetId));
     } else {
         $sql = 'DELETE FROM %%PLANETS%% WHERE id = :planetId OR id_luna = :planetId;';
         $db->delete($sql, array(':planetId' => $planetId));
     }
     return true;
 }
 public function show()
 {
     global $USER, $PLANET, $reslist, $resource, $LNG;
     $acsData = array();
     $FleetID = HTTP::_GP('fleetID', 0);
     $GetAction = HTTP::_GP('action', "");
     $this->tplObj->loadscript('flotten.js');
     if (!empty($FleetID) && !IsVacationMode($USER)) {
         switch ($GetAction) {
             case "sendfleetback":
                 FleetFunctions::SendFleetBack($USER, $FleetID);
                 break;
             case "acs":
                 $acsData = $this->getACSPageData($FleetID);
                 break;
         }
     }
     $techExpedition = $USER[$resource[124]];
     if ($techExpedition >= 1) {
         $activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15);
         $maxExpedition = floor(sqrt($techExpedition));
     } else {
         $activeExpedition = 0;
         $maxExpedition = 0;
     }
     $maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
     $targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
     $targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
     $targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
     $targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
     $targetMission = HTTP::_GP('target_mission', 0);
     $fleetResult = $GLOBALS['DATABASE']->query("SELECT * FROM " . FLEETS . " WHERE fleet_owner = " . $USER['id'] . " AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;");
     $activeFleetSlots = $GLOBALS['DATABASE']->numRows($fleetResult);
     $FlyingFleetList = array();
     while ($fleetsRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
         $fleet = explode(";", $fleetsRow['fleet_array']);
         $FleetList = array();
         foreach ($fleet as $shipDetail) {
             if (empty($shipDetail)) {
                 continue;
             }
             $ship = explode(",", $shipDetail);
             $FleetList[$fleetsRow['fleet_id']][$ship[0]] = $ship[1];
         }
         if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
             $returnTime = $fleetsRow['fleet_start_time'];
         } else {
             $returnTime = $fleetsRow['fleet_end_time'];
         }
         $FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
     }
     $GLOBALS['DATABASE']->free_result($fleetResult);
     $FleetsOnPlanet = array();
     $avaible_fleets = array(202, 203, 209, 223, 219, 210, 224, 204, 205, 206, 207, 211, 214, 215, 216);
     foreach ($avaible_fleets as $FleetID) {
         if ($PLANET[$resource[$FleetID]] == 0) {
             continue;
         }
         $FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
     }
     $this->tplObj->assign_vars(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'activeExpedition' => $activeExpedition, 'maxExpedition' => $maxExpedition, 'activeFleetSlots' => $activeFleetSlots, 'maxFleetSlots' => $maxFleetSlots, 'targetGalaxy' => $targetGalaxy, 'targetSystem' => $targetSystem, 'targetPlanet' => $targetPlanet, 'targetType' => $targetType, 'targetMission' => $targetMission, 'acsData' => $acsData, 'isVacation' => IsVacationMode($USER), 'bonusAttack' => $USER[$resource[109]] * 10 + (1 + abs($USER['factor']['Attack'])) * 100, 'bonusDefensive' => $USER[$resource[110]] * 10 + (1 + abs($USER['factor']['Defensive'])) * 100, 'bonusShield' => $USER[$resource[111]] * 10 + (1 + abs($USER['factor']['Shield'])) * 100, 'bonusCombustion' => $USER[$resource[115]] * 10, 'bonusImpulse' => $USER[$resource[117]] * 20, 'bonusHyperspace' => $USER[$resource[118]] * 30));
     $this->display('page.fleetTable.default.tpl');
 }
 public function show()
 {
     global $USER, $PLANET, $reslist, $resource, $LNG;
     $acsData = array();
     $FleetID = HTTP::_GP('fleetID', 0);
     $GetAction = HTTP::_GP('action', "");
     $this->tplObj->loadscript('flotten.js');
     if (!empty($FleetID) && !IsVacationMode($USER)) {
         switch ($GetAction) {
             case "sendfleetback":
                 FleetFunctions::SendFleetBack($USER, $FleetID);
                 break;
             case "acs":
                 $acsData = $this->getACSPageData($FleetID);
                 break;
         }
     }
     $techExpedition = $USER[$resource[124]];
     if ($techExpedition >= 1) {
         $activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15);
         $maxExpedition = floor(sqrt($techExpedition));
     } else {
         $activeExpedition = 0;
         $maxExpedition = 0;
     }
     $maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
     $targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
     $targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
     $targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
     $targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
     $targetMission = HTTP::_GP('target_mission', 0);
     $fleetResult = $GLOBALS['DATABASE']->query("SELECT * FROM " . FLEETS . " WHERE fleet_owner = " . $USER['id'] . " AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;");
     $activeFleetSlots = $GLOBALS['DATABASE']->numRows($fleetResult);
     $FlyingFleetList = array();
     while ($fleetsRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
         $fleet = explode(";", $fleetsRow['fleet_array']);
         $FleetList = array();
         foreach ($fleet as $shipDetail) {
             if (empty($shipDetail)) {
                 continue;
             }
             $ship = explode(",", $shipDetail);
             $FleetList[$fleetsRow['fleet_id']][$ship[0]] = $ship[1];
         }
         if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
             $returnTime = $fleetsRow['fleet_start_time'];
         } else {
             $returnTime = $fleetsRow['fleet_end_time'];
         }
         $FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
     }
     $GLOBALS['DATABASE']->free_result($fleetResult);
     $FleetsOnPlanet = array();
     $FleetsOnPlanetTransport = array();
     $FleetsOnPlanetProccesors = array();
     $FleetsOnPlanetSpecial = array();
     $elementALL = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230);
     $elementPlanet = array(204, 205, 229, 206, 207, 215, 213, 211, 224, 225, 226, 214, 216, 230, 227, 228, 218, 222, 221);
     $elementPlanetTransport = array(202, 203, 217);
     $elementPlanetProccesors = array(209, 219);
     $elementPlanetSpecial = array(208, 210, 220, 223);
     $getch3 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[202]] . " + " . $PLANET[$resource[203]] . " + " . $PLANET[$resource[204]] . " + " . $PLANET[$resource[205]] . " + " . $PLANET[$resource[206]] . " + " . $PLANET[$resource[207]] . " + " . $PLANET[$resource[208]] . " + " . $PLANET[$resource[209]] . " + " . $PLANET[$resource[210]] . " + " . $PLANET[$resource[211]] . " + " . $PLANET[$resource[212]] . " + " . $PLANET[$resource[213]] . " + " . $PLANET[$resource[214]] . " + " . $PLANET[$resource[215]] . " + " . $PLANET[$resource[216]] . " + " . $PLANET[$resource[217]] . " + " . $PLANET[$resource[218]] . " + " . $PLANET[$resource[219]] . " + " . $PLANET[$resource[220]] . " + " . $PLANET[$resource[221]] . " + " . $PLANET[$resource[222]] . " + " . $PLANET[$resource[223]] . " + " . $PLANET[$resource[224]] . " + " . $PLANET[$resource[225]] . " + " . $PLANET[$resource[226]] . " + " . $PLANET[$resource[227]] . " + " . $PLANET[$resource[228]] . ") as fleet3 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
     while ($x3 = $GLOBALS['DATABASE']->fetch_array($getch3)) {
         $resp3 = $x3['fleet3'];
     }
     $getch = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[202]] . " + " . $PLANET[$resource[203]] . " + " . $PLANET[$resource[217]] . ") as fleet FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
     while ($x = $GLOBALS['DATABASE']->fetch_array($getch)) {
         $resp = $x['fleet'];
     }
     $getch1 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[209]] . " + " . $PLANET[$resource[219]] . ") as fleet1 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
     while ($x1 = $GLOBALS['DATABASE']->fetch_array($getch1)) {
         $resp1 = $x1['fleet1'];
     }
     $getch2 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[208]] . " + " . $PLANET[$resource[210]] . " + " . $PLANET[$resource[220]] . " + " . $PLANET[$resource[223]] . ") as fleet2 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
     while ($x2 = $GLOBALS['DATABASE']->fetch_array($getch2)) {
         $resp2 = $x2['fleet2'];
     }
     $xxx = $resp2;
     $ttt = $resp;
     if ($targetMission != 12) {
         foreach ($elementPlanet as $FleetID) {
             if ($PLANET[$resource[$FleetID]] == 0) {
                 continue;
             }
             $FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
         }
         foreach ($elementPlanetTransport as $FleetID) {
             if ($PLANET[$resource[$FleetID]] == 0) {
                 continue;
             }
             $FleetsOnPlanetTransport[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
         }
     }
     foreach ($elementPlanetProccesors as $FleetID) {
         if ($PLANET[$resource[$FleetID]] == 0) {
             continue;
         }
         $FleetsOnPlanetProccesors[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
     }
     foreach ($elementPlanetSpecial as $FleetID) {
         if ($PLANET[$resource[$FleetID]] == 0) {
             continue;
         }
         $FleetsOnPlanetSpecial[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
     }
     $SC = round(($PLANET['metal'] + $PLANET['crystal'] + $PLANET['deuterium']) / 5000);
     $LC = round(($PLANET['metal'] + $PLANET['crystal'] + $PLANET['deuterium']) / 25000);
     $UT = round(($PLANET['metal'] + $PLANET['crystal'] + $PLANET['deuterium']) / 400000000);
     $GR = round(($PLANET['metal'] + $PLANET['crystal'] + $PLANET['deuterium']) / 200000000);
     $REC = round(($PLANET['metal'] + $PLANET['crystal'] + $PLANET['deuterium']) / 20000);
     $this->tplObj->assign_vars(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FleetsOnPlanetTransport' => $FleetsOnPlanetTransport, 'FleetsOnPlanetProccesors' => $FleetsOnPlanetProccesors, 'FleetsOnPlanetSpecial' => $FleetsOnPlanetSpecial, 'FlyingFleetList' => $FlyingFleetList, 'activeExpedition' => $activeExpedition, 'maxExpedition' => $maxExpedition, 'activeFleetSlots' => $activeFleetSlots, 'maxFleetSlots' => $maxFleetSlots, 'targetGalaxy' => $targetGalaxy, 'targetSystem' => $targetSystem, 'targetPlanet' => $targetPlanet, 'targetType' => $targetType, 'targetMission' => $targetMission, 'acsData' => $acsData, 'isVacation' => IsVacationMode($USER), 'bonusAttack' => $USER[$resource[109]] + getbonusOne(1102, $USER['academy_1102']) + getbonusOne(1101, $USER['academy_1101']) + abs($USER['factor']['Attack']) * 100, 'bonusDefensive' => $USER[$resource[110]] + abs($USER['factor']['Defensive']) * 100, 'bonusShield' => $USER[$resource[111]] + abs($USER['factor']['Shield']) * 100, 'bonusCombustion' => $USER[$resource[115]] * 10, 'bonusImpulse' => $USER[$resource[117]] * 20, 'bonusHyperspace' => $USER[$resource[118]] * 30, 'sc' => $SC, 'lc' => $LC, 'ut' => $UT, 'gr' => $GR, 'rec' => $REC, 'resp' => $resp, 'resp1' => $resp1, 'xxx' => $xxx, 'ttt' => $ttt, 'resp3' => $resp3));
     $this->display('page.fleetTable.default.tpl');
 }