Example #1
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     if (!isset($_POST) or empty($_POST)) {
         Functions_Lib::redirect('game.php?page=fleet1');
     }
     $resource = parent::$objects->get_objects();
     $pricelist = parent::$objects->get_price();
     $reslist = parent::$objects->get_objects_list();
     $lang = $this->_lang;
     #####################################################################################################
     // SOME DEFAULT VALUES
     #####################################################################################################
     // ARRAYS
     $exp_values = array(1, 2, 3, 4, 5);
     $hold_values = array(0, 1, 2, 4, 8, 16, 32);
     // LANG
     $this->_lang['js_path'] = XGP_ROOT . JS_PATH;
     $parse = $this->_lang;
     // LOAD TEMPLATES REQUIRED
     $mission_row_template = parent::$page->get_template('fleet/fleet3_mission_row');
     $input_template = parent::$page->get_template('fleet/fleet3_inputs');
     $stay_template = parent::$page->get_template('fleet/fleet3_stay_row');
     $options_template = parent::$page->get_template('fleet/fleet_options');
     // OTHER VALUES
     $galaxy = (int) $_POST['galaxy'];
     $system = (int) $_POST['system'];
     $planet = (int) $_POST['planet'];
     $planettype = (int) $_POST['planettype'];
     $fleet_acs = (int) $_POST['fleet_group'];
     $YourPlanet = FALSE;
     $UsedPlanet = FALSE;
     $MissionSelector = '';
     // QUERYS
     $select = parent::$db->query_fetch("SELECT `planet_user_id`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `" . PLANETS . "`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `planet_galaxy` = '" . $galaxy . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `planet_system` = '" . $system . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `planet_planet` = '" . $planet . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `planet_type` = '" . $planettype . "';");
     if ($select) {
         if ($select['planet_user_id'] == $this->_current_user['user_id']) {
             $YourPlanet = TRUE;
             $UsedPlanet = TRUE;
         } else {
             $UsedPlanet = TRUE;
         }
     }
     if ($_POST['planettype'] == 2) {
         if ($_POST['ship209'] >= 1) {
             $missiontype = array(8 => $this->_lang['type_mission'][8]);
         } else {
             $missiontype = array();
         }
     } elseif ($_POST['planettype'] == 1 or $_POST['planettype'] == 3) {
         if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
             $missiontype = array(7 => $this->_lang['type_mission'][7]);
         } elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
             $missiontype = array(6 => $this->_lang['type_mission'][6]);
         }
         if ($_POST['ship202'] >= 1 or $_POST['ship203'] >= 1 or $_POST['ship204'] >= 1 or $_POST['ship205'] >= 1 or $_POST['ship206'] >= 1 or $_POST['ship207'] >= 1 or $_POST['ship210'] >= 1 or $_POST['ship211'] >= 1 or $_POST['ship213'] >= 1 or $_POST['ship214'] >= 1 or $_POST['ship215'] >= 1) {
             if (!$YourPlanet) {
                 $missiontype[1] = $this->_lang['type_mission'][1];
             }
             $missiontype[3] = $this->_lang['type_mission'][3];
             $missiontype[5] = $this->_lang['type_mission'][5];
         }
     } elseif ($_POST['ship209'] >= 1 or $_POST['ship208']) {
         $missiontype[3] = $this->_lang['type_mission'][3];
     }
     if ($YourPlanet) {
         $missiontype[4] = $this->_lang['type_mission'][4];
     }
     if ($_POST['planettype'] == 3 || $_POST['planettype'] == 1 && $fleet_acs > 0 && $UsedPlanet) {
         $acs = parent::$db->query_fetch("SELECT `acs_fleet_galaxy`, `acs_fleet_planet``, `acs_fleet_system`, `acs_fleet_planet_type`\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM `" . ACS_FLEETS . "`\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE `acs_fleet_id` = '" . $fleet_acs . "';");
         if ($acs['acs_fleet_galaxy'] == $galaxy && $acs['acs_fleet_planet'] == $planet && $acs['acs_fleet_system'] == $system && $acs['acs_fleet_planet_type'] == $planettype) {
             $missiontype[2] = $this->_lang['type_mission'][2];
         }
     }
     if ($_POST['planettype'] == 3 && $_POST['ship214'] >= 1 && !$YourPlanet && $UsedPlanet) {
         $missiontype[9] = $this->_lang['type_mission'][9];
     }
     $fleetarray = unserialize(base64_decode(str_rot13($_POST['usedfleet'])));
     $mission = $_POST['target_mission'];
     $SpeedFactor = $_POST['speedfactor'];
     $AllFleetSpeed = Fleets_Lib::fleet_max_speed($fleetarray, 0, $this->_current_user);
     $GenFleetSpeed = $_POST['speed'];
     $MaxFleetSpeed = min($AllFleetSpeed);
     $distance = Fleets_Lib::target_distance($_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet']);
     $duration = Fleets_Lib::mission_duration($GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor);
     $consumption = Fleets_Lib::fleet_consumption($fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $this->_current_user);
     #####################################################################################################
     // INPUTS DATA
     #####################################################################################################
     $parse['metal'] = floor($this->_current_planet['planet_metal']);
     $parse['crystal'] = floor($this->_current_planet['planet_crystal']);
     $parse['deuterium'] = floor($this->_current_planet['planet_deuterium']);
     $parse['consumption'] = $consumption;
     $parse['distance'] = $distance;
     $parse['speedfactor'] = $_POST['speedfactor'];
     $parse['thisgalaxy'] = $_POST['thisgalaxy'];
     $parse['thissystem'] = $_POST['thissystem'];
     $parse['thisplanet'] = $_POST['thisplanet'];
     $parse['galaxy'] = $_POST['galaxy'];
     $parse['system'] = $_POST['system'];
     $parse['planet'] = $_POST['planet'];
     $parse['thisplanettype'] = $_POST['thisplanettype'];
     $parse['planettype'] = $_POST['planettype'];
     $parse['speedallsmin'] = $_POST['speedallsmin'];
     $parse['speed'] = $_POST['speed'];
     $parse['speedfactor'] = $_POST['speedfactor'];
     $parse['usedfleet'] = $_POST['usedfleet'];
     $parse['maxepedition'] = $_POST['maxepedition'];
     $parse['curepedition'] = $_POST['curepedition'];
     $parse['fleet_group'] = $_POST['fleet_group'];
     $parse['acs_target_mr'] = $_POST['acs_target_mr'];
     #####################################################################################################
     // EXTRA INPUTS
     #####################################################################################################
     $input_extra = '';
     foreach ($fleetarray as $Ship => $Count) {
         $input_parse['ship'] = $Ship;
         $input_parse['amount'] = $Count;
         $input_parse['capacity'] = $pricelist[$Ship]['capacity'];
         $input_parse['consumption'] = Fleets_Lib::ship_consumption($Ship, $this->_current_user);
         $input_parse['speed'] = Fleets_Lib::fleet_max_speed("", $Ship, $this->_current_user);
         $input_extra .= parent::$page->parse_template($input_template, $input_parse);
     }
     #####################################################################################################
     // TOP TABLE TITLE
     #####################################################################################################
     if ($_POST['thisplanettype'] == 1) {
         $parse['title'] = "" . $_POST['thisgalaxy'] . ":" . $_POST['thissystem'] . ":" . $_POST['thisplanet'] . " - " . $this->_lang['fl_planet'] . "";
     } elseif ($_POST['thisplanettype'] == 3) {
         $parse['title'] = "" . $_POST['thisgalaxy'] . ":" . $_POST['thissystem'] . ":" . $_POST['thisplanet'] . " - " . $this->_lang['fl_moon'] . "";
     }
     #####################################################################################################
     // MISSION TYPES
     #####################################################################################################
     if (count($missiontype) > 0) {
         if ($planet == 16) {
             $parse_mission['value'] = 15;
             $parse_mission['mission'] = $this->_lang['type_mission'][15];
             $parse_mission['expedition_message'] = $this->_lang['fl_expedition_alert_message'];
             $parse_mission['id'] = ' ';
             $parse_mission['checked'] = ' checked="checked"';
             $MissionSelector .= parent::$page->parse_template($mission_row_template, $parse_mission);
         } else {
             $i = 0;
             foreach ($missiontype as $a => $b) {
                 $parse_mission['value'] = $a;
                 $parse_mission['mission'] = $b;
                 $parse_mission['expedition_message'] = '';
                 $parse_mission['id'] = ' id="inpuT_' . $i . '" ';
                 $parse_mission['checked'] = $mission == $a ? ' checked="checked"' : '';
                 $i++;
                 $MissionSelector .= parent::$page->parse_template($mission_row_template, $parse_mission);
             }
         }
     } else {
         Functions_Lib::redirect('game.php?page=fleet1');
     }
     #####################################################################################################
     // STAY / EXPEDITION BLOCKS
     #####################################################################################################
     $stay_row['options'] = '';
     if ($planet == 16) {
         $stay_row['stay_type'] = 'expeditiontime';
         foreach ($exp_values as $value) {
             $stay['value'] = $value;
             $stay['selected'] = '';
             $stay['title'] = $value;
             $stay_row['options'] .= parent::$page->parse_template($options_template, $stay);
         }
         $StayBlock = parent::$page->parse_template($stay_template, array_merge($stay_row, $this->_lang));
     } elseif ($missiontype[5] != '') {
         $stay_row['stay_type'] = 'holdingtime';
         foreach ($hold_values as $value) {
             $stay['value'] = $value;
             $stay['selected'] = $value == 1 ? ' selected' : '';
             $stay['title'] = $value;
             $stay_row['options'] .= parent::$page->parse_template($options_template, $stay);
         }
         $StayBlock = parent::$page->parse_template($stay_template, array_merge($stay_row, $this->_lang));
     }
     $parse['input_extra'] = $input_extra;
     $parse['missionselector'] = $MissionSelector;
     $parse['stayblock'] = $StayBlock;
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('fleet/fleet3_table'), $parse));
 }
