{include file="header.tpl"}

{if $userinfo.umessages}
<div class="row mb-4">
    <div class="col-12">
        <div class="alert alert-info">
            <ul class="mb-0">
                {foreach from=$userinfo.umessages item=m}
                <li>{$m.text|escape:html|nl2br}</li>
                {/foreach}
            </ul>
        </div>
    </div>
</div>
{/if}

{if $settings.use_transaction_code ==1 && $userinfo.transaction_code == ''}
<div class="row mb-4">
    <div class="col-12">
        <div class="alert alert-warning">
            <strong>Note:</strong> Currently you have not specified a Transaction code. The Transaction code strengthens your funds security in our system. The code is required to withdraw funds from your account{if $settings.internal_transfer_enabled} and for internal transfer to another user account{/if}. Just do not change 'Transaction code' in your account information if you do not want to use this feature. <a href="?a=edit_account" class="alert-link">Click here</a> to specify a new transaction code.
        </div>
    </div>
</div>
{/if}

<div class="main-content">
    <div class="page-content">
        <div class="row">
            <!-- Overview Cards -->
            <div class="col-xl-3">
                <div class="card">
                    <div class="card-body">
                        <h4 class="card-title mb-4">Overview</h4>

                        <div>
                            <!-- Active Deposit -->
                            <div class="pb-3 border-bottom">
                                <div class="row align-items-center">
                                    <div class="col-8">
                                        <p class="mb-2">Total Deposit</p>
                                        <h4 class="mb-0">{$currency_sign}{$total}</h4>
                                    </div>
                                    <div class="col-8">
                                        <p class="mb-2">Active Deposit</p>
                                        <h4 class="mb-0">{$currency_sign}{$ab_formated.active_deposit}</h4>
                                    </div>
                                    <div class="col-4">
                                        <div class="text-right">
                                            <div>
                                                <i class="mdi mdi-arrow-up text-success ml-1"></i>
                                            </div>
                                            <div class="progress progress-sm mt-3">
                                                <div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="3000"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- Total Deposit -->
                            {if $ab_formated.deposit != 0}
                            <div class="py-3 border-bottom">
                                <div class="row align-items-center">
                                    <div class="col-8">
                                        <p class="mb-2">Total Deposit</p>
                                        <h4 class="mb-0">{$currency_sign}{$ab_formated.deposit}</h4>
                                    </div>
                                    <div class="col-4">
                                        <div class="text-right">
                                            <div>
                                                <i class="mdi mdi-arrow-up text-success ml-1"></i>
                                            </div>
                                            <div class="progress progress-sm mt-3">
                                                <div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            {/if}
                            
                            <!-- Total Withdraw -->
                            <div class="pt-3">
                                <div class="row align-items-center">
                                    <div class="col-8">
                                        <p class="mb-2">Total Withdraw</p>
                                        <h4 class="mb-0">{$currency_sign}{$ab_formated.withdrawal}</h4>
                                    </div>
                                    <div class="col-4">
                                        <div class="text-right">
                                            <div>
                                                <i class="mdi mdi-arrow-down text-danger ml-1"></i>
                                            </div>
                                            <div class="progress progress-sm mt-3">
                                                <div class="progress-bar bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Main Content Area -->
            <div class="col-xl-9">
                <div class="card">
                    <div class="card-body">
                        <!-- Referral Link Section -->
                        {if $settings.use_referal_program}
                        <div class="mb-4">
                            <h5 class="mb-1 text-bold">My Referral Link</h5>
                            <p>Click on the blue button to copy your referral link</p>
                            <div class="input-group mb-3">
                                <input type="text" value="{$settings.site_url}?ref={$userinfo.username}" id="referralInput" class="form-control" readonly>
                                <div class="input-group-append">
                                    <button class="btn btn-primary" type="button" onclick="copyReferralLink()">
                                        <i class="mdi mdi-content-copy"></i> Copy
                                    </button>
                                </div>
                            </div>
                        </div>
                        {/if}

                        <!-- Account Information -->
                        <h4 class="card-title">Your Account</h4>
                        <br>

                        <div class="table-responsive">
                            <table class="table table-sm table-striped">
                                <tr>
                                    <td><strong>User:</strong></td>
                                    <td>{$userinfo.username}</td>
                                </tr>
                                <tr>
                                    <td><strong>Registration Date:</strong></td>
                                    <td>{$userinfo.create_account_date}</td>
                                </tr>
                                <tr>
                                    <td><strong>Last Access:</strong></td>
                                    <td>{$last_access|default:"n/a"}</td>
                                </tr>
                                <tr>
                                    <td><strong>Account Balance:</strong></td>
                                    <td>
                                        {$currency_sign}<strong>{$ab_formated.total}</strong><br>
                                        <small class="text-muted">
                                            {section name=p loop=$ps}
                                                {if $ps[p].balance > 0}
                                                    {$currency_sign}{$ps[p].balance} of {$ps[p].name}<br>
                                                {/if}
                                            {/section}
                                        </small>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>Earned Total:</strong></td>
                                    <td>{$currency_sign}<strong>{$ab_formated.earning}</strong></td>
                                </tr>
                                <tr>
                                    <td><strong>Pending Withdrawal:</strong></td>
                                    <td>{$currency_sign}<strong>{$ab_formated.withdraw_pending}</strong></td>
                                </tr>
                                <tr>
                                    <td><strong>Withdrew Total:</strong></td>
                                    <td>{$currency_sign}<strong>{$ab_formated.withdrawal}</strong></td>
                                </tr>
                                <tr>
                                    <td><strong>Active Deposit:</strong></td>
                                    <td>{$currency_sign}<strong>{$ab_formated.active_deposit}</strong></td>
                                </tr>
                                
                                {if $last_deposit}
                                <tr>
                                    <td><strong>Last Deposit:</strong></td>
                                    <td>
                                        {$currency_sign}<strong>{$last_deposit|default:"n/a"}</strong>
                                        <small class="text-muted ml-2">{$last_deposit_date|default:"n/a"}</small>
                                    </td>
                                </tr>
                                {/if}
                                
                                {if $last_withdrawal}
                                <tr>
                                    <td><strong>Last Withdrawal:</strong></td>
                                    <td>
                                        {$currency_sign}<strong>{$last_withdrawal|default:"n/a"}</strong>
                                        <small class="text-muted ml-2">{$last_withdrawal_date|default:"n/a"}</small>
                                    </td>
                                </tr>
                                {/if}
                            </table>
                        </div>
