goback();
$PoS = ($coin->algo == 'PoS'); // or if 'stake' key is present in 'getinfo' method
$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 = bitcoinvaluetoa(($reserved1 + $reserved2) * 2);
$reserved1 = altcoinvaluetoa($reserved1);
$reserved2 = bitcoinvaluetoa($reserved2);
$balance = altcoinvaluetoa($coin->balance);
$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 $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 = $market->lastsent > $market->lasttraded ? 'late': ''; echo ''.(empty($sent) ? "" : "$sent ago").' | '; echo ''.(empty($traded) ? "" : "$traded ago").' | '; echo ''.$late.' | '; echo ''; echo "edit "; echo "sell "; echo "del"; echo ' '.$market->deposit_address.' | '; echo "$market->message | "; echo "
"; echo " | "; echo " | Name | "; echo "Symbol | "; echo "Difficulty | "; echo "Blocks | "; echo "Balance | "; echo "BTC | "; if ($PoS) echo "Stake | "; echo "Conns | "; echo "Price | "; echo "Reward | "; echo "Index * | "; echo "
---|---|---|---|---|---|---|---|---|---|---|---|---|
[ + ] | "; else echo "[ ] | "; echo "$coin->name | "; echo "$coin->symbol | "; if(!$info) { echo "ERROR $remote->error | "; echo "
Time | "; echo "Category | "; echo "Amount | "; echo "Height | "; echo "Difficulty | "; echo "Confirm | "; echo "Address | "; echo "|||
---|---|---|---|---|---|---|---|---|---|
$d | "; echo "{$transaction['category']} | "; echo "{$transaction['amount']} | "; if($block) { echo "{$block['height']} | {$block['difficulty']} | "; } else echo ""; if(isset($transaction['confirmations'])) echo " | {$transaction['confirmations']} | "; else echo ""; echo " | ";
if(isset($transaction['address']))
{
$address = $transaction['address'];
echo "$address "; } // if($block) foreach($block['tx'] as $i=>$tx) // echo "tx-$i $tx "; echo " | ";
echo "