{if $addfundsdisabled}
    {include file="$template/includes/alert.tpl" type="error" msg="{lang key='clientareaaddfundsdisabled'}" textcenter=true}
{elseif $notallowed}
    {include file="$template/includes/alert.tpl" type="error" msg="{lang key='clientareaaddfundsnotallowed'}" textcenter=true}
{elseif $errormessage}
    {include file="$template/includes/alert.tpl" type="error" errorshtml=$errormessage textcenter=true}
{/if}

{if !$addfundsdisabled}
    <section class="dashboard-analytics-grid dashboard-analytics-grid--three">
        <article class="dashboard-analytics-card dashboard-analytics-card--mint">
            <span class="dashboard-analytics-card__icon"><i class="far fa-arrow-alt-circle-down"></i></span>
            <div class="dashboard-analytics-card__copy">
                <span class="dashboard-analytics-card__label">{lang key='addfundsminimum'}</span>
                <strong class="dashboard-analytics-card__value">{$minimumamount}</strong>
                <span class="dashboard-analytics-card__meta">{lang key='addfundsminimum'}</span>
            </div>
        </article>
        <article class="dashboard-analytics-card dashboard-analytics-card--violet">
            <span class="dashboard-analytics-card__icon"><i class="far fa-arrow-alt-circle-up"></i></span>
            <div class="dashboard-analytics-card__copy">
                <span class="dashboard-analytics-card__label">{lang key='addfundsmaximum'}</span>
                <strong class="dashboard-analytics-card__value">{$maximumamount}</strong>
                <span class="dashboard-analytics-card__meta">{lang key='addfundsmaximum'}</span>
            </div>
        </article>
        <article class="dashboard-analytics-card dashboard-analytics-card--green">
            <span class="dashboard-analytics-card__icon"><i class="fas fa-database"></i></span>
            <div class="dashboard-analytics-card__copy">
                <span class="dashboard-analytics-card__label">{lang key='addfundsmaximumbalance'}</span>
                <strong class="dashboard-analytics-card__value">{$maximumbalance}</strong>
                <span class="dashboard-analytics-card__meta">{lang key='addfundsmaximumbalance'}</span>
            </div>
        </article>
    </section>

    <section class="dashboard-panel dashboard-funds-panel">
        <div class="dashboard-panel__header">
            <div>
                <h2 class="dashboard-panel__title">{lang key='addfunds'}</h2>
                <p class="dashboard-panel__copy">{lang key='addfunds'}</p>
            </div>
            <div class="dashboard-funds-panel__art" aria-hidden="true">
                <i class="fas fa-wallet"></i>
            </div>
        </div>
        <div class="dashboard-funds-form">
            <form method="post" action="{$smarty.server.PHP_SELF}?action=addfunds" class="dashboard-funds-form__form">
                <fieldset>
                    <div class="dashboard-funds-form__row">
                        <label for="amount" class="dashboard-funds-form__label">
                            <span class="dashboard-funds-form__label-icon"><i class="far fa-money-bill-alt"></i></span>
                            <span>{lang key='addfundsamount'}</span>
                        </label>
                        <div class="dashboard-funds-form__field dashboard-funds-form__field--amount">
                            <input type="text" name="amount" id="amount" value="{$amount}" class="form-control" required />
                            <span class="dashboard-funds-form__suffix">{$currency.prefix|default:$activeCurrency.prefix|default:'USD'}</span>
                        </div>
                    </div>
                    <div class="dashboard-funds-form__row">
                        <label for="paymentmethod" class="dashboard-funds-form__label">
                            <span class="dashboard-funds-form__label-icon"><i class="far fa-credit-card"></i></span>
                            <span>{lang key='orderpaymentmethod'}</span>
                        </label>
                        <div class="dashboard-funds-form__field">
                            <select name="paymentmethod" id="paymentmethod" class="form-control custom-select">
                                {foreach $gateways as $gateway}
                                    <option value="{$gateway.sysname}">{$gateway.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-brand dashboard-funds-form__submit">
                        <i class="far fa-lock-alt"></i>
                        {lang key='addfunds'}
                    </button>
                </fieldset>
            </form>
            <div class="dashboard-funds-note">
                <span class="dashboard-funds-note__icon"><i class="far fa-shield-check"></i></span>
                <span>* {lang key='addfundsnonrefundable'}</span>
            </div>
        </div>
    </section>

{/if}
