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


PHP account::setBalance方法代码示例

本文整理汇总了PHP中account::setBalance方法的典型用法代码示例。如果您正苦于以下问题:PHP account::setBalance方法的具体用法?PHP account::setBalance怎么用?PHP account::setBalance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account的用法示例。


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

示例1: header

                    $fullname = helper::clearText($fullname);
                    $fullname = helper::escapeText($fullname);
                    $location = helper::clearText($location);
                    $location = helper::escapeText($location);
                    $balance = helper::clearInt($balance);
                    $fb_page = helper::clearText($fb_page);
                    $fb_page = helper::escapeText($fb_page);
                    $instagram_page = helper::clearText($instagram_page);
                    $instagram_page = helper::escapeText($instagram_page);
                    $email = helper::clearText($email);
                    $email = helper::escapeText($email);
                    if ($authToken === helper::getAuthenticityToken()) {
                        $account->setUsername($username);
                        $account->setFullname($fullname);
                        $account->setLocation($location);
                        $account->setBalance($balance);
                        $account->setFacebookPage($fb_page);
                        $account->setInstagramPage($instagram_page);
                        $account->setEmail($email);
                    }
                }
                header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
                exit;
        }
    }
} else {
    header("Location: /admin/main.php");
}
if ($accountInfo['error'] === true) {
    header("Location: /admin/main.php");
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:profile.php

示例2: array

    $giftId = helper::clearInt($giftId);
    $giftAnonymous = helper::clearInt($giftAnonymous);
    $giftTo = helper::clearInt($giftTo);
    $message = helper::clearText($message);
    $message = preg_replace("/[\r\n]+/", "<br>", $message);
    //replace all new lines to one new line
    $message = preg_replace('/\\s+/', ' ', $message);
    //replace all white spaces to one space
    $message = helper::escapeText($message);
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $gift = new gift($dbo);
    $gift->setRequestFrom($accountId);
    $giftInfo = $gift->db_info($giftId);
    if ($giftInfo['error'] === false && $giftInfo['removeAt'] == 0) {
        $account = new account($dbo, $accountId);
        $balance = $account->getBalance();
        if ($balance == $giftInfo['cost'] || $balance > $giftInfo['cost']) {
            $result = $gift->send($giftId, $giftTo, $message, $giftAnonymous);
            if ($result['error'] === false) {
                $account->setBalance($balance - $giftInfo['cost']);
                $result['balance'] = $balance - $giftInfo['cost'];
            }
        }
    }
    echo json_encode($result);
    exit;
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:gifts.send.inc.php

示例3: isset

<?php

/*!
 * ifsoft.co.uk engine v1.0
 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
    $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $cost = isset($_POST['cost']) ? $_POST['cost'] : 0;
    $cost = helper::clearInt($cost);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $account = new account($dbo, $accountId);
    $balance = $account->getBalance();
    if ($balance >= $cost) {
        $account->setBalance($account->getBalance() - $cost);
        $result = $account->setAdmob(0);
    }
    echo json_encode($result);
    exit;
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:account.disableAds.inc.php

示例4: isset

<?php

/*!
 * ifsoft.co.uk engine v1.0
 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
    $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $funds = isset($_POST['funds']) ? $_POST['funds'] : 0;
    $funds = helper::clearInt($funds);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $account = new account($dbo, $accountId);
    $result = $account->setBalance($account->getBalance() + $funds);
    if ($result['error'] === false) {
        $result['balance'] = $account->getBalance();
    }
    echo json_encode($result);
    exit;
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:30,代码来源:account.addFunds.inc.php


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