本文整理汇总了PHP中pretty_number函数的典型用法代码示例。如果您正苦于以下问题:PHP pretty_number函数的具体用法?PHP pretty_number怎么用?PHP pretty_number使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pretty_number函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tpl_parse_fleet_db
function tpl_parse_fleet_db($fleet, $index, $user_data = false)
{
global $lang, $time_now, $user, $sn_data;
if (!$user_data) {
$user_data = $user;
}
if ($fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] == 2) {
$aks = doquery("SELECT * FROM {{aks}} WHERE id={$fleet['fleet_group']} LIMIT 1;", '', true);
}
$spy_level = $user['id'] == $fleet['fleet_owner'] ? 100 : $user[$sn_data[TECH_SPY]['name']] + $user[$sn_data[MRC_SPY]['name']];
$return['fleet'] = array('NUMBER' => $index, 'ID' => $fleet['fleet_id'], 'OWNER' => $fleet['fleet_owner'], 'TARGET_OWNER' => $fleet['fleet_target_owner'], 'MESSAGE' => $fleet['fleet_mess'], 'MISSION' => $fleet['fleet_mission'], 'MISSION_NAME' => $lang['type_mission'][$fleet['fleet_mission']], 'ACS' => $aks['name'], 'AMOUNT' => $spy_level >= 4 ? pretty_number($fleet['fleet_amount']) . ($fleet['fleet_resource_metal'] + $fleet['fleet_resource_crystal'] + $fleet['fleet_resource_deuterium'] ? '+' : '') : '?', 'METAL' => $spy_level >= 8 ? $fleet['fleet_resource_metal'] : 0, 'CRYSTAL' => $spy_level >= 8 ? $fleet['fleet_resource_crystal'] : 0, 'DEUTERIUM' => $spy_level >= 8 ? $fleet['fleet_resource_deuterium'] : 0, 'START_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_start_type']], 'START_COORDS' => "[{$fleet['fleet_start_galaxy']}:{$fleet['fleet_start_system']}:{$fleet['fleet_start_planet']}]", 'START_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_end_time']), 'START_LEFT' => floor($fleet['fleet_end_time'] + 1 - $time_now), 'START_URL' => uni_render_coordinates_href($fleet, 'fleet_start_', 3), 'START_NAME' => $fleet['fleet_start_name'], 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_end_type']], 'END_COORDS' => "[{$fleet['fleet_end_galaxy']}:{$fleet['fleet_end_system']}:{$fleet['fleet_end_planet']}]", 'END_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_start_time']), 'END_LEFT' => floor($fleet['fleet_start_time'] + 1 - $time_now), 'END_URL' => uni_render_coordinates_href($fleet, 'fleet_end_', 3), 'END_NAME' => $fleet['fleet_end_name'], 'STAY_TIME' => date(FMT_DATE_TIME, $fleet['fleet_end_stay']), 'STAY_LEFT' => floor($fleet['fleet_end_stay'] + 1 - $time_now), 'OV_LABEL' => $fleet['ov_label'], 'OV_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['ov_time']), 'OV_LEFT' => floor($fleet['ov_time'] + 1 - $time_now), 'OV_THIS_PLANET' => $fleet['ov_this_planet']);
$ship_list = explode(';', $fleet['fleet_array']);
if ($spy_level >= 6) {
foreach ($ship_list as $ship_record) {
if ($ship_record) {
$ship_data = explode(',', $ship_record);
if ($spy_level >= 10) {
$return['ships'][$ship_data[0]] = array('ID' => $ship_data[0], 'NAME' => $lang['tech'][$ship_data[0]], 'AMOUNT' => $ship_data[1], 'CONSUMPTION' => GetShipConsumption($ship_data[0], $user_data), 'SPEED' => get_ship_speed($ship_data[0], $user_data), 'CAPACITY' => $sn_data[$ship_data[0]]['capacity']);
} else {
$return['ships'][$ship_data[0]] = array('ID' => $ship_id++, 'NAME' => $lang['tech'][SHIP_FLEET], 'AMOUNT' => $ship_data[1], 'CONSUMPTION' => 0, 'SPEED' => 0, 'CAPACITY' => 0);
}
}
}
}
return $return;
}
示例2: _rewardPurchase
function _rewardPurchase($userId, $currency, $mc_gross)
{
// Make userid safe to use in query
$userId = mysql_real_escape_string($userId);
$timer = time();
$INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . $userId . ";");
if ($INFO1['lp_points'] >= 0) {
$tex = 1;
} elseif ($INFO1['lp_points'] >= 125) {
$tex = 2;
} elseif ($INFO1['lp_points'] >= 625) {
$tex = 4;
} elseif ($INFO1['lp_points'] >= 2500) {
$tex = 6;
} elseif ($INFO1['lp_points'] >= 7000) {
$tex = 8;
}
mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + " . $currency . " WHERE `id` = '" . $userId . "';");
if ($INFO1['ref_id'] != 0) {
mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $currency / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
SendSimpleMessage($INFO1['ref_id'], '', $timer, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($currency / 100 * 5) . ' anti matter have been credited to your account.');
}
SendSimpleMessage($userId, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' anti matter have been credited to your account.');
SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' Anti Matter Units have been credited to ' . $userId . ' account.');
if (DEBUG == true) {
error_log(date('[Y-m-d H:i e] ') . "Verified IPN: {$req} " . PHP_EOL, 3, LOG_FILE);
}
}
示例3: int_calc_storage_bar
function int_calc_storage_bar($resource_id)
{
global $lang, $template, $caps_real, $planetrow, $user;
$totalProduction = $caps_real['total'][$resource_id];
$storage_fill = $caps_real['total_storage'][$resource_id] ? floor(mrc_get_level($user, $planetrow, $resource_id) / $caps_real['total_storage'][$resource_id] * 100) : 0;
$template->assign_block_vars('resources', array('NAME' => $lang["sys_" . pname_resource_name($resource_id)], 'HOURLY' => pretty_number($totalProduction, true, true), 'WEEKLY' => pretty_number($totalProduction * 24 * 7, true, true), 'DAILY' => pretty_number($totalProduction * 24, true, true), 'MONTHLY' => pretty_number($totalProduction * 24 * 30, true, true), 'STORAGE' => intval($storage_fill), 'BAR' => min($storage_fill, 100)));
}
示例4: run
function run()
{
if (Config::get(ROOT_UNI)->ref_active != 1) {
return null;
}
/** @var $langObjects Language[] */
$langObjects = array();
$db = Database::get();
$sql = 'SELECT `username`, `ref_id`, `id`, `lang`, user.`universe`
FROM %%USERS%% user
INNER JOIN %%STATPOINTS%% as stats
ON stats.`id_owner` = user.`id` AND stats.`stat_type` = :type AND stats.`total_points` >= :points
WHERE user.`ref_bonus` = 1;';
$userArray = $db->select($sql, array(':type' => 1, ':points' => Config::get(ROOT_UNI)->ref_minpoints));
foreach ($userArray as $user) {
if (!isset($langObjects[$user['lang']])) {
$langObjects[$user['lang']] = new Language($user['lang']);
$langObjects[$user['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
}
$userConfig = Config::get($user['universe']);
$LNG = $langObjects[$user['lang']];
$sql = 'UPDATE %%USERS%% SET `darkmatter` = `darkmatter` + :bonus WHERE `id` = :userId;';
$db->update($sql, array(':bonus' => $userConfig->ref_bonus, ':userId' => $user['ref_id']));
$sql = 'UPDATE %%USERS%% SET `ref_bonus` = 0 WHERE `id` = :userId;';
$db->update($sql, array(':userId' => $user['id']));
$Message = sprintf($LNG['sys_refferal_text'], $user['username'], pretty_number($userConfig->ref_minpoints), pretty_number($userConfig->ref_bonus), $LNG['tech'][921]);
PlayerUtil::sendMessage($user['ref_id'], '', $LNG['sys_refferal_from'], 4, sprintf($LNG['sys_refferal_title'], $user['username']), $Message, TIMESTAMP);
}
return true;
}
示例5: _rewardPurchase
function _rewardPurchase($userId, $pay, $realpay, $received, $credits, $type, $transac, $code, $timer)
{
// Make userid safe to use in query
$userId = mysql_real_escape_string($userId);
$timer = time();
$INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . mysql_escape_string($userId) . ";");
if ($INFO1['lp_points'] >= 0) {
$tex = 1;
} elseif ($INFO1['lp_points'] >= 125) {
$tex = 2;
} elseif ($INFO1['lp_points'] >= 625) {
$tex = 4;
} elseif ($INFO1['lp_points'] >= 2500) {
$tex = 6;
} elseif ($INFO1['lp_points'] >= 7000) {
$tex = 8;
}
mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + '" . $credits . "' WHERE `id` = '" . mysql_escape_string($userId) . "';");
mysql_query("INSERT INTO `uni1_allopass_log` VALUES ('', '" . mysql_escape_string($userId) . "', '" . mysql_escape_string($code) . "', '" . mysql_escape_string($credits) . "','" . mysql_escape_string($type) . "', '" . mysql_escape_string($transac) . "', '" . mysql_escape_string($pay) . "', '" . mysql_escape_string($realpay) . "', '" . mysql_escape_string($received) . "', '" . $timer . "', '1');");
if ($INFO1['ref_id'] != 0) {
mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $INFO['amount'] / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
SendSimpleMessage($INFO1['ref_id'], '', TIMESTAMP, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($INFO['amount'] / 100 * 5) . ' anti matter have been credited to your account.');
}
SendSimpleMessage(mysql_escape_string($userId), '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to your account');
//Admin Message
SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to ' . $userId . '');
}
示例6: ReturnEvent
function ReturnEvent()
{
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
$this->RestoreFleet();
}
示例7: ReturnEvent
function ReturnEvent()
{
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_stat_mess'], GetStartAddressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 4, $LNG['sys_mess_fleetback'], $Message, $this->_fleet['fleet_end_time'], NULL, 1, $this->_fleet['fleet_universe']);
$this->RestoreFleet();
}
示例8: GetElementPrice
function GetElementPrice($USER, $PLANET, $Element, $USERfactor = true)
{
global $pricelist, $resource, $LNG;
if ($USERfactor) {
$level = isset($PLANET[$resource[$Element]]) ? $PLANET[$resource[$Element]] : $USER[$resource[$Element]];
}
$array = array('metal' => $LNG['Metal'], 'crystal' => $LNG['Crystal'], 'deuterium' => $LNG['Deuterium'], 'energy_max' => $LNG['Energy'], 'darkmatter' => $LNG['Darkmatter']);
$text = "";
foreach ($array as $ResType => $ResTitle) {
if ($pricelist[$Element][$ResType] != 0) {
$text .= $ResTitle . ": ";
if ($USERfactor) {
$cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost = floor($pricelist[$Element][$ResType]);
}
if (isset($PLANET[$ResType]) && $cost > $PLANET[$ResType] || isset($USER[$ResType]) && $cost > $USER[$ResType]) {
$text .= "<b style=\"color:red;\" id=\"" . $ResType . "_" . $Element . "\">" . pretty_number($cost) . "</b> ";
} else {
$text .= "<b style=\"color:lime;\" id=\"" . $ResType . "_" . $Element . "\">" . pretty_number($cost) . "</b> ";
}
}
}
return $text;
}
示例9: show
function show()
{
global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
$code = isset($_GET['code']) ? $_GET['code'] : null;
$quer = $GLOBALS['DATABASE']->query("SELECT *FROM `uni1_allopass_log` where `code` = '" . $code . "' ;");
if ($GLOBALS['DATABASE']->numRows($quer) < 1) {
$this->printMessage("We are proceeding the payment, do not quit this page. <br> you wil be redirected in 5 seconds", true, array('game.php?page=allo&code=' . $code . '', 5));
die;
}
$query = $GLOBALS['DATABASE']->query("SELECT transac, date, orderid, reference_paid, credits FROM `uni1_allopass_log` where `code` = '" . $code . "' ;");
$query = $GLOBALS['DATABASE']->fetch_array($query);
$INFO1 = $GLOBALS['DATABASE']->uniquequery("SELECT * FROM `uni1_users` WHERE `id` = " . $USER['id'] . ";");
if ($INFO1['lp_points'] == 0) {
$text = 0;
}
if ($INFO1['lp_points'] > 0) {
$text = 0;
}
if ($INFO1['lp_points'] >= 125) {
$text = 5;
}
if ($INFO1['lp_points'] >= 625) {
$text = 10;
}
if ($INFO1['lp_points'] >= 2500) {
$text = 15;
}
if ($INFO1['lp_points'] >= 7000) {
$text = 20;
}
$this->tplObj->assign_vars(array('transac' => $query['transac'], 'code' => $code, 'date' => str_replace(' ', ' ', _date($LNG['php_tdformat'], $query['date']), $USER['timezone']), 'orderid' => $query['orderid'], 'total' => $query['reference_paid'], 'credits' => pretty_number($query['credits'] + $query['credits'] / 100 * $text)));
$this->display('page.allo.order.tpl');
}
示例10: ShowGalaxyFooterlist
function ShowGalaxyFooterlist($Galaxy, $System, $CurrentMIP, $CurrentRC, $CurrentSP)
{
global $lang, $maxfleet_count, $fleetmax, $planetcount;
$Result = "";
if ($planetcount == 1) {
$PlanetCountMessage = $planetcount . " " . $lang['gf_cntmone'];
} elseif ($planetcount == 0) {
$PlanetCountMessage = $lang['gf_cntmnone'];
} else {
$PlanetCountMessage = $planetcount . " " . $lang['gf_cntmsome'];
}
$Recyclers = pretty_number($CurrentRC);
$SpyProbes = pretty_number($CurrentSP);
$Result .= "<table ><tbody>";
$Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"180\" colspan=3><span id=\"slots\">" . $maxfleet_count . "</span>/" . $fleetmax . " " . $lang['gf_fleetslt'] . " </td>";
$Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"180\" colspan=2><span id=\"recyclers\">" . $Recyclers . "</span> " . $lang['gf_rc_title'] . " </td>";
$Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"170\" colspan=2><span id=\"probes\">" . $SpyProbes . "</span> " . $lang['gf_sp_title'] . " </td>";
$Result .= "</tr>";
$Result .= "<tr style=\"display: none;\" id=\"fleetstatusrow\">";
$Result .= "<th class=c colspan=8><!--<div id=\"fleetstatus\"></div>-->";
$Result .= "<table style=\"font-weight: bold\" width=\"90%\" id=\"fleetstatustable\">";
$Result .= "<!-- will be filled with content later on while processing ajax replys -->";
$Result .= "</tr></tbody></table>";
$Result .= "</tr>";
/*
<tr style=\"display: none;\" id=\"fleetstatusrow\"><th colspan="8"><!--<div id="fleetstatus"></div>-->
<table style="font-weight: bold;" width=100% id="fleetstatustable">
<!-- will be filled with content later on while processing ajax replys -->
</table>
</th>
</tr>
*/
return $Result;
}
示例11: IPN
function IPN()
{
global $USER;
/* if (!$this_p->validate_ipn())
{
message('There was an error');
}
*/
$ID = HTTP::_GP('custom', '');
$txn_id = $_GET['txn_id'];
$mc_gross = $_GET['mc_gross'];
//print_r($ID);
// $ID = HTTP::_GP('amount','');
$explode = explode(',', $ID);
$user_id = $explode[0];
$the_id = $explode[1];
if (empty($ID)) {
message("Error occured");
}
$INFO = $GLOBALS['DATABASE']->uniquequery("SELECT * FROM `uni1_paypal` WHERE `id` = " . $GLOBALS['DATABASE']->sql_escape($the_id) . " and `player` = " . $GLOBALS['DATABASE']->sql_escape($user_id) . ";");
//print_r($INFO);
if (!empty($INFO)) {
$GLOBALS['DATABASE']->query("UPDATE `uni1_users` SET `darkmatter` = `darkmatter` + " . $INFO['amount'] . " WHERE `id` = '" . $INFO['player'] . "';");
$GLOBALS['DATABASE']->query("DELETE FROM `uni1_paypal` WHERE `id` = '" . $the_id . "';");
//$GLOBALS['DATABASE']->query("INSERT INTO `uni1_paypal_log` VALUES (null,".$INFO['player'].",".$INFO['amount'].",".TIMESTAMP.") ;");
$GLOBALS['DATABASE']->query("INSERT INTO `uni1_paysafecard_log` VALUES ('', '" . mysql_escape_string($user_id) . "', '" . TIMESTAMP . "', '" . $txn_id . "', '" . $mc_gross . "','1', 'Paypal', '1');");
message(pretty_number($INFO['amount']) . ' Credit have been added to your account. <br><br><a href="?page=overview">Continue</a>');
} else {
message('Error please contact the administrator <br><br><a href="?page=overview">Continue</a>');
}
}
示例12: show
function show()
{
global $USER, $PLANET, $LNG, $UNI, $CONF, $resource, $pricelist;
$mode = HTTP::_GP('y', '');
$table = "";
$range = $PLANET['hangar'] * 3 - 2;
if ($range < 0) {
$range = 0;
}
if ($mode == '1') {
$cautare = $GLOBALS['DATABASE']->query("SELECT *from " . PLANETS . " where (`der_metal` >0 OR `der_crystal` >0) AND (`system` > '" . ($PLANET['system'] - $range) . "' AND `system` < '" . ($PLANET['system'] + $range) . "') AND `galaxy` = '" . $PLANET['galaxy'] . "' and `planet_type` = '1' AND universe = " . $UNI . " ;");
$table = "<tr><th>" . $LNG['debris_action_1'] . "</th><th>" . $LNG['debris_action_2'] . "</th><th>" . $LNG['debris_action_3'] . "</th><th>" . $LNG['debris_action_4'] . "</th><th>" . $LNG['debris_action_5'] . "</th><th>" . $LNG['debris_action_6'] . "\n\t\t\t</th></tr>";
//print_r($cautare);
if ($GLOBALS['DATABASE']->numRows($cautare) > 0) {
while ($GalaxyRowPlanet = $GLOBALS['DATABASE']->fetch_array($cautare)) {
$GRecNeeded = min(ceil(($GalaxyRowPlanet['der_metal'] + $GalaxyRowPlanet['der_crystal']) / $pricelist[219]['capacity']), $PLANET[$resource[219]]);
$table .= "<tr><td>" . $GalaxyRowPlanet['galaxy'] . "</td><td>" . $GalaxyRowPlanet['system'] . "</td><td>" . $GalaxyRowPlanet['planet'] . "</td><td>" . pretty_number($GalaxyRowPlanet['der_metal']) . "</td><td>" . pretty_number($GalaxyRowPlanet['der_crystal']) . "</td><td><a href='javascript:doit(8," . $GalaxyRowPlanet['id'] . ");'>" . $LNG['debris_action_6'] . "</a></td></tr>";
}
} else {
$table .= "<tr><td colspan='6'>" . $LNG['debris_action_7'] . "</td></tr>";
}
}
$this->tplObj->assign_vars(array('range' => $range, 'debris' => $table, 'user_maxfleetsettings' => $USER['settings_fleetactions']));
$this->display("page.finddebris.default.tpl");
}
示例13: flt_mission_relocate
function flt_mission_relocate($mission_data)
{
$fleet_row = $mission_data['fleet'];
$destination_planet = $mission_data['dst_planet'];
if (!$destination_planet || !is_array($destination_planet)) {
doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
return CACHE_FLEET;
}
/*
// flt_mission_relocate
$TargetAdress = sprintf ($lang['sys_adress_planet'], $fleet_row['fleet_start_galaxy'], $fleet_row['fleet_start_system'], $fleet_row['fleet_start_planet']);
$TargetAddedGoods = sprintf ($lang['sys_stay_mess_goods'],
$lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']),
$lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']),
$lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
$TargetMessage = $lang['sys_stay_mess_back'] ."<a href=\"galaxy.php?mode=3&galaxy=". $fleet_row['fleet_start_galaxy'] ."&system=". $fleet_row['fleet_start_system'] ."\">";
$TargetMessage .= $TargetAdress. "</a>". $lang['sys_stay_mess_bend'] ."<br />". $TargetAddedGoods;
SendSimpleMessage ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
*/
global $lang;
$TargetUserID = $destination_planet['id_owner'];
$TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']);
$TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']), $lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
$TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $fleet_row['fleet_end_galaxy'] . "&system=" . $fleet_row['fleet_end_system'] . "\">";
$TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
msg_send_simple_message($TargetUserID, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
return RestoreFleetToPlanet($fleet_row, false);
}
示例14: show
public function show()
{
global $LNG, $USER, $resource;
$darkmatter_cost_trader = Config::get()->darkmatter_cost_trader;
$this->assign(array('tr_cost_dm_trader' => sprintf($LNG['tr_cost_dm_trader'], pretty_number($darkmatter_cost_trader), $LNG['tech'][921]), 'charge' => self::$Charge, 'resource' => $resource, 'requiredDarkMatter' => $USER['darkmatter'] < $darkmatter_cost_trader ? sprintf($LNG['tr_not_enought'], $LNG['tech'][921]) : false));
$this->display("page.trader.default.tpl");
}
示例15: show
function show()
{
global $LNG, $USER, $PLANET, $resource, $reslist;
if ($USER['planet_sort'] == 0) {
$Order = "id ";
} elseif ($USER['planet_sort'] == 1) {
$Order = "galaxy, system, planet, planet_type ";
} elseif ($USER['planet_sort'] == 2) {
$Order = "name ";
}
$Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC";
$PlanetsRAW = $GLOBALS['DATABASE']->query("SELECT * FROM " . PLANETS . " WHERE id_owner = '" . $USER['id'] . "' AND destruyed = '0' AND planet_type != '4' ORDER BY " . $Order . ";");
$elementALL = array(212, 202, 203, 204, 205, 229, 209, 206, 207, 217, 215, 213, 211, 219, 225, 226, 214, 216, 230, 227, 228, 222, 218, 221, 208, 210, 220, 223);
$elementALLBis = array(401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419, 420, 421, 422, 502, 503);
$elementAllTris = array(1, 2, 3, 4, 5, 6, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 41, 42, 43, 44, 48);
foreach ($elementAllTris as $Element) {
$elementListallTris[$Element] = array('id' => $Element);
}
foreach ($elementALL as $Element) {
$elementListall[$Element] = array('id' => $Element);
}
foreach ($elementALLBis as $Element) {
$elementListallBis[$Element] = array('id' => $Element);
}
$planetList = array();
$PlanetRess = new ResourceUpdate();
while ($PLANETA = $GLOBALS['DATABASE']->fetch_array($PlanetsRAW)) {
list($USER, $PLANETA) = $PlanetRess->CalcResource($USER, $PLANETA, true);
$planetList[] = array('id' => $PLANETA['id'], 'name' => $PLANETA['name'], 'image' => $PLANETA['image'], 'galaxy' => $PLANETA['galaxy'], 'system' => $PLANETA['system'], 'planet' => $PLANETA['planet'], 'type' => $PLANETA['planet_type'], 'metal_percent' => round($PLANETA['metal'] * 100 / $PLANETA['metal_max']), 'cystal_percent' => round($PLANETA['crystal'] * 100 / $PLANETA['crystal_max']), 'deut_percent' => round($PLANETA['deuterium'] * 100 / $PLANETA['deuterium_max']), 'metal_mine' => $PLANETA['metal_mine'], 'crystal_mine' => $PLANETA['crystal_mine'], 'deuterium_sintetizer' => $PLANETA['deuterium_sintetizer'], 'solar_plant' => $PLANETA['solar_plant'], 'searcher' => $PLANETA['searcher'], 'fusion_plant' => $PLANETA['fusion_plant'], 'robot_factory' => $PLANETA['robot_factory'], 'nano_factory' => $PLANETA['nano_factory'], 'hangar' => $PLANETA['hangar'], 'metal_store' => $PLANETA['metal_store'], 'crystal_store' => $PLANETA['crystal_store'], 'deuterium_store' => $PLANETA['deuterium_store'], 'laboratory' => $PLANETA['laboratory'], 'terraformer' => $PLANETA['terraformer'], 'university' => $PLANETA['university'], 'ally_deposit' => $PLANETA['ally_deposit'], 'silo' => $PLANETA['silo'], 'mondbasis' => $PLANETA['mondbasis'], 'phalanx' => $PLANETA['phalanx'], 'sprungtor' => $PLANETA['sprungtor'], 'collider' => $PLANETA['collider'], 'solar_satelit' => pretty_number($PLANETA['solar_satelit']), 'small_ship_cargo' => pretty_number($PLANETA['small_ship_cargo']), 'big_ship_cargo' => pretty_number($PLANETA['big_ship_cargo']), 'light_hunter' => pretty_number($PLANETA['light_hunter']), 'heavy_hunter' => pretty_number($PLANETA['heavy_hunter']), 'M7' => pretty_number($PLANETA['M7']), 'recycler' => pretty_number($PLANETA['recycler']), 'crusher' => pretty_number($PLANETA['crusher']), 'battle_ship' => pretty_number($PLANETA['battle_ship']), 'ev_transporter' => pretty_number($PLANETA['ev_transporter']), 'battleship' => pretty_number($PLANETA['battleship']), 'destructor' => pretty_number($PLANETA['destructor']), 'bomber_ship' => pretty_number($PLANETA['bomber_ship']), 'М19' => pretty_number($PLANETA['М19']), 'giga_recykler' => pretty_number($PLANETA['giga_recykler']), 'galleon' => pretty_number($PLANETA['galleon']), 'destroyer' => pretty_number($PLANETA['destroyer']), 'dearth_star' => pretty_number($PLANETA['dearth_star']), 'lune_noir' => pretty_number($PLANETA['lune_noir']), 'M32' => pretty_number($PLANETA['M32']), 'frigate' => pretty_number($PLANETA['frigate']), 'black_wanderer' => pretty_number($PLANETA['black_wanderer']), 'flying_death' => pretty_number($PLANETA['flying_death']), 'star_crasher' => pretty_number($PLANETA['star_crasher']), 'bs_class_oneil' => pretty_number($PLANETA['bs_class_oneil']), 'colonizer' => pretty_number($PLANETA['colonizer']), 'spy_sonde' => pretty_number($PLANETA['spy_sonde']), 'dm_ship' => pretty_number($PLANETA['dm_ship']), 'Scrappy' => pretty_number($PLANETA['Scrappy']), 'misil_launcher' => pretty_number($PLANETA['misil_launcher']), 'small_laser' => pretty_number($PLANETA['small_laser']), 'big_laser' => pretty_number($PLANETA['big_laser']), 'gauss_canyon' => pretty_number($PLANETA['gauss_canyon']), 'ionic_canyon' => pretty_number($PLANETA['ionic_canyon']), 'buster_canyon' => pretty_number($PLANETA['buster_canyon']), 'small_protection_shield' => pretty_number($PLANETA['small_protection_shield']), 'big_protection_shield' => pretty_number($PLANETA['big_protection_shield']), 'planet_protector' => pretty_number($PLANETA['planet_protector']), 'graviton_canyon' => pretty_number($PLANETA['graviton_canyon']), 'orbital_station' => pretty_number($PLANETA['orbital_station']), 'lepton_gun' => pretty_number($PLANETA['lepton_gun']), 'proton_gun' => pretty_number($PLANETA['proton_gun']), 'canyon' => pretty_number($PLANETA['canyon']), 'hydrogen_gun' => pretty_number($PLANETA['hydrogen_gun']), 'dora_gun' => pretty_number($PLANETA['dora_gun']), 'photon_cannon' => pretty_number($PLANETA['photon_cannon']), 'particle_emitter' => pretty_number($PLANETA['particle_emitter']), 'slim_mehador' => pretty_number($PLANETA['slim_mehador']), 'iron_mehador' => pretty_number($PLANETA['iron_mehador']), 'grand_mehador' => pretty_number($PLANETA['grand_mehador']), 'interceptor_misil' => pretty_number($PLANETA['interceptor_misil']), 'interplanetary_misil' => pretty_number($PLANETA['interplanetary_misil']), 'current' => $PLANETA['field_current'], 'max' => CalculateMaxPlanetFields($PLANETA), 'energy_used' => $PLANETA['energy'] + $PLANETA['energy_used'], 'resource901' => pretty_number($PLANETA['metal']), 'resource902' => pretty_number($PLANETA['crystal']), 'resource903' => pretty_number($PLANETA['deuterium']), 'resource911' => pretty_number($PLANETA['energy']));
}
$this->tplObj->loadscript("empire.js");
$this->tplObj->assign_vars(array('planetList' => $planetList, 'elementListall' => $elementListall, 'elementListallBis' => $elementListallBis, 'elementListallTris' => $elementListallTris));
$this->display('page.empire.default.tpl');
}