function funct_Billing_JSONRPC_ListAccounts($intConfirmationsCountMin) { //give address and minimum confirmations it must have and get the balance of that address if (!$intConfirmationsCountMin) { $intConfirmationsCountMin = 0; } $mybtc = new jsonRPCClient(JSONRPC_CONNECTIONSTRING); try { //return print_r($mybtc->listaccounts($intConfirmationsCountMin) ); $objJSON = $mybtc->listaccounts($intConfirmationsCountMin); return $objJSON; } catch (Exception $e) { echo nl2br($e->getMessage()) . '<br />' . "\n"; } }
ユーザー名: <input type=text size="40" name="username" value=""><br /> <input type="submit" name="param" value="アドレス取得"> <input type="submit" name="param" value="入金チェック"> </form> <?php require_once __DIR__ . '/jsonRPCClient.php'; $host = 'localhost'; /* monacoind 又は monacoin-qt を実行中のホストのアドレス */ $rpcuser = '******'; /* monacoin.conf で指定した rpcユーザー名 */ $rpcpassword = '******'; /* monacoin.conf で指定した rpcパスワード */ $rpcport = '4000'; /* monacoin.conf で指定した rpcポート */ $historyNum = 50; /* 取得するトランザクション数 */ /* monacoind への接続アドレス */ $coindaddr = "http://{$rpcuser}:{$rpcpassword}@{$host}:{$rpcport}/"; $coind = new jsonRPCClient($coindaddr); $info = $coind->getinfo(); echo "Balance: <div id=balance>{$info['balance']}</div>"; $list = $coind->listaccounts(); print_r($list); ?> <div id="COUNTDOWN">0</div> <div id="BTCMONA">wait</div> </body> </html>
?> <h1 class="pageheading">Bitcoin Accounts</h1> <table border="0"> <tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" align="center">Account</td><td class="dataTableHeadingContent">Address</td><td class="dataTableHeadingContent">Balance</td></tr> <?php try { $bitcoin->getinfo(); } catch (Exception $e) { echo 'Error: Bitcoin server is down. Please email system administrator.'; $down = true; } if (!$down) { global $db; $accounts = $bitcoin->listaccounts(); //print_r($accounts); $count = 0; foreach ($accounts as $a => $t) { //if($a!==''){ $bc = $bitcoin->getaddressesbyaccount($a); print '<tr><td align="left">' . $a . '</td><td border="1px">'; foreach ($bc as $b) { $v = $bitcoin->getreceivedbyaddress($b); print $b . '<br />'; $sql = 'SELECT * FROM ' . TABLE_ORDERS_STATUS_HISTORY . ' AS osh LEFT JOIN ' . TABLE_ORDERS_STATUS . ' AS os ON os.orders_status_id = osh.orders_status_id WHERE os.orders_status_name = "' . Pending . '" AND osh.comments LIKE "%' . $b . '%"'; $result = $db->Execute($sql); if ($result->RecordCount() > 0) { while (!$result->EOF) { $sql = 'SELECT * FROM ' . TABLE_ORDERS . ' LEFT JOIN ' . TABLE_ORDERS_STATUS . ' on orders_status_id WHERE orders_id = ' . $result->fields['orders_id'] . ' AND orders_status = "1"'; $order = $db->Execute($sql);