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');
 }
 function putsend()
 {
     global $USER, $PLANET, $LNG, $UNI, $CONF, $resource;
     $metal = $_POST['resource901'];
     $crystal = $_POST['resource902'];
     $deuterium = $_POST['resource903'];
     $premium_bank = 0;
     if ($USER['premium_reward_bank'] > 0 && $USER['premium_reward_bank_days'] > TIMESTAMP) {
         $premium_bank = $USER['premium_reward_bank'];
     }
     $academy_bank = 1;
     if ($USER['academy_1306'] > 0) {
         $academy_bank = getbonusOne(1306, $USER['academy_1306']);
     }
     $cost = 0;
     for ($i = 0; $i < $USER[$resource[125]]; $i++) {
         $cost = 2000 * pow(2, $USER[$resource[125]] + $i);
     }
     $max = $cost * $premium_bank * $academy_bank;
     if ($metal < 0 || $crystal < 0 || $deuterium < 0) {
         $this->printMessage("Hack Attempt", true, array('game.php?page=alliance&mode=storage', 2));
         die;
     } elseif ($PLANET['metal'] < $metal || $PLANET['crystal'] < $crystal || $PLANET['deuterium'] < $deuterium) {
         $this->printMessage("You dont have enough resources", true, array('game.php?page=alliance&mode=storage', 2));
         die;
     } elseif ($metal + $crystal + $deuterium > $max) {
         $this->printMessage("Maximum values are not respected", true, array('game.php?page=alliance&mode=storage', 2));
         die;
     } else {
         $PLANET['metal'] -= $metal;
         $PLANET['crystal'] -= $crystal;
         $PLANET['deuterium'] -= $deuterium;
         $GLOBALS['DATABASE']->query("UPDATE " . ALLIANCE . " set `storage_metal` = `storage_metal` + " . $metal . " where `id` = '" . $this->allianceData['id'] . "';");
         $GLOBALS['DATABASE']->query("UPDATE " . ALLIANCE . " set `storage_crystal` = `storage_crystal` + " . $crystal . " where `id` = '" . $this->allianceData['id'] . "';");
         $GLOBALS['DATABASE']->query("UPDATE " . ALLIANCE . " set `storage_deuterium` = `storage_deuterium` + " . $deuterium . " where `id` = '" . $this->allianceData['id'] . "';");
         $GLOBALS['DATABASE']->query("UPDATE " . USERS . " set `alliance_storage_deposit` = " . (TIMESTAMP + (12 * 60 * 60 - 10 * $USER['brotherhood'] * 60)) . " where `id` = '" . $USER['id'] . "';");
         $GLOBALS['DATABASE']->query("INSERT INTO `uni1_storages_logs` VALUES (" . $GLOBALS['DATABASE']->GetInsertID() . "," . $this->allianceData['id'] . "," . $USER['id'] . "," . $metal . "," . $crystal . "," . $deuterium . ", " . TIMESTAMP . ", '1') ;");
         $this->tplObj->assign_vars(array());
         $this->printMessage("Ressource are put in the vault");
     }
 }
 function show()
 {
     global $LNG, $USER, $PLANET, $resource, $reslist, $CONF;
     //if($USER['id'] != 1){
     //$this->printMessage('The page is under maintencane!',  true, array('game.php?page=overview', 3));
     //}
     $TOTAL = calculationBis(1101, $USER['academy_1101']) + calculationBis(1102, $USER['academy_1102']) + calculationBis(1103, $USER['academy_1103']) + calculationBis(1104, $USER['academy_1104']) + calculationBis(1105, $USER['academy_1105']) + calculationBis(1106, $USER['academy_1106']) + calculationBis(1107, $USER['academy_1107']) + calculationBis(1108, $USER['academy_1108']) + calculationBis(1109, $USER['academy_1109']) + calculationBis(1110, $USER['academy_1110']) + calculationBis(1111, $USER['academy_1111']) + calculationBis(1112, $USER['academy_1112']) + calculationBis(1113, $USER['academy_1113']) + calculationBis(1201, $USER['academy_1201']) + calculationBis(1202, $USER['academy_1202']) + calculationBis(1203, $USER['academy_1203']) + calculationBis(1204, $USER['academy_1204']) + calculationBis(1208, $USER['academy_1208']) + calculationBis(1209, $USER['academy_1209']) + calculationBis(1210, $USER['academy_1210']) + calculationBis(1205, $USER['academy_1205']) + calculationBis(1207, $USER['academy_1207']) + calculationBis(1206, $USER['academy_1206']) + calculationBis(1301, $USER['academy_1301']) + calculationBis(1302, $USER['academy_1302']) + calculationBis(1303, $USER['academy_1303']) + calculationBis(1304, $USER['academy_1304']) + calculationBis(1305, $USER['academy_1305']) + calculationBis(1306, $USER['academy_1306']) + calculationBis(1307, $USER['academy_1307']) + calculationBis(1308, $USER['academy_1308']) + calculationBis(1309, $USER['academy_1309']) + calculationBis(1310, $USER['academy_1310']) + calculationBis(1311, $USER['academy_1311']) + calculationBis(1312, $USER['academy_1312']) + calculationBis(1313, $USER['academy_1313']) + calculationBis(1314, $USER['academy_1314']);
     $academy_cost = 50;
     if ($CONF['academy_bonus'] != 0 && $CONF['purchase_bonus_timer'] > TIMESTAMP) {
         $academy_cost = round($academy_cost - $academy_cost / 100 * $CONF['academy_bonus']);
     }
     $academy_1101_bonus = getbonusOne(1101, $USER['academy_1101']);
     $academy_1101_points = calculation(1101, $USER['academy_1101']);
     $academy_1101_next = 1 + $USER['academy_1101'] * 1;
     $academy_1102_bonus1 = getbonusOne(1102, $USER['academy_1102']);
     $academy_1102_bonus2 = getbonusTwo(1102, $USER['academy_1102']);
     $academy_1102_points = calculation(1102, $USER['academy_1102']);
     $academy_1102_next = 1 + $USER['academy_1102'] * 1;
     $academy_1103_bonus = getbonusOne(1103, $USER['academy_1103']);
     $academy_1103_points = calculation(1103, $USER['academy_1103']);
     $academy_1103_next = 1 + $USER['academy_1103'] * 1;
     $academy_1104_bonus = getbonusOne(1104, $USER['academy_1104']);
     $academy_1104_points = calculation(1104, $USER['academy_1104']);
     $academy_1104_next = 1 + $USER['academy_1104'] * 1;
     $academy_1105_bonus = getbonusOne(1105, $USER['academy_1105']);
     $academy_1105_points = calculation(1105, $USER['academy_1105']);
     $academy_1105_next = 1 + $USER['academy_1105'] * 1;
     $academy_1106_bonus = getbonusOne(1106, $USER['academy_1106']);
     $academy_1106_points = calculation(1106, $USER['academy_1106']);
     $academy_1106_next = 1 + $USER['academy_1106'] * 1;
     $academy_1107_bonus = getbonusOne(1107, $USER['academy_1107']);
     $academy_1107_points = calculation(1107, $USER['academy_1107']);
     $academy_1107_next = 1 + $USER['academy_1107'] * 1;
     $academy_1108_bonus = getbonusOne(1108, $USER['academy_1108']);
     $academy_1108_points = calculation(1108, $USER['academy_1108']);
     $academy_1108_next = 1 + $USER['academy_1108'] * 1;
     $academy_1109_bonus = getbonusOne(1109, $USER['academy_1109']);
     $academy_1109_points = calculation(1109, $USER['academy_1109']);
     $academy_1109_next = 1 + $USER['academy_1109'] * 1;
     $academy_1110_bonus = getbonusOne(1109, $USER['academy_1110']);
     $academy_1110_points = calculation(1109, $USER['academy_1110']);
     $academy_1110_next = 1 + $USER['academy_1110'] * 1;
     $academy_1111_bonus = getbonusOne(1111, $USER['academy_1111']);
     $academy_1111_points = calculation(1111, $USER['academy_1111']);
     $academy_1111_next = 1 + $USER['academy_1111'] * 1;
     $academy_1112_bonus = getbonusOne(1112, $USER['academy_1112']);
     $academy_1112_points = calculation(1112, $USER['academy_1112']);
     $academy_1112_next = 1 + $USER['academy_1112'] * 1;
     $academy_1113_bonus = getbonusOne(1113, $USER['academy_1113']);
     $academy_1113_points = calculation(1113, $USER['academy_1113']);
     $academy_1113_next = 1 + $USER['academy_1113'] * 1;
     $academy_1201_bonus = getbonusOne(1201, $USER['academy_1201']);
     $academy_1201_points = calculation(1201, $USER['academy_1201']);
     $academy_1201_next = 1 + $USER['academy_1201'] * 1;
     $academy_1202_bonus = getbonusOne(1202, $USER['academy_1202']);
     $academy_1202_points = calculation(1202, $USER['academy_1202']);
     $academy_1202_next = 1 + $USER['academy_1202'] * 1;
     $academy_1203_bonus = getbonusOne(1203, $USER['academy_1203']);
     $academy_1203_points = calculation(1203, $USER['academy_1203']);
     $academy_1203_next = 1 + $USER['academy_1203'] * 1;
     $academy_1204_bonus = getbonusOne(1204, $USER['academy_1204']);
     $academy_1204_points = calculation(1204, $USER['academy_1204']);
     $academy_1204_next = 1 + $USER['academy_1204'] * 1;
     $academy_1205_bonus = getbonusOne(1205, $USER['academy_1205']);
     $academy_1205_points = calculation(1205, $USER['academy_1205']);
     $academy_1205_next = 1 + $USER['academy_1205'] * 1;
     $academy_1206_bonus = getbonusOne(1206, $USER['academy_1206']);
     $academy_1206_points = calculation(1206, $USER['academy_1206']);
     $academy_1206_next = 1 + $USER['academy_1206'] * 1;
     $academy_1207_bonus = getbonusOne(1207, $USER['academy_1207']);
     $academy_1207_points = calculation(1207, $USER['academy_1207']);
     $academy_1207_next = 1 + $USER['academy_1207'] * 1;
     $academy_1208_bonus = getbonusOne(1208, $USER['academy_1208']);
     $academy_1208_points = calculation(1208, $USER['academy_1208']);
     $academy_1208_next = 1 + $USER['academy_1208'] * 1;
     $academy_1209_bonus = getbonusOne(1209, $USER['academy_1209']);
     $academy_1209_points = calculation(1209, $USER['academy_1209']);
     $academy_1209_next = 1 + $USER['academy_1209'] * 1;
     $academy_1210_bonus = getbonusOne(1210, $USER['academy_1210']);
     $academy_1210_points = calculation(1210, $USER['academy_1210']);
     $academy_1210_next = 1 + $USER['academy_1210'] * 1;
     $academy_1301_bonus = getbonusOne(1301, $USER['academy_1301']);
     $academy_1301_points = calculation(1301, $USER['academy_1301']);
     $academy_1301_next = 1 + $USER['academy_1301'] * 1;
     $academy_1302_bonus1 = getbonusOne(1302, $USER['academy_1302']);
     $academy_1302_bonus2 = getbonusTwo(1302, $USER['academy_1302']);
     $academy_1302_points = calculation(1302, $USER['academy_1302']);
     $academy_1302_next = 1 + $USER['academy_1302'] * 1;
     $academy_1303_bonus = getbonusOne(1303, $USER['academy_1303']);
     $academy_1303_points = calculation(1303, $USER['academy_1303']);
     $academy_1303_next = 1 + $USER['academy_1303'] * 1;
     $academy_1304_bonus = getbonusOne(1304, $USER['academy_1304']);
     $academy_1304_points = calculation(1304, $USER['academy_1304']);
     $academy_1304_next = 1 + $USER['academy_1304'] * 1;
     $academy_1305_bonus = getbonusOne(1305, $USER['academy_1305']);
     $academy_1305_points = calculation(1305, $USER['academy_1305']);
     $academy_1305_next = 1 + $USER['academy_1305'] * 1;
     $academy_1306_bonus = getbonusOne(1306, $USER['academy_1306']);
     $academy_1306_points = calculation(1306, $USER['academy_1306']);
     $academy_1306_next = 1 + $USER['academy_1306'] * 1;
     $academy_1307_bonus = getbonusOne(1307, $USER['academy_1307']);
     $academy_1307_points = calculation(1307, $USER['academy_1307']);
     $academy_1307_next = 1 + $USER['academy_1307'] * 1;
     $academy_1308_bonus = getbonusOne(1308, $USER['academy_1308']);
     $academy_1308_points = calculation(1308, $USER['academy_1308']);
     $academy_1308_next = 1 + $USER['academy_1308'] * 1;
     $academy_1309_bonus = getbonusOne(1309, $USER['academy_1309']);
     $academy_1309_points = calculation(1309, $USER['academy_1309']);
     $academy_1309_next = 1 + $USER['academy_1309'] * 1;
     $academy_1310_bonus = getbonusOne(1310, $USER['academy_1310']);
     $academy_1310_points = calculation(1310, $USER['academy_1310']);
     $academy_1310_next = 1 + $USER['academy_1310'] * 1;
     $academy_1311_bonus = getbonusOne(1311, $USER['academy_1311']);
     $academy_1311_points = calculation(1311, $USER['academy_1311']);
     $academy_1311_next = 1 + $USER['academy_1311'] * 1;
     $academy_1312_bonus = getbonusOne(1312, $USER['academy_1312']);
     $academy_1312_points = calculation(1312, $USER['academy_1312']);
     $academy_1312_next = 1 + $USER['academy_1312'] * 1;
     $academy_1313_bonus = getbonusOne(1313, $USER['academy_1313']);
     $academy_1313_points = calculation(1313, $USER['academy_1313']);
     $academy_1313_next = 1 + $USER['academy_1313'] * 1;
     $academy_1314_bonus = getbonusOne(1314, $USER['academy_1314']);
     $academy_1314_points = calculation(1314, $USER['academy_1314']);
     $academy_1314_next = 1 + $USER['academy_1314'] * 1;
     $manual_25_step = 1;
     if ($USER['training'] == 0 && $USER['training_step'] == 25 && $USER['academy_1101'] < 1 && $USER['academy_1201'] < 1 && $USER['academy_1301'] < 1) {
         $manual_25_step = 0;
     }
     $manual_25_1_step = 1;
     if ($USER['training'] == 0 && $USER['training_step'] == 25 && ($USER['academy_1101'] >= 1 || $USER['academy_1201'] >= 1 || $USER['academy_1301'] >= 1)) {
         $manual_25_1_step = 0;
         $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET `training_step` = '26' WHERE `id` = " . $USER['id'] . ";");
         $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET `experience_peace` = `experience_peace` + '650' WHERE `id` = " . $USER['id'] . ";");
     }
     $this->tplObj->loadscript("pointes.js");
     $this->tplObj->assign_vars(array('manual_25_step' => $manual_25_step, 'manual_25_1_step' => $manual_25_1_step, 'academy_p' => pretty_number($USER['academy_p']), 'academy_1101' => $USER['academy_1101'], 'academy_1102' => $USER['academy_1102'], 'academy_1103' => $USER['academy_1103'], 'academy_1104' => $USER['academy_1104'], 'academy_1105' => $USER['academy_1105'], 'academy_1106' => $USER['academy_1106'], 'academy_1107' => $USER['academy_1107'], 'academy_1108' => $USER['academy_1108'], 'academy_1109' => $USER['academy_1109'], 'academy_1110' => $USER['academy_1110'], 'academy_1111' => $USER['academy_1111'], 'academy_1112' => $USER['academy_1112'], 'academy_1113' => $USER['academy_1113'], 'academy_1201' => $USER['academy_1201'], 'academy_1202' => $USER['academy_1202'], 'academy_1203' => $USER['academy_1203'], 'academy_1204' => $USER['academy_1204'], 'academy_1208' => $USER['academy_1208'], 'academy_1209' => $USER['academy_1209'], 'academy_1210' => $USER['academy_1210'], 'academy_1205' => $USER['academy_1205'], 'academy_1207' => $USER['academy_1207'], 'academy_1206' => $USER['academy_1206'], 'academy_1301' => $USER['academy_1301'], 'academy_1302' => $USER['academy_1302'], 'academy_1303' => $USER['academy_1303'], 'academy_1304' => $USER['academy_1304'], 'academy_1305' => $USER['academy_1305'], 'academy_1306' => $USER['academy_1306'], 'academy_1307' => $USER['academy_1307'], 'academy_1308' => $USER['academy_1308'], 'academy_1309' => $USER['academy_1309'], 'academy_1310' => $USER['academy_1310'], 'academy_1311' => $USER['academy_1311'], 'academy_1312' => $USER['academy_1312'], 'academy_1313' => $USER['academy_1313'], 'academy_1314' => $USER['academy_1314'], 'academy_1101_bonus' => $academy_1101_bonus, 'academy_1101_points' => $academy_1101_points, 'academy_1101_next' => $academy_1101_next, 'academy_1102_bonus1' => $academy_1102_bonus1, 'academy_1102_bonus2' => $academy_1102_bonus2, 'academy_1102_points' => $academy_1102_points, 'academy_1102_next' => $academy_1102_next, 'academy_1103_bonus' => $academy_1103_bonus, 'academy_1103_points' => $academy_1103_points, 'academy_1103_next' => $academy_1103_next, 'academy_1104_bonus' => $academy_1104_bonus, 'academy_1104_points' => $academy_1104_points, 'academy_1104_next' => $academy_1104_next, 'academy_1105_bonus' => $academy_1105_bonus, 'academy_1105_points' => $academy_1105_points, 'academy_1105_next' => $academy_1105_next, 'academy_1106_bonus' => $academy_1106_bonus, 'academy_1106_points' => $academy_1106_points, 'academy_1106_next' => $academy_1106_next, 'academy_1107_bonus' => $academy_1107_bonus, 'academy_1107_points' => $academy_1107_points, 'academy_1107_next' => $academy_1107_next, 'academy_1108_bonus' => $academy_1108_bonus, 'academy_1108_points' => $academy_1108_points, 'academy_1108_next' => $academy_1108_next, 'academy_1109_bonus' => $academy_1109_bonus, 'academy_1109_points' => $academy_1109_points, 'academy_1109_next' => $academy_1109_next, 'academy_1110_bonus' => $academy_1110_bonus, 'academy_1110_points' => $academy_1110_points, 'academy_1110_next' => $academy_1110_next, 'academy_1111_bonus' => $academy_1111_bonus, 'academy_1111_points' => $academy_1111_points, 'academy_1111_next' => $academy_1111_next, 'academy_1112_bonus' => $academy_1112_bonus, 'academy_1112_points' => $academy_1112_points, 'academy_1112_next' => $academy_1112_next, 'academy_1113_bonus' => $academy_1113_bonus, 'academy_1113_points' => $academy_1113_points, 'academy_1113_next' => $academy_1113_next, 'academy_1201_bonus' => $academy_1201_bonus, 'academy_1201_points' => $academy_1201_points, 'academy_1201_next' => $academy_1201_next, 'academy_1202_bonus' => $academy_1202_bonus, 'academy_1202_points' => $academy_1202_points, 'academy_1202_next' => $academy_1202_next, 'academy_1203_bonus' => $academy_1203_bonus, 'academy_1203_points' => $academy_1203_points, 'academy_1203_next' => $academy_1203_next, 'academy_1204_bonus' => $academy_1204_bonus, 'academy_1204_points' => $academy_1204_points, 'academy_1204_next' => $academy_1204_next, 'academy_1205_bonus' => $academy_1205_bonus, 'academy_1205_points' => $academy_1205_points, 'academy_1205_next' => $academy_1205_next, 'academy_1206_bonus' => $academy_1206_bonus, 'academy_1206_points' => $academy_1206_points, 'academy_1206_next' => $academy_1206_next, 'academy_1207_bonus' => $academy_1207_bonus, 'academy_1207_points' => $academy_1207_points, 'academy_1207_next' => $academy_1207_next, 'academy_1208_bonus' => $academy_1208_bonus, 'academy_1208_points' => $academy_1208_points, 'academy_1208_next' => $academy_1208_next, 'academy_1209_bonus' => $academy_1209_bonus, 'academy_1209_points' => $academy_1209_points, 'academy_1209_next' => $academy_1209_next, 'academy_1210_bonus' => $academy_1210_bonus, 'academy_1210_points' => $academy_1210_points, 'academy_1210_next' => $academy_1210_next, 'academy_1301_bonus' => $academy_1301_bonus, 'academy_1301_points' => $academy_1301_points, 'academy_1301_next' => $academy_1301_next, 'academy_1302_bonus1' => $academy_1302_bonus1, 'academy_1302_bonus2' => $academy_1302_bonus2, 'academy_1302_points' => $academy_1302_points, 'academy_1302_next' => $academy_1302_next, 'academy_1303_bonus' => $academy_1303_bonus, 'academy_1303_points' => $academy_1303_points, 'academy_1303_next' => $academy_1303_next, 'academy_1304_bonus' => $academy_1304_bonus, 'academy_1304_points' => $academy_1304_points, 'academy_1304_next' => $academy_1304_next, 'academy_1305_bonus' => $academy_1305_bonus, 'academy_1305_points' => $academy_1305_points, 'academy_1305_next' => $academy_1305_next, 'academy_1306_bonus' => $academy_1306_bonus, 'academy_1306_points' => $academy_1306_points, 'academy_1306_next' => $academy_1306_next, 'academy_1307_bonus' => $academy_1307_bonus, 'academy_1307_points' => $academy_1307_points, 'academy_1307_next' => $academy_1307_next, 'academy_1308_bonus' => $academy_1308_bonus, 'academy_1308_points' => $academy_1308_points, 'academy_1308_next' => $academy_1308_next, 'academy_1309_bonus' => $academy_1309_bonus, 'academy_1309_points' => $academy_1309_points, 'academy_1309_next' => $academy_1309_next, 'academy_1310_bonus' => $academy_1310_bonus, 'academy_1310_points' => $academy_1310_points, 'academy_1310_next' => $academy_1310_next, 'academy_1311_bonus' => $academy_1311_bonus, 'academy_1311_points' => $academy_1311_points, 'academy_1311_next' => $academy_1311_next, 'academy_1312_bonus' => $academy_1312_bonus, 'academy_1312_points' => $academy_1312_points, 'academy_1312_next' => $academy_1312_next, 'academy_1313_bonus' => $academy_1313_bonus, 'academy_1313_points' => $academy_1313_points, 'academy_1313_next' => $academy_1313_next, 'academy_1314_bonus' => $academy_1314_bonus, 'academy_1314_points' => $academy_1314_points, 'academy_1314_next' => $academy_1314_next, 'academy_cost' => $academy_cost, 'total_free' => floor($TOTAL / 2), 'total_dm' => floor($TOTAL / 100 * 75), 'total_am' => floor($TOTAL)));
     $this->display("page.academy.default.tpl");
 }