@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $scan_galaxy = sys_get_param_int('galaxy'); |
| 32 | 32 | $scan_system = sys_get_param_int('system'); |
| 33 | 33 | $scan_planet = sys_get_param_int('planet'); |
| 34 | -$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
| 34 | +$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
| 35 | 35 | $id = sys_get_param_id('id'); |
| 36 | 36 | |
| 37 | 37 | $source_galaxy = $planetrow['galaxy']; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sensorRange = GetPhalanxRange($sensorLevel); |
| 42 | 42 | |
| 43 | 43 | $system_distance = abs($source_system - $scan_system); |
| 44 | -if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
| 44 | +if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
| 45 | 45 | { |
| 46 | 46 | SnTemplate::messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
| 47 | 47 | } |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type); |
| 57 | -if(!$planet_scanned['id']) |
|
| 57 | +if (!$planet_scanned['id']) |
|
| 58 | 58 | { |
| 59 | 59 | SnTemplate::messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | -if($planet_scanned['destruyed']) |
|
| 62 | +if ($planet_scanned['destruyed']) |
|
| 63 | 63 | { |
| 64 | 64 | SnTemplate::messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
| 65 | 65 | } |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | * DO NOT CHANGE |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -if (!defined('INSIDE')) die(); |
|
| 29 | +if (!defined('INSIDE')) { |
|
| 30 | + die(); |
|
| 31 | +} |
|
| 30 | 32 | |
| 31 | 33 | |
| 32 | 34 | $a_lang_array = [ |
@@ -25,7 +25,9 @@ |
||
| 25 | 25 | * DO NOT CHANGE |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -if (!defined('INSIDE')) die(); |
|
| 28 | +if (!defined('INSIDE')) { |
|
| 29 | + die(); |
|
| 30 | +} |
|
| 29 | 31 | |
| 30 | 32 | $a_lang_array = [ |
| 31 | 33 | 'opt_account' => 'Account', |
@@ -25,7 +25,9 @@ |
||
| 25 | 25 | * DO NOT CHANGE |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -if (!defined('INSIDE')) die(); |
|
| 28 | +if (!defined('INSIDE')) { |
|
| 29 | + die(); |
|
| 30 | +} |
|
| 29 | 31 | |
| 30 | 32 | $a_lang_array = [ |
| 31 | 33 | 'msg_page_header' => 'Personal messages', |
@@ -24,7 +24,9 @@ |
||
| 24 | 24 | * DO NOT CHANGE |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -if (!defined('INSIDE')) die(); |
|
| 27 | +if (!defined('INSIDE')) { |
|
| 28 | + die(); |
|
| 29 | +} |
|
| 28 | 30 | |
| 29 | 31 | $a_lang_array = [ |
| 30 | 32 | 'opt_account' => 'Профиль', |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | * DO NOT CHANGE |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -if (!defined('INSIDE')) die(); |
|
| 26 | +if (!defined('INSIDE')) { |
|
| 27 | + die(); |
|
| 28 | +} |
|
| 27 | 29 | |
| 28 | 30 | $a_lang_array = [ |
| 29 | 31 | 'msg_page_header' => 'Личные сообщения', |
@@ -118,8 +118,7 @@ |
||
| 118 | 118 | )); |
| 119 | 119 | |
| 120 | 120 | SnTemplate::display($template, $lang['tech'][STRUC_MOON_GATE]); |
| 121 | - } |
|
| 122 | - else |
|
| 121 | + } else |
|
| 123 | 122 | { |
| 124 | 123 | SnTemplate::messageBox($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
| 125 | 124 | } |
@@ -17,39 +17,39 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | lng_include('fleet'); |
| 19 | 19 | |
| 20 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
| 20 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
| 21 | 21 | { |
| 22 | 22 | SN::db_transaction_start(); |
| 23 | 23 | db_user_by_id($user['id'], true, 'id'); |
| 24 | 24 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
| 25 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
| 25 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
| 26 | 26 | { |
| 27 | 27 | $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
| 28 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
| 28 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
| 29 | 29 | { |
| 30 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
| 31 | - if(!$NextDestTime) |
|
| 30 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
| 31 | + if (!$NextDestTime) |
|
| 32 | 32 | { |
| 33 | 33 | // $SubQueryOri = ""; |
| 34 | 34 | // $SubQueryDes = ""; |
| 35 | 35 | $ship_list = sys_get_param('ships'); |
| 36 | 36 | $db_changeset = array(); |
| 37 | - foreach($ship_list as $ship_id => $ship_count) |
|
| 37 | + foreach ($ship_list as $ship_id => $ship_count) |
|
| 38 | 38 | { |
| 39 | - if(!in_array($ship_id, sn_get_groups('fleet'))) |
|
| 39 | + if (!in_array($ship_id, sn_get_groups('fleet'))) |
|
| 40 | 40 | { |
| 41 | 41 | continue; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
| 45 | - if($ship_count) |
|
| 45 | + if ($ship_count) |
|
| 46 | 46 | { |
| 47 | 47 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, -$ship_count, $user, $planetrow['id']); |
| 48 | 48 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, $ship_count, $user, $TargetGate['id']); |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | // Dit monsieur, y avait quelque chose a envoyer ??? |
| 52 | - if(!empty($db_changeset)) |
|
| 52 | + if (!empty($db_changeset)) |
|
| 53 | 53 | { |
| 54 | 54 | DBStaticPlanet::db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
| 55 | 55 | DBStaticPlanet::db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
@@ -58,31 +58,31 @@ discard block |
||
| 58 | 58 | db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'"); |
| 59 | 59 | |
| 60 | 60 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
| 61 | - $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
| 61 | + $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow)); |
|
| 62 | 62 | } else { |
| 63 | 63 | $RetMessage = $lang['gate_wait_data']; |
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | - $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
| 66 | + $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime); |
|
| 67 | 67 | } |
| 68 | 68 | } else { |
| 69 | 69 | $RetMessage = $lang['gate_no_dest_g']; |
| 70 | 70 | } |
| 71 | 71 | } else { |
| 72 | - $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
| 72 | + $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime); |
|
| 73 | 73 | } |
| 74 | 74 | SN::db_transaction_commit(); |
| 75 | 75 | SnTemplate::messageBox($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
| 76 | 76 | } else { |
| 77 | 77 | $template = SnTemplate::gettemplate('jumpgate', true); |
| 78 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
| 78 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
| 79 | 79 | { |
| 80 | 80 | $Combo = ''; |
| 81 | 81 | $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']); |
| 82 | 82 | // while($CurMoon = db_fetch($MoonList)) |
| 83 | - foreach($MoonList as $CurMoon) |
|
| 83 | + foreach ($MoonList as $CurMoon) |
|
| 84 | 84 | { |
| 85 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
| 85 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
| 86 | 86 | { |
| 87 | 87 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
| 88 | 88 | $template->assign_block_vars('moon', array( |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - foreach(sn_get_groups('fleet') as $Ship) |
|
| 99 | + foreach (sn_get_groups('fleet') as $Ship) |
|
| 100 | 100 | { |
| 101 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
| 101 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
| 102 | 102 | { |
| 103 | 103 | continue; |
| 104 | 104 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // $same_user = false; |
| 48 | 48 | // } |
| 49 | 49 | |
| 50 | - if(!$user_data) { |
|
| 50 | + if (!$user_data) { |
|
| 51 | 51 | SnTemplate::messageBox($lang['imp_imperator_none'], $lang['sys_error'], 'index.php', 10); |
| 52 | 52 | die(); |
| 53 | 53 | } |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | $stat_array = array(); |
| 59 | 59 | $query = doquery("SELECT * FROM {{statpoints}} WHERE `stat_type` = 1 AND `id_owner` = {$user_id} ORDER BY `stat_code` DESC;"); |
| 60 | 60 | $stat_count = SN::$db->db_affected_rows(); |
| 61 | - while($row = db_fetch($query)) { |
|
| 62 | - foreach($stat_fields as $field_db_name => $field_template_name) { |
|
| 61 | + while ($row = db_fetch($query)) { |
|
| 62 | + foreach ($stat_fields as $field_db_name => $field_template_name) { |
|
| 63 | 63 | // $stat_count - $row['stat_code'] - для реверсирования ID статы в JS |
| 64 | 64 | $stat_array[$field_template_name]['DATA'][$stat_count - $row['stat_code']] = $row[$field_db_name]; |
| 65 | 65 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $stat_array_date = $stat_array['STAT_DATE']; |
| 69 | 69 | empty($stat_array_date['DATA']) ? $stat_array_date['DATA'] = array() : false; |
| 70 | - foreach($stat_array_date['DATA'] as $key => $value) { |
|
| 70 | + foreach ($stat_array_date['DATA'] as $key => $value) { |
|
| 71 | 71 | $template->assign_block_vars('stat_date', array( |
| 72 | 72 | 'ID' => $key, |
| 73 | 73 | 'VALUE' => $value, |
@@ -77,21 +77,21 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | unset($stat_array['STAT_DATE']); |
| 79 | 79 | $template_data = array(); |
| 80 | - foreach($stat_array as $stat_type => &$stat_type_data) { |
|
| 80 | + foreach ($stat_array as $stat_type => &$stat_type_data) { |
|
| 81 | 81 | $reverse_min_max = strpos($stat_type, '_RANK') !== false; |
| 82 | 82 | $stat_type_data['MIN'] = $reverse_min_max ? max($stat_type_data['DATA']) : min($stat_type_data['DATA']); |
| 83 | 83 | $stat_type_data['MAX'] = $reverse_min_max ? min($stat_type_data['DATA']) : max($stat_type_data['DATA']); |
| 84 | 84 | $stat_type_data['AVG'] = avg($stat_type_data['DATA']); |
| 85 | - foreach($stat_type_data['DATA'] as $key => $value) { |
|
| 85 | + foreach ($stat_type_data['DATA'] as $key => $value) { |
|
| 86 | 86 | $stat_type_data['PERCENT'][$key] = ($stat_type_data['MAX'] - $value ? ($value - $stat_type_data['MIN']) / ($stat_type_data['MAX'] - $stat_type_data['MIN']) : 1) * 100; |
| 87 | 87 | $template_data[$stat_type][$key]['ID'] = $key; |
| 88 | 88 | $template_data[$stat_type][$key]['VALUE'] = $value; |
| 89 | - $template_data[$stat_type][$key]['DELTA'] = ($reverse_min_max ? $stat_type_data['MIN'] - $value : $value - $stat_type_data['MAX']); |
|
| 89 | + $template_data[$stat_type][$key]['DELTA'] = ($reverse_min_max ? $stat_type_data['MIN'] - $value : $value - $stat_type_data['MAX']); |
|
| 90 | 90 | $template_data[$stat_type][$key]['PERCENT'] = $stat_type_data['PERCENT'][$key]; |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - foreach($template_data as $stat_type => $stat_type_data) { |
|
| 94 | + foreach ($template_data as $stat_type => $stat_type_data) { |
|
| 95 | 95 | $template->assign_block_vars('stat', array( |
| 96 | 96 | 'TYPE' => $stat_type, |
| 97 | 97 | 'TEXT' => $lang['imp_stat_types'][$stat_type], |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | 'MAX' => $stat_array[$stat_type]['MAX'], |
| 100 | 100 | 'AVG' => $stat_array[$stat_type]['AVG'], |
| 101 | 101 | )); |
| 102 | - foreach($stat_type_data as $stat_entry) { |
|
| 102 | + foreach ($stat_type_data as $stat_entry) { |
|
| 103 | 103 | $template->assign_block_vars('stat.entry', $stat_entry); |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | - if($same_user) { |
|
| 108 | + if ($same_user) { |
|
| 109 | 109 | rpg_level_up($user, RPG_STRUCTURE); |
| 110 | 110 | rpg_level_up($user, RPG_RAID); |
| 111 | 111 | rpg_level_up($user, RPG_TECH); |
@@ -142,29 +142,29 @@ discard block |
||
| 142 | 142 | 'builder_xp' => HelperString::numberFloorAndFormat($user_data['xpminier']), |
| 143 | 143 | 'builder_lvl' => HelperString::numberFloorAndFormat($user_data['lvl_minier']), |
| 144 | 144 | 'builder_lvl_st' => HelperString::numberFloorAndFormat(rpg_get_miner_xp($user_data['lvl_minier'])), |
| 145 | - 'builder_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_miner_xp($user_data['lvl_minier']+1)), |
|
| 145 | + 'builder_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_miner_xp($user_data['lvl_minier'] + 1)), |
|
| 146 | 146 | 'raid_xp' => HelperString::numberFloorAndFormat($user_data['xpraid']), |
| 147 | 147 | 'raid_lvl' => HelperString::numberFloorAndFormat($user_data['lvl_raid']), |
| 148 | - 'raid_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_raider_xp($user_data['lvl_raid']+1)), |
|
| 148 | + 'raid_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_raider_xp($user_data['lvl_raid'] + 1)), |
|
| 149 | 149 | 'raids' => HelperString::numberFloorAndFormat($user_data['raids']), |
| 150 | 150 | 'raidswin' => HelperString::numberFloorAndFormat($user_data['raidswin']), |
| 151 | 151 | 'raidsloose' => HelperString::numberFloorAndFormat($user_data['raidsloose']), |
| 152 | 152 | 'tech_xp' => HelperString::numberFloorAndFormat($user_data['player_rpg_tech_xp']), |
| 153 | 153 | 'tech_lvl' => HelperString::numberFloorAndFormat($user_data['player_rpg_tech_level']), |
| 154 | 154 | 'tech_lvl_st' => HelperString::numberFloorAndFormat(rpg_get_tech_xp($user_data['player_rpg_tech_level'])), |
| 155 | - 'tech_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_tech_xp($user_data['player_rpg_tech_level']+1)), |
|
| 155 | + 'tech_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_tech_xp($user_data['player_rpg_tech_level'] + 1)), |
|
| 156 | 156 | |
| 157 | 157 | 'explore_xp' => HelperString::numberFloorAndFormat($user_data['player_rpg_explore_xp']), |
| 158 | 158 | 'explore_lvl' => HelperString::numberFloorAndFormat($user_data['player_rpg_explore_level']), |
| 159 | 159 | 'explore_lvl_st' => HelperString::numberFloorAndFormat(rpg_get_explore_xp($user_data['player_rpg_explore_level'])), |
| 160 | - 'explore_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_explore_xp($user_data['player_rpg_explore_level']+1)), |
|
| 161 | - |
|
| 162 | - 'build_points' => HelperString::numberFloorAndFormat( $StatRecord['build_points'] ), |
|
| 163 | - 'tech_points' => HelperString::numberFloorAndFormat( $StatRecord['tech_points'] ), |
|
| 164 | - 'fleet_points' => HelperString::numberFloorAndFormat( $StatRecord['fleet_points'] ), |
|
| 165 | - 'defs_points' => HelperString::numberFloorAndFormat( $StatRecord['defs_points'] ), |
|
| 166 | - 'res_points' => HelperString::numberFloorAndFormat( $StatRecord['res_points'] ), |
|
| 167 | - 'total_points' => HelperString::numberFloorAndFormat( $StatRecord['total_points'] ), |
|
| 160 | + 'explore_lvl_up' => HelperString::numberFloorAndFormat(rpg_get_explore_xp($user_data['player_rpg_explore_level'] + 1)), |
|
| 161 | + |
|
| 162 | + 'build_points' => HelperString::numberFloorAndFormat($StatRecord['build_points']), |
|
| 163 | + 'tech_points' => HelperString::numberFloorAndFormat($StatRecord['tech_points']), |
|
| 164 | + 'fleet_points' => HelperString::numberFloorAndFormat($StatRecord['fleet_points']), |
|
| 165 | + 'defs_points' => HelperString::numberFloorAndFormat($StatRecord['defs_points']), |
|
| 166 | + 'res_points' => HelperString::numberFloorAndFormat($StatRecord['res_points']), |
|
| 167 | + 'total_points' => HelperString::numberFloorAndFormat($StatRecord['total_points']), |
|
| 168 | 168 | 'user_rank' => $StatRecord['total_rank'], |
| 169 | 169 | 'RANK_DIFF' => $StatRecord['total_old_rank'] - $StatRecord['total_rank'], |
| 170 | 170 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | $combat_data = sn_ube_report_load(sys_get_param_str('cypher')); |
| 14 | 14 | |
| 15 | - if($combat_data != UBE_REPORT_NOT_FOUND) { |
|
| 15 | + if ($combat_data != UBE_REPORT_NOT_FOUND) { |
|
| 16 | 16 | sn_ube_report_generate($combat_data, $template_result); |
| 17 | 17 | $template = SnTemplate::gettemplate('ube_combat_report', $template); |
| 18 | 18 | $template->assign_vars(array( |