Example #1
0
 public static function ShowFleet1Page()
 {
     global $USER, $PLANET, $resource, $pricelist, $reslist, $db, $LNG, $ExtraDM;
     $TargetGalaxy = request_var('galaxy', $PLANET['galaxy']);
     $TargetSystem = request_var('system', $PLANET['system']);
     $TargetPlanet = request_var('planet', $PLANET['planet']);
     $TargetPlanettype = request_var('planet_type', $PLANET['planet_type']);
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDB();
     $template = new template();
     $template->loadscript('notifybox.js');
     $template->loadscript('flotten.js');
     $template->page_header();
     $template->page_topnav();
     $template->page_leftmenu();
     $template->page_planetmenu();
     $template->page_footer();
     $template->getplanets();
     foreach ($reslist['fleet'] as $id => $ShipID) {
         $amount = min(request_var('ship' . $ShipID, '0') + 0, $PLANET[$resource[$ShipID]] + 0);
         if ($amount <= 0 || $ShipID == 212 || !is_numeric($amount)) {
             continue;
         }
         $Fleet[$ShipID] = $amount;
         $FleetRoom += $pricelist[$ShipID]['capacity'] * $amount;
     }
     if (!is_array($Fleet)) {
         parent::GotoFleetPage();
     }
     $template->execscript('updateVars();FleetTime();window.setInterval("FleetTime()", 1000);');
     $FleetData = array('fleetroom' => floattostring($FleetRoom), 'gamespeed' => parent::GetGameSpeedFactor(), 'fleetspeedfactor' => (TIMESTAMP - $USER[$resource[706]] <= 0 ? 1 - $ExtraDM[706]['add'] : 1) - GENERAL * $USER['rpg_general'], 'planet' => array('galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type']), 'maxspeed' => parent::GetFleetMaxSpeed($Fleet, $USER), 'ships' => parent::GetFleetShipInfo($Fleet, $USER));
     $template->assign_vars(array('mission' => request_var('target_mission', 0), 'Shoutcutlist' => parent::GetUserShotcut($USER), 'Colonylist' => parent::GetColonyList($template->UserPlanets), 'AKSList' => parent::IsAKS($USER['id']), 'AvailableSpeeds' => parent::GetAvailableSpeeds(), 'fleetarray' => parent::SetFleetArray($Fleet), 'galaxy_post' => $TargetGalaxy, 'system_post' => $TargetSystem, 'planet_post' => $TargetPlanet, 'fleetdata' => json_encode($FleetData), 'options_selector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon']), 'options' => $TargetPlanettype, 'fl_send_fleet' => $LNG['fl_send_fleet'], 'fl_destiny' => $LNG['fl_destiny'], 'fl_fleet_speed' => $LNG['fl_fleet_speed'], 'fl_distance' => $LNG['fl_distance'], 'fl_flying_time' => $LNG['fl_flying_time'], 'fl_fuel_consumption' => $LNG['fl_fuel_consumption'], 'fl_max_speed' => $LNG['fl_max_speed'], 'fl_cargo_capacity' => $LNG['fl_cargo_capacity'], 'fl_shortcut' => $LNG['fl_shortcut'], 'fl_shortcut_add_edit' => $LNG['fl_shortcut_add_edit'], 'fl_no_shortcuts' => $LNG['fl_no_shortcuts'], 'fl_planet_shortcut' => $LNG['fl_planet_shortcut'], 'fl_debris_shortcut' => $LNG['fl_debris_shortcut'], 'fl_moon_shortcut' => $LNG['fl_moon_shortcut'], 'fl_my_planets' => $LNG['fl_my_planets'], 'fl_acs_title' => $LNG['fl_acs_title'], 'fl_continue' => $LNG['fl_continue'], 'fl_no_colony' => $LNG['fl_no_colony'], 'fl_flying_arrival' => $LNG['fl_flying_arrival'], 'fl_flying_return' => $LNG['fl_flying_return']));
     $template->show('fleet1_table.tpl');
 }