本文整理匯總了PHP中NUMBER函數的典型用法代碼示例。如果您正苦於以下問題:PHP NUMBER函數的具體用法?PHP NUMBER怎麽用?PHP NUMBER使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NUMBER函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DISPLAY_ALL_ALLIANCES
function DISPLAY_ALL_ALLIANCES()
{
global $color, $color_header, $order, $type, $PHP_SELF, $l_team_galax, $l_team_member, $l_team_coord, $l_score, $l_name;
global $db, $dbtables;
echo "<h2>$l_team_galax</h2>";
echo "<TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2>";
echo "<TR BGCOLOR=\"$color_header\">";
echo "<TD><B>Rank</B></TD>";
echo "<TD><B>$l_name</B></TD>";
echo "<TD><B>$l_score</B></TD>";
echo "</TR>";
$sql_query = "SELECT $dbtables[players].character_name,
COUNT(*) as number_of_members,
ROUND(SQRT(SUM(POW($dbtables[players].score,2)))) as total_score,
$dbtables[teams].id,
$dbtables[teams].team_name
FROM $dbtables[players]
LEFT JOIN $dbtables[teams] ON $dbtables[players].team = $dbtables[teams].id
WHERE $dbtables[players].team = $dbtables[teams].id
GROUP BY $dbtables[teams].team_name ORDER BY total_score DESC";
$res = $db->Execute($sql_query) or die($db->ErrorMsg());
$rank = 1;
while(!$res->EOF) {
$row = $res->fields;
echo "<TR BGCOLOR=\"$color\">";
echo "<TD><B>$rank</B></TD>";
$rank++;
echo "<TD>".$row[team_name]."</TD>";
echo "<TD>".NUMBER($row[total_score])."</TD>";
echo "</TR>";
$res->MoveNext();
}
echo "</table><BR>";
}
示例2: display_transactions
function display_transactions()
{
global $db, $dbtables;
$res5 = $db->Execute("SELECT * FROM {$dbtables['fair_tribe']} " . "WHERE clan_id = '{$_SESSION['clanid']}' " . "ORDER BY trans_id");
echo "<P>" . "<CENTER>" . "<TABLE CLASS=color_table BORDER=1 CELLPADDING=4 CELLSPACING=0>" . "<TR CLASS=color_header>" . "<TD>Buy/Sell</TD>" . "<TD>Product</TD>" . "<TD>Quantity</TD>" . "<TD>Price</TD>" . "<TD>Total</TD>" . "<TD>Cancel</TD>" . "</TR>";
$r = 0;
while (!$res5->EOF) {
$rc = $r % 2;
$r++;
$output = $res5->fields;
echo "<TR CLASS=color_row{$rc}>";
if ($output[buy_sell] == 'B') {
echo "<TD>Buy</TD>";
} elseif ($output[buy_sell] == 'S') {
echo "<TD>Sell</TD>";
} elseif ($output[buy_sell] == 'C') {
echo "<TD>Culture</TD>";
}
$total = $output[price] * $output[quantity];
if ($output[buy_sell] == 'C') {
$total = $output[price];
}
echo "<TD>{$output['product']}</TD>" . "<TD>{$output['quantity']}</TD>" . "<TD>{$output['price']}</TD>" . "<TD>";
$total = NUMBER($total);
echo "{$total}</TD>" . "<TD>" . "<FORM ACTION=fair.php METHOD=POST><INPUT TYPE=HIDDEN NAME=transaction VALUE=\"{$output['buy_sell']}\">" . "<INPUT TYPE=HIDDEN NAME=quantity VALUE=\"{$output['quantity']}\">" . "<INPUT TYPE=HIDDEN NAME=cancel_trans_id VALUE=\"{$output['trans_id']}\">" . "<INPUT TYPE=HIDDEN NAME=cancel_product VALUE=\"{$output['product']}\">" . "<INPUT TYPE=SUBMIT VALUE=CANCEL>" . "</FORM>" . "</TD>" . "</TR>";
$res5->MoveNext();
}
echo "</TABLE>" . "</CENTER>";
}
示例3: time
$gm = $db->Execute("SELECT * FROM {$dbtables['game_date']} WHERE type = 'month'");
$gy = $db->Execute("SELECT * FROM {$dbtables['game_date']} WHERE type = 'year'");
$month = $gm->fields;
$year = $gy->fields;
$curdate = "{$month['count']} / {$year['count']}";
$online = " ";
$now = time();
$onlinenow = $now - $row[hour];
$onlineminutes = floor($onlinenow / 60);
if ($onlineminutes < 10) {
$online = "Y";
}
if ($i == 11) {
echo "<TR><TD COLSPAN=9> </TD></TR>";
}
echo "<TR BGCOLOR=\"{$color}\" ALIGN=CENTER><TD>" . NUMBER($i) . "</TD><TD>{$claninfo['clanid']}</TD><TD>";
echo " ";
echo " ";
echo "<b>{$row['chiefname']}</b></TD>";
echo "<TD>({$battles})</TD>";
echo "<TD>{$claninfo['clanname']}</TD><TD>{$time}</TD><TD> </TD><TD>{$claninfo['religion']}</TD><TD>{$online}</TD><TD>{$row['score']}</TD></TR>\n";
if ($color == $color_line1) {
$color = $color_line2;
} else {
$color = $color_line1;
}
$res->MoveNext();
}
echo "</TABLE>";
}
echo "<FONT SIZE=+1>Current Date is {$curdate}</FONT><P>";
示例4: NUMBER
"<tr><td><font size=2><b>Armour</b> ($sship[minarmour]/$sship[maxarmour])</td>" .
"<td valign=bottom>$armour_bars</td></tr>" .
"<tr><td><font size=2><b>Shields</b> ($sship[minshields]/$sship[maxshields])</td>" .
"<td valign=bottom>$shields_bars</td></tr>" .
"<tr><td><font size=2><b>Beams</b> ($sship[minbeams]/$sship[maxbeams])</td>" .
"<td valign=bottom>$beams_bars</td></tr>" .
"<tr><td><font size=2><b>Torpedo Launchers</b> ($sship[mintorp_launchers]/$sship[maxtorp_launchers])</td>" .
"<td valign=bottom>$torp_launchers_bars</td></tr>" .
"<tr><td><font size=2><b>Cloak</b> ($sship[mincloak]/$sship[maxcloak])</td>" .
"<td valign=bottom>$cloak_bars</td></tr>" .
"<tr><td><font color=white size=4><b><br>Price: </b></td>" .
"<td><font color=red size=4><b><br>" . NUMBER($sship[cost_credits]) . " C</b></td></tr>" .
"<tr><td><font color=white size=4><b><br>You have: </b></td>" .
"<td><font color=green size=4><b><br>" . NUMBER($playerinfo[credits]) . " C</b></td></tr>" .
"<tr><td><font color=white size=4><b>Current ship<br>trade-in value: </b></td>" .
"<td><font color=white size=4><b><br>" . NUMBER(0.8*value_ship($playerinfo[currentship])) . " C</b></td></tr>".
"</table><p>";
echo "<form action=shipyard2.php method=POST>" .
"<input type=hidden name=stype value=$stype>" .
"<input type=submit value=Purchase>" .
"</form><br>";
echo "<font size=2 color=silver><b><a href=shipyard3.php>Return to shipyard</a></b></font><p>";
}
} else {
?>
<table width=100% border=1 cellpadding=5>
<tr bgcolor=<? echo $color_line2 ?>><td width=10% align=center>
<?
echo "<font size=2 color=white><b>Welcome to our shipyard!<br>";
示例5: NUMBER
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_armourpts</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[armour_pts]) . " / " . NUMBER($armour_pts_max) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_fighters</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_fighters]) . " / " . NUMBER($ship_fighters_max) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_torps</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[torps]) . " / " . NUMBER($torps_max) . "</TD></TR>";
//echo "<TR><TD> </TD></TR>";
echo "</TABLE><p>";
//echo "</TD><TD VALIGN=TOP>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
$energy_max = NUM_ENERGY($shipinfo[power]);
echo "<TR BGCOLOR=\"$color_header\"><TD><B>$l_energy</B></TD><TD ALIGN=RIGHT><B>" . NUMBER($shipinfo[ship_energy]) . " / " . NUMBER($energy_max) . "</B></TD></TR>";
echo "</TABLE><P>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
echo "<TR BGCOLOR=\"$color_header\"><TD COLSPAN=2 align=center><B>$l_devices</B></TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_beacons</TD><TD ALIGN=RIGHT>$shipinfo[dev_beacon]</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_warpedit</TD><TD ALIGN=RIGHT>$shipinfo[dev_warpedit]</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_genesis</TD><TD ALIGN=RIGHT>$shipinfo[dev_genesis]</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_deflect</TD><TD ALIGN=RIGHT>".NUMBER($shipinfo[dev_minedeflector])."</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_ewd</TD><TD ALIGN=RIGHT>$shipinfo[dev_emerwarp]</TD></TR>";
$escape_pod = ($shipinfo[dev_escapepod] == 'Y') ? $l_yes : $l_no;
$fuel_scoop = ($shipinfo[dev_fuelscoop] == 'Y') ? $l_yes : $l_no;
$lssd = ($shipinfo[dev_lssd] == 'Y') ? $l_yes : $l_no;
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_escape_pod</TD><TD ALIGN=RIGHT>$escape_pod</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_fuel_scoop</TD><TD ALIGN=RIGHT>$fuel_scoop</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_lssd</TD><TD ALIGN=RIGHT>$lssd</TD></TR>";
$sectorwmd = ($shipinfo[dev_sectorwmd] == 'Y') ? $l_yes : $l_no;
if ($sectorwmd == $l_yes) {
echo "<TR BGCOLOR=\"$color_line1\"><TD>Sector-WMD</TD><TD ALIGN=RIGHT>$sectorwmd</TD></TR>";
}
//echo "<TR><TD> </TD></TR>";
echo "</TABLE>";
//echo "</TD></TR>";
示例6: include
<?
include("config.php");
include("languages/$lang");
$title = "Logout";
setcookie("username","",0);
setcookie("password","",0);
include("header.php");
connectdb();
$result = $db->Execute("SELECT * FROM $dbtables[players] WHERE email='$username'");
$playerinfo = $result->fields;
$current_score = gen_score($playerinfo[player_id]);
playerlog($playerinfo[player_id], LOG_LOGOUT, $ip);
bigtitle();
echo "$l_logout_score ".NUMBER($current_score).".<BR>";
$l_logout_text=str_replace("[name]",$username,$l_logout_text);
echo $l_logout_text;
include("footer.php");
?>
示例7:
}
$ship_value=$upgrade_cost*(floor(mypw($upgrade_factor, $shipinfo[hull]))+floor(mypw($upgrade_factor, $shipinfo[engines]))+floor(mypw($upgrade_factor, $shipinfo[power]))+floor(mypw($upgrade_factor, $shipinfo[computer]))+floor(mypw($upgrade_factor, $shipinfo[sensors]))+floor(mypw($upgrade_factor, $shipinfo[beams]))+floor(mypw($upgrade_factor, $shipinfo[torp_launchers]))+floor(mypw($upgrade_factor, $shipinfo[shields]))+floor(mypw($upgrade_factor, $shipinfo[armour]))+floor(mypw($upgrade_factor, $shipinfo[cloak])));
$ship_salvage_rate=rand(10,20);
$ship_salvage=$ship_value*$ship_salvage_rate/100;
// Triple salvage if you were an outlaw
$result3 = $db->Execute ("SELECT amount FROM $dbtables[bounty] WHERE placed_by=0 AND bounty_on=$playerinfo[player_id]");
if (!$result3->EOF) {
echo "Triple outlaw salvage bonus for $targetinfo[character_name]!<br>";
$ship_salvage *=3;
}
$l_att_salv=str_replace("[salv_ore]",NUMBER($salv_ore),$l_att_salv);
$l_att_salv=str_replace("[salv_organics]",NUMBER($salv_organics),$l_att_salv);
$l_att_salv=str_replace("[salv_goods]",NUMBER($salv_goods),$l_att_salv);
$l_att_salv=str_replace("[ship_salvage_rate]",$ship_salvage_rate,$l_att_salv);
$l_att_salv=str_replace("[ship_salvage]",NUMBER($ship_salvage),$l_att_salv);
$l_att_salv=str_replace("[name]",$targetinfo[character_name],$l_att_salv);
echo "<b>$l_att_salv</b><BR>";
$update6 = $db->Execute ("UPDATE $dbtables[players] SET credits=credits+$ship_salvage WHERE player_id=$targetinfo[player_id]");
$armour_lost=$targetshipinfo[armour_pts]-$targetarmour;
$fighters_lost=$targetshipinfo[ship_fighters]-$targetfighters;
$energy=$targetshipinfo[ship_energy];
$update6b = $db->Execute ("UPDATE $dbtables[ships] SET ship_energy=$energy,ship_fighters=ship_fighters-$fighters_lost, armour_pts=armour_pts-$armour_lost, torps=torps-$targettorpnum,ship_ore=ship_ore+$salv_ore, ship_organics=ship_organics+$salv_organics, ship_goods=ship_goods+$salv_goods WHERE player_id=$targetinfo[player_id] AND ship_id=$targetinfo[currentship]");
}
}
}
}
}
$db->Execute("UNLOCK TABLES");
//-------------------------------------------------------------------------------------------------
示例8: NUMBER
echo "<TD><A HREF=warpedit.php$ck>$l_warpedit</A></TD><TD>" . NUMBER($shipinfo[dev_warpedit]) . "</TD><TD>$l_manual</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line1\">";
echo "<TD><A HREF=genesis.php$ck>$l_genesis</A></TD><TD>" . NUMBER($shipinfo[dev_genesis]) . "</TD><TD>$l_manual</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line2\">";
echo "<TD>$l_deflect</TD><TD>" . NUMBER($shipinfo[dev_minedeflector]) . "</TD><TD>$l_automatic</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line1\">";
echo "<TD><A HREF=mines.php$ck&op=1>$l_mines</A></TD><TD>" . NUMBER($shipinfo[torps]) . "</TD><TD>$l_manual</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line2\">";
echo "<TD><A HREF=mines.php$ck&op=2>$l_fighters</A></TD><TD>" . NUMBER($shipinfo[ship_fighters]) . "</TD><TD>$l_manual</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line1\">";
echo "<TD><A HREF=emerwarp.php$ck>$l_ewd</A></TD><TD>" . NUMBER($shipinfo[dev_emerwarp]) . "</TD><TD>$l_manual/$l_automatic</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line2\">";
echo "<TD>$l_escape_pod</TD><TD>" . (($shipinfo[dev_escapepod] == 'Y') ? $l_yes : $l_no) . "</TD><TD>$l_automatic</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line1\">";
echo "<TD>$l_fuel_scoop</TD><TD>" . (($shipinfo[dev_fuelscoop] == 'Y') ? $l_yes : $l_no) . "</TD><TD>$l_automatic</TD>";
echo "</TR>";
echo "<TR BGCOLOR=\"$color_line2\">";
echo "<TD>$l_lssd</TD><TD>" . (($shipinfo[dev_lssd] == 'Y') ? $l_yes : $l_no) . "</TD><TD>$l_automatic</TD>";
echo "</TR>";
if ($shipinfo[tow]>0) {
echo "<TR BGCOLOR=\"$color_line1\">";
echo "<TD><A HREF=tractor.php$ck&cmd=rel>Release Tractor Beam</TD><TD>Active</TD><TD>$l_manual</TD>";
echo "</TR>";
} else {
示例9: SUM
}
else
{
/* if scan succeeds, show results and inform target. */
/* scramble results by scan error factor. */
// Get total bounty on this player, if any
$btyamount = 0;
$hasbounty = $db->Execute("SELECT SUM(amount) AS btytotal FROM $dbtables[bounty] WHERE bounty_on = $targetinfo[player_id]");
if($hasbounty)
{
$resx = $hasbounty->fields;
if($resx[btytotal] > 0)
{
$btyamount = NUMBER($resx[btytotal]);
$l_scan_bounty=str_replace("[amount]",$btyamount,$l_scan_bounty);
echo $l_scan_bounty . "<BR>";
$btyamount = 0;
// Check for Federation bounty
$hasfedbounty = $db->Execute("SELECT SUM(amount) AS btytotal FROM $dbtables[bounty] WHERE bounty_on = $targetinfo[player_id] AND placed_by = 0");
if($hasfedbounty)
{
$resy = $hasfedbounty->fields;
if($resy[btytotal] > 0)
{
$btyamount = $resy[btytotal];
echo $l_scan_fedbounty . "<BR>";
}
}
}
示例10: elseif
$trade_color = "#fff";
$trade_result = "{$l_cost} : ";
} elseif ($total_cost < 0) {
$trade_color = $color_green;
$trade_result = $trade_benefit;
} else {
$trade_color = $color_red;
$trade_result = $trade_deficit;
}
/*
Build table
*/
?>
<div class="general-table-container">
<?php
echo "<table><tbody>\n <tr>\n <td colspan=\"2\">{$l_trade_result}</td>\n </tr>\n <tr>\n <td colspan=\"2\">Total Trade Cost: <span class=\"table_word_yellow\">" . NUMBER(abs($total_cost)) . "</span> Credits</td>\n </tr>\n <tr>\n <td>{$l_traded_ore}:</td><td>" . NUMBER($trade_ore) . "</td>\n </tr>\n <tr>\n <td>{$l_traded_organics}: </td><td>" . NUMBER($trade_organics) . "</td>\n </tr>\n <tr>\n <td>{$l_traded_goods}: </td><td>" . NUMBER($trade_goods) . "</td>\n </tr>\n <tr>\n <td>{$l_traded_energy}: </td><td>" . NUMBER($trade_energy) . "</td>\n </tr>\n </tbody></table></div>";
// Update ship cargo, credits and turns
$trade_result = $db->Execute("UPDATE {$db->prefix}ships SET turns=turns-1, turns_used=turns_used+1, rating=rating+1, credits=credits-{$total_cost}, ship_ore=ship_ore+{$trade_ore}, ship_organics=ship_organics+{$trade_organics}, ship_goods=ship_goods+{$trade_goods}, ship_energy=ship_energy+{$trade_energy} WHERE ship_id={$playerinfo['ship_id']}");
db_op_result($db, $trade_result, __LINE__, __FILE__, $db_logging);
// Make all trades positive to change port values
$trade_ore = round(abs($trade_ore));
$trade_organics = round(abs($trade_organics));
$trade_goods = round(abs($trade_goods));
$trade_energy = round(abs($trade_energy));
// Decrease supply and demand on port
$trade_result2 = $db->Execute("UPDATE {$db->prefix}universe SET port_ore=port_ore-{$trade_ore}, port_organics=port_organics-{$trade_organics}, port_goods=port_goods-{$trade_goods}, port_energy=port_energy-{$trade_energy} WHERE sector_id={$sectorinfo['sector_id']}");
db_op_result($db, $trade_result2, __LINE__, __FILE__, $db_logging);
echo $l_trade_complete . ".<br><br>";
}
}
}
示例11: shiptoship
//.........這裏部分代碼省略.........
$db->Execute("UPDATE $dbtables[ships] SET player_id=0,on_planet='N',sector=$targetshipinfo[sector] WHERE ship_id=$targetshipinfo[tow]");
}
$db->Execute("UPDATE $dbtables[ships] SET ship_destroyed ='Y', sector=0, tow=0 WHERE player_id=$targetinfo[player_id] AND ship_id=$targetinfo[currentship]");
playerlog($targetinfo[player_id],LOG_ATTACK_LOSE, "$playerinfo[character_name]|Y");
collect_bounty($playerinfo[player_id],$targetinfo[player_id]);
$newstext = $newstext.$targetinfo[character_name]." survived and podded off to Sector 0.";
}
else
{
playerlog($targetinfo[player_id], LOG_ATTACK_LOSE, "$playerinfo[character_name]|N");
db_kill_player($targetinfo[player_id],$targetinfo[currentship],$playerinfo[player_id]);
collect_bounty($playerinfo[player_id],$targetinfo[player_id]);
$newstext .= $targetinfo[character_name]." did not survive the attack.";
}
$newstext = addslashes($newstext);
$player_id = $playerinfo[player_id];
$news = $db->Execute("INSERT INTO $dbtables[news] (headline, newstext, user_id, date, news_type) VALUES ('$headline','$newstext','$player_id',NOW(), 'attack')");
if($attackerarmor > 0)
{
$rating_change=round($targetinfo[rating]*$rating_combat_factor);
$free_ore = round($targetshipinfo[ship_ore]/2);
$free_organics = round($targetshipinfo[ship_organics]/2);
$free_goods = round($targetshipinfo[ship_goods]/2);
$free_holds = NUM_HOLDS($shipinfo[hull]) - $shipinfo[ship_ore] - $shipinfo[ship_organics] - $shipinfo[ship_goods] - $shipinfo[ship_colonists];
if($free_holds > $free_goods)
{
$salv_goods=$free_goods;
$free_holds=$free_holds-$free_goods;
}
elseif($free_holds > 0)
{
$salv_goods=$free_holds;
$free_holds=0;
}
else
{
$salv_goods=0;
}
if($free_holds > $free_ore)
{
$salv_ore=$free_ore;
$free_holds=$free_holds-$free_ore;
}
elseif($free_holds > 0)
{
$salv_ore=$free_holds;
$free_holds=0;
}
else
{
$salv_ore=0;
}
if($free_holds > $free_organics)
{
$salv_organics=$free_organics;
$free_holds=$free_holds-$free_organics;
}
elseif($free_holds > 0)
{
$salv_organics=$free_holds;
$free_holds=0;
}
else
{
$salv_organics=0;
}
$ship_value=$upgrade_cost*(round(mypw($upgrade_factor, $targetshipinfo[hull]))+round(mypw($upgrade_factor, $targetshipinfo[engines]))+round(mypw($upgrade_factor, $targetshipinfo[power]))+round(mypw($upgrade_factor, $targetshipinfo[computer]))+round(mypw($upgrade_factor, $targetshipinfo[sensors]))+round(mypw($upgrade_factor, $targetshipinfo[beams]))+round(mypw($upgrade_factor, $targetshipinfo[torp_launchers]))+round(mypw($upgrade_factor, $targetshipinfo[shields]))+round(mypw($upgrade_factor, $targetshipinfo[armor]))+round(mypw($upgrade_factor, $targetshipinfo[cloak])));
$ship_salvage_rate=rand(10,20);
$ship_salvage=$ship_value*$ship_salvage_rate/100;
// Triple salvage if this is an outlaw
$result3 = $db->Execute ("SELECT amount FROM $dbtables[bounty] WHERE placed_by=0 AND bounty_on=$targetinfo[player_id]");
if (!$result3->EOF) {
$ship_salvage *=3;
echo "You destroyed a Federation fugitive! Triple hull salvage!<br>";
}
$l_cmb_yousalvaged = str_replace("[cmb_salv_ore]", NUMBER($salv_ore), $l_cmb_yousalvaged);
$l_cmb_yousalvaged = str_replace("[cmb_salv_organics]", NUMBER($salv_organics), $l_cmb_yousalvaged);
$l_cmb_yousalvaged = str_replace("[cmb_salv_goods]", NUMBER($salv_goods), $l_cmb_yousalvaged);
$l_cmb_yousalvaged = str_replace("[cmb_salvage_rate]", $ship_salvage_rate, $l_cmb_yousalvaged);
$l_cmb_yousalvaged = str_replace("[cmb_salvage]", NUMBER($ship_salvage), $l_cmb_yousalvaged);
$l_cmb_yousalvaged = str_replace("[cmb_number_rating_change]", NUMBER(abs($rating_change)), $l_cmb_yousalvaged);
echo "$l_cmb_yousalvaged";
$update3 = $db->Execute ("UPDATE $dbtables[players] SET credits=credits+$ship_salvage WHERE player_id=$playerinfo[player_id]");
$update3 = $db->Execute ("UPDATE $dbtables[ships] SET ship_ore=ship_ore+$salv_ore, ship_organics=ship_organics+$salv_organics, ship_goods=ship_goods+$salv_goods WHERE player_id=$playerinfo[player_id] AND ship_id=$playerinfo[currentship]");
}
}
else
{
$l_cmb_youdidntdestroyhim = str_replace("[cmb_targetinfo_ship_name]", $targetshipinfo[ship_name], $l_cmb_youdidntdestroyhim);
echo "$l_cmb_youdidntdestroyhim<BR>";
$target_rating_change=round($targetinfo[rating]*.1);
$target_armor_lost=$targetshipinfo[armour_pts]-$targetarmor;
$target_fighters_lost=$targetshipinfo[ship_fighters]-$targetfighters;
$target_energy=$targetshipinfo[ship_energy];
playerlog($targetinfo[player_id], LOG_ATTACKED_WIN, "$playerinfo[character_name]|$target_armor_lost|$target_fighters_lost");
$update4 = $db->Execute ("UPDATE $dbtables[ships] SET ship_energy=$target_energy,ship_fighters=ship_fighters-$target_fighters_lost, armour_pts=armour_pts-$target_armor_lost, torps=torps-$targettorpnum WHERE player_id=$targetinfo[player_id] AND ship_id=$targetinfo[currentship]");
}
$db->Execute("UNLOCK TABLES");
}
示例12: SUM
echo "</ul>";
$query->MoveNext();
}
$resultSDa = $db->Execute("SELECT SUM(quantity) as mines from {$db->prefix}sector_defence WHERE sector_id=? and defence_type='M';", array($sector));
db_op_result($db, $resultSDa, __LINE__, __FILE__, $db_logging);
$resultSDb = $db->Execute("SELECT SUM(quantity) as fighters from {$db->prefix}sector_defence WHERE sector_id=? and defence_type='F';", array($sector));
db_op_result($db, $resultSDb, __LINE__, __FILE__, $db_logging);
$defM = $resultSDa->fields;
$defF = $resultSDb->fields;
echo "</td></tr>";
echo "<tr><td class=\"long-rang-scan-titles-cell\"><span class=\"long-rang-scan-titles\">Mines</span></td>";
$has_mines = NUMBER($defM['mines']);
echo "<td>" . $has_mines;
echo "</td></tr>";
echo "<tr><td class=\"long-rang-scan-titles-cell\"><span class=\"long-rang-scan-titles\">Fighters</span></td>";
$has_fighters = NUMBER($defF['fighters']);
echo "<td>" . $has_fighters;
echo "</td></tr>";
if ($playerinfo['dev_lssd'] == 'Y') {
echo "<tr><td class=\"long-rang-scan-titles-cell\"><span class=\"long-rang-scan-titles\">Last ship seen in this sector</span></td>";
echo "<td>";
$resx = $db->Execute("SELECT * FROM {$db->prefix}movement_log WHERE ship_id <> ? AND sector_id = ? ORDER BY time DESC LIMIT 1;", array($playerinfo['ship_id'], $sector));
db_op_result($db, $resx, __LINE__, __FILE__, $db_logging);
if (!$resx) {
echo "None";
} else {
$myrow = $resx->fields;
echo "<span class=\"table_word_red\">" . get_player($db, $myrow['ship_id']) . "</span>";
}
echo "</td></tr>";
} else {
示例13: NUMBER
<table BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR="#005000" align="center">
<tr><td>
<table BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#005000" align="center" class=dis>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_ore ?>" src="images/ore.gif"> <? echo $l_ore ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($shipinfo[ship_ore]); ?> </span></td></tr>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_organics ?>" src="images/organics.gif"> <? echo $l_organics ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($shipinfo[ship_organics]); ?> </span></td></tr>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_goods ?>" src="images/goods.gif"> <? echo $l_goods ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($shipinfo[ship_goods]); ?> </span></td></tr>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_energy ?>" src="images/energy.gif"> <? echo $l_energy ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($shipinfo[ship_energy]); ?> </span></td></tr>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_colonists ?>" src="images/colonists.gif"> <? echo $l_colonists ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($shipinfo[ship_colonists]); ?> </span></td></tr>
<tr><td nowrap align='left'> <img height=12 width=12 alt="<? echo $l_credits ?>" src="images/credits.gif"> <? echo $l_credits ?> </td></tr>
<tr><td nowrap align='right'><span class=mnu> <? echo NUMBER($playerinfo[credits]); ?> </span></td></tr>
</table>
</td></tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" align="center"><tr valign="top">
<td><img src="images/lcorner.gif" width="8" height="11" border="0" alt=""></td>
<td nowrap bgcolor="<? echo $color_line2; ?>"><font face="verdana" size="1" color="#ffffff"><b>
<? echo $l_traderoutes ?>
</b></font></td>
<td><img src="images/rcorner.gif" width="8" height="11" border="0" alt=""></td>
</tr></table>
<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR="#005000" align="center">
示例14: if
$curship = $res->fields;
// Federation Sector Check - only newbies can use
if ($playerinfo[sector]==0 && $playerinfo[score] > $fed_dock_max) {
echo "This Spacedock is reserved for new traders. Please try another special port spacedock.<br>";
} else {
$canDock = true;
// Check to see if we are at a special port
if ($sectorinfo[port_type] == "special") {
// Check that they have some money in their IGB account
$res2 = $db->Execute("SELECT balance FROM $dbtables[ibank_accounts] WHERE player_id=$playerinfo[player_id] ");
$row = $res2->fields;
if ($row[balance] <1000) {
echo "The Spacedock owners require you to have at least 1000 credits in your IGB account before they will allow you to dock.<br><br>";
$canDock=false;
} else if ($row[balance] < 10000) {
echo "The Spacedock owners grudgingly let you moor the ship but with only ".NUMBER($row[balance])." credits in your IGB account you better be careful not to loose you ship for non-payment of mooring fees!<br>";
}
}
if ($canDock) {
echo "You detatch the tractor beam connection from your ship to the $shipinfo[ship_name] and it settles safely into the space dock.<br><br>";
// Belt and braces
$db->Execute("UPDATE $dbtables[ships] SET sector=$playerinfo[sector] WHERE ship_id=$shipinfo[tow]");
$db->Execute("UPDATE $dbtables[ships] SET tow = 0 WHERE player_id=$playerinfo[player_id] AND ship_id=$playerinfo[currentship]");
}
}
} else {
echo "You cannot do that!<br><br>";
}
} else {
echo "You are not towing any ship!<br><br>";
}
示例15: planet_production_change
//.........這裏部分代碼省略.........
if($color == $color_line1)
{
$color = $color_line2;
}
else
{
$color = $color_line1;
}
}
echo "</TABLE><br>";
echo "<TABLE WIDTH=\"100%\" BORDER=1 CELLSPACING=0 CELLPADDING=0>";
echo "<TR BGCOLOR=\"$color_header\" VALIGN=BOTTOM>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=sector_id>Sector</A></FONT><br>";
echo "<A HREF=planet-report.php?PRepType=2&sort=name>$l_name</A></FONT></TD>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=colonists>Pops</A></FONT></TD>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=credits>Creds</A></FONT></TD>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=fighters>$l_fighters</A></FONT></TD>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=torp>Torps</A></FONT></TD>";
echo "</TR>";
$color = $color_line1;
for($i=0; $i<$num_planets; $i++)
{
$total_colonists += $planet[$i][colonists];
$total_credits += $planet[$i][credits];
if(empty($planet[$i][name]))
{
$planet[$i][name] = $l_unnamed;
}
echo "<TR BGCOLOR=\"$color\">";
echo "<TD ALIGN=CENTER><A HREF=rsmove.php?engage=1&destination=". $planet[$i][sector_id] . ">". $planet[$i][sector_id] ."</A><br>";
echo $planet[$i][name] . "</TD>";
echo "<TD ALIGN=CENTER>" . NUMBER($planet[$i][colonists]) . "</TD>";
echo "<TD ALIGN=CENTER>" . NUMBER($planet[$i][credits]) . "</TD>";
echo "<TD ALIGN=CENTER>" . "<input size=2 type=text name=\"prod_fighters[" . $planet[$i]["planet_id"] . "]\" value=\"" . $planet[$i]["prod_fighters"] . "\">" . "</TD>";
echo "<TD ALIGN=CENTER>" . "<input size=2 type=text name=\"prod_torp[" . $planet[$i]["planet_id"] . "]\" value=\"" . $planet[$i]["prod_torp"] . "\">" . "</TD>";
echo "</TR>";
if($color == $color_line1)
{
$color = $color_line2;
}
else
{
$color = $color_line1;
}
}
echo "<TR BGCOLOR=$color>";
echo "<TD ALIGN=CENTER>$l_pr_totals</TD>";
echo "<TD ALIGN=CENTER>" . NUMBER($total_colonists) . "</TD>";
echo "<TD ALIGN=CENTER>" . NUMBER($total_credits) . "</TD>";
echo "<TD>" . "" . "</TD>";
echo "<TD>" . "" . "</TD>";
echo "</TR>";
echo "</TABLE><br>";
echo "<TABLE WIDTH=\"100%\" BORDER=1 CELLSPACING=0 CELLPADDING=2>";
echo "<TR BGCOLOR=\"$color_header\" VALIGN=BOTTOM>";
echo "<TD ALIGN=CENTER><A HREF=planet-report.php?PRepType=2&sort=sector_id>Sector</A></FONT><br>";
echo "<A HREF=planet-report.php?PRepType=2&sort=name>$l_name</A></FONT></TD>";
if($playerinfo[team] > 0)
echo "<TD ALIGN=CENTER>Alliance<br>Planet?</TD>";
echo "<TD ALIGN=CENTER>$l_selling?</TD>";
echo "<TD ALIGN=CENTER>Planet IQ</TD>";
echo "</TR>";
$color = $color_line1;