• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getdbo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BackendClearEarnings

function BackendClearEarnings()
{
    //	debuglog(__FUNCTION__);
    $delay = time() - 150 * 60;
    $total_cleared = 0;
    $list = getdbolist('db_earnings', "status=1 and mature_time<{$delay}");
    foreach ($list as $earning) {
        $user = getdbo('db_accounts', $earning->userid);
        if (!$user) {
            $earning->delete();
            continue;
        }
        $coin = getdbo('db_coins', $earning->coinid);
        if (!$coin) {
            $earning->delete();
            continue;
        }
        $earning->status = 2;
        // cleared
        $earning->price = $coin->price;
        $earning->save();
        // 		$refcoin = getdbo('db_coins', $user->coinid);
        // 		if($refcoin && $refcoin->price<=0) continue;
        // 		$value = $earning->amount * $coin->price / ($refcoin? $refcoin->price: 1);
        $value = yaamp_convert_amount_user($coin, $earning->amount, $user);
        $user->balance += $value;
        $user->save();
        if ($user->coinid == 6) {
            $total_cleared += $value;
        }
    }
    if ($total_cleared > 0) {
        debuglog("total cleared from mining {$total_cleared} BTC");
    }
}
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:35,代码来源:clear.php


示例2: actionIndex

 public function actionIndex()
 {
     if (isset($_COOKIE['mainbtc'])) {
         return;
     }
     if (!LimitRequest('explorer')) {
         return;
     }
     $id = getiparam('id');
     $coin = getdbo('db_coins', $id);
     $height = getparam('height');
     if ($coin && intval($height) > 0) {
         $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
         $hash = $remote->getblockhash(intval($height));
     } else {
         $hash = getparam('hash');
     }
     $txid = getparam('txid');
     if ($coin && !empty($txid) && ctype_alnum($txid)) {
         $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
         $tx = $remote->getrawtransaction($txid, 1);
         $hash = $tx['blockhash'];
     }
     if ($coin && !empty($hash) && ctype_alnum($hash)) {
         $this->render('block', array('coin' => $coin, 'hash' => substr($hash, 0, 64)));
     } else {
         if ($coin) {
             $this->render('coin', array('coin' => $coin));
         } else {
             $this->render('index');
         }
     }
 }
开发者ID:zarethernet,项目名称:yaamp,代码行数:33,代码来源:ExplorerController.php


示例3: actionUpdate

 public function actionUpdate()
 {
     if (!$this->admin) {
         return;
     }
     $coin = getdbo('db_coins', getiparam('id'));
     if (isset($_POST['db_coins'])) {
         $coin->attributes = $_POST['db_coins'];
         if ($coin->save()) {
             $this->redirect(array('index'));
         }
     }
     $this->render('_form', array('coin' => $coin, 'update' => true));
 }
开发者ID:zarethernet,项目名称:yaamp,代码行数:14,代码来源:CoinController.php


示例4: actionStop

 public function actionStop()
 {
     if (!$this->admin) {
         return;
     }
     $id = getiparam('id');
     $nicehash = getdbo('db_nicehash', $id);
     if (!$nicehash) {
         return;
     }
     $nicehash->active = false;
     $nicehash->save();
     $this->goback();
 }
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:14,代码来源:NicehashController.php


示例5: showUser

