"; echo "
$title
"; echo "
"; } $mining = getdbosql('db_mining'); $defaultalgo = user()->getState('yaamp-algo'); $show_details = getparam('showdetails'); $user = getuserparam(getparam('address')); if(!$user) return; WriteBoxHeader("Wallet: $user->username"); $refcoin = getdbo('db_coins', $user->coinid); if(!$refcoin) { if($user->coinid != null) echo "
This wallet address is not valid. You will not receive payments using this address.
"; $refcoin = getdbosql('db_coins', "symbol='BTC'"); } elseif ($user->coinid == 6 && $defaultalgo != 'sha256') { echo "
This pool does not convert/trade currencies. You will not receive payments using this BTC address.
"; return; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $total_pending = 0; if($show_details) { $t1 = microtime(true); $list = dbolist("select coinid from earnings where userid=$user->id group by coinid"); if(!count($list)) echo ""; else { // sort by value foreach($list as $item) { $coin = getdbo('db_coins', $item['coinid']); if(!$coin) continue; $name = substr($coin->name, 0, 12); $confirmed = controller()->memcache->get_database_scalar("wallet_confirmed-$user->id-$coin->id", "select sum(amount) from earnings where status=1 and userid=$user->id and coinid=$coin->id"); $unconfirmed = controller()->memcache->get_database_scalar("wallet_unconfirmed-$user->id-$coin->id", "select sum(amount) from earnings where status=0 and userid=$user->id and coinid=$coin->id"); $total = $confirmed + $unconfirmed; // $value = bitcoinvaluetoa($total * $coin->price / $refcoin->price); $value = bitcoinvaluetoa(yaamp_convert_amount_user($coin, $total, $user)); $confirmed = altcoinvaluetoa($confirmed); $unconfirmed = altcoinvaluetoa($unconfirmed); $total = altcoinvaluetoa($total); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } $d1 = microtime(true) - $t1; controller()->memcache->add_monitoring_function('wallet_results-1', $d1); } ////////////////////////////////////////////////////////////////////////////// // $confirmed = bitcoinvaluetoa(controller()->memcache->get_database_scalar("wallet_confirmed-$user->id", // "select sum(amount*price) from earnings where status=1 and userid=$user->id"))/$refcoin->price; // $unconfirmed = bitcoinvaluetoa(controller()->memcache->get_database_scalar("wallet_unconfirmed-$user->id", // "select sum(amount*price) from earnings where status=0 and userid=$user->id"))/$refcoin->price; $confirmed = yaamp_convert_earnings_user($user, "status=1"); $unconfirmed = yaamp_convert_earnings_user($user, "status=0"); $total_unsold = bitcoinvaluetoa($confirmed + $unconfirmed); $confirmed = $confirmed? bitcoinvaluetoa($confirmed): ''; $unconfirmed = $unconfirmed? bitcoinvaluetoa($unconfirmed): ''; //$total_usd = number_format($total_unsold*$mining->usdbtc*$refcoin->price, 3, '.', ' '); $total_pending = bitcoinvaluetoa($total_pending); if(!$show_details && $total_unsold > 0) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // //////////////////////////////////////////////////////////////////////////// $balance = bitcoinvaluetoa($user->balance); //$balance_usd = number_format($user->balance*$mining->usdbtc*$refcoin->price, 3, '.', ' '); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //////////////////////////////////////////////////////////////////////////// $total_unpaid = bitcoinvaluetoa($balance + $total_unsold); //$total_unpaid_usd = number_format($total_unpaid*$mining->usdbtc*$refcoin->price, 3, '.', ' '); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //////////////////////////////////////////////////////////////////////////// $total_paid = controller()->memcache->get_database_scalar("wallet_total_paid-$user->id", "select sum(amount) from payouts where account_id=$user->id"); $total_paid = bitcoinvaluetoa($total_paid); //$total_paid_usd = number_format($total_paid*$mining->usdbtc*$refcoin->price, 3, '.', ' '); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //////////////////////////////////////////////////////////////////////////// //$delay = 7*24*60*60; $total_earned = bitcoinvaluetoa($total_unsold + $balance + $total_paid); //$total_earned_usd = number_format($total_earned*$mining->usdbtc*$refcoin->price, 3, '.', ' '); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
NameImmatureConfirmedTotalValue*
-none-
$name ($coin->algo)$unconfirmed$confirmed$total$value $refcoin->symbol
"; if($refcoin->symbol == 'BTC') echo "$refcoin->name"; else echo "$refcoin->name"; echo "
(total pending)
$unconfirmed$confirmed$total_unsold $refcoin->symbol
 
Balance$balance $refcoin->symbol
Total Unpaid$total_unpaid $refcoin->symbol
Total Paid$total_paid $refcoin->symbol
Total Earned$total_earned $refcoin->symbol
"; echo "
"; $usd = number_format($mining->usdbtc, 2, '.', ' '); echo "

 * approximate from current exchange rates
 ** bitstamp $usd USD/BTC

"; echo "
"; WriteBoxHeader("Last 24 Hours Payouts: $user->username"); $t = time()-24*60*60; $list = getdbolist('db_payouts', "account_id=$user->id and time>$t order by time desc"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $total = 0; foreach($list as $payout) { $d = datetoa2($payout->time); $amount = bitcoinvaluetoa($payout->amount); $payout_tx = substr($payout->tx, 0, 36).'...'; echo ""; echo ""; echo ""; if($user->coinid == 6) $txurl = "https://blockchain.info/tx/$payout->tx"; else $txurl = "/explorer?id=$user->coinid&txid=$payout->tx"; echo ""; echo ""; $total += $payout->amount; } $amount = bitcoinvaluetoa($total); echo ""; echo ""; echo ""; echo ""; echo ""; echo "
TimeAmountTx
$d ago$amount$payout_tx
Total:$amount

"; echo ""; echo "
";