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


PHP getCredits函数代码示例

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


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

示例1: showCreditsPage

/**
 * This is largely cadged from PageHistory::history
 */
function showCreditsPage($article)
{
    global $wgOut, $wgUser;
    $fname = 'showCreditsPage';
    wfProfileIn($fname);
    // Show a 404 page for anonymous users accessing the credits.
    // We do this to hopefully improve SEO by removing links visible
    // to Google.
    if ($wgUser->isAnon()) {
        $wgOut->setRobotpolicy('noindex,nofollow');
        $wgOut->addHTML(wfMsg('logintoview'));
        header('HTTP/1.0 404 Not Found');
        return;
    }
    $wgOut->setPageTitle($article->mTitle->getPrefixedText());
    $wgOut->setSubtitle(wfMsg('creditspage'));
    $wgOut->setArticleFlag(false);
    $wgOut->setArticleRelated(true);
    $wgOut->setRobotpolicy('noindex,nofollow');
    if ($article->mTitle->getArticleID() == 0) {
        $s = wfMsg('nocredits');
    } else {
        $s = getCredits($article, -1);
    }
    $wgOut->addHTML($s);
    wfProfileOut($fname);
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:30,代码来源:Credits.php

示例2: createTransaction

function createTransaction()
{
    // We need globals.
    global $DB;
    global $MySelf;
    global $TIMEMARK;
    // Are we allowed to poke in here?
    if (!$MySelf->isAccountant()) {
        makeNotice("Umm, you are not allowed to do this. Really. You are not.", "warning", "You are not supposed to be here");
    }
    // Check the ints.
    numericCheck($_POST[wod], 0, 1);
    numericCheck($_POST[amount], 0);
    numericCheck($_POST[id], 0);
    // Its easier on the eyes.
    $type = $_POST[wod];
    $amount = $_POST[amount];
    $id = $_POST[id];
    $username = idToUsername($id);
    // invert the amount if we have a withdrawal.
    if ($_POST[wod] == 1) {
        $dir = "withdrawed";
        $dir2 = "from";
        $hisMoney = getCredits($id);
        if ($hisMoney < $amount) {
            $ayee = $hisMoney - $amount;
            confirm("WARNING:<br>{$username} can NOT afford this withdrawal. If you choose to " . "authorize this transaction anyway his account will be at " . number_format($ayee, 2) . " ISK.");
        }
    } else {
        $amount = $_POST[amount];
        $dir = "deposited";
        $dir2 = "into";
    }
    // We use custom reason, if set.
    if ($_POST[reason2] != "") {
        $reason = sanitize($_POST[reason2]);
    } else {
        $reason = sanitize($_POST[reason1]);
    }
    // Create transaction.
    $transaction = new transaction($id, $type, $amount);
    $transaction->setReason($reason);
    // Success?
    if (!$transaction->commit()) {
        // Nope :(
        makeNotice("Unable to create transaction. Danger, Will Robinson, DANGER!", "error", "Internal Error", "index.php?action=edituser&id={$id}", "[Back]");
    } else {
        // Success !
        makeNotice("You successfully {$dir} {$amount} ISK {$dir2} " . $username . "'s account.", "notice", "Transaction complete", "index.php?action=edituser&id={$id}", "[Ok]");
    }
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:51,代码来源:createTransaction.php

示例3: showCreditsPage

/**
 * This is largely cadged from PageHistory::history
 */
function showCreditsPage($article)
{
    global $wgOut;
    $fname = 'showCreditsPage';
    wfProfileIn($fname);
    $wgOut->setPageTitle($article->mTitle->getPrefixedText());
    $wgOut->setSubtitle(wfMsg('creditspage'));
    $wgOut->setArticleFlag(false);
    $wgOut->setArticleRelated(true);
    $wgOut->setRobotpolicy('noindex,nofollow');
    if ($article->mTitle->getArticleID() == 0) {
        $s = wfMsg('nocredits');
    } else {
        $s = getCredits($article, -1);
    }
    $wgOut->addHTML($s);
    wfProfileOut($fname);
}
开发者ID:BackupTheBerlios,项目名称:blahtex,代码行数:21,代码来源:Credits.php

示例4: index

 public function index()
 {
     //$this->openid  =  $this->openid();
     $this->openid = 'o3Iz7jmy9NjyTWvKQ7rkNhjJNSuY';
     //会员
     $usr = M('t_huiyuan')->where(array('open_id' => $this->openid))->find();
     //print_r($usr);
     if ($usr) {
         //call sand api
         sand_api_call();
         $score = getCredits($usr['card_no']);
         $usr['score'] = $score;
         $this->usr = $usr;
         $this->display('Yhjf');
     } else {
         $this->cityList = $this->cityList();
         $this->display();
     }
 }
开发者ID:elliott-hs,项目名称:ld,代码行数:19,代码来源:IntegralController.class.php

示例5: transferMoney

function transferMoney()
{
    // Globals
    global $MySelf;
    global $DB;
    global $TIMEMARK;
    $MyCredits = getCredits($MySelf->getID());
    // Can we afford even the most basic transactions?
    if (!numericCheckBool($MyCredits, 0)) {
        makeNotice("You can not afford any transaction.", "warning", "Out of money", "index.php?action=manageWallet", "[cancel]");
    }
    // Did we supply an isk amount at all?
    if ($_POST[amount] == "") {
        makeNotice("You did not specify an ISK amount. Please go back, and try again.", "warning", "How much?", "index.php?action=manageWallet", "[cancel]");
    }
    if (!is_numeric($_POST[amount])) {
        makeNotice("The frog looks at you and your cheque with the amount of \"" . $_POST[amount] . "\". The frog is unsure how much ISK that is and instead decides to lick your face in a friendly manner, then it closes the teller and goes for lunch.", "warning", "Huh?");
    }
    // Check for sanity.
    if (!numericCheckBool($_POST[to], 0)) {
        makeNotice("The supplied reciver is not valid.", "warning", "Invalid ID", "index.php?action=manageWallet", "[cancel]");
    }
    if (!numericCheckBool($_POST[amount], 0)) {
        makeNotice("You need to specify a positive ISK value.", "error", "Invalid amount", "index.php?action=manageWallet", "[cancel]");
    }
    if (!numericCheckBool($_POST[amount], 0, $MyCredits)) {
        makeNotice("You can not afford this transaction.", "warning", "Out of money", "index.php?action=manageWallet", "[cancel]");
    }
    // Ok so now we know: The reciver is valid, the sender has enough money.
    $from = "<br><br>From: " . ucfirst($MySelf->getUsername());
    $to = "<br>To: " . ucfirst(idToUsername($_POST[to]));
    $amount = "<br>Amount: " . number_format($_POST[amount], 2) . " ISK";
    $reason = "<br>Reason: " . $_POST[reason];
    confirm("Please authorize this transaction:" . $from . $to . $amount . $reason);
    // Lets do it.
    $transaction = new transaction($_POST[to], 0, $_POST[amount]);
    $transaction->setReason("Cash transfer from " . ucfirst($MySelf->getUsername()) . " to " . ucfirst(idToUsername($_POST[to])) . ": " . $_POST[reason]);
    $transaction->isTransfer(true);
    $transaction->commit();
    // Send'em back.
    makeNotice($amount . " has been transfered from your into " . ucfirst(idToUsername($_POST[to])) . " account.", "notice", "Cash transfered", "index.php?action=manageWallet", "[OK]");
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:42,代码来源:transferMoney.php

示例6: requestPayout

function requestPayout()
{
    // Globals
    global $MySelf;
    global $DB;
    global $TIMEMARK;
    // How much overdraft are we allowed?
    $overdraft = 100 * 1000000;
    // 100m
    $overdraftlimit = false;
    // How much isk we got?
    $MyCredits = getCredits($MySelf->getID());
    // Is this a number?
    if (!is_numeric($_POST[amount])) {
        makeNotice("The frog looks at you and your cheque with the amount of \"" . $_POST[amount] . "\". The frog is unsure how much ISK that is and instead decides to lick your face in a friendly manner, then it closes the teller and goes for lunch.", "warning", "Huh?");
    }
    // We are requesting a POSITIVE amount, right?
    if (!numericCheckBool($_POST[amount], 0)) {
        makeNotice("You can only request positive amounts of ISK. If you want money, go work for it.", "notice", "This aint no charity", "index.php?action=manageWallet", "But i got women and children to feed...");
    }
    // So, can we afford it?
    if ($overdraft <= 0 && !numericCheckBool($_POST[amount], 1, $MyCredits)) {
        makeNotice("You can only request a payment up to " . number_format($MyCredits) . " ISK. You requested " . number_format($_POST[amount]) . " ISK. Thats " . number_format($_POST[amount] - $MyCredits, 2) . " ISK more than you can afford.", "warning", "Too big of a payout.", "index.php?action=manageWallet", "[Cancel]");
    }
    // Allow an overdraft, but not too much
    if ($overdraft > 0 && $overdraftlimit && !numericCheckBool($_POST[amount], 1, $MyCredits + $overdraft)) {
        makeNotice("You can only request a payment up to " . number_format($MyCredits + $overdraft) . " ISK. You requested " . number_format($_POST[amount]) . " ISK. Thats " . number_format($_POST[amount] - ($MyCredits + $overdraft), 2) . " ISK more than you are allowed.", "warning", "Too big of a payout.", "index.php?action=manageWallet", "[Cancel]");
    }
    // We sure?
    confirm("Please confirm your payout request of " . number_format($_POST[amount], 2) . " ISK.");
    // Ok, do it.
    $DB->query("INSERT INTO payoutRequests (time, applicant, amount) VALUES (?,?,?)", array($TIMEMARK, $MySelf->getID(), $_POST[amount]));
    if ($DB->affectedRows() == 1) {
        mailUser("We are notifying you that " . $MySelf->getUsername() . " has requested a payout of " . number_format($_POST[amount], 2) . " ISK", "WHB Payout Requested", "isAccountant");
        makeNotice("You request has been logged. An accountant will soon honor your request.", "notice", "Request logged", "index.php?action=manageWallet", "[OK]");
    } else {
        makeNotice("Internal Error! Unable to record your request into the database! Inform the admin!", "error", "Internal Error!", "index.php?action=manageWallet", "[cancel]");
    }
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:39,代码来源:requestPayout.php

示例7: outputPage


//.........这里部分代码省略.........
         $tpl->set('body_onload', false);
     }
     global $wgUseSiteJs;
     if ($wgUseSiteJs) {
         if ($this->loggedin) {
             $tpl->set('jsvarurl', $this->makeUrl($this->userpage . '/-', 'action=raw&gen=js&maxage=' . $wgSquidMaxage));
         } else {
             $tpl->set('jsvarurl', $this->makeUrl('-', 'action=raw&gen=js'));
         }
     } else {
         $tpl->set('jsvarurl', false);
     }
     wfProfileOut("{$fname}-stuff2");
     wfProfileIn("{$fname}-stuff3");
     $tpl->setRef('newtalk', $ntl);
     $tpl->setRef('skin', $this);
     $tpl->set('logo', $this->logoText());
     if ($wgOut->isArticle() and (!isset($oldid) or isset($diff)) and $this->getContext()->canUseWikiPage() && 0 != $this->getContext()->getWikiPage()->getId()) {
         if (!$wgDisableCounters) {
             $viewcount = $this->getContext()->getWikiPage()->getCount();
             if ($viewcount) {
                 $tpl->set('viewcount', wfMessage("viewcount", $viewcount)->text());
             } else {
                 $tpl->set('viewcount', false);
             }
         } else {
             $tpl->set('viewcount', false);
         }
         $tpl->set('lastmod', $this->lastModified());
         $tpl->set('copyright', $this->getCopyright());
         $this->credits = false;
         if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
             require_once "{$IP}/includes/Credits.php";
             $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
         }
         $tpl->setRef('credits', $this->credits);
     } elseif (isset($oldid) && !isset($diff)) {
         $tpl->set('copyright', $this->getCopyright());
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
     } else {
         $tpl->set('copyright', false);
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
     }
     wfProfileOut("{$fname}-stuff3");
     wfProfileIn("{$fname}-stuff4");
     $tpl->set('copyrightico', $this->getCopyrightIcon());
     $tpl->set('poweredbyico', $this->getPoweredBy());
     $tpl->set('disclaimer', $this->disclaimerLink());
     $tpl->set('about', $this->aboutLink());
     $tpl->setRef('debug', $out->mDebugtext);
     //$out->addHTML($printfooter);
     $tpl->set('bottomscripts', $this->bottomScripts());
     if ($wgTitle->getNamespace() == NS_USER && $wgUser->getId() == 0 && !UserPagePolicy::isGoodUserPage($wgTitle->getDBKey())) {
         $txt = $out->parse(wfMessage('noarticletext_user')->text());
         $tpl->setRef('bodytext', $txt);
         header('HTTP/1.1 404 Not Found');
     } else {
         if (!is_null($out)) {
             $tpl->setRef('bodytext', $out->getHTML());
         }
     }
     # Language links
开发者ID:biribogos,项目名称:wikihow-src,代码行数:67,代码来源:WikiHowSkin.php

示例8: getName

                    <div class="panel-body">
                        <h4 class="adjst"><?php 
echo getName($row);
?>
</h4>
                        <p>
                        <div id="overview">
                            <?php 
echo getOverview($row);
?>
                        </div>
                        <div id="credits">
                            <strong>Cast:</strong>
                            <?php 
echo getCredits($row);
?>
                        
                        </div>
                        <div id="director">
                            <strong>Director:</strong>
                            <?php 
echo getDirector($row);
?>
                        </div>
                        <div id="runtime">
                            <strong>Runtime:</strong>
                            <?php 
echo getRuntime($row);
?>
 
开发者ID:roseblumentopf,项目名称:mywatchlst,代码行数:29,代码来源:movie.php

示例9: manageWallet

function manageWallet()
{
    // Globals
    global $MySelf;
    global $DB;
    $MyCredits = getCredits($MySelf->getID());
    // Get (recent?) transactions
    $html = getTransactions($MySelf->getID());
    if ($MyCredits > 0) {
        // Create the dropdown menu with all pilots.
        $NamesDS = $DB->query("SELECT DISTINCT username, id FROM users WHERE deleted='0' ORDER BY username");
        $ddm = "<select name=\"to\">";
        while ($name = $NamesDS->fetchRow()) {
            // Lets not allow transfers to self.
            if ($name[id] != $MySelf->getID()) {
                $ddm .= "<option value=\"" . $name[id] . "\">" . ucfirst($name[username]) . "</option>";
            }
        }
        $ddm .= "</select>";
        $tt = new table(2, true);
        $tt->addHeader(">> Transfer ISK");
        $tt->addRow("#060622");
        $tt->addCol("You can transfer ISK into another Pilots wallet by using this form.", array("colspan" => 2));
        $tt->addRow();
        $tt->addCol("Transfer from:");
        $tt->addCol(ucfirst($MySelf->getUsername()));
        $tt->addRow();
        $tt->addCol("Transfer to:");
        $tt->addCol($ddm);
        $tt->addRow();
        $tt->addCol("Amount:");
        $tt->addCol("<input type=\"text\" name=\"amount\">");
        $tt->addRow();
        $tt->addCol("Reason:");
        $tt->addCol("<input type=\"text\" name=\"reason\">");
        $tt->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Transfer money\">");
        // Create form stuff, and embed the table within.
        $transfer = "<form action=\"index.php\" method=\"POST\">";
        $transfer .= $tt->flush();
        $transfer .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
        $transfer .= "<input type=\"hidden\" name=\"action\" value=\"transferMoney\">";
        $transfer .= "</form>";
        // Create the payout form.
        $payout = new table(2, true);
        $payout->addHeader(">> Request payout");
        $payout->addRow("#060622");
        $payout->addCol("Fill out this form to request payout of ISK. An accountant will honor your request soon.", array("colspan" => 2));
        $payout->addRow();
        $payout->addCol("Payout amount:");
        $payout->addCol("<input type=\"text\" name=\"amount\" value=\"" . $MyCredits . "\"> ISK");
        $payout->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"request payout\">");
        // Create form stuff, and embed the table within.
        $requestPayout = "<form action=\"index.php\" method=\"POST\">";
        $requestPayout .= $payout->flush();
        $requestPayout .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
        $requestPayout .= "<input type=\"hidden\" name=\"action\" value=\"requestPayout\">";
        $requestPayout .= "</form>";
    }
    /*
     * Show current requests
     */
    $requests = $DB->query("SELECT * FROM payoutRequests WHERE payoutTime IS NULL AND applicant='" . $MySelf->getID() . "' ORDER BY time");
    $table = new table(4, true);
    $table->addHeader(">> Pending payout requests");
    $table->addRow("#060622");
    $table->addCol("request");
    $table->addCol("time");
    $table->addCol("amount");
    $table->addCol("Cancel");
    while ($request = $requests->fetchRow()) {
        $table->addRow();
        $table->addCol("#" . str_pad($request[request], "5", "0", STR_PAD_LEFT));
        $table->addCol(date("d.m.y H:i:s", $request[time]));
        $table->addCol(number_format($request[amount], 2) . " ISK");
        $table->addCol("<input type=\"checkbox\" name=\"" . $request[request] . "\" value=\"true\">");
        $haveRequest = true;
    }
    $table->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"cancel marked requests\">");
    $takeBack = "<form action=\"index.php\" method=\"POST\">";
    $takeBack .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
    $takeBack .= "<input type=\"hidden\" name=\"action\" value=\"deleteRequest\">";
    $takeBack .= $table->flush();
    $rakeBack .= "</form>";
    /*
     * Show fulfilled requests
     */
    $requests = $DB->query("SELECT * FROM payoutRequests WHERE payoutTime IS NOT NULL AND applicant='" . $MySelf->getID() . "' ORDER BY time");
    $table_done = new table(5, true);
    $table_done->addHeader(">> Fulfilled payout requests");
    $table_done->addRow("#060622");
    $table_done->addCol("request");
    $table_done->addCol("time");
    $table_done->addCol("amount");
    $table_done->addCol("Payout time");
    $table_done->addCol("Paid by");
    while ($request = $requests->fetchRow()) {
        $table_done->addRow();
        $table_done->addCol("#" . str_pad($request[request], "5", "0", STR_PAD_LEFT));
        $table_done->addCol(date("d.m.y H:i:s", $request[time]));
        $table_done->addCol(number_format($request[amount], 2) . " ISK");
//.........这里部分代码省略.........
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:manageWallet.php

示例10: outputPage


//.........这里部分代码省略.........
     $tpl->setRef('newtalk', $ntl);
     $tpl->setRef('skin', $this);
     $tpl->set('logo', $this->logoText());
     if ($wgOut->isArticle() and (!isset($oldid) or isset($diff)) and 0 != $wgArticle->getID()) {
         if (!$wgDisableCounters) {
             $viewcount = $wgLang->formatNum($wgArticle->getCount());
             if ($viewcount) {
                 $tpl->set('viewcount', wfMsg("viewcount", $viewcount));
             } else {
                 $tpl->set('viewcount', false);
             }
         } else {
             $tpl->set('viewcount', false);
         }
         if ($wgPageShowWatchingUsers) {
             $dbr =& wfGetDB(DB_SLAVE);
             extract($dbr->tableNames('watchlist'));
             $sql = "SELECT COUNT(*) AS n FROM {$watchlist}\n\t\t\t\t\tWHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . "' AND  wl_namespace=" . $this->mTitle->getNamespace();
             $res = $dbr->query($sql, 'SkinPHPTal::outputPage');
             $x = $dbr->fetchObject($res);
             $numberofwatchingusers = $x->n;
             if ($numberofwatchingusers > 0) {
                 $tpl->set('numberofwatchingusers', ' ' . wfMsg('number_of_watching_users_pageview', $numberofwatchingusers));
             } else {
                 $tpl->set('numberofwatchingusers', false);
             }
         } else {
             $tpl->set('numberofwatchingusers', false);
         }
         $tpl->set('copyright', $this->getCopyright());
         $this->credits = false;
         if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
             require_once "Credits.php";
             $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
         } else {
             $tpl->set('lastmod', $this->lastModified());
         }
         $tpl->setRef('credits', $this->credits);
     } elseif (isset($oldid) && !isset($diff)) {
         $tpl->set('copyright', $this->getCopyright());
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
         $tpl->set('numberofwatchingusers', false);
     } else {
         $tpl->set('copyright', false);
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
         $tpl->set('numberofwatchingusers', false);
     }
     wfProfileOut("{$fname}-stuff3");
     wfProfileIn("{$fname}-stuff4");
     $tpl->set('copyrightico', $this->getCopyrightIcon());
     $tpl->set('poweredbyico', $this->getPoweredBy());
     $tpl->set('disclaimer', $this->disclaimerLink());
     $tpl->set('about', $this->aboutLink());
     $tpl->setRef('debug', $out->mDebugtext);
     $tpl->set('reporttime', $out->reportTime());
     $tpl->set('sitenotice', wfGetSiteNotice());
     $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
     $out->mBodytext .= $printfooter;
     $tpl->setRef('bodytext', $out->mBodytext);
     # Language links
     $language_urls = array();
     if (!$wgHideInterlanguageLinks) {
开发者ID:BackupTheBerlios,项目名称:enotifwiki,代码行数:67,代码来源:SkinTemplate.php

示例11: changeCredits

function changeCredits($uid, $pid, $credits)
{
    if (!canViewPuzzle($uid, $pid)) {
        utilsError("You do not have permission to modify this puzzle.");
    }
    $purifier = new HTMLPurifier();
    mysql_query('START TRANSACTION');
    $oldCredits = getCredits($pid);
    $cleanCredits = $purifier->purify($credits);
    //$cleanCredits = htmlspecialchars($cleanCredits);
    updateCredits($uid, $pid, $oldCredits, $cleanCredits);
    mysql_query('COMMIT');
}
开发者ID:paultag,项目名称:puzzle-editing,代码行数:13,代码来源:utils.php

示例12: makeWelcome

function makeWelcome()
{
    // Load the globals.
    global $VERSION;
    global $SITENAME;
    global $IGB;
    global $IGB_VISUAL;
    global $MySelf;
    global $DB;
    global $ValidUntil;
    /* HTML stuff */
    $page = "<h2>Welcome to {$VERSION}!</h2>";
    /* The welcome table */
    $table = new table(2, true);
    $table->addHeader(">> Welcome to {$VERSION}");
    $table->addRow();
    $table->addCol("Logged in as:", array("bold" => true, "align" => "right"));
    $table->addCol(ucfirst($MySelf->getUsername()));
    $table->addRow();
    $table->addCol("Registered Rank:", array("bold" => true, "align" => "right"));
    $table->addCol($MySelf->getRankName());
    $table->addRow();
    $table->addCol("Latest login:", array("bold" => true, "align" => "right"));
    if ($MySelf->getLastlogin() < 1) {
        $table->addCol("This is your very first login! Welcome!");
    } else {
        $table->addCol(date("r", $MySelf->getLastlogin()));
    }
    $table->addRow();
    $table->addCol("Your account:", array("bold" => true, "align" => "right"));
    $table->addCol(number_format(getCredits($MySelf->getID()), 2) . " ISK");
    $table->addRow();
    $table->addCol("Your profile:", array("bold" => true, "align" => "right"));
    $table->addCol(makeProfileLink($MySelf->getID()));
    global $BLESSED;
    if ($BLESSED) {
        $table->addRow("#330000");
        $table->addCol("Installation Blessed!", array("bold" => true, "align" => "right"));
        $table->addCol("It is not affected by expiration. It runs with the highest priority on the server and all limitations have been lifted.");
    }
    // Set the filename to the announce textfile.
    $announceFile = "/path/to/your/announce/txt.file";
    // Check its existance...
    if (file_exists($announceFile)) {
        // Then load it.
        $globalAnnounce = file_get_contents($announceFile);
    }
    // Only display contents if more than X characters long.
    if (strlen($globalAnnounce) > 10) {
        // Create announcement table...
        $announceTable = new table(1, true);
        $announceTable->addHeader(">>> Important hosting information");
        $announceTable->addRow();
        $announceTable->addCol("{$globalAnnounce}");
        // ... and add it to the page.
        $page .= $announceTable->flush();
    }
    $page .= $table->flush();
    /* Show failed Logins to admins. */
    if ($MySelf->isAdmin()) {
        $page .= showFailedLogins("15");
    } else {
        $page .= showFailedLogins("10", $MySelf->getUsername());
    }
    /* permissions table */
    $permsTable = new table(1, true);
    $permsTable->addHeader(">> Your permissions");
    // Permissions matrix
    $perms = array("canLogin" => "log in.", "canJoinRun" => "join mining operations.", "canCreateRun" => "create new mining operations.", "canCloseRun" => "close mining operations.", "canDeleteRun" => "delete mining operations.", "canAddHaul" => "haul to mining operations.", "canSeeEvents" => "view scheduled events.", "canEditEvents" => "add and delete scheduled events.", "canChangePwd" => "change your own password.", "canChangeEmail" => "change your own email.", "canChangeOre" => "manage ore prices and enable/disable them.", "canAddUser" => "add new accounts.", "canSeeUsers" => "see other accounts.", "canDeleteUser" => "delete other accounts.", "canEditRank" => "edit other peoples ranks.", "canManageUser" => "grant and take permissions.", "isAccountant" => "manage the corporation wallet and authorize payments.", "isOfficial" => "create official mining runs (with payout).");
    $permDS = $DB->getAssoc("SELECT * FROM users WHERE id='" . $MySelf->getID() . "' AND deleted='0'");
    $keys = array_keys($perms);
    foreach ($keys as $key) {
        if ($permDS[$MySelf->getID()][$key] == 1) {
            $permsTable->addRow();
            $permsTable->addCol("You are allowed to " . $perms[$key]);
        }
    }
    $permsTable->addHeader("If you believe your permissions are faulty, consult your CEO immediatly.");
    // Show the balance
    $balance = getTransactions($MySelf->getID());
    $logins = getLogins($MySelf->getID());
    $page .= "<br>" . $balance . "<br>" . $permsTable->flush() . "<br>" . $logins;
    // .. then return it.
    return $page;
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:85,代码来源:makeWelcome.php

示例13: payout

function payout()
{
    // Some globals needed.
    global $DB;
    global $TIMEMARK;
    global $MySelf;
    global $IGB;
    global $IGB_VISUAL;
    // Are we allowed to do this?
    if (!$MySelf->isAccountant()) {
        makeNotice("You are not an accountant to your corporation. Access denied.", "error", "Access denied");
    }
    /*
     * Amount of ISK owned.
     */
    $iskOwned = new table(2, true);
    $iskOwned->addHeader(">> Outstanding ISK");
    // Load all unique members from the database.
    $uniqeMembers = $DB->query("SELECT DISTINCT id FROM users WHERE deleted='0' ORDER BY username ASC");
    // Create a row for each member.
    while ($id = $uniqeMembers->fetchRow()) {
        $playerCreds = getCredits($id['id']);
        // We need this later on...
        $allPeeps[$id['id']] = ucfirst(idToUsername($id['id']));
        // if the member has more or less than zero isk, list him.
        if ($playerCreds != 0) {
            $iskOwned->addRow();
            $iskOwned->addCol("<a href=\"index.php?action=showTransactions&id=" . $id['id'] . "\">" . $allPeeps[$id['id']] . "</a>");
            $iskOwned->addCol(number_format($playerCreds, 2) . " ISK");
        }
    }
    // Show the total isk owned.
    $outstanding = totalIskOwned();
    $iskOwned->addRow("#060622");
    $iskOwned->addCol(">> Total Outstanding ISK:");
    $iskOwned->addCol(totalIskOwned() . " ISK");
    /*
     * Show a drop down menu to create a menu to see everyones transaction log.
     */
    $freeSelect = new table(2, true);
    $freeSelect->addHeader(">> Lookup specific transaction log");
    // Create a PDM for all the peoples.
    foreach ($allPeeps as $peep) {
        $pdm .= "<option value=\"" . array_search($peep, $allPeeps) . "\">{$peep}</option>";
    }
    $freeSelect->addRow();
    $freeSelect->addCol("Show log of ", array("align" => "right"));
    $freeSelect->addCol("<select name=\"id\">{$pdm}</select>");
    $freeSelect->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Lookup log in Database\">");
    unset($pdm);
    /*
     * Show current requests
     */
    $requests = $DB->query("SELECT * FROM payoutRequests WHERE payoutTime IS NULL ORDER BY time DESC");
    if ($IGB && $IGB_VISUAL) {
        $table = new table(6, true);
    } else {
        $table = new table(5, true);
    }
    $table->addHeader(">> Pending payout requests");
    $table->addRow("#060622");
    $table->addCol("request");
    $table->addCol("applicant");
    if ($IGB && $IGB_VISUAL) {
        $table->addCol("right click menu");
    }
    $table->addCol("time");
    $table->addCol("amount");
    $table->addCol("Payout");
    while ($request = $requests->fetchRow()) {
        if ($IGB && $IGB_VISUAL) {
            $api = new api($request['applicant']);
            //			$profile = new profile($request['applicant']);
            if ($api->valid() && ($IGB && $IGB_VISUAL)) {
                $rcm = " [<a href=\"showinfo:1378//" . $api->getCharacterID() . "\">RCM</a>]";
            }
        }
        $table->addRow();
        $table->addCol("#" . str_pad($request['request'], "5", "0", STR_PAD_LEFT));
        $table->addCol("<a href=\"index.php?action=showTransactions&id={$request['applicant']}\">" . ucfirst(idToUsername($request['applicant'])) . "</a>");
        if ($IGB && $IGB_VISUAL) {
            $table->addCol($rcm);
        }
        $table->addCol(date("d.m.y H:i:s", $request['time']));
        if (getCredits($request['applicant']) < $request['amount']) {
            $class .= "red";
        }
        if ($IGB && $IGB_VISUAL) {
            $table->addCol("<input type=\"text\" class=\"{$class}\" name=\"dumb\" readonly value=\"" . number_format($request['amount'], 2) . "\"> ISK");
        } else {
            $table->addCol(number_format($request['amount'], 2) . " ISK", array("class" => $class));
        }
        // Can the user still cover his request with cash?
        $table->addCol("<input type=\"checkbox\" name=\"" . $request['request'] . "\" value=\"true\">");
        $haveRequest = true;
        //} else {
        //	$table->addCol("<i>not enough ISK</i>");
        //}
    }
    $table->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Mark as paid\">");
//.........这里部分代码省略.........
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:payout.php

示例14: split

             echo $mod_strings['_LBL_FAX_SETTINGS_CONNECTIVITY_ERROR'];
         } else {
             $errCode = split(":", $credits);
             if ($errCode[0] == "ERR") {
                 echo $mod_strings['LBL_GET_CREDITS_ERROR'] . " (" . $errCode[1] . ")";
             } else {
                 echo $errCode[1];
             }
         }
     } else {
         echo $mod_strings['LBL_GET_CREDITS_ERROR'];
     }
 } else {
     if ($_REQUEST["command"] == "checkconnectivity") {
         $config = Accounting::loadConfigParams();
         $result = getCredits($config);
         if ($result == "-1") {
             echo $mod_strings['_LBL_FAX_SETTINGS_CONNECTIVITY_ERROR'];
         } else {
             $errCode = split(":", $result);
             if ($errCode[0] == "ERR") {
                 echo $mod_strings['_LBL_FAX_SETTINGS_CONNECTIVITY_ERROR_LOGIN'] . " (" . $errCode[1] . ")";
             } else {
                 echo $mod_strings['_LBL_FAX_SETTINGS_CONNECTIVITY_OK'];
             }
         }
     } else {
         if ($_REQUEST["command"] == "addtemplate") {
             Accounting::addTemplate($_REQUEST["name"], $_REQUEST["body"]);
         } else {
             if ($_REQUEST["command"] == "savetemplate") {
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:31,代码来源:SettingsUpdate.php

示例15: displayCredits

function displayCredits($uid, $pid)
{
    $notes = htmlspecialchars(getCredits($pid));
    ?>
    <table class="creditsInfo">
        <tr>
            <td class='creditsInfo'>
                <strong>Credits: </strong> <?php 
    echo $notes;
    ?>
            </td>
            <td class='creditsInfo'>
                <a href="#" class="changeLink">[Change]</a>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                <form method="post" action="form-submit.php">
                    <input type="hidden" name="uid" value="<?php 
    echo $uid;
    ?>
" />
                    <input type="hidden" name="pid" value="<?php 
    echo $pid;
    ?>
" />
                    <input type="text" name="credits" maxlength="255" class="longin" value="<?php 
    echo $notes;
    ?>
"/>
                    <input type="submit" name="changeCredits" value="Change" />
                </form>
            </td>
        </tr>
    </table>
<?php 
}
开发者ID:paultag,项目名称:puzzle-editing,代码行数:37,代码来源:puzzle.php


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