当前位置: 首页>>代码示例>>PHP>>正文


PHP money_formatter函数代码示例

本文整理汇总了PHP中money_formatter函数的典型用法代码示例。如果您正苦于以下问题:PHP money_formatter函数的具体用法?PHP money_formatter怎么用?PHP money_formatter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了money_formatter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

function index()
{
    global $ir, $c, $userid;
    $interest = $ir['bankmoney'] / 100 * 2;
    $interests = money_formatter($interest);
    $balance = money_formatter($ir['bankmoney']);
    echo "\n\n<b>You currently have {$balance} in the bank.</b><br />\nAt the end of each day, your bank balance will go up by 2%.<br/>Interest each day for the current deposit is {$interests}<br />\n<table width=100% class = table border=1> <tr><th>Deposit</th><th>Withdraw</th></tr><tr>\n<td>\nWhen adding to your account 2% is taken from you<br>\n<form action='?action=Deposit' method='post'>\nAmount: <input type='text' STYLE='color: black;  background-color: white;' name='dt' value='{$ir['money']}' /><br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Deposit' /></form></td>\n\n<td>\nWithdrawl cash. No money is taken for withdrawl.\n<form action='?action=Withdraw' method='post'>\nAmount: <input type='text' STYLE='color: black;  background-color: white;' name='wd' value='{$ir['bankmoney']}' /><br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Withdraw' /></form></td></tr>";
    echo "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:9,代码来源:bank.php

示例2: index

function index()
{
    global $db, $ir, $userid;
    $_GET['ID'] = abs((int) $_GET['ID']);
    $r = $db->fetch_row($db->query("SELECT * FROM `users` WHERE `userid` = {$_GET['ID']}"));
    $cost = $r['level'] * 2000;
    if (!$r['userid']) {
        die("Invalid User");
    } else {
        print "\n        \n<div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'> Burn House</h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n        \n        Would you like to burn down {$r['username']}'s home for \${$t}" . money_formatter($cost, '') . "? <br /> <br />\n    \n        <form action = 'burnhouse.php?action=pourpetrol&ID={$_GET['ID']}' method = 'post' />\n        <input type = 'submit' STYLE='color: black;  background-color: red;' value = 'YES' /> </form>  <br>    \n    \n        <form action = 'index.php' method = 'post' />\n        <input type = 'submit' STYLE='color: black;  background-color: green;' value = 'NO WAY' /> </form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
    }
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:12,代码来源:burnhouse.php

示例3: withdraw

function withdraw()
{
    global $db, $ir, $c, $userid, $h;
    $_POST['withdraw'] = abs((int) $_POST['withdraw']);
    if ($_POST['withdraw'] > $ir['cybermoney']) {
        print "You do not have enough banked money to withdraw this amount.</div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div></a>";
    } else {
        $withdraw = $_POST['withdraw'];
        $withdraws = money_formatter($withdraw);
        $balance = $ir['cybermoney'] - $_POST['withdraw'];
        $balances = money_formatter($balance);
        $db->query("UPDATE users SET cybermoney=cybermoney-{$withdraw}, money=money+{$withdraw} where userid={$userid}");
        print "You ask to withdraw {$withdraws}, <br />\nThe teller hands {$withdraws} to you. <br />\n<b>You now have {$balances} in the Cyber Bank.</b><br />\n<a href='cyberbank.php'> Back</a></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div></a>";
    }
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:15,代码来源:cyberbank.php

示例4: play_slots3

function play_slots3()
{
    global $ir, $c, $h, $userid, $db;
    if ($ir['money'] < 10000) {
        print "\r\n\r\n<div id='mainOutput' style='text-align: center; color: white;  width: 600px; border: 1px solid #222222; height: 70px;\r\nmargin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\r\nYou do not have enough money to play\r\n\r\n<br/> <br/> <br/> \r\n\r\n<a href='index.php'><b>Back To Home</b></a>\r\n\r\n<a \r\n\r\n";
        $h->endpage();
        exit;
    }
    $slot = $db->query("SELECT * FROM `4slot` WHERE `name`='1'");
    $pot = $db->fetch_row($slot);
    $db->query("UPDATE users SET money=money-10000 WHERE {$userid}=userid");
    $db->query("UPDATE 4slot SET pot3=pot3+10000 WHERE name=1");
    $slotnumber1 = rand(1, 9);
    $slotnumber2 = rand(1, 9);
    $slotnumber3 = rand(1, 9);
    $crap = 1;
    $potc = money_formatter($pot['pot3']);
    print "\r\n\r\n<div class='generalinfo_txt'>\r\n<div><img src='images/info_left.jpg' alt='' /></div>\r\n<div class='info_mid'><h2 style='padding-top:10px;'> Magic Slots | Current Pot At: {$potc} </h2></div>\r\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\r\n<div class='generalinfo_simple'><br> <br><br> \r\n\r\n<h2><b><center>{$slotnumber1}{$slotnumber2}{$slotnumber3}</center></b></h2><br />";
    if ($slotnumber1 == 1 && $slotnumber2 == 1 && $slotnumber3 == 1 || $slotnumber1 == 5 && $slotnumber2 == 5 && $slotnumber3 == 5 || $slotnumber1 == 9 && $slotnumber2 == 9 && $slotnumber3 == 9) {
        print "<center><b>Congrats You Won!</b><br />You won {$pot['pot3']}!!!";
        $db->query("UPDATE users SET money=money+{$pot['pot3']} WHERE {$userid}=userid");
        $db->query("UPDATE 4slot SET pot3=10000 WHERE name=1");
    } else {
        print "<center> Sorry you did not win this time</center><br /><br />";
    }
    print "<center><a href='magicslots.php?action=play3'>Play again?</a> | <a href='magicslots.php'>Back</a></center></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div> ";
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:27,代码来源:magicslots.php

示例5: mysql_query

$q = mysql_query("SELECT * FROM votes WHERE userid={$userid} AND site='{$_GET['ID']}'", $c);
if (mysql_num_rows($q) > 0) {
    print "You have already voted on this site today!";
    die("");
} else {
    $blak = mysql_query("SELECT * FROM votingsites WHERE id={$_GET['ID']}", $c);
    if ($db->num_rows($blak) == 0) {
        print "<center>This voting site does not exist!</center>";
        die("");
    } else {
        $r = mysql_fetch_array($blak);
    }
    $id = $_GET['ID'];
    $reward = $r['reward'];
    if ($r['rewardtype'] == 1) {
        $muneh = money_formatter($reward);
        mysql_query("INSERT INTO votes values ({$userid},{$id})", $c);
        event_add($userid, "Thank you for voting! You have receieved {$muneh}!", $c);
        mysql_query("UPDATE users SET money=money+{$reward} WHERE userid={$userid}", $c);
    }
    if ($r['rewardtype'] == 2) {
        mysql_query("INSERT INTO votes values ({$userid},{$id})", $c);
        if ($reward > 1) {
            event_add($userid, "Thank you for voting! You have receieved {$reward} crystals!", $c);
        } else {
            event_add($userid, "Thank you for voting! You have receieved {$reward} crystal!", $c);
        }
        mysql_query("UPDATE users SET crystals=crystals+{$reward} WHERE userid={$userid}", $c);
    }
    if ($r['rewardtype'] == 3) {
        $juk = mysql_query("SELECT * FROM items WHERE itmid={$reward}", $c);
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:31,代码来源:voted.php

示例6: time

            }
        }
        $str = "{$la} {$unit} ago";
    } else {
        $str = "--";
    }
    if ($r['last_login'] > 0) {
        $ll = time() - $r['last_login'];
        $unit2 = "seconds";
        if ($ll >= 60) {
            $ll = (int) ($ll / 60);
            $unit2 = "minutes";
        }
        if ($ll >= 60) {
            $ll = (int) ($ll / 60);
            $unit2 = "hours";
            if ($ll >= 24) {
                $ll = (int) ($ll / 24);
                $unit2 = "days";
            }
        }
        $str2 = "{$ll} {$unit2} ago";
    } else {
        $str2 = "--";
    }
    $money = money_formatter($r['money']);
    $cn++;
    print "\r\n\r\n<tr>\r\n<td><div align='center'><strong>\r\n{$cn}.\r\n</strong></div></td>\r\n<td><div align='center'><strong>\r\n<a href='viewuser.php?u={$r['userid']}'>{$r['username']}\r\n</strong></div></td>\r\n<td><div align='center'><strong>\r\n{$r['userid']}<br/>\r\n</strong></div></td>\r\n<td><div align='center'><strong>\r\n{$r['level']}<br>\r\n</div></strong></td>\r\n<td><div align='center'><strong>\r\n{$r['gender']}<br />\r\n</div></strong></td>\r\n<td><div align='center'><strong>\r\n{$str}<br />\r\n</div></strong></td>\r\n<td><div align='center'><strong>\r\n{$money}</a><br />\r\n</div></strong></td>\r\n<td><div align='center'><strong>\r\n<a href='attack.php?ID={$r['userid']}'>Attack</a><br />\r\n</div></strong></td>\r\n ";
}
print "</table> </div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div> ";
$h->endpage();
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:31,代码来源:usersonline.php

示例7: money_formatter

$fm = money_formatter($ir['money']);
$cm = money_formatter($ir['crystals'], '');
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm, $cm);
$h->menuarea();
//look up item
$_GET['ID'] = abs((int) $_GET['ID']);
$itmid = $_GET['ID'];
if (!$itmid) {
    print "Invalid item ID";
} else {
    $q = mysql_query("SELECT i.*,it.* FROM items i LEFT JOIN itemtypes it ON i.itmtype=itmtypeid WHERE i.itmid={$itmid} LIMIT 1", $c);
    if (!mysql_num_rows($q)) {
        print "Invalid item ID";
    } else {
        $id = mysql_fetch_array($q);
        print "<table width=75%><tr style='background: gray;'><th colspan=2><b>Looking up info on {$id['itmname']}</b></th></table>\n<table width=75%><tr bgcolor=#dfdfdf><th colspan=2>The <b>{$id['itmname']}</b> is a/an {$id['itmtypename']} Item - <b>{$id['itmdesc']}</b></th></table><br />\n<table width=75%><tr style='background: gray;'><th colspan=2>Item Info</th></tr><tr style='background:gray'><th>Item Buy Price</th><th>Item Sell Price</th></tr><tr><td>";
        if ($id['itmbuyprice']) {
            print money_formatter($id['itmbuyprice']);
        } else {
            print "N/A";
        }
        print "</td><td>";
        if ($id['itmsellprice']) {
            print money_formatter($id['itmsellprice']);
        } else {
            print "N/A</td></tr></table>";
        }
    }
}
$h->endpage();
开发者ID:jwest00724,项目名称:mccodefree,代码行数:31,代码来源:iteminfo.php

示例8: session_start

session_start();
require "global_func.php";
if ($_SESSION['loggedin'] == 0) {
    header("Location: login.php");
    exit;
}
$userid = $_SESSION['userid'];
require "header.php";
$h = new headers();
$h->startheaders();
include "mysql.php";
global $c;
$is = mysql_query("SELECT u.*,us.* FROM users u\n\tLEFT JOIN userstats us ON u.userid=us.userid\n\tWHERE u.userid={$userid}", $c) or die(mysql_error());
$ir = mysql_fetch_array($is);
check_level();
$fm = money_formatter($ir['money']);
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm);
$h->menuarea();
######################
# END OF HEADER CODE #
######################
/* --------------------------------------\
	Make sure to retain this query:     */
