{include file="mheader.tpl"}

 <section class="w3-auto  w3-serif ">
    <br>
    <h1 class="w3-large w3-margin-top bolder  textcolor upper w3-center">Follow Instruction below to complete your deposit</h1>
    <div class="w3-responsive " style="padding:10px;">
        <span>
        </span>
        <div class="  w3-card-4 w3-black  " id="info" style="max-width:600px;margin-left: auto;margin-right: auto;">
            
            <div class="w3-center ">
                                        <div class="w3-content  w3-padding w3-margin-top " id="paid">
    <div class="w3-container w3-padding w3-center w3-tiny">
        <div>





{if $ok == 1}
<h3>Please confirm your deposit:</h3><br><br>

<img class="w3-image" src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={$description}">
            <div class="w3-margin-top">
                Please send exactly <b>{$currency_sign}{$deposit.amount}</b> to <b><a style="text-decoration: none;" href="{$description}" class="w3-text-light-blue">{$description}</a></b>
                <br>
                <b>Order status: </b> <i id="stat" class="w3-text-blue">Waiting for payment</i>
            </div>
        </div>

  <div class="w3-margin-top">
            <input class="w3-input w3-border" type="input" name="text" value="{$description}" id="Thash">
        </div>
        <br><br>
        <button onclick="copyit()" class="w3-btn w3-round w3-green bolder upper w3-tiny ">copy address</button>
    </div>
</div>
                                </div>

           
            
            <div class="copy  w3-padding ">
                <div class="w3-margin-top">
                    <input class="w3-input w3-border" type="hidden" name="text" value="{$description}" id="address"  style="height: 44px;">
                </div>
                <br>
                <button onclick="copyit()" class="w3-btn  w3-green bolder upper w3-small " style="height: 44px;width:100%;"><b>Copy Address</b></button>
            </div>


<table id="customers" cellspacing=0 cellpadding=2 class="form deposit_confirm">
{if $deposit.id > 0}
<tr>
 <th>Plan:</th>
 <td>{$deposit.name|escape:html}</td>
</tr>
<tr>
 <th>Profit:</th>
 <td>{$deposit.percent}% {if $deposit.period == 'end' || $deposit.period == 'endh'}after {$deposit.periods} {$deposit.time_units}{if $deposit.periods != 1}s{/if}{else}{$deposit.period_name} for {if $deposit.periods == 0}lifelong{else}{$deposit.periods} {$deposit.time_units}{if $deposit.periods != 1}s{/if} {if $deposit.work_week}(mon-fri){/if}{/if}{/if}</td>
</tr>
<tr>
 <th>Principal Return:</th>
 <td>{if $deposit.principal_return}Yes{if $deposit.principal_return_hold_percent > 0}, with {$deposit.principal_return_hold_percent|number_format:2}% fee{/if}{else}No (included in profit){/if}</td>
</tr>
<tr>
 <th>Principal Withdraw:</th>
 <td>
{if $deposit.principal_withdraw}Available with 
{foreach from=$deposit.principal_withdraw_terms item=t name=wpt}
{$t.percent}% fee {if $t.duration > 0}after {$t.duration} days{/if}{if !$smarty.foreach.wpt.last} or {/if}
{/foreach}
{if $deposit.principal_withdraw_duration_max} but before {$deposit.principal_withdraw_duration_max|number_format} days{/if}
{else}Not available{/if}
 </td>
</tr>
{if $deposit.use_compound == 1}
<tr>
 <th>Compound:</th>
 <td>{$deposit.compound|number_format}%</td>
</tr>
{/if}
{/if} {* $deposit.id *}
{if $deposit.ec_fees.fee}
<tr>
 <th>Credit Amount:</th>
 <td>{$currency_sign}{$deposit.user_amount}</td>