Example #2
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $resource = parent::$objects->get_objects();
     $pricelist = parent::$objects->get_price();
     $reslist = parent::$objects->get_objects_list();
     #####################################################################################################
     // SOME DEFAULT VALUES
     #####################################################################################################
     // QUERYS
     $getCurrentAcs = parent::$db->query("SELECT *\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . ACS_FLEETS . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE acs_fleet_members = '" . $this->_current_user['user_id'] . "'");
     // ARRAYS
     $speed_values = array(10 => 100, 9 => 90, 8 => 80, 7 => 70, 6 => 60, 5 => 50, 4 => 40, 3 => 30, 2 => 20, 1 => 10);
     $planet_type = array('fl_planet', 'fl_debris', 'fl_moon');
     // LOAD TEMPLATES REQUIRED
     $inputs_template = parent::$page->get_template('fleet/fleet2_inputs');
     $options_template = parent::$page->get_template('fleet/fleet_options');
     $shortcut_template = parent::$page->get_template('fleet/fleet2_shortcuts');
     $shortcut_row_template = parent::$page->get_template('fleet/fleet2_shortcuts_row');
     $shortcut_noshortcuts = parent::$page->get_template('fleet/fleet2_shortcuts_noshortcuts_row');
     $shortcut_acs_row = parent::$page->get_template('fleet/fleet2_shortcut_acs_row');
     // LANGUAGE
     $this->_lang['js_path'] = XGP_ROOT . JS_PATH;
     $parse = $this->_lang;
     // COORDS
     $g = $_POST['galaxy'] == '' ? $this->_current_planet['planet_galaxy'] : $_POST['galaxy'];
     $s = $_POST['system'] == '' ? $this->_current_planet['planet_system'] : $_POST['system'];
     $p = $_POST['planet'] == '' ? $this->_current_planet['planet_planet'] : $_POST['planet'];
     $t = $_POST['planet_type'] == '' ? $this->_current_planet['planet_type'] : $_POST['planet_type'];
     // OTHER VALUES
     $value = 0;
     $FleetHiddenBlock = '';
     #####################################################################################################
     // END DEFAULT VALUES
     #####################################################################################################
     #####################################################################################################
     // LOAD SHIPS INPUTS
     #####################################################################################################
     $fleet['fleetlist'] = '';
     $fleet['amount'] = 0;
     $fleet['consumption'] = 0;
     foreach ($reslist['fleet'] as $n => $i) {
         if (isset($_POST["ship{$i}"]) && $i >= 201 && $i <= 215 && $_POST["ship{$i}"] > "0") {
             if ($_POST["ship{$i}"] > $this->_current_planet[$resource[$i]] or !ctype_digit($_POST["ship{$i}"])) {
                 Functions_Lib::redirect('game.php?page=fleet1');
             } else {
                 $fleet['fleetarray'][$i] = $_POST["ship{$i}"];
                 $fleet['fleetlist'] .= $i . "," . $_POST["ship{$i}"] . ";";
                 $fleet['amount'] += $_POST["ship{$i}"];
                 $fleet['i'] = $i;
                 $fleet['consumption'] += Fleets_Lib::ship_consumption($i, $this->_current_user);
                 $fleet['speed'] = Fleets_Lib::fleet_max_speed('', $i, $this->_current_user);
                 $fleet['capacity'] = $pricelist[$i]['capacity'];
                 $fleet['ship'] = $_POST["ship{$i}"];
                 $speedalls[$i] = Fleets_Lib::fleet_max_speed('', $i, $this->_current_user);
                 $FleetHiddenBlock .= parent::$page->parse_template($inputs_template, $fleet);
             }
         }
     }
     if (!$fleet['fleetlist']) {
         Functions_Lib::redirect('game.php?page=fleet1');
     } else {
         $speedallsmin = min($speedalls);
     }
     #####################################################################################################
     // LOAD PLANET TYPES OPTIONS
     #####################################################################################################
     $parse['options_planettype'] = '';
     foreach ($planet_type as $type) {
         $value++;
         $options['value'] = $value;
         if ($value == $t) {
             $options['selected'] = 'SELECTED';
         } else {
             $options['selected'] = '';
         }
         $options['title'] = $this->_lang[$type];
         $parse['options_planettype'] .= parent::$page->parse_template($options_template, $options);
     }
     #####################################################################################################
     // LOAD SPEED OPTIONS
     #####################################################################################################
     $parse['options'] = '';
     foreach ($speed_values as $value => $porcentage) {
         $speed_porcentage['value'] = $value;
         $speed_porcentage['selected'] = '';
         $speed_porcentage['title'] = $porcentage;
         $parse['options'] .= parent::$page->parse_template($options_template, $speed_porcentage);
     }
     #####################################################################################################
     // PARSE THE REST OF THE OPTIONS
     #####################################################################################################
     $parse['fleetblock'] = $FleetHiddenBlock;
     $parse['speedallsmin'] = $speedallsmin;
     $parse['fleetarray'] = str_rot13(base64_encode(serialize($fleet['fleetarray'])));
     $parse['galaxy'] = $this->_current_planet['planet_galaxy'];
     $parse['system'] = $this->_current_planet['planet_system'];
     $parse['planet'] = $this->_current_planet['planet_planet'];
     $parse['galaxy_post'] = (int) $_POST['galaxy'];
     $parse['system_post'] = (int) $_POST['system'];
     $parse['planet_post'] = (int) $_POST['planet'];
     $parse['speedfactor'] = Functions_Lib::fleet_speed_factor();
     $parse['planet_type'] = $this->_current_planet['planet_type'];
     $parse['metal'] = floor($this->_current_planet['planet_metal']);
     $parse['crystal'] = floor($this->_current_planet['planet_crystal']);
     $parse['deuterium'] = floor($this->_current_planet['planet_deuterium']);
     $parse['g'] = $g;
     $parse['s'] = $s;
     $parse['p'] = $p;
     #####################################################################################################
     // LOAD FLEET SHORTCUTS
     #####################################################################################################
     if (Officiers_Lib::is_officier_active($this->_current_user['premium_officier_commander'])) {
         if ($this->_current_user['user_fleet_shortcuts']) {
             $scarray = explode(";", $this->_current_user['user_fleet_shortcuts']);
             foreach ($scarray as $a => $b) {
                 if ($b != "") {
                     $c = explode(',', $b);
                     $shortcut['description'] = $c[0] . " " . $c[1] . ":" . $c[2] . ":" . $c[3] . " ";
                     switch ($c[4]) {
                         case 1:
                             $shortcut['description'] .= $this->_lang['fl_planet_shortcut'];
                             break;
                         case 2:
                             $shortcut['description'] .= $this->_lang['fl_debris_shortcut'];
                             break;
                         case 3:
                             $shortcut['description'] .= $this->_lang['fl_moon_shortcut'];
                             break;
                         default:
                             $shortcut['description'] .= '';
                             break;
                     }
                     $shortcut['select'] = 'shortcuts';
                     $shortcut['selected'] = '';
                     $shortcut['value'] = $c['1'] . ';' . $c['2'] . ';' . $c['3'] . ';' . $c['4'];
                     $shortcut['title'] = $shortcut['description'];
                     $shortcut['shortcut_options'] .= parent::$page->parse_template($options_template, $shortcut);
                 }
             }
             $parse['shortcuts_rows'] = parent::$page->parse_template($shortcut_row_template, $shortcut);
             $parse['shortcut'] = parent::$page->parse_template($shortcut_template, $parse);
         } else {
             $parse['fl_shorcut_message'] = $this->_lang['fl_no_shortcuts'];
             $parse['shortcuts_rows'] = parent::$page->parse_template($shortcut_noshortcuts, $parse);
             $parse['shortcut'] = parent::$page->parse_template($shortcut_template, $parse);
         }
     }
     #####################################################################################################
     // LOAD COLONY SHORTCUTS
     #####################################################################################################
     $colony['select'] = 'colonies';
     $colony['shortcut_options'] = Functions_Lib::build_planet_list($this->_current_user, $this->_current_planet['planet_id']);
     $parse['colonylist'] = parent::$page->parse_template($shortcut_row_template, $colony);
     if ($colony['shortcut_options'] === FALSE) {
         $parse['fl_shorcut_message'] = $this->_lang['fl_no_colony'];
         $parse['colonylist'] = parent::$page->parse_template($shortcut_noshortcuts, $parse);
     }
     #####################################################################################################
     // LOAD SAC SHORTCUTS
     #####################################################################################################
     $acs_fleets = '';
     while ($row = parent::$db->fetch_array($getCurrentAcs)) {
         $members = explode(",", $row['acs_fleet_invited']);
         foreach ($members as $a => $b) {
             if ($b == $this->_current_user['user_id']) {
                 $acs['galaxy'] = $row['acs_fleet_galaxy'];
                 $acs['system'] = $row['acs_fleet_system'];
                 $acs['planet'] = $row['acs_fleet_planet'];
                 $acs['planet_type'] = $row['acs_fleet_planet_type'];
                 $acs['id'] = $row['acs_fleet_id'];
                 $acs['name'] = $row['acs_fleet_name'];
                 $acs_fleets .= parent::$page->parse_template($shortcut_acs_row, $acs);
             }
         }
     }
     $parse['asc'] = $acs_fleets;
     $parse['maxepedition'] = $_POST['maxepedition'];
     $parse['curepedition'] = $_POST['curepedition'];
     $parse['target_mission'] = $_POST['target_mission'];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('fleet/fleet2_table'), $parse));
 }