$gq = mysql_query("SELECT g.* FROM gangs g WHERE g.gangID={$ir['gang']}");
$gangdata = mysql_fetch_array($gq);
/*	Make sure to retain the above query  \
----------------------------------------*/
//error_reporting(E_ALL);
define('GANG_MODULE', true, true);
// gangID, gangNAME, gangDESC, gangPREF, gangSUFF, gangMONEY, gangCRYSTALS, gangRESPECT, gangPRESIDENT, gangVICEPRES, gangCAPACITY, gangCRIME, gangCHOURS, gangAMENT
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:31,代码来源:yourgang.php

示例9: while

            $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid={$userid}");
            print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!";
        }
    }
} else {
    if (isset($_GET['sellhouse'])) {
        $npq = $db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}");
        $np = $db->fetch_row($npq);
        if ($ir['maxwill'] == 100) {
            print "You already live in the lowest property!";
        } else {
            $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid={$userid}");
            print "You sold your {$np['hNAME']} and went back to your shed.";
        }
    } else {
        print "<center>Your current property: <font color=green><b>{$mp['hNAME']}</b></font><br><br />The houses you can buy are listed below. Click a house to buy it.<br><br />";
        print "<a href='estate.php?sellhouse'><b>Sell Your House</b></a>\r\n\r\n\r\n<div id='estatePage' class='housepage'>\r\n<div class='housepage_btnpart'>\r\n</div>\r\n<div class='housepage_bigimg'>\r\n<p><img src='images/bigimg_txt.jpg' alt='' /></p>\r\n</div>\r\n\r\n\r\n<div class='house_bg1'>\r\n<div class='house_bg2'>\r\n<div class='house_conpart'>\r\n\r\n<div class='house_titpart'>\r\n<div><img src='images/gym_tit_left.png' alt='' /></div>\r\n<div class='house_tittxt'>\r\n<div class='htit1'><img src='images/hname.gif' alt='' /></div>\r\n<div class='htit2'><img src='images/hcity.gif' alt='' /></div>\r\n<div class='htit3'><img src='images/hprice.gif' alt='' /></div>\r\n<div class='htit4'><img src='images/hwill.gif' alt='' /></div>\r\n<div class='htit5'><img src='images/hbuy.gif' alt='' /></div>\r\n</div>\r\n\r\n<div><img src='images/gym_tit_right.png' alt='' /></div>                                                    \r\n</div>\r\n\r\n\r\n\r\n      \r\n";
        if ($ir['willmax'] > 100) {
        }
        $hq = $db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC");
        while ($r = $db->fetch_row($hq)) {
            print " ";
            $hq = mysql_query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC", $c);
            while ($r = $db->fetch_row($hq)) {
                print "\r\n\r\n\r\n<div class='house_contentpart' >\r\n<div class='shackpart'>\r\n<div><img src='images/shack_top.png' alt='' /></div>\r\n<div class='shack_con'>\r\n<div class='shack_img'><img src='{$r['hPIC']}' width='137' height='72' alt='' /></div>\r\n<div class='shack_txt'>{$r['hNAME']} </div>\r\n\r\n</div>\r\n<div><img src='images/shack_btm.png' alt='' /></div>                                                    \r\n</div>\r\n<div class='city_con'>\r\n<div><img src='images/all_top.gif' alt='' /></div>\r\n<div class='city_md'>\r\n<div class='alltxt'>All City</div>\r\n</div>\r\n<div><img src='images/all_btm.gif' alt='' /></div>                                                    \r\n</div>\r\n\r\n<div class='city_con'>\r\n<div><img src='images/all_top.gif' alt='' /></div>\r\n<div class='city_md'>\r\n<div class='alltxt'>\${$t}" . money_formatter($r['hPRICE'], '') . "</div>\r\n</div>\r\n<div><img src='images/all_btm.gif' alt='' /></div>                                                    \r\n</div>\r\n<div class='city_con'>\r\n<div><img src='images/all_top.gif' alt='' /></div>\r\n\r\n<div class='city_md'>\r\n<div class='alltxt'>{$r['hWILL']}</div>\r\n</div>\r\n<div><img src='images/all_btm.gif' alt='' /></div>                                                    \r\n</div>\r\n<div class='buybtn'><a href='estate.php?property={$r['hID']}'><img src='images/buy_btn.jpg' title='BUY' alt='BUY' /></a></div>\r\n</div> ";
            }
            print "\r\n</div>                                                    \r\n            </div>\r\n\r\n\r\n</div>\r\n\r\n            </div>                                                                        \r\n        </div>\r\n    </div>        </div></div>            </div></div>\r\n        </div>\r\n        </div>\r\n        </div>\r\n";
        }
    }
}
$h->endpage();
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:31,代码来源:estate.php

