goback();
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
$reserved1 = dboscalar("select sum(balance) from accounts where coinid=$coin->id");
$reserved2 = dboscalar("select sum(amount*price) from earnings
where status!=2 and userid in (select id from accounts where coinid=$coin->id)");
$reserved = ($reserved1 + $reserved2) * 2;
$owed = dboscalar("select sum(amount) from earnings where status!=2 and coinid=$coin->id");
$owed_btc = $owed? bitcoinvaluetoa($owed*$coin->price): '';
$owed = $owed? altcoinvaluetoa($owed): '';
echo "cleared $reserved1, earnings $reserved2, reserved $reserved, balance $coin->balance, owed $owed, owned btc $owed_btc
";
//////////////////////////////////////////////////////////////////////////////////////
$list = getdbolist('db_markets', "coinid=$coin->id order by price desc");
echo "
Name | "; echo "Price | "; echo "Price2 | "; echo "Sent | "; echo "Traded | "; echo "Late | "; echo "Deposit | "; echo "Message | "; echo "
---|---|---|---|---|---|---|---|
$market->name | "; echo "$price | "; echo "$price2 | "; $sent = datetoa2($market->lastsent); $traded = datetoa2($market->lasttraded); $late = $sent > $traded? 'late': ''; echo "$sent ago | "; echo "$traded ago | "; echo "$late | "; echo "$market->deposit_address "; echo "edit "; echo "sell "; echo "del | "; echo "$market->message | "; echo "
"; echo " | "; echo " | Name | "; echo "Symbol | "; echo "Difficulty | "; echo "Blocks | "; echo "Balance | "; echo "BTC | "; echo "Conns | "; echo "Price | "; echo "Reward | "; echo "Index * | "; echo "|||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[ + ] | "; else echo "[ ] | "; echo "$coin->name | "; echo "$coin->symbol | "; $info = $remote->getinfo(); if(!$info) { echo "ERROR $remote->error"; return; } $errors = isset($info['errors'])? $info['errors']: ''; $balance = isset($info['balance'])? $info['balance']: ''; $txfee = isset($info['paytxfee'])? $info['paytxfee']: ''; $connections = isset($info['connections'])? $info['connections']: ''; $blocks = isset($info['blocks'])? $info['blocks']: ''; echo " | $coin->difficulty | "; if(!empty($errors)) echo "$blocks | "; else echo "$blocks | "; echo "$balance | "; $btc = $balance*$coin->price; echo "$btc | "; echo "$connections | "; echo "$coin->price | "; echo "$coin->reward | "; if($coin->difficulty) $index = round($coin->reward * $coin->price / $coin->difficulty * 10000, 3); echo "$index | "; echo "
Time | "; echo "Height | "; echo "Category | "; echo "Amount | "; echo "Confirmations | "; echo ""; echo " | ||
---|---|---|---|---|---|---|---|
$d | "; if($block) echo "{$block['height']} | "; else echo ""; echo " | {$transaction['category']} | "; echo "{$transaction['amount']} | "; if(isset($transaction['confirmations'])) echo "{$transaction['confirmations']} | "; else echo ""; echo " | ";
if(isset($transaction['address']))
{
$address = $transaction['address'];
echo "address $address "; } // if($block) foreach($block['tx'] as $i=>$tx) // echo "tx-$i $tx "; echo " | ";
echo "