Example #3
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $resource = parent::$objects->get_objects();
     $reslist = parent::$objects->get_objects_list();
     #####################################################################################################
     // SOME DEFAULT VALUES
     #####################################################################################################
     // QUERYS
     $count = parent::$db->query_fetch("SELECT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT COUNT(fleet_owner) AS `actcnt`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . FLEETS . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `fleet_owner` = '" . (int) $this->_current_user['user_id'] . "') AS max_fleet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT COUNT(fleet_owner) AS `expedi`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . FLEETS . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `fleet_owner` = '" . (int) $this->_current_user['user_id'] . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `fleet_mission` = '15') AS max_expeditions");
     // LOAD TEMPLATES REQUIRED
     $inputs_template = parent::$page->get_template('fleet/fleet1_inputs');
     $ships_row_template = parent::$page->get_template('fleet/fleet1_row_ships');
     // LANGUAGE
     $this->_lang['js_path'] = XGP_ROOT . JS_PATH;
     $parse = $this->_lang;
     $MaxFlyingFleets = $count['max_fleet'];
     $MaxExpedition = $this->_current_user[$resource[124]];
     if ($MaxExpedition >= 1) {
         $ExpeditionEnCours = $count['max_expeditions'];
         $EnvoiMaxExpedition = Fleets_Lib::get_max_expeditions($MaxExpedition);
     } else {
         $ExpeditionEnCours = 0;
         $EnvoiMaxExpedition = 0;
     }
     $MaxFlottes = Fleets_Lib::get_max_fleets($this->_current_user[$resource[108]], $this->_current_user['premium_officier_admiral']);
     $missiontype = Fleets_Lib::get_missions();
     $galaxy = isset($_GET['galaxy']) ? (int) $_GET['galaxy'] : $this->_current_planet['planet_galaxy'];
     $system = isset($_GET['system']) ? (int) $_GET['system'] : $this->_current_planet['planet_system'];
     $planet = isset($_GET['planet']) ? (int) $_GET['planet'] : $this->_current_planet['planet_planet'];
     $planettype = isset($_GET['planettype']) ? (int) $_GET['planettype'] : $this->_current_planet['planet_type'];
     $target_mission = isset($_GET['target_mission']) ? (int) $_GET['target_mission'] : FALSE;
     $parse['flyingfleets'] = $MaxFlyingFleets;
     $parse['maxfleets'] = $MaxFlottes;
     $parse['currentexpeditions'] = $ExpeditionEnCours;
     $parse['maxexpeditions'] = $EnvoiMaxExpedition;
     $parse['message_nofreeslot'] = $MaxFlottes == $MaxFlyingFleets ? parent::$page->parse_template(parent::$page->get_template('fleet/fleet1_noslots_row'), $parse) : '';
     $ships = $this->_lang;
     $ShipData = '';
     $ship_inputs = '';
     $ships_row = '';
     foreach ($reslist['fleet'] as $n => $i) {
         if ($this->_current_planet[$resource[$i]] > 0) {
             if ($i == 212) {
                 $ships['fleet_max_speed'] = '-';
             } else {
                 $ships['fleet_max_speed'] = Fleets_Lib::fleet_max_speed("", $i, $this->_current_user);
             }
             $ships['ship'] = $this->_lang['tech'][$i];
             $ships['amount'] = Format_Lib::pretty_number($this->_current_planet[$resource[$i]]);
             $inputs['i'] = $i;
             $inputs['maxship'] = $this->_current_planet[$resource[$i]];
             $inputs['consumption'] = Fleets_Lib::ship_consumption($i, $this->_current_user);
             $inputs['speed'] = Fleets_Lib::fleet_max_speed("", $i, $this->_current_user);
             $inputs['capacity'] = isset($pricelist[$i]['capacity']) ? $pricelist[$i]['capacity'] : 0;
             if ($i == 212) {
                 $ships['max_ships'] = '';
                 $ships['set_ships'] = '';
             } else {
                 $ships['max_ships'] = "<a href=\"javascript:maxShip('ship" . $i . "'); shortInfo();\">" . $this->_lang['fl_max'] . "</a>";
                 $ships['set_ships'] = "<input name=\"ship" . $i . "\" size=\"10\" value=\"0\" onfocus=\"javascript:if(this.value == '0') this.value='';\" onblur=\"javascript:if(this.value == '') this.value='0';\" alt=\"" . $this->_lang['tech'][$i] . $this->_current_planet[$resource[$i]] . "\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" />";
             }
             $ship_inputs .= parent::$page->parse_template($inputs_template, $inputs);
             $ships_row .= parent::$page->parse_template($ships_row_template, $ships);
         }
         $have_ships = TRUE;
     }
     if (!$have_ships) {
         $parse['noships_row'] = parent::$page->parse_template(parent::$page->get_template('fleet/fleet1_noships_row'), $this->_lang);
     } else {
         if ($MaxFlottes > $MaxFlyingFleets) {
             $parse['none_max_selector'] = parent::$page->parse_template(parent::$page->get_template('fleet/fleet_selectors'), $this->_lang);
             $parse['continue_button'] = parent::$page->parse_template(parent::$page->get_template('fleet/fleet1_button'), $this->_lang);
         }
     }
     $parse['body'] = $ships_row;
     $parse['shipdata'] = $ship_inputs;
     $parse['galaxy'] = $galaxy;
     $parse['system'] = $system;
     $parse['planet'] = $planet;
     $parse['planettype'] = $planettype;
     $parse['target_mission'] = $target_mission;
     $parse['envoimaxexpedition'] = $EnvoiMaxExpedition;
     $parse['expeditionencours'] = $ExpeditionEnCours;
     $parse['target_mission'] = $target_mission;
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('fleet/fleet1_table'), $parse));
 }