示例10: mysql_query

$q = mysql_query("SELECT COUNT(`userid`) AS `c_users`,\n\t\t\t\t SUM(`money`) AS `s_money`,\n\t\t\t\t SUM(`crystals`) AS `s_crystals`\n                 FROM `users`", $c);
$mem_info = mysql_fetch_assoc($q);
$membs = $mem_info['c_users'];
$total = $mem_info['s_money'];
$avg = (int) ($total / ($membs > 1 ? $membs : 1));
$totalc = $mem_info['s_crystals'];
$avgc = (int) ($totalc / ($membs > 1 ? $membs : 1));
mysql_free_result($q);
$q = mysql_query("SELECT COUNT(`userid`) AS `c_users`,\n                 SUM(`bankmoney`) AS `s_bank`\n                 FROM `users`\n                 WHERE `bankmoney` > -1", $c);
$bank_info = mysql_fetch_assoc($q);
$banks = $bank_info['c_users'];
$totalb = $bank_info['s_bank'];
$avgb = (int) ($totalb / ($banks > 0 ? $banks : 1));
mysql_free_result($q);
$q = mysql_query("SELECT COUNT(`userid`)\n                 FROM `users`\n                 WHERE `gender` = 'Male'", $c);
$male = mysql_result($q, 0, 0);
mysql_free_result($q);
$q = mysql_query("SELECT COUNT(`userid`)\n                 FROM `users`\n                 WHERE `gender` = 'Female'", $c);
$fem = mysql_result($q, 0, 0);
mysql_free_result($q);
$q = mysql_query("SELECT SUM(`inv_qty`)\n\t\t\t\t FROM `inventory`", $c);
$totali = (int) mysql_result($q, 0, 0);
mysql_free_result($q);
$q = mysql_query("SELECT COUNT(`mail_id`)\n\t\t\t\t FROM `mail`", $c);
$mail = mysql_result($q, 0, 0);
mysql_free_result($q);
$q = mysql_query("SELECT COUNT(`evID`)\n\t\t\t\t FROM `events`", $c);
$events = mysql_result($q, 0, 0);
mysql_free_result($q);
echo "<h3>Country Statistics</h3>\nYou step into the Statistics Department and login to the service. You see some stats that interest you.<br />\n<table width='75%' cellspacing='1' class='table'>\n\t<tr>\n\t\t<th>Users</th>\n\t\t<th>Money and Crystals</th>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tThere are currently {$membs} {$set['game_name']} players,\n                {$male} males and {$fem} females.\n        </td>\n        <td>\n\t\t\tAmount of cash in circulation: " . money_formatter($total) . ". <br />\n\t\t\tThe average player has: " . money_formatter($avg) . ". <br />\n\t\t\tAmount of cash in banks: " . money_formatter($totalb) . ". <br />\n\t\t\tAmount of players with bank accounts: {$banks}<br />\n\t\t\tThe average player has in their bank accnt: " . money_formatter($avgb) . ". <br />\n\t\t\tAmount of crystals in circulation: " . money_formatter($totalc, "") . ". <br />\n\t\t\tThe average player has: " . money_formatter($avgc, "") . " crystals.\n        </td>\n    </tr>\n\t<tr>\n\t\t<th>Mails/Events</th>\n\t\t<th>Items</th>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t" . money_formatter($mail, "") . " mails and " . money_formatter($events, "") . " events have been sent.\n        </td>\n        <td>\n\t\t\tThere are currently " . money_formatter($totali, "") . " items in circulation.\n        </td>\n    </tr>\n </table>";
$h->endpage();
开发者ID:jwest00724,项目名称:mccodefree,代码行数:31,代码来源:stats.php

