本文整理汇总了PHP中number函数的典型用法代码示例。如果您正苦于以下问题:PHP number函数的具体用法?PHP number怎么用?PHP number使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了number函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: game_status
function game_status($playerid, $gameid)
{
$query0 = "SELECT * FROM games WHERE gameid = '{$gameid}' ";
$recordset = mysql_query($query0) or die(mysql_error());
$row = mysql_fetch_array($recordset);
//---game stats---//
$gamecode = $row["gamecode"];
$boss = $row["boss"];
$bosshealth = $row["bosshealth"];
$weather = $row["weather"];
$story = $row["bossmove"];
$gamestate = $row["gamestate"];
$roundcount = $row["roundcount"];
$arrayplayersid = explode(",", $row["players"]);
array_pop($arrayplayersid);
$bossmaxhealth = number("starting_boss_health_per_player") * count($arrayplayersid);
//---player stats---//
if ($playerid > 0) {
$query1 = "SELECT * FROM players WHERE playerid = '{$playerid}' ";
$recordset = mysql_query($query1) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$name = $row["name"];
$health = $row["health"];
$strength = $row["strength"];
$speed = $row["speed"];
$playermove = $row["playermove"];
$playerstate = $row["playerstate"];
$playermaxhealth = number("starting_health");
$arrayplayerid = array($playerid);
$arrayplayersid = array_diff($arrayplayersid, $arrayplayerid);
} else {
$name = 0;
$health = 0;
$strength = 0;
$speed = 0;
$playermove = 0;
$playerstate = 0;
$playermaxhealth = 0;
}
if ($playerstate == "dead") {
unset($_SESSION["playerid"]);
}
//---players list---//
$arrayplayernames = array("");
array_pop($arrayplayernames);
foreach ($arrayplayersid as $playerid) {
$query2 = "SELECT * FROM players WHERE playerid = '{$playerid}' ";
$recordset = mysql_query($query2) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$arrayplayername = array($row["name"]);
$arrayplayernames = array_merge($arrayplayernames, $arrayplayername);
}
$playernames = "";
foreach ($arrayplayernames as $playername) {
$playernames = $playernames . $playername . ",";
}
$playernames = substr($playernames, 0, -1);
return $gameid . ";" . $boss . ";" . $bosshealth . ";" . $weather . ";" . $gamestate . ";" . $roundcount . ";" . $story . ";" . $name . ";" . $health . ";" . $strength . ";" . $speed . ";" . $playermove . ";" . $playerstate . ";" . $playernames . ";" . $bossmaxhealth . ";" . $playermaxhealth . ";" . $gamecode;
//16
}
开发者ID:maximforever,项目名称:bossfight,代码行数:60,代码来源:status.php
示例2: boss_attack_all
function boss_attack_all($arrayplayersid)
{
$target = "";
foreach ($arrayplayersid as $playerid) {
$target = $target . $playerid . ",";
}
$target = substr($target, 0, -1);
$attack = mt_rand(number("boss_attack_one_min"), number("boss_attack_one_max"));
return $target . ";" . $attack;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:10,代码来源:bossattackall.php
示例3: log_action
function log_action($user, $action) {
if (!is_array($user) && strlen(number($user)) < 5)
if ($u = user($user)) $user = $u;
if (is_array($user)) $user = $user['phone'];
redis()->lpush('actions', json_encode(array(
'phone' => $user,
'action' => $action,
'time' => time(),
)));
}
开发者ID:rishair,项目名称:schlagelink-twilio,代码行数:10,代码来源:Helper.php
示例4: getContractsData
/**
* @param int $corporation_id
*
* @return mixed
*/
public function getContractsData(int $corporation_id)
{
$contracts = $this->getCorporationContracts($corporation_id, false);
return Datatables::of($contracts)->editColumn('issuerID', function ($row) {
return view('web::partials.contractissuer', compact('row'))->render();
})->editColumn('type', function ($row) {
return view('web::partials.contracttype', compact('row'))->render();
})->editColumn('price', function ($row) {
return number($row->price);
})->editColumn('reward', function ($row) {
return number($row->reward);
})->make('true');
}
开发者ID:eveseat,项目名称:web,代码行数:18,代码来源:ContractsController.php
示例5: getTransactionsData
/**
* @param int $corporation_id
*
* @return mixed
*/
public function getTransactionsData(int $corporation_id)
{
$transactions = $this->getCorporationWalletTransactions($corporation_id, false);
return Datatables::of($transactions)->editColumn('transactionType', function ($row) {
return view('web::partials.transactiontype', compact('row'))->render();
})->editColumn('price', function ($row) {
return number($row->price);
})->addColumn('total', function ($row) {
return number($row->price * $row->quantity);
})->editColumn('clientName', function ($row) {
return view('web::partials.transactionclient', compact('row'))->render();
})->make(true);
}
开发者ID:eveseat,项目名称:web,代码行数:18,代码来源:WalletController.php
示例6: currency
function currency($amount)
{
$position = get('currency.position', 'before');
$symbol = get('currency.symbol', '$');
$str = '';
if ($position === 'before') {
$str .= $symbol;
}
$str .= number($amount);
if ($position === 'after') {
$str .= ' ' . $symbol;
}
return $str;
}
开发者ID:cs-team,项目名称:miniflux,代码行数:14,代码来源:Translator.php
示例7: heal
function heal($playerid)
{
$query1 = "SELECT * FROM players WHERE playerid = '{$playerid}' ";
$recordset = mysql_query($query1) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$gameid = $row["gameid"];
//---build heal targets---//
$query2 = "SELECT * FROM games WHERE gameid = '{$gameid}' ";
$recordset = mysql_query($query2) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$arraytargetsid = explode(",", $row["players"]);
$arrayplayerid = array($playerid);
$arraytargetsid = array_diff($arraytargetsid, $arrayplayerid);
$healhealth = mt_rand(number("heal_health_min"), number("heal_health_max"));
$healstrength = mt_rand(number("heal_strength_min"), number("heal_strength_max"));
$healspeed = mt_rand(number("heal_speed_min"), number("heal_speed_max"));
//---heal targets---//
foreach ($arraytargetsid as $targetid) {
$query3 = "SELECT * FROM players WHERE playerid = '{$targetid}' ";
$recordset = mysql_query($query3) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$health = $row["health"];
$strength = $row["strength"];
$speed = $row["speed"];
if ($health > 0) {
$newhealth = $health + $healhealth;
$newstrength = $strength + $healstrength;
$newspeed = $speed + $healspeed;
if ($newhealth > number("starting_health")) {
$newhealth = number("starting_health");
}
if ($newstrength > number("starting_strength")) {
$newstrength = number("starting_strength");
}
if ($newspeed > number("starting_speed")) {
$newspeed = number("starting_speed");
}
//---update stats---//
$query2 = "UPDATE players SET health = ('{$newhealth}') WHERE playerid = '{$targetid}' ";
mysql_query($query2) or die(mysql_error());
$query3 = "UPDATE players SET strength = ('{$newstrength}') WHERE playerid = '{$targetid}' ";
mysql_query($query3) or die(mysql_error());
$query4 = "UPDATE players SET speed = ('{$newspeed}') WHERE playerid = '{$targetid}' ";
mysql_query($query4) or die(mysql_error());
}
}
}
开发者ID:maximforever,项目名称:bossfight,代码行数:47,代码来源:heal.php
示例8: get_wait_info
function get_wait_info($data)
{
require_once 'common_natural_language.php';
global $mysqli;
$fork_key = $data['fork_key'];
$sql = sprintf("select `Fork Key`,`Fork Result`,`Fork Scheduled Date`,`Fork Start Date`,`Fork State`,`Fork Type`,`Fork Operations Done`,`Fork Operations No Changed`,`Fork Operations Errors`,`Fork Operations Total Operations` from `Fork Dimension` where `Fork Key`=%d ", $fork_key);
$res = $mysqli->query($sql);
if ($row = $res->fetch_assoc()) {
$result_extra_data = array();
switch ($data['tag']) {
case 'journals':
$formated_tag = ' ' . ngettext('journal', 'journals', $row['Fork Operations Total Operations']);
break;
default:
$formated_tag = ' ' . ngettext('record', 'records', $row['Fork Operations Total Operations']);
}
$etr = '';
if ($row['Fork State'] == 'In Process') {
//$msg=number($row['Fork Operations Done']+$row['Fork Operations Errors']+$row['Fork Operations No Changed']).'/'.$row['Fork Operations Total Operations'];
$formated_status = _('In Process');
$formated_progress = _('Processing') . ' ' . number($row['Fork Operations Done']) . ' ' . _('of') . ' ' . number($row['Fork Operations Total Operations']);
$formated_progress .= $formated_tag;
if ($row['Fork Operations Done'] > 1) {
$etr = _('ETA') . ': ' . seconds_to_string(($row['Fork Operations Total Operations'] - $row['Fork Operations Done']) * (gmdate('U') - strtotime($row['Fork Start Date'])) / $row['Fork Operations Done']);
}
} elseif ($row['Fork State'] == 'Queued') {
$formated_status = _('Queued');
$formated_progress = _('Records to process') . ': ' . number($row['Fork Operations Total Operations']);
} elseif ($row['Fork State'] == 'Finished') {
$formated_status = _('Finished');
$formated_progress = number($row['Fork Operations Done']) . $formated_tag . ' ' . _('processed');
} elseif ($row['Fork State'] == 'Cancelled') {
$formated_status = _('Cancelled');
$formated_progress = number($row['Fork Operations Done']) . $formated_tag . ' ' . _('processed');
} else {
$formated_status = $row['Fork State'];
$formated_progress = '';
}
$response = array('state' => 200, 'date' => gmdate('Y-m-d H:i:s'), 'fork_key' => $fork_key, 'fork_state' => $row['Fork State'], 'done' => number($row['Fork Operations Done']), 'no_changed' => number($row['Fork Operations No Changed']), 'errors' => number($row['Fork Operations Errors']), 'total' => number($row['Fork Operations Total Operations']), 'todo' => number($row['Fork Operations Total Operations'] - $row['Fork Operations Done']), 'result' => $row['Fork Result'], 'formated_status' => $formated_status, 'formated_progress' => $formated_progress . '<br>' . $etr, 'progress' => sprintf('%s/%s (%s)', number($row['Fork Operations Done']), number($row['Fork Operations Total Operations']), percentage($row['Fork Operations Done'], $row['Fork Operations Total Operations'])), 'tag' => $data['tag'], 'result_extra_data' => $result_extra_data, 'etr' => $etr);
echo json_encode($response);
} else {
$response = array('state' => 400);
echo json_encode($response);
}
}
开发者ID:inikoo,项目名称:fact,代码行数:45,代码来源:ar_fork.php
示例9: new_player
function new_player($name, $gameid, $browserinfo)
{
$randomseed = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1, 16))), 0, 16);
$starting_health = number("starting_health");
$starting_strength = number("starting_strength");
$starting_speed = number("starting_speed");
$query1 = "INSERT INTO players (name, gameid, health, strength, speed, playerstate, browserinfo) VALUES ('{$name}','{$gameid}','{$starting_health}','{$starting_speed}','{$starting_strength}','{$randomseed}','{$browserinfo}')";
mysql_query($query1) or die(mysql_error());
$query2 = "SELECT * FROM players WHERE name = '{$name}' AND playerstate = '{$randomseed}' ";
$recordset = mysql_query($query2) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$playerid = $row["playerid"];
$query3 = "UPDATE players SET playerstate = ('setting up') WHERE playerid = '{$playerid}' AND playerstate = '{$randomseed}' ";
mysql_query($query3) or die(mysql_error());
$query4 = "UPDATE games SET players = CONCAT(players,'{$playerid},') WHERE gameid = '{$gameid}' ";
mysql_query($query4) or die(mysql_error());
return $playerid;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:18,代码来源:newplayer.php
示例10: getMarketData
/**
* @param int $character_id
*
* @return mixed
*/
public function getMarketData(int $character_id)
{
$orders = $this->getCharacterMarketOrders($character_id, false);
$states = $this->getEveMarketOrderStates();
return Datatables::of($orders)->addColumn('bs', function ($row) {
return view('web::partials.marketbuysell', compact('row'))->render();
})->addColumn('vol', function ($row) {
return view('web::partials.marketvolume', compact('row'))->render();
})->addColumn('state', function ($row) use($states) {
return $states[$row->orderState];
})->editColumn('price', function ($row) {
return number($row->price);
})->addColumn('total', function ($row) {
return number($row->price * $row->volEntered);
})->editColumn('typeName', function ($row) {
return view('web::partials.markettype', compact('row'))->render();
})->make(true);
}
开发者ID:eveseat,项目名称:web,代码行数:23,代码来源:MarketController.php
示例11: boss_move
function boss_move($gameid)
{
$query1 = "SELECT * FROM games WHERE gameid = '{$gameid}' ";
$recordset = mysql_query($query1) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$players = $row["players"];
$arrayplayersid = explode(",", $players);
array_pop($arrayplayersid);
$randomnumber = mt_rand(0, 99);
//---defend---//
if ($randomnumber < number("percentage_boss_dodge")) {
$move = "dodge";
} elseif ($randomnumber > number("percentage_boss_dodge") - 1 and $randomnumber < number("percentage_boss_dodge") + number("percentage_boss_attack_all")) {
$move = "attackall";
} elseif ($randomnumber > 99 - number("percentage_boss_attack_one")) {
$move = "attackone";
}
return $move;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:19,代码来源:bossmove.php
示例12: change_weather
function change_weather($weather)
{
$randomchange = mt_rand(0, 99);
if ($randomchange > number("percentage_weather_change")) {
$newweather = $weather;
} else {
$randomweather = mt_rand(0, 99);
if ($randomweather < number("percentage_weather_sunny")) {
$newweather = "sunny";
} elseif ($randomweather > number("percentage_weather_sunny") - 1 and $randomweather < number("percentage_weather_sunny") + number("percentage_weather_windy")) {
$newweather = "windy";
} elseif ($randomweather > number("percentage_weather_sunny") + number("percentage_weather_windy") - 1 and $randomweather < number("percentage_weather_sunny") + number("percentage_weather_windy") + number("percentage_weather_rainy")) {
$newweather = "rainy";
} elseif ($randomweather > 99 - number("percentage_weather_snowy")) {
$newweather = "snowy";
}
}
return $newweather;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:19,代码来源:changeweather.php
示例13: struk
function struk($pembelian, $bayar, $voucher = 0, $output = null)
{
$recipe = new RecipeMaker(40);
$recipe->center('NIMCO STORE')->breaks();
$recipe->center('Jl. Cendrawasih No. 25')->breaks();
$recipe->center('Demangan Baru Yogyakarta')->breaks();
$recipe->center('Telp : ( 0274 ) 549827')->breaks();
$recipe->breaks(' ');
$recipe->left('TRNS-00001')->right('Nama Kasir')->breaks();
$recipe->left(date('d-m-Y'))->right('Nama Member')->breaks();
$recipe->breaks('-');
$jual = 0;
$total_diskon = 0;
$grand_total = 0;
foreach ($pembelian as $key => $value) {
$value['sub_total'] = $value['harga'] * $value['qty'];
$jual += $value['sub_total'];
$recipe->left($value['kode'] . ' (' . $value['qty'] . ' x ' . number($value['harga']) . ')')->right(number($value['sub_total']))->sparator()->breaks();
if ($value['diskon']) {
$diskon = $value['diskon'] * $value['sub_total'] / 100;
$recipe->left('- Diskon (' . $value['diskon'] . '%)')->right(number($diskon))->sparator()->breaks();
$total_diskon += $diskon;
}
}
$grand_total = $jual - ($total_diskon + $voucher);
$kembali = $bayar - $grand_total;
$recipe->breaks('-');
$recipe->left('Harga Jual')->right(number($jual))->sparator()->breaks();
$recipe->left('Total Diskon')->right(number($total_diskon))->sparator()->breaks();
$recipe->left('Voucher')->right(number($voucher))->sparator()->breaks();
$recipe->left('Grand Total')->right(number($grand_total))->sparator()->breaks();
$recipe->left('Bayar')->right(number($bayar))->sparator()->breaks();
$recipe->left('Kembali')->right(number($kembali))->sparator()->breaks();
$recipe->breaks(' ');
$recipe->center('Terima Kasih & Selamat Belanja Kembali')->breaks();
$recipe->end();
if ($output == 'HTML') {
return $recipe->outputHTML();
} else {
return $recipe->output();
}
}
开发者ID:agungjk,项目名称:POS-Recipe-maker,代码行数:42,代码来源:test.php
示例14: boss_attack_one
function boss_attack_one($arrayplayersid)
{
$arraytargets = array("");
array_pop($arraytargets);
foreach ($arrayplayersid as $playerid) {
$query2 = "SELECT * FROM players WHERE playerid = '{$playerid}' ";
$recordset = mysql_query($query2) or die(mysql_error());
$row = mysql_fetch_array($recordset);
$health = $row["health"];
$arrayplayerid = array($playerid);
$x = 0;
while ($x < $health) {
$arraytargets = array_merge($arraytargets, $arrayplayerid);
$x = $x + 1;
}
}
shuffle($arraytargets);
$target = $arraytargets[0];
$attack = mt_rand(number("boss_attack_one_min"), number("boss_attack_one_max"));
return $target . ";" . $attack;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:21,代码来源:bossattackone.php
示例15: start_game
function start_game($gameid)
{
$query1 = "UPDATE games SET gamestate=('playerturn') WHERE gameid = '{$gameid}' ";
mysql_query($query1) or die(mysql_error());
$query2 = "SELECT * FROM players WHERE gameid =('{$gameid}') ";
$recordset = mysql_query($query2) or die(mysql_error());
$arrayplayersid = array("");
array_pop($arrayplayersid);
while ($row = mysql_fetch_array($recordset)) {
$playerid = $row["playerid"];
$arrayplayerid = array($playerid);
$arrayplayersid = array_merge($arrayplayersid, $arrayplayerid);
}
$bosshealth = 0;
foreach ($arrayplayersid as $playerid) {
$query3 = "UPDATE players SET playerstate =('playerturn') WHERE playerid = '{$playerid}' ";
mysql_query($query3) or die(mysql_error());
$bosshealth = $bosshealth + number("starting_boss_health_per_player");
}
$query4 = "UPDATE games SET bosshealth = ('{$bosshealth}') WHERE gameid = '{$gameid}' ";
mysql_query($query4) or die(mysql_error());
return $gameid;
}
开发者ID:maximforever,项目名称:bossfight,代码行数:23,代码来源:startgame.php
示例16: print_link
function print_link()
{
//generate template
function number($i, $number)
{
//return ereg_replace("^(.*)%%number%%(.*)$","\\1$i\\2",$number);
return preg_replace("/^(.*)%%number%%(.*)\$/", "({$i})", $number);
}
$print_link = false;
if ($this->p["count"] > $this->p["baris"]) {
// print prev
if ($this->page > 1) {
$print_link .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "&page=" . ($this->page - 1) . "\">" . $this->prev . "</a>\n";
}
// set number
$this->p["bawah"] = $this->page - $this->p["langkah"];
if ($this->p["bawah"] < 1) {
$this->p["bawah"] = 1;
}
$this->p["atas"] = $this->page + $this->p["langkah"];
if ($this->p["atas"] > $this->p["total_page"]) {
$this->p["atas"] = $this->p["total_page"];
}
// print start
if ($this->page != 1) {
for ($i = $this->p["bawah"]; $i <= $this->page - 1; $i++) {
$print_link .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "&page={$i}\">" . number($i, $this->number) . "</a>\n";
}
}
// print active
if ($this->p["total_page"] > 1) {
$print_link .= "<b>" . number($this->page, $this->number) . "</b>\n";
}
// print end
for ($i = $this->page + 1; $i <= $this->p["atas"]; $i++) {
$print_link .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "&page={$i}\">" . number($i, $this->number) . "</a>\n";
}
// print next
if ($this->page < $this->p["total_page"]) {
$print_link .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "&page=" . ($this->page + 1) . "\">" . $this->next . "</a>\n";
}
return $print_link;
}
}
开发者ID:nesmaster,项目名称:anakosta,代码行数:44,代码来源:paging_class.php
示例17: idf_escape
$value = $row["partition_values"][$key];
$partitions[] = "\n PARTITION " . idf_escape($val) . " VALUES " . ($row["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ({$value})" : " MAXVALUE");
//! SQL injection
}
}
$partitioning .= "\nPARTITION BY {$row['partition_by']}({$row['partition']})" . ($partitions ? " (" . implode(",", $partitions) . "\n)" : ($row["partitions"] ? " PARTITIONS " . +$row["partitions"] : ""));
} elseif (support("partitioning") && preg_match("~partitioned~", $table_status["Create_options"])) {
$partitioning .= "\nREMOVE PARTITIONING";
}
$message = lang('Table has been altered.');
if ($TABLE == "") {
cookie("adminer_engine", $row["Engine"]);
$message = lang('Table has been created.');
}
$name = trim($row["name"]);
queries_adminer_redirect(ME . (support("table") ? "table=" : "select=") . urlencode($name), $message, alter_table($TABLE, $name, $jush == "sqlite" && ($use_all_fields || $foreign) ? $all_fields : $fields, $foreign, $row["Comment"] != $table_status["Comment"] ? $row["Comment"] : null, $row["Engine"] && $row["Engine"] != $table_status["Engine"] ? $row["Engine"] : "", $row["Collation"] && $row["Collation"] != $table_status["Collation"] ? $row["Collation"] : "", $row["Auto_increment"] != "" ? number($row["Auto_increment"]) : "", $partitioning));
}
}
page_header($TABLE != "" ? lang('Alter table') : lang('Create table'), $error, array("table" => $TABLE), h($TABLE));
if (!$_POST) {
$row = array("Engine" => $_COOKIE["adminer_engine"], "fields" => array(array("field" => "", "type" => isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : ""))), "partition_names" => array(""));
if ($TABLE != "") {
$row = $table_status;
$row["name"] = $TABLE;
$row["fields"] = array();
if (!$_GET["auto_increment"]) {
// don't prefill by original Auto_increment for the sake of performance and not reusing deleted ids
$row["Auto_increment"] = "";
}
foreach ($orig_fields as $field) {
$field["has_default"] = isset($field["default"]);
开发者ID:gigikiri,项目名称:WordPress,代码行数:31,代码来源:create.inc.php
示例18: foreach
<p>Địa chỉ: ' . $_POST['add'] . '</p>
<br />
<hr />
<p><strong>Nội dung:</strong></p>
<br />';
foreach ($_SESSION['shopcart'] as $id => $tol) {
$product = @mysql_fetch_array(@mysql_query("SELECT product_code, product_name, product_price FROM cnt_products WHERE id = " . $id));
$p_monney = $product['product_price'] * $tol;
$monney += $p_monney;
if ($i < 1) {
$content = $id . ':' . $tol;
} else {
$content .= ',' . $id . ':' . $tol;
}
$i++;
$mail .= '<p>' . $product['product_name'] . '<em>(' . $product['product_code'] . ')</em>: ' . number($product['product_price']) . ' VNĐ x ' . number($tol) . ' = ' . number($p_monney) . ' VNĐ</p>';
}
$mail .= '<p>--------------------------------</p>
<p><strong>Tổng cộng: ' . number($monney) . ' VNĐ</strong></p>
</div>';
@mysql_query("INSERT INTO cnt_bills (bill_name, bill_email, bill_phone, bill_fax, bill_add, bill_content, bill_user, bill_time) VALUES ('" . $_POST['name'] . "', '" . $_POST['email'] . "', '" . $_POST['phone'] . "', '" . $_POST['fax'] . "', '" . $_POST['add'] . "', '" . $content . "', " . ($_SESSION['user']['id'] ? $_SESSION['user']['id'] : 0) . ", " . time() . ")");
$_SESSION['pay'] = true;
unset($_SESSION['shopcart']);
@mail($_POST['email'], get_option('name') . " | Đơn đặt hàng tại Website: " . get_option('url'), $mail . "<br />Vui lòng thanh toán để nhận được hàng sớm nhất.<br />-------------------------------------------------------<br />" . get_option('name') . "<br />Email: " . get_option('email') . "<br />Website: " . get_option('url'), "From: " . get_option('email') . "\r\nReply-To: " . get_option('email') . "\r\nContent-type:text/html; charset=UTF-8\r\n\n\\ ");
header('Location: shopcart.html');
} else {
header('Location: shopcart.html');
}
} else {
echo "Hacking attempt";
}
开发者ID:lkyxmen,项目名称:TamPhp,代码行数:31,代码来源:cnt-pay.php
示例19: get
function get($key)
{
//print $key;
if (array_key_exists($key, $this->data)) {
return $this->data[$key];
}
switch ($key) {
case 'Login Count':
case 'Failed Login Count':
return number($this->data['User ' . $key]);
break;
case 'Created ':
case 'Last Failed Login':
case 'Last Login':
if ($this->data['User ' . $key] == '' or $this->data['User ' . $key] == '0000-00-00 00:00:00') {
return '';
} else {
return strftime("%e %b %Y %H:%M %Z", strtotime($this->data['User ' . $key] . " +00:00"));
}
break;
case 'User Pasword':
return "******";
}
}
开发者ID:inikoo,项目名称:fact,代码行数:24,代码来源:class.User.php
示例20: NUMBER
} else {
if ($planetinfo['facility_hydroponics'] == "Y" && $planetinfo['facility_research'] == "Y" && $planetinfo['facility_military'] == "Y" && $planetinfo['facility_medical'] == "Y" && $planetinfo['facility_solarplant'] == "Y" && $planetinfo['facility_shipyard'] == "Y" && $planetinfo['facility_bank'] == "Y") {
} else {
echo "You have a base on this planet.<br/><br/>FACILITIES NOT ACTIVE, ARE CURRENTLY IN STATISCIAL TEST MODE, YOU MAY BUILD THEM, BUT THATS ALL. This is to aid refining a new economy for use within the game, need to ensure its not too fast or too slow!<br/><br/>";
}
if ($planetinfo['facility_hydroponics'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_hydroponics>Build</a> a hydroponics facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_hydro_credits) . " Credits / Organics: " . NUMBER($requirement_hydro_organics) . " / Goods: " . NUMBER($requirement_hydro_goods) . " )</span><br/> <sub>Allows planet to generate food without requiring the colonists to farm food, also produces food required for your ships crew!</sub><br/>";
}
if ($planetinfo['facility_bank'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_bank>Build</a> a marketing facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_banking_creds) . " Credits / Military Facility)</span><br/> <sub>Allows your people to set up buisness, industry etc, supplies your empire with Rare Ores</sub><br/>";
}
if ($planetinfo['facility_shipyard'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_shipyard>Build</a> a shipyard facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_shipyard_credits) . " Credits / Goods: " . number($requirement_shipyard_goods) . " / Ore: " . NUMBER($requirement_shipyard_ore) . " / Military Facility)</span><br/> <sub>Builds parts required for upgrading your ship.</sub><br/>";
}
if ($planetinfo['facility_solarplant'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_solarplant>Build</a> a solarplant facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_solar_credits) . " Credits / Goods: " . number($requirement_solar_goods) . " / Ore: " . NUMBER($requirement_solar_ore) . ")</span><br/> <sub>Used to power planets shields and beams, also to produce organic energy cells (Cells).</sub><br/>";
}
if ($planetinfo['facility_medical'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_medical>Build</a> a medical facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_medical_credits) . " Credits / Goods: " . NUMBER($requirement_medical_goods) . " / Colonists: " . NUMBER($requirement_medical_cols) . " / Hydroponics Facility)</span><br/> <sub>Better healthcare for your colonists, significantly reduced chance of a zombie outbreak!</sub><br/>";
}
if ($planetinfo['facility_military'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_military>Build</a> a military facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_military_credits) . " Credits / Fighters: " . NUMBER($requirement_military_figs) . " / Torpedoes: " . NUMBER($requirement_military_torps) . " / Colonists: " . NUMBER($requirement_military_cols) . ")</span><br/> <sub>Strengthens your planets defences!</sub><br/>";
}
if ($planetinfo['facility_research'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_research>Build</a> a research facility <span class='planet-facilities-requiremenets'>(Requires: " . NUMBER($requirement_research_credits) . " Credits / Colonists: " . NUMBER($requirement_research_cols) . ")</span><br/> <sub>Increases the hacking ability of your ship!</sub><br/>";
}
if ($planetinfo['facility_homeworld'] == "N") {
echo "<a href=planet.php?planet_id={$planet_id}&command=facility_homeworld>Build</a> a homeworld senate <span class='planet-facilities-requiremenets'>(Requires: Research Facility, Military Facility, Solar Plant Facility, Medical Facility, Shipyard Facility, Banking Facility, Hydrophonics Facility.)</span><br/> <sub>Allows you to assign a senator to the planet!</sub><br/>";
}
}
echo "<br/><a href=log2.php>View</a> Players Log<br/>";
开发者ID:kagetenshi,项目名称:xenoberage,代码行数:31,代码来源:planet.php
注:本文中的number函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论