<center><h1 style="color: #fff;">Live Chart</h1></center>

<div class="tradingview-widget-container" style="width: 100%; height: 74px;">
  <iframe scrolling="no" allowtransparency="true" frameborder="0" src="https://s.tradingview.com/embed-widget/ticker-tape/?locale=en#%7B%22symbols%22%3A%5B%7B%22proName%22%3A%22FOREXCOM%3ASPXUSD%22%2C%22title%22%3A%22S%26P%20500%22%7D%2C%7B%22proName%22%3A%22FOREXCOM%3ANSXUSD%22%2C%22title%22%3A%22Nasdaq%20100%22%7D%2C%7B%22proName%22%3A%22FX_IDC%3AEURUSD%22%2C%22title%22%3A%22EUR%2FUSD%22%7D%2C%7B%22proName%22%3A%22BITSTAMP%3ABTCUSD%22%2C%22title%22%3A%22BTC%2FUSD%22%7D%2C%7B%22proName%22%3A%22BITSTAMP%3AETHUSD%22%2C%22title%22%3A%22ETH%2FUSD%22%7D%5D%2C%22colorTheme%22%3A%22dark%22%2C%22isTransparent%22%3Afalse%2C%22displayMode%22%3A%22compact%22%2C%22width%22%3A%22100%25%22%2C%22height%22%3A74%2C%22utm_source%22%3A%22%22%2C%22utm_medium%22%3A%22widget%22%2C%22utm_campaign%22%3A%22ticker-tape%22%7D" style="box-sizing: border-box; height: 74px; width: 100%;"></iframe>
  
<style>
	.tradingview-widget-copyright {
		font-size: 13px !important;
		line-height: 32px !important;
		text-align: center !important;
		vertical-align: middle !important;
		font-family: 'Trebuchet MS', Arial, sans-serif !important;
		color: #9db2bd !important;
	}

	.tradingview-widget-copyright .blue-text {
		color: #2196f3 !important;
	}

	.tradingview-widget-copyright a {
		text-decoration: none !important;
		color: #9db2bd !important;
	}

	.tradingview-widget-copyright a:visited {
		color: #9db2bd !important;
	}

	.tradingview-widget-copyright a:hover .blue-text {
		color: #38acdb !important;
	}

	.tradingview-widget-copyright a:active .blue-text {
		color: #299dcd !important;
	}

	.tradingview-widget-copyright a:visited .blue-text {
		color: #2196f3 !important;
	}
	</style></div>