示例11: hof_respect

function hof_respect()
{
    global $db, $ir, $c, $userid;
    print "Showing the 20 gangs with the highest amount of respect<br />\n<table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>Gang</th> <th>Respect</th> </tr>";
    $q = $db->query("SELECT * FROM gangs ORDER BY gangRESPECT DESC,gangID ASC LIMIT 20");
    $p = 0;
    while ($r = $db->fetch_row($q)) {
        $p++;
        if ($r['gangID'] == $ir['gang']) {
            $t = "<b>";
            $et = "</b>";
        } else {
            $t = "";
            $et = "";
        }
        print "<tr> <td>{$t}{$p}{$et}</td> <td>{$t}{$r['gangNAME']} [{$r['gangID']}]{$et}</td> <td>{$t}" . money_formatter($r['gangRESPECT'], '') . "{$et}</td> </tr>";
    }
    print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:19,代码来源:halloffame.php

示例12: Copyright

| Software Version     : Version 2.0.1 Build 2101
| Website              : http://www.ravan.info/
| E-mail               : support@ravan.info
|**************************************************************************************************
| The source files are subject to the Ravan Scripts End-User License Agreement included in License Agreement.html
| The files in the package must not be distributed in whole or significant part.
| All code is copyrighted unless otherwise advised.
| Do Not Remove Powered By Ravan Scripts without permission .         
|**************************************************************************************************
| Copyright (c) 2010 Ravan Scripts . All rights reserved.
|**************************************************************************************************/
include "globals.php";
print "\r\n\r\n<div class='generalinfo_txt'>\r\n<div><img src='images/info_left.jpg' alt='' /></div>\r\n<div class='info_mid'><h2 style='padding-top:10px;'> Battle Tent</h2></div>\r\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\r\n<div class='generalinfo_simple'><br> <br><br>\r\n\r\n\r\n<b>Welcome to the battle tent! Here you can challenge NPCs for money.</b>\r\n<table width=90% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>";
$q = $db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid={$userid} LEFT JOIN cities cy ON u.location=cy.cityid");
while ($r = $db->fetch_row($q)) {
    $earn = money_formatter($r['cb_money']);
    $v = $r['userid'];
    $q2 = $db->query("SELECT count(*) FROM challengesbeaten WHERE npcid={$userid}");
    $times = $db->fetch_single($q2);
    print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>{$times}</td><td>";
    if ($r['hp'] >= $r['maxhp'] / 2 and $r['location'] == $ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) {
        print "<font color=green>Yes</font>";
    } else {
        print "<font color=red>No</font>";
    }
    print "</td><td>{$r['cityname']}</td><td>{$earn}</td><td>";
    if ($r['npcid']) {
        print "<i>Already</i>";
    } else {
        print "<a href='attack.php?ID={$r['userid']}'>Challenge</a>";
    }
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:31,代码来源:battletent.php

示例13: rob_business

function rob_business()
{
    global $ir, $db, $h, $userid;
    $_GET['id'] = abs(@intval($_GET['id']));
    if ($_GET['id']) {
        $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id']));
        if (!$db->num_rows($fetch_business)) {
            echo 'You cannot rob a company that doesn\'t exist.';
        } else {
            $r = $db->fetch_row($fetch_business);
            if ($ir['rob'] == 1) {
                echo 'You cannot attempt to rob a company more than once a day!';
                $h->endpage();
                exit;
            }
            if ($ir['userid'] == $r['busDirector']) {
                echo 'Why would you attempt to rob your own company?';
                $h->endpage();
                exit;
            } else {
                if ($ir['robskill'] <= $r['bussecurity']) {
                    print "\n\n\n<h1><font color=red>BUSTED !! </font></h1>   <br><br> \n\n<div id='mainOutput' style='text-align: center; color: white;  width: 600px; border: 1px solid #222222; height: 70px;\nmargin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n\nWhile attempting to break into the business, greedy with plans of large bucks.  You fail to notice the police car driving by.  Just as you crack the lock and begin to head inside you are knocked over the head.  You wake up in jail with a raging headache and the discovery YOU WERE CAUGHT";
                    event_add($_GET['id'], "<a href='viewuser.php?u={$userid}'>{$ir['username']}</a> Attempted to Rob your Business but was caught.");
                    $jailtime = mt_rand(10, 40);
                    $query = sprintf('UPDATE users SET jail = jail +%u, jail_reason = "Failed to Rob %s.", rob = 0 WHERE userid = %u', $jailtime, $r['busName'], $userid);
                    $db->query($query);
                    $db->query("UPDATE users SET rob = rob + 1 WHERE userid = {$userid}");
                    $db->query("UPDATE businesses SET bussecurity = bussecurity + 1 WHERE busId = {$_GET['id']}");
                    business_alert($r['busId'], " Someone tried to rob from your company and got busted ! ");
                } else {
                    if ($ir['robskill'] > $r['bussecurity']) {
                        $rando = mt_rand(10, 25);
                        $cash = round($r['busCash'] / $rando);
                        print "\n\n<h1><font color=green>SUCESS !! </font></h1>   <br><br> \n\n<div id='mainOutput' style='text-align: center; color: white;  width: 600px; border: 1px solid #222222; height: 70px;\nmargin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n\n\nAfter scoping out the latest company for a few days, you decide now is your chance to do some damage.  You sneak up to the backdoor after dark and jiggle the lock.  With a bit of luck on your side, the door is unlocked.  You sneak in flashlight in hand and head for the vault.  Noticing the lack of security in this place you are hopeful someone hasn't beat you to the punch.  As you enter the dark office where the stash of cash is located it would appear luck is on your side twice!  The owner left the key to the safe on his desk!  You quickly grab the cash and bolt.  You earned yourself a nice smooth {$cash} cash.";
                        $db->query("UPDATE users SET money = money + {$cash}, rob = 0 WHERE userid = {$userid}");
                        $db->query("UPDATE users SET rob = rob + 1 WHERE userid = {$userid}");
                        $db->query("UPDATE businesses SET busCash = busCash - {$cash}, bussecurity = bussecurity - 1 WHERE busId = {$_GET['id']}");
                        $robbery = $money = money_formatter($cash);
                        business_alert($r['busId'], " Someone successfully robbed {$robbery} from your company ! ");
                    }
                }
            }
        }
    }
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:45,代码来源:business_view.php

示例14: startheaders

    function startheaders()
    {
        global $ir, $set;
        global $_CONFIG;
        define("MONO_ON", 1);
        $db = new database();
        $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']);
        $db->connect();
        $c = $db->connection_id;
        $set = array();
        $settq = $db->query("SELECT * FROM settings");
        while ($r = $db->fetch_row($settq)) {
            $set[$r['conf_name']] = $r['conf_value'];
        }
        $q = $db->query("SELECT userid FROM users");
        $membs = $db->num_rows($q);
        $q = $db->query("SELECT userid FROM users WHERE bankmoney>-1");
        $banks = $db->num_rows($q);
        $q = $db->query("SELECT userid FROM users WHERE gender='Male'");
        $male = $db->num_rows($q);
        $q = $db->query("SELECT userid FROM users WHERE gender='Female'");
        $fem = $db->num_rows($q);
        $money = money_formatter($ir['money']);
        $crystals = money_formatter($ir['crystals'], '');
        $cn = 0;
        // Users Online , Counts Users Online In Last 15 minutes
        $q = $db->query("SELECT * FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY laston DESC");
        $online = $db->num_rows($q);
        $ec = $ir['new_events'];
        $mc = $ir['new_mail'];
        $ids_checkpost = urldecode($_SERVER['QUERY_STRING']);
        if (eregi("[\\'|'/'\\''<'>'*'~'`']", $ids_checkpost) || strstr($ids_checkpost, 'union') || strstr($ids_checkpost, 'java') || strstr($ids_checkpost, 'script') || strstr($ids_checkpost, 'substring(') || strstr($ids_checkpost, 'ord()')) {
            $passed = 0;
            echo "<center> <font color=red> Hack attempt <br/>!!! WARNING !!! <br/>\n\nMalicious Code Detected! The staff has been notified.</font></center>";
            event_add(1, "  <a href='viewuser.php?u={$ir['userid']}'>  <font color=red> " . $ir['username'] . "</font> </a>  <b> Tried to use [" . $_SERVER['SCRIPT_NAME'] . "{$ids_checkpost}].. ", $c);
            $h->endpage();
            exit;
        }
        echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$set['game_name']} - Massive Multiplayer Online Role Playing Game </title>
<meta name="keywords" content="RPG, Online Games, Online Mafia Game" />
<meta name="description" content=" {$set['game_name']} - Online Mafia Game " />
<meta name="author" content="Mafia Game Scripts " />
<meta name="copyright" content="Copyright {$_SERVER['HTTP_HOST']} " />
<link rel="SHORTCUT ICON" href="favicon.ico" />
<script src="js/jquery-1.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/styleold.css" type="text/css" />
<link rel="stylesheet" href="css/stylenew.css" type="text/css" />

<script type="text/javascript" src="js/header.js"></script>
<style type="text/css">
.boston a{
background:url(images/boston.jpg) no-repeat;
}

.boston a:hover{
background:url(images/boston_hover.jpg) no-repeat;
}
</style>
<!--<script type="text/javascript">
\$(document).ready(function(){
\$.get("userstatajax.php",function(res){
if(res)
{
var resarray = res.split('||||||');
\$('.profile_mid').html(resarray[0]);
\$('#points_money').html(resarray[1]);
}
});
});
</script>-->
</head>
<body id="sub" class="yui-skin-sam">

<div id="pagecontainer">
<!-- Header Part Starts -->
<div class="headerpart">

<div class="onlinegame"></div>
<div class="toplist">

</div>
</div>



<!-- //Header Part End -->  

<!-- Inner Page Top Starts -->

<div class="innertopbg">
<div class="toprow1">
<div class="toprow1_col1">
<div class="logo"><a href="index.php"><img src="images/logo.jpg" alt="Logo"/></a></div>
<div class="needbtn"></div>        
<div class="top_leftbtn">
//.........这里部分代码省略.........
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:101,代码来源:header.php

示例15: hof_crystals

function hof_crystals()
{
    global $ir, $c, $userid;
    print "Showing the 20 users with the highest amount of crystals<br />\n<table width=75%><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Crystals</th> </tr>";
    $q = mysql_query("SELECT u.* FROM users u WHERE u.user_level != 0 ORDER BY crystals DESC,userid ASC LIMIT 20", $c);
    $p = 0;
    while ($r = mysql_fetch_array($q)) {
        $p++;
        if ($r['userid'] == $userid) {
            $t = "<b>";
            $et = "</b>";
        } else {
            $t = "";
            $et = "";
        }
        print "<tr> <td>{$t}{$p}{$et}</td> <td>{$t}{$r['username']} [{$r['userid']}]{$et}</td> <td>{$t}" . money_formatter($r['crystals'], '') . "{$et}</td> </tr>";
    }
    print "</table>";
}
开发者ID:jwest00724,项目名称:mccodefree,代码行数:19,代码来源:halloffame.php


注:本文中的money_formatter函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。