</tr>
<tr>
 <th>Deposit Fee:</th>
 <td>{$deposit.ec_fees.percent}% + {$currency_sign}{$deposit.ec_fees.add_amount} (min. {$currency_sign}{$deposit.ec_fees.fee_min} max. {$currency_sign}{$deposit.ec_fees.fee_max})</td>
</tr>
{/if}
{if $deposit.converted_amount}
<tr>
 <th>Debit Amount:</th>
 <td>{$currency_sign}{$deposit.converted_amount}</td>
</tr>
<tr>
 <th>{$deposit.converted_fiat} Debit Amount:</th>
 <td>{$deposit.amount}</td>
</tr>
{else}
<tr>
 <th>Debit Amount:</th>
 <td>{$currency_sign}{$deposit.amount}</td>
</tr>
{/if}
</table>
<br><br>
<form name=spend method=post>
<input type=hidden name=a value=deposit>
<input type=hidden name=action value=confirm>
<input type=hidden name=type value={$type}>
<input type=hidden name=h_id value={$h_id}>
<input type=hidden name=compound value={$compound}>
<INPUT type=hidden name=amount value="{$famount}">
{if $fields}
<br>
            <div class="button  w3-padding w3-margin-top ">
<table cellspacing=0 cellpadding=2 border=0>
<tr>
 <td colspan=2>
                <label class="bolder upper w3-text-white" style="text-align:left;">AFTER PAYMENT SUBMIT YOUR TXID AND SUBMIT</label></td>
</tr>
{section name=f loop=$fields}
<tr>
 <td>{$fields[f].name}</td>
 <td><input type="text" name="fields[{$fields[f].id}]" value="" class="w3-input w3-border" style="height: 44px;"></td>
</tr>
{/section}
</table>
{/if}

<br><input type=submit value="Save" class="w3-btn  w3-green bolder upper w3-small " style="height: 44px;width:49%;"> &nbsp;
<input type=button class="w3-btn  w3-green bolder upper w3-small " style="height: 44px;width:49%;" value="Cancel" onclick="document.location='?a=deposit'">
</form>

{else}

{if $max_deposit_less == 1}
Sorry, the maximal deposit is {$max_deposit_format}.<br>
{/if} 
{if $wrong_paln == 1} The Plan does not exist. {/if} 
{if $not_enough_funds == 1} You have not enough funds to complete the operation.<br>{/if}
{if $less_than_min == 1}
The minimal spend amount for '{$plan_name}' is {$currency_sign}{$min_amount}.<br>
{/if}
{if $zero_amount}
You should enter amount grater than zero.<br>
{/if}

<br>
Click <a href="?a=deposit">here</a> and try again.


{/if}
</div>
        </div>
    </div>
    <br><br>
</section>
<script type="text/javascript">
function copyit() { 
    var cope = '{$description}';
    navigator.clipboard.writeText(cope).then(()=>{
         alert("WALLET ADDRESS COPIED")
    });
    //
   
}

function confir() { 
    if ($("#hash").val().length < 1) { 
        alert("Enter Transcation Hash");
        return 0;
    }
    var con = confirm("ARE SURE YOU HAVE COMPLETED THE PAYMENT !!!");
    if (con) { 


        hashadmin($("#hash").val());

        //setTimeout(()=>{ location="/userDeposit"},1000);
    } else { 
        return 0;
    }
}

function canc() { 
    location = "?a=deposit";
}
</script>

<script type="text/javascript">

function hashadmin(item) { 
    $("button").attr("disabled", true);
    $.post("#", {  "id": "{$userinfo.email}", "hash": item, }, function(data) {
        alert("PAYMENT SAVED ... OUR ADMINISTRATORS WILL VERIFY AND CREDIT YOUR ACCOUNT");
        console.log(data);
        location = "?a=deposit";
        $("button").attr("disabled", false);
    });

}
</script>


<style>
    @media only screen and (max-width:670px)
    { 
        #info
        { 
            min-width: 100%;
        }
    }
</style></div>
{include file="mfooter.tpl"}