<br>


	  <div class="row">
       <div class="col-md-12">

 <br> <br>
            <!-- TradingView Widget BEGIN -->
          <div class="tradingview-widget-container">
            <div id="tradingview_e8053"><div id="tradingview_4a766-wrapper" style="position: relative;box-sizing: content-box;width: 100%;height: 550px;margin: 0 auto !important;padding: 0 !important;font-family:Arial,sans-serif;"><div style="width: 100%;height: 550px;background: transparent;padding: 0 !important;"><iframe id="tradingview_4a766" src="https://s.tradingview.com/widgetembed/?frameElementId=tradingview_4a766&amp;symbol=BITSTAMP%3ABTCUSD&amp;interval=D&amp;hidesidetoolbar=0&amp;symboledit=1&amp;saveimage=1&amp;toolbarbg=f1f3f6&amp;details=1&amp;studies=AwesomeOscillator%40tv-basicstudies%1FBollingerBandsR%40tv-basicstudies%1FBollingerBandsWidth%40tv-basicstudies%1FchandeMO%40tv-basicstudies&amp;theme=Dark&amp;style=1&amp;timezone=Etc%2FUTC&amp;withdateranges=1&amp;showpopupbutton=1&amp;studies_overrides=%7B%7D&amp;overrides=%7B%7D&amp;enabled_features=%5B%5D&amp;disabled_features=%5B%5D&amp;showpopupbutton=1&amp;locale=en&amp;utm_source=cryptoexpresstrading.com&amp;utm_medium=widget&amp;utm_campaign=chart&amp;utm_term=BITSTAMP%3ABTCUSD" style="width: 100%; height: 100%; margin: 0 !important; padding: 0 !important;" frameborder="0" allowtransparency="true" scrolling="no" allowfullscreen=""></iframe></div></div></div>
            <script>
              new TradingView.widget(
                {
                  "width": "100%",
                  "height": 550,
                  "symbol": "BITSTAMP:BTCUSD",
                  "interval": "D",
                  "timezone": "Etc/UTC",
                  "theme": "Dark",
                  "style": "1",
                  "locale": "en",
                  "toolbar_bg": "#f1f3f6",
                  "enable_publishing": false,
                  "withdateranges": true,
                  "hide_side_toolbar": false,
                  "allow_symbol_change": true,
                    "details": true,
                    "studies": [
                        "AwesomeOscillator@tv-basicstudies",
                        "BollingerBandsR@tv-basicstudies",
                        "BollingerBandsWidth@tv-basicstudies",
                        "chandeMO@tv-basicstudies"
                        ],
                  "show_popup_button": true,
                  "popup_width": "1000",
                  "popup_height": "650",
                  "container_id": "tradingview_e8053"
                }
              );
            </script>
          </div>
          <!-- TradingView Widget END -->
         </div>
    </div>
                        <!-- Pending Deposits Section -->
                        {section name=p loop=$ps}
                            {if $ps[p].pending_col > 0}
                                <div class="alert alert-info mt-3">
                                    <i class="mdi mdi-clock-outline"></i>
                                    {$ps[p].pending_col} {$ps[p].name} deposit{if $ps[p].pending_col > 1}s{/if} 
                                    of {$currency_sign}{$ps[p].pending_amount} total pending
                                </div>
                            {/if}
                        {/section}

                        <!-- Wire Transfer Status -->
                        {if $wires}
                            <div class="alert alert-warning mt-3">
                                <i class="mdi mdi-bank-transfer"></i>
                                {$wires} Wire Transfer(s) pending.
                            </div>
                        {/if}

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
function copyReferralLink() {
    var copyText = document.getElementById("referralInput");
    copyText.select();
    copyText.setSelectionRange(0, 99999);
    document.execCommand("copy");
    
    // Show success message
    var button = event.target.closest('button');
    var originalText = button.innerHTML;
    button.innerHTML = '<i class="mdi mdi-check"></i> Copied!';
    button.classList.add('btn-success');
    button.classList.remove('btn-primary');
    
    setTimeout(function() {
        button.innerHTML = originalText;
        button.classList.add('btn-primary');
        button.classList.remove('btn-success');
    }, 2000);
}
</script>

{include file="footer.tpl"}