function showUser($userid, $what)
{
    $user = getdbo('db_accounts', $userid);
    if (!$user) {
        return;
    }
    $d = datetoa2($user->last_login);
    $balance = bitcoinvaluetoa($user->balance);
    $paid = dboscalar("select sum(amount) from payouts where account_id={$user->id}");
    $paid = bitcoinvaluetoa($paid);
    $t = time() - 24 * 60 * 60;
    $miner_count = getdbocount('db_workers', "userid={$user->id}");
    $share_count = getdbocount('db_shares', "userid={$user->id}");
    $block_count = getdbocount('db_blocks', "userid={$user->id} and time>{$t}");
    $coin = getdbo('db_coins', $user->coinid);
    echo "<tr class='ssrow'>";
    if ($coin) {
        echo "<td><img src='{$coin->image}' width=16> {$coin->symbol}</td>";
    } else {
        echo "<td></td>";
    }
    echo "<td>{$user->id}</td>";
    echo "<td><a href='/site?address={$user->username}'>{$user->username}</a></td>";
    echo "<td>{$what}</td>";
    echo "<td>{$d}</td>";
    echo "<td>{$block_count}</td>";
    echo "<td>{$balance}</td>";
    if (intval($paid) > 0.01) {
        echo "<td><b>{$paid}</b></td>";
    } else {
        echo "<td>{$paid}</td>";
    }
    echo "<td>{$miner_count}</td>";
    echo "<td>{$share_count}</td>";
    if ($user->is_locked) {
        echo "<td>locked</td>";
        echo "<td><a href='/site/unblockuser?wallet={$user->username}'>unblock</a></td>";
    } else {
        echo "<td></td>";
        echo "<td><a href='/site/blockuser?wallet={$user->username}'>block</a></td>";
    }
    echo "</tr>";
}
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:43,代码来源:monsters.php


示例6: BackendProcessList

function BackendProcessList()
{
    $list = dbolist("show processlist");
    foreach ($list as $item) {
        $conn = getdbo('db_connections', $item['Id']);
        if (!$conn) {
            $conn = new db_connections();
            $conn->id = $item['Id'];
            $conn->user = $item['User'];
            $conn->host = $item['Host'];
            $conn->db = $item['db'];
            $conn->created = time();
        }
        $conn->idle = $item['Time'];
        $conn->last = time();
        $conn->save();
    }
    $delay = time() - 5 * 60;
    dborun("delete from connections where last<{$delay}");
}
开发者ID:zarethernet,项目名称:yaamp,代码行数:20,代码来源:system.php


示例7: actionSellto

 public function actionSellto()
 {
     if (!$this->admin) {
         return;
     }
     $market = getdbo('db_markets', getiparam('id'));
     $coin = getdbo('db_coins', $market->coinid);
     $amount = getparam('amount');
     $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
     $info = $remote->getinfo();
     if (!$info || !$info['balance']) {
         return false;
     }
     $deposit_info = $remote->validateaddress($market->deposit_address);
     if (!$deposit_info || !isset($deposit_info['isvalid']) || !$deposit_info['isvalid']) {
         user()->setFlash('error', "invalid address {$coin->name}, {$market->deposit_address}");
         $this->redirect(array('site/coin', 'id' => $coin->id));
     }
     $amount = min($amount, $info['balance'] - $info['paytxfee']);
     //		$amount = max($amount, $info['balance'] - $info['paytxfee']);
     $amount = round($amount, 8);
     debuglog("selling ({$market->deposit_address}, {$amount})");
     $tx = $remote->sendtoaddress($market->deposit_address, $amount);
     if (!$tx) {
         user()->setFlash('error', $remote->error);
         $this->redirect(array('site/coin', 'id' => $coin->id));
     }
     $exchange = new db_exchange();
     $exchange->market = $market->name;
     $exchange->coinid = $coin->id;
     $exchange->send_time = time();
     $exchange->quantity = $amount;
     $exchange->price_estimate = $coin->price;
     $exchange->status = 'waiting';
     $exchange->tx = $tx;
     $exchange->save();
     $this->redirect(array('site/coin', 'id' => $coin->id));
 }
开发者ID:zarethernet,项目名称:yaamp,代码行数:38,代码来源:MarketController.php


示例8: delete_block

function delete_block()
{
    global $COLLATE;
    global $block_id;
    $dbo = getdbo();
    $block_ids = array();
    $block_ids[] = $block_id;
    $sql = "SELECT name FROM blocks WHERE id='{$block_id}'";
    $result = $dbo->query($sql);
    if ($result->rowCount() != '1') {
        header("HTTP/1.1 400 Bad Request");
        echo $COLLATE['languages']['selected']['selectblock'];
        exit;
    }
    $name = $result->fetchColumn();
    collate_log("4", "Block {$name} has been deleted!");
    if (find_child_blocks($block_id) !== false) {
        # this is a recursive function
        $block_ids = array_merge($block_ids, find_child_blocks($block_id));
    }
    foreach ($block_ids as $block_id) {
        // First delete all static IPs
        $sql = "DELETE FROM statics WHERE subnet_id IN (SELECT id FROM subnets WHERE block_id='{$block_id}')";
        $dbo->query($sql);
        // Next, remove the DHCP ACLs
        $sql = "DELETE FROM acl WHERE subnet_id IN (SELECT id FROM subnets WHERE block_id='{$block_id}')";
        $dbo->query($sql);
        // Next, remove the subnets
        $sql = "DELETE FROM subnets WHERE block_id='{$block_id}'";
        $dbo->query($sql);
        // Lastly, delete the IP block
        $sql = "DELETE FROM blocks WHERE id='{$block_id}'";
        $dbo->query($sql);
    }
    # we don't output to the user on success. The row fades on the page to provide feedback.
}
开发者ID:edblighter,项目名称:collate-network,代码行数:36,代码来源:_blocks.php


示例9: BackendStatsUpdate

function BackendStatsUpdate()
{
    //	debuglog(__FUNCTION__);
    //	$t1xx = microtime(true);
    $t = time() - 2 * 60;
    $errors = '';
    $list = getdbolist('db_stratums', "time<{$t}");
    foreach ($list as $stratum) {
        debuglog("stratum {$stratum->algo} terminated");
        $errors .= "{$stratum->algo}, ";
    }
    if (!empty($errors)) {
        send_email_alert('stratums', "stratums restarted {$errors}", "stratums were restarted: {$errors}");
    }
    dborun("delete from stratums where time<{$t}");
    dborun("delete from workers where pid not in (select pid from stratums)");
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // long term stats
    $t = floor(time() / 60 / 60) * 60 * 60;
    foreach (yaamp_get_algos() as $algo) {
        $pool_rate = yaamp_pool_rate($algo);
        $stats = getdbosql('db_hashstats', "time={$t} and algo=:algo", array(':algo' => $algo));
        if (!$stats) {
            $stats = new db_hashstats();
            $stats->time = $t;
            $stats->hashrate = $pool_rate;
            $stats->algo = $algo;
        } else {
            $percent = 1;
            $stats->hashrate = round(($stats->hashrate * (100 - $percent) + $pool_rate * $percent) / 100);
        }
        $stats->earnings = dboscalar("select sum(amount*price) from blocks where time>{$t} and category!='orphan' and algo=:algo", array(':algo' => $algo));
        $stats->save();
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    // short term stats
    $step = 15;
    $t = floor(time() / $step / 60) * $step * 60;
    foreach (yaamp_get_algos() as $algo) {
        $stats = getdbosql('db_hashrate', "time={$t} and algo=:algo", array(':algo' => $algo));
        if (!$stats) {
            $stats = new db_hashrate();
            $stats->time = $t;
            $stats->hashrate = dboscalar("select hashrate from hashrate where algo=:algo order by time desc limit 1", array(':algo' => $algo));
            $stats->hashrate_bad = 0;
            //dboscalar("select hashrate_bad from hashrate where algo=:algo order by time desc limit 1", array(':algo'=>$algo));
            $stats->price = dboscalar("select price from hashrate where algo=:algo order by time desc limit 1", array(':algo' => $algo));
            $stats->rent = dboscalar("select rent from hashrate where algo=:algo order by time desc limit 1", array(':algo' => $algo));
            $stats->algo = $algo;
        }
        $pool_rate = yaamp_pool_rate($algo);
        $stats->hashrate = $pool_rate;
        //round(($stats->hashrate*(100-$percent) + $pool_rate*$percent) / 100);
        $pool_rate_bad = yaamp_pool_rate_bad($algo);
        $stats->hashrate_bad = $pool_rate_bad;
        //round(($stats->hashrate_bad*(100-$percent) + $pool_rate_bad*$percent) / 100);
        if ($stats->hashrate < 1000) {
            $stats->hashrate = 0;
        }
        $t1 = time() - 5 * 60;
        $total_rentable = dboscalar("select sum(difficulty) from shares where valid and extranonce1 and algo=:algo and time>{$t1}", array(':algo' => $algo));
        $total_diff = dboscalar("select sum(difficulty) from shares where valid and algo=:algo and time>{$t1}", array(':algo' => $algo));
        $total_rented = 0;
        if (!$total_diff) {
            $t1 = time() - 15 * 60;
            $total_diff = dboscalar("select sum(difficulty) from shares where valid and algo=:algo and time>{$t1}", array(':algo' => $algo));
        }
        if ($total_diff > 0) {
            $price = 0;
            $rent = 0;
            $list = dbolist("select coinid, sum(difficulty) as d from shares where valid and algo=:algo and time>{$t1} group by coinid", array(':algo' => $algo));
            foreach ($list as $item) {
                if ($item['coinid'] == 0) {
                    if (!$total_rentable) {
                        continue;
                    }
                    $total_rented = $item['d'];
                    $price += $stats->rent * $item['d'] / $total_diff;
                    $rent += $stats->rent * $item['d'] / $total_rentable;
                } else {
                    $coin = getdbo('db_coins', $item['coinid']);
                    if (!$coin) {
                        continue;
                    }
                    $btcghd = yaamp_profitability($coin);
                    $price += $btcghd * $item['d'] / $total_diff;
                    $rent += $btcghd * $item['d'] / $total_diff;
                }
            }
            $percent = 33;
            $rent = max($price, ($stats->rent * (100 - $percent) + $rent * $percent) / 100);
            $target = yaamp_hashrate_constant($algo);
            $interval = yaamp_hashrate_step();
            $aa = $total_rentable * $target / $interval / 1000;
            $bb = dboscalar("select sum(speed) from jobs where active and ready and price>{$rent} and algo=:algo", array(':algo' => $algo));
            if ($total_rented * 1.3 < $total_rentable || $bb > $aa) {
                $rent += $price * YAAMP_FEES_RENTING / 100;
            } else {
                $rent -= $price * YAAMP_FEES_RENTING / 100;
            }
//.........这里部分代码省略.........
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:101,代码来源:stats.php


示例10: updateJubiMarkets

function updateJubiMarkets()
{
    $btc = jubi_api_query('ticker', "?coin=btc");
    if (!$btc) {
        continue;
    }
    $list = getdbolist('db_markets', "name='jubi'");
    foreach ($list as $market) {
        $coin = getdbo('db_coins', $market->coinid);
        if (!$coin) {
            continue;
        }
        $lowsymbol = strtolower($coin->symbol);
        $ticker = jubi_api_query('ticker', "?coin={$lowsymbol}");
        if (!$ticker) {
            continue;
        }
        $ticker->buy /= $btc->sell;
        $ticker->sell /= $btc->buy;
        $price2 = ($ticker->buy + $ticker->sell) / 2;
        $market->price2 = AverageIncrement($market->price2, $price2);
        $market->price = AverageIncrement($market->price, $ticker->buy * 0.95);
        $market->save();
    }
}
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:25,代码来源:markets.php


示例11: time

echo "<th align=right>Last 7 Days</th>";
echo "<th align=right>Last 30 Days</th>";
echo "</tr>";
echo "</thead>";
$t1 = time() - 60 * 60;
$t2 = time() - 24 * 60 * 60;
$t3 = time() - 7 * 24 * 60 * 60;
$t4 = time() - 30 * 24 * 60 * 60;
$total1 = 0;
$total2 = 0;
$total3 = 0;
$total4 = 0;
$algo = user()->getState('yaamp-algo');
$list = dbolist("SELECT coin_id FROM blocks where category!='orphan' and time>{$t4} and coin_id in (select id from coins where algo=:algo) group by coin_id order by id desc", array(':algo' => $algo));
foreach ($list as $item) {
    $coin = getdbo('db_coins', $item['coin_id']);
    if ($coin->symbol == 'BTC') {
        continue;
    }
    $res1 = controller()->memcache->get_database_row("history_item1-{$coin->id}-{$algo}", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>{$t1} and coin_id={$coin->id} and algo=:algo", array(':algo' => $algo));
    $res2 = controller()->memcache->get_database_row("history_item2-{$coin->id}-{$algo}", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>{$t2} and coin_id={$coin->id} and algo=:algo", array(':algo' => $algo));
    $res3 = controller()->memcache->get_database_row("history_item3-{$coin->id}-{$algo}", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>{$t3} and coin_id={$coin->id} and algo=:algo", array(':algo' => $algo));
    $res4 = controller()->memcache->get_database_row("history_item4-{$coin->id}-{$algo}", "select count(*) as a, sum(amount*price) as b from blocks where category!='orphan' and time>{$t4} and coin_id={$coin->id} and algo=:algo", array(':algo' => $algo));
    $total1 += $res1['b'];
    $total2 += $res2['b'];
    $total3 += $res3['b'];
    $total4 += $res4['b'];
    $name = substr($coin->name, 0, 12);
    echo "<tr class='ssrow'>";
    echo "<td width=18><img width=16 src='{$coin->image}'></td>";
    echo "<td><b><a href='/site/block?id={$coin->id}'>{$name}</a></b></td>";
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:31,代码来源:history_results.php


示例12: yaamp_job_rate_bad

function yaamp_job_rate_bad($jobid)
{
    $job = getdbo('db_jobs', $jobid);
    if (!$job) {
        return 0;
    }
    $target = yaamp_hashrate_constant($job->algo);
    $interval = yaamp_hashrate_step();
    $delay = time() - $interval;
    $rate = controller()->memcache->get_database_scalar("yaamp_job_rate_bad-{$jobid}", "select sum(difficulty) * {$target} / {$interval} / 1000 from jobsubmits where not valid and time>{$delay} and jobid={$jobid}");
    return $rate;
}
开发者ID:zarethernet,项目名称:yaamp,代码行数:12,代码来源:yaamp.php


示例13: doBittrexTrading

function doBittrexTrading($quick = false)
{
    $flushall = rand(0, 4) == 0;
    if ($quick) {
        $flushall = false;
    }
    //	debuglog("-------------- doBittrexTrading() flushall $flushall");
    $orders = bittrex_api_query('market/getopenorders');
    if (!$orders || !$orders->success) {
        return;
    }
    foreach ($orders->result as $order) {
        $symbol = substr($order->Exchange, 4);
        $pair = $order->Exchange;
        $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol' => $symbol));
        if (!$coin) {
            continue;
        }
        if ($coin->dontsell) {
            continue;
        }
        $ticker = bittrex_api_query('public/getticker', "&market={$order->Exchange}");
        if (!$ticker || !$ticker->success || !$ticker->result) {
            continue;
        }
        $ask = bitcoinvaluetoa($ticker->result->Ask);
        $sellprice = bitcoinvaluetoa($order->Limit);
        // flush orders not on the ask
        if ($ask + 5.0E-8 < $sellprice || $flushall) {
            // 			debuglog("bittrex cancel order $order->Exchange $sellprice -> $ask");
            bittrex_api_query('market/cancel', "&uuid={$order->OrderUuid}");
            $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid' => $order->OrderUuid));
            if ($db_order) {
                $db_order->delete();
            }
            sleep(1);
        } else {
            $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid' => $order->OrderUuid));
            if ($db_order) {
                continue;
            }
            debuglog("adding order {$coin->symbol}");
            //	$ticker = bittrex_api_query('public/getticker', "&market=$pair");
            //	$sellprice = bitcoinvaluetoa($ticker->result->Ask);
            $db_order = new db_orders();
            $db_order->market = 'bittrex';
            $db_order->coinid = $coin->id;
            $db_order->amount = $order->Quantity;
            $db_order->price = $sellprice;
            $db_order->ask = $ticker->result->Ask;
            $db_order->bid = $ticker->result->Bid;
            $db_order->uuid = $order->OrderUuid;
            $db_order->created = time();
            $db_order->save();
        }
    }
    // flush obsolete orders
    $list = getdbolist('db_orders', "market='bittrex'");
    foreach ($list as $db_order) {
        $coin = getdbo('db_coins', $db_order->coinid);
        if (!$coin) {
            continue;
        }
        $found = false;
        foreach ($orders->result as $order) {
            if ($order->OrderUuid == $db_order->uuid) {
                $found = true;
                break;
            }
        }
        if (!$found) {
            debuglog("bittrex deleting order {$coin->name} {$db_order->amount}");
            $db_order->delete();
        }
    }
    // 	if($flushall)
    // 	{
    // 		debuglog("bittrex flushall");
    // 		return;
    // 	}
    sleep(2);
    // add orders
    $balances = bittrex_api_query('account/getbalances');
    if (!$balances || !isset($balances->result) || !$balances->success) {
        return;
    }
    $savebalance = getdbosql('db_balances', "name='bittrex'");
    $savebalance->balance = 0;
    foreach ($balances->result as $balance) {
        if ($balance->Currency == 'BTC') {
            $savebalance->balance = $balance->Available;
            continue;
        }
        $amount = floatval($balance->Available);
        if (!$amount) {
            continue;
        }
        //	debuglog($balance->Currency);
        $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol' => $balance->Currency));
        if (!$coin || $coin->dontsell) {
//.........这里部分代码省略.........
开发者ID:zarethernet,项目名称:yaamp,代码行数:101,代码来源:bittrex_trading.php


示例14: foreach

<div class="main-left-title">Search Wallet:</div>
<div class="main-left-inner">
<form action="/" method="get" style="padding: 10px;">
<input type="text" name="address" class="main-text-input" placeholder="Wallet Address">
<input type="submit" value="Submit" class="main-submit-button" ><br><br>
END;
echo "<table class='dataGrid2'>";
foreach ($recents as $address) {
    if (empty($address)) {
        continue;
    }
    $user = getuserparam($address);
    if (!$user) {
        continue;
    }
    $coin = getdbo('db_coins', $user->coinid);
    if ($user->username == $username) {
        echo "<tr style='background-color: #e0d3e8;'><td width=24>";
    } else {
        echo "<tr class='ssrow'><td width=24>";
    }
    if ($coin) {
        echo "<img width=16 src='{$coin->image}'>";
    } else {
        echo "<img width=16 src='/images/base/delete.png'>";
    }
    echo "</td><td><a href='/?address={$address}' style='font-family: monospace; font-size: 1.1em;'>{$address}</a></td>";
    $balance = bitcoinvaluetoa($user->balance);
    if ($coin) {
        $balance = $balance > 0 ? "{$balance} {$coin->symbol}" : '';
    } else {
开发者ID:zarethernet,项目名称:yaamp,代码行数:31,代码来源:wallet.php


示例15: delete_acl

function delete_acl()
{
    global $COLLATE;
    $dbo = getdbo();
    $acl_id = isset($_GET['acl_id']) && is_numeric($_GET['acl_id']) ? $_GET['acl_id'] : '';
    if (empty($acl_id)) {
        header("HTTP/1.1 400 Bad Request");
        echo $COLLATE['languages']['selected']['invalidrequest'];
        exit;
    }
    $sql = "SELECT name FROM subnets WHERE id=(SELECT subnet_id FROM acl WHERE id='{$acl_id}')";
    $result = $dbo->query($sql);
    if ($result->rowCount() != '1') {
        header("HTTP/1.1 400 Bad Request");
        echo $COLLATE['languages']['selected']['invalidrequest'];
        exit;
    }
    $subnet_name = $result->fetchColumn();
    collate_log('3', "ACL Statement #{$acl_id} deleted in {$subnet_name} subnet");
    $sql = "DELETE FROM acl WHERE id='{$acl_id}'";
    $dbo->query($sql);
    exit;
}
开发者ID:edblighter,项目名称:collate-network,代码行数:23,代码来源:_statics.php


示例16: foreach

echo "<th width=20></th>";
echo "<th>Name</th>";
echo "<th>Time</th>";
echo "<th>Height</th>";
echo "<th>Amount</th>";
echo "<th>Status</th>";
echo "<th>Difficulty</th>";
echo "<th>Found Diff</th>";
echo "<th>Blockhash</th>";
echo "</tr>";
echo "</thead><tbody>";
foreach ($db_blocks as $db_block) {
    if (!$db_block->coin_id) {
        continue;
    }
    $coin = getdbo('db_coins', $db_block->coin_id);
    if (!$coin) {
        continue;
    }
    //	$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
    // 	$blockext = $remote->getblock($db_block->blockhash);
    // 	$tx = $remote->gettransaction($blockext['tx'][0]);
    // 	$db_block->category = $tx['details'][0]['category'];
    if ($db_block->category == 'immature') {
        echo "<tr style='background-color: #e0d3e8;'>";
    } else {
        echo "<tr class='ssrow'>";
    }
    echo "<td><img width=16 src='{$coin->image}'></td>";
    echo "<td><b>{$coin->name} ({$coin->symbol})</b></td>";
    //	$db_block->confirmations = $blockext['confirmations'];
开发者ID:zarethernet,项目名称:yaamp,代码行数:31,代码来源:block_results.php


示例17: foreach

echo "<br><table class='dataGrid'>";
echo "<thead>";
echo "<tr>";
echo "<th width=20></th>";
echo "<th>Name</th>";
echo "<th>Market</th>";
echo "<th>Created</th>";
echo "<th>Quantity</th>";
echo "<th>Estimate</th>";
echo "<th>Sold Price</th>";
echo "<th>Value</th>";
echo "<th></th>";
echo "</tr>";
echo "</thead><tbody>";
foreach ($exchanges as $exchange) {
    $coin = getdbo('db_coins', $exchange->coinid);
    $lowsymbol = strtolower($coin->symbol);
    if ($exchange->market == 'cryptsy') {
        $marketurl = "https://www.cryptsy.com/markets/view/{$coin->symbol}_BTC";
    } else {
        if ($exchange->market == 'bittrex') {
            $marketurl = "https://bittrex.com/Market/Index?MarketName=BTC-{$coin->symbol}";
        } else {
            if ($exchange->market == 'mintpal') {
                $marketurl = "https://www.mintpal.com/market/{$coin->symbol}/BTC";
            } else {
                if ($exchange->market == 'poloniex') {
                    $marketurl = "https://poloniex.com/exchange/btc_{$coin->symbol}";
                } else {
                    if ($exchange->market == 'c-cex') {
                        $marketurl = "https://c-cex.com/?p={$lowsymbol}-btc";
开发者ID:zarethernet,项目名称:yaamp,代码行数:31,代码来源:exchange_results.php


示例18: getdbolist

echo "<th>Algo</th>";
echo "<th>Host</th>";
echo "<th>Max Price</th>";
echo "<th>Max Hash</th>";
echo "<th>Current Hash</th>";
echo "<th>Difficulty</th>";
echo "<th>Ready</th>";
echo "<th>Active</th>";
echo "</tr>";
echo "</thead><tbody>";
$list = getdbolist('db_jobs', "ready");
foreach ($list as $job) {
    $hashrate = yaamp_job_rate($job->id);
    $hashrate = $hashrate ? Itoa2($hashrate) . 'h/s' : '';
    $speed = Itoa2($job->speed) . 'h/s';
    $renter = getdbo('db_renters', $job->renterid);
    if (!$renter) {
        continue;
    }
    if ($deposit == $renter->address) {
        echo "<tr class='ssrow' style='background-color: #dfd'>";
    } else {
        echo "<tr class='ssrow'>";
    }
    echo "<td>{$job->renterid}</td>";
    echo "<td>{$job->id}</td>";
    echo "<td><a href='/renting?address={$renter->address}'>{$renter->address}</a></td>";
    echo "<td>{$job->algo}</td>";
    echo "<td>{$job->host}:{$job->port}</td>";
    echo "<td>{$job->price}</td>";
    echo "<td>{$speed}</td>";
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:31,代码来源:admin.php


示例19: BackendCoinPayments

function BackendCoinPayments($coin)
{
    //	debuglog("BackendCoinPayments $coin->symbol");
    $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
    $info = $remote->getinfo();
    if (!$info) {
        debuglog("{$coin->symbol} cant connect to coin");
        return;
    }
    $min = 0.001;
    // 	if(date("w", time()) == 0 && date("H", time()) > 12)		// sunday afternoon
    // 		$min = 0.0001;
    $users = getdbolist('db_accounts', "balance>{$min} and coinid={$coin->id}");
    if ($coin->symbol == 'MUE' || $coin->symbol == 'DIME') {
        foreach ($users as $user) {
            $user = getdbo('db_accounts', $user->id);
            if (!$user) {
                continue;
            }
            $amount = $user->balance;
            while ($user->balance > $min && $amount > $min) {
                debuglog("{$coin->symbol} sendtoaddress {$user->username} {$amount}");
                $tx = $remote->sendtoaddress($user->username, round($amount, 8));
                if (!$tx) {
                    debuglog("error {$remote->error}, {$user->username}, {$amount}");
                    if ($remote->error == 'transaction too large' || $remote->error == 'invalid amount') {
                        $amount /= 2;
                        continue;
                    }
                    break;
                }
                $payout = new db_payouts();
                $payout->account_id = $user->id;
                $payout->time = time();
                $payout->amount = bitcoinvaluetoa($amount);
                $payout->fee = 0;
                $payout->tx = $tx;
                $payout->save();
                $user->balance -= $amount;
                $user->save();
            }
        }
        debuglog("payment done");
        return;
    }
    $total_to_pay = 0;
    $addresses = array();
    foreach ($users as $user) {
        $total_to_pay += round($user->balance, 8);
        $addresses[$user->username] = round($user->balance, 8);
    }
    if (!$total_to_pay) {
        //	debuglog("nothing to pay");
        return;
    }
    if ($info['balance'] - 0.001 < $total_to_pay) {
        debuglog("{$coin->symbol} wallet insufficient funds for payment {$info['balance']} < {$total_to_pay}");
        return;
    }
    if ($coin->symbol == 'BTC') {
        global $cold_wallet_table;
        $balance = $info['balance'];
        $stats = getdbosql('db_stats', "1 order by time desc");
        $renter = dboscalar("select sum(balance) from renters");
        $pie = $balance - $total_to_pay - $renter - 1;
        debuglog("pie to split is {$pie}");
        if ($pie > 0) {
            foreach ($cold_wallet_table as $coldwallet => $percent) {
                $coldamount = round($pie * $percent, 8);
                if ($coldamount < $min) {
                    break;
                }
                debuglog("paying cold wallet {$coldwallet} {$coldamount}");
                $addresses[$coldwallet] = $coldamount;
                $total_to_pay += $coldamount;
            }
        }
    }
    debuglog("paying {$total_to_pay} {$coin->symbol} min is {$min}");
    $tx = $remote->sendmany('', $addresses, 1, '');
    if (!$tx) {
        debuglog($remote->error);
        return;
    }
    foreach ($users as $user) {
        $user = getdbo('db_accounts', $user->id);
        if (!$user) {
            continue;
        }
        $payout = new db_payouts();
        $payout->account_id = $user->id;
        $payout->time = time();
        $payout->amount = bitcoinvaluetoa($user->balance);
        $payout->fee = 0;
        $payout->tx = $tx;
        $payout->save();
        $user->balance = 0;
        $user->save();
    }
    debuglog("payment done");
//.........这里部分代码省略.........
开发者ID:zarethernet,项目名称:yaamp,代码行数:101,代码来源:payment.php


示例20: dbolist

<?php

echo "<br><table class='dataGrid'>";
echo "<thead>";
echo "<tr>";
echo "<th>Coin</th>";
echo "<th>Market</th>";
echo "<th>Price</th>";
echo "<th>Message</th>";
echo "<th>Deposit</th>";
echo "</tr>";
echo "</thead><tbody>";
$list = dbolist("SELECT coins.id as coinid, markets.id as marketid FROM coins, markets WHERE coins.installed AND \r\n\tcoins.id=markets.coinid AND (markets.deposit_address IS NULL or (message is not null and message!='')) order by markets.id desc");
foreach ($list as $item) {
    $coin = getdbo('db_coins', $item['coinid']);
    $market = getdbo('db_markets', $item['marketid']);
    echo "<tr class='ssrow'>";
    echo "<td><a href='/site/coin?id={$coin->id}'>{$coin->name}</a></td>";
    echo "<td>{$market->name}</td>";
    echo "<td>{$market->price}</td>";
    echo "<td>{$market->message}</td>";
    echo "<td>{$market->deposit_address}</td>";
    echo "</tr>";
}
echo "</tbody></table>";
echo '<br><br><br><br><br><br><br><br><br><br>';
echo '<br><br><br><br><br><br><br><br><br><br>';
开发者ID:zarethernet,项目名称:yaamp,代码行数:27,代码来源:emptymarkets.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getdbolist函数代码示例发布时间:2022-05-15
下一篇:
PHP getdbname函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap