Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- JavascriptFile("/extensions/jqplot/jquery.jqplot.js");
- JavascriptFile("/extensions/jqplot/plugins/jqplot.dateAxisRenderer.js");
- JavascriptFile("/extensions/jqplot/plugins/jqplot.barRenderer.js");
- JavascriptFile("/extensions/jqplot/plugins/jqplot.highlighter.js");
- JavascriptFile('/yaamp/ui/js/auto_refresh.js');
- $recents = array();
- $raw_recents = isset($_COOKIE['wallets'])? explode("|", $_COOKIE['wallets']): array();
- // make it unique
- foreach($raw_recents as $addr) {
- $recents[$addr] = $addr;
- }
- $address = getparam('address');
- $drop_address = getparam('drop');
- if (!empty($drop_address)) {
- // to clean cookies
- foreach($recents as $k=>$addr) {
- if ($addr == $drop_address) {
- unset($recents[$k]);
- if (controller()->admin)
- setcookie('wallets', implode("|", $recents), time()+60*60*24*30, '/');
- break;
- }
- }
- }
- $user = getuserparam($address);
- if($user)
- {
- user()->setState('yaamp-wallet', $user->username);
- $recents[$user->username] = $user->username;
- $coin = getdbo('db_coins', $user->coinid);
- if($coin) echo <<<END
- <script type="text/javascript">
- $(function() {
- $('#favicon').remove();
- $('head').append('<link href="{$coin->image}" id="favicon" rel="shortcut icon">');
- });
- </script>
- END;
- if(empty($user->hostaddr) && !$this->admin) {
- $user->hostaddr = $_SERVER['REMOTE_ADDR'];
- $user->save();
- }
- }
- $username = $user? $user->username: '';
- if(!controller()->admin)
- setcookie('wallets', implode("|", $recents), time()+60*60*24*30, '/');
- echo <<<END
- <div id='resume_update_button' style='color: #444; background-color: #ffd; border: 1px solid #eea;
- padding: 10px; margin-left: 20px; margin-right: 20px; margin-top: 15px; cursor: pointer; display: none;'
- onclick='auto_page_resume();' align=center>
- <b>Auto refresh is paused - Click to resume</b></div>
- END;
- echo "<div class='row'>";
- if($user) echo <<<END
- <div class='col-lg-6 col-md-12 col-xs-12'>
- <div id='main_wallet_results'></div>
- </div>
- END;
- if($user) echo <<<END
- <div class='col-lg-6 col-md-12 col-xs-12'>
- <div class="col-md-12">
- <div class="panel-body h-200 list">
- <div class="stats-title" style="display: flex;">
- <h4 style="width: 100%;">Last 24 Hours Balance: $user->username</h4>
- <label id="myLocalTime" style="text-align:right;width: 100%;color: #838383;margin-bottom: 10px;">22:53:03</label>
- </div>
- </div>
- <div class=""col-md-12">
- <div class="panel-body">
- <div id='graph_earnings_results'></div>
- </div>
- </div>
- </div>
- </div>
- END;
- echo "</div>";
- if($user) echo <<<END
- <div id='main_graphs_results'>
- </div>
- END;
- if($user) echo <<<END
- <div id='main_miners_results'>
- </div>
- END;
- // echo "<div class='col-lg-6 col-md-12 col-xs-12'>";
- // echo '<div class="table-responsive" id="transactiontable">';
- // echo '<div class="panel panel-filled c-accent">';
- // echo '<table class="table" id="transactiontableobj">';
- // foreach($recents as $addr)
- // {
- // if(empty($addr)) continue;
- // $user = getuserparam($addr);
- // 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="16px" src="'.$coin->image.'">';
- // echo '</td><td><a class="address" href="/?address='.$addr.'" style="font-family: monospace; font-size: 1.1em;">'.
- // $addr.'</a></td>';
- // $balance = bitcoinvaluetoa($user->balance);
- // if($coin)
- // $balance = $balance>0? "$balance $coin->symbol": '';
- // else
- // $balance = $balance>0? "$balance BTC": '';
- // echo '<td align="right">'.$balance.'</td>';
- // echo '<td style="width: 16px; max-width: 16px;">'.
- // '<img src="/images/base/delete.png" onclick="javascript:drop_cookie(this);" style="cursor:pointer;"/>'.
- // '</td>';
- // echo '</tr>';
- // }
- // echo "</table>";
- // echo "</div>";
- // echo "</div>";
- // echo "</div>";
- echo <<<END
- <div class='col-lg-6 col-md-12 col-xs-12'>
- <div id='pool_current_results'></div>
- </div>
- END;
- if($user) echo <<<END
- <div class='col-lg-6 col-md-12 col-xs-12'>
- <div id='found_results'></div>
- </div>
- END;
- echo <<<END
- </div>
- <script>
- function page_refresh()
- {
- pool_current_refresh();
- found_refresh();
- if('$username' != '')
- {
- main_wallet_refresh();
- main_miners_refresh();
- main_graphs_refresh();
- main_title_refresh();
- }
- }
- function select_algo(algo)
- {
- window.location.href = '/site/algo?algo='+algo+'&r=/site/mining';
- }
- ////////////////////////////////////////////////////
- function main_wallet_ready(data)
- {
- $('#main_wallet_results').html(data);
- }
- function main_wallet_refresh()
- {
- var url = "/site/wallet_results?address=$username";
- $.get(url, '', main_wallet_ready);
- }
- function main_wallet_refresh_details()
- {
- var url = "/site/wallet_results?address=$username&showdetails=1";
- $.get(url, '', main_wallet_ready);
- }
- ////////////////////////////////////////////////////
- function main_miners_ready(data)
- {
- $('#main_miners_results').html(data);
- }
- function main_miners_refresh()
- {
- var url = "/site/wallet_miners_results?address=$username";
- $.get(url, '', main_miners_ready);
- }
- ////////////////////////////////////////////////////
- function pool_current_ready(data)
- {
- $('#pool_current_results').html(data);
- }
- function pool_current_refresh()
- {
- var url = "/site/current_results";
- $.get(url, '', pool_current_ready);
- }
- ////////////////////////////////////////////////////
- function main_title_ready(data)
- {
- document.title = data;
- }
- function main_title_refresh()
- {
- var url = "/site/title_results?address=$username";
- $.get(url, '', main_title_ready);
- }
- ////////////////////////////////////////////////////
- function found_ready(data)
- {
- $('#found_results').html(data);
- }
- function found_refresh()
- {
- var url = "/site/user_earning_results?address=$username";
- $.get(url, '', found_ready);
- }
- ////////////////////////////////////////////////////
- var last_graph_update = 0;
- function main_graphs_ready(data)
- {
- $('#main_graphs_results').html(data);
- $('.graph_algo').each(function()
- {
- var algo = $(this).attr('id');
- main_refresh_hashrate(algo);
- });
- }
- function main_graphs_refresh()
- {
- var now = Date.now()/1000;
- if(now < last_graph_update + 900) return;
- last_graph_update = now;
- var url = "/site/wallet_graphs_results?address=$username";
- $.get(url, '', main_graphs_ready);
- graph_earnings_refresh();
- }
- ///////////////////////////////////////////////////////////////////////
- function main_refresh_hashrate(algo)
- {
- var url = "/site/graph_user_results?address=$username&algo="+algo;
- $.get(url, '', function(data)
- {
- graph_init_hashrate(data, algo);
- });
- }
- ///////////////////////////////////////////////////////////////////////
- function graph_init_hashrate(data, algo)
- {
- var gdata = $.parseJSON(data);
- $.plot($('#graph_results_'+algo), [gdata]);
- }
- ///////////////////////////////////////////////////////////////////////
- function graph_earnings_ready(data)
- {
- graph_earnings_init(data);
- }
- function graph_earnings_refresh()
- {
- var url = "/site/graph_earnings_results?address=$username";
- $.get(url, '', graph_earnings_ready);
- }
- function graph_earnings_init(data)
- {
- var gdata = $.parseJSON(data);
- $.plot($('#graph_earnings_results'), [gdata]);
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- function main_wallet_tx()
- {
- var w = window.open("/site/tx?address=$username", "yaamp_tx",
- "width=800,height=600,location=no,menubar=no,resizable=yes,status=yes,toolbar=no");
- }
- function drop_cookie(el)
- {
- var addr = $(el).closest('tr').find('td a.address').text();
- window.location.href = '?address={$address}&drop=' + addr;
- }
- </script>
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement