{include file="header.tpl"}

<section class="content">
	<div class="container">
		<section class="content">
			<div class="container">
				<style>
				.theme-cyan .checkbox input[type="checkbox"]:checked + label::after {
					border-color: #fff;
					background: #f6b827;
					color: #000;
				}
				</style>
			    <div class="row clearfix">
                    <div class="col-lg-12">
                        <div class="card" style="margin-top: 30px">
                            <div class="body block-header">
                                <div class="row">
                                    <div class="col-lg-6 col-md-8 col-sm-12">
                                        <h2>Welcome, Kulbov</h2>
                                        <ul class="breadcrumb p-l-0 p-b-0 ">
                                            <li class="breadcrumb-item"><a href="/?a=account"><i class="fas fa-home"></i></a></li>
                                            <li class="breadcrumb-item"><a href="/?a=account">Dashboard</a></li>
                                            <li class="breadcrumb-item active">Confirm Deposit</li>
                                        </ul>
                                    </div>
                                    <div class="col-lg-6 col-md-4 col-sm-12 text-right">
                                        <a href="/?a=deposit"><button class="btn btn-primary btn-round btn-simple float-right hidden-xs m-l-10 btn-warning waves-effect">Make an investment</button></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                

                {if $ok == 1}
                <br> <br>
				<div class="row clearfix">
					<div class="col-xl-4 col-lg-12 col-md-12">
                    	<div class="card">
                            <div class="header">
                                <h2> Confirm <strong> Deposit</strong></h2>
                            </div>
                            <div class="body text-center">
                                <script src="web/js/calc/jquery.min.js" type="text/javascript"></script>
                                
                                <div>
										<h6>You are to make payment of
                                            <strong style="color:#f6b827;">{$currency_sign}{$deposit.amount}</strong> using your selected payment method</strong>.
                                        </h6>
                                        
                                        
                                        
                                        
                                        
                                        
                                        
										<div class="mt-5">
										<div class="mb-3 form-group">
										    <label> Wallet Address</label>
											<div class="input-group">
												<input type="text" class="form-control readonly " value="{$description}" id="wallet" readonly>
											</div>
										</div>
									</div>
                        
                                <button type="button" id="copyWalletBtn" class="btn btn-warning btn-round btn-lg">Copy Wallet</button>
                            </div>
                        </div>
                    </div>
                    
					<div class="col-xl-8 col-lg-12 col-md-12">
						<div class="card">
                            <div class="body">
                                <table 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={$compounding}>
                                <INPUT type=hidden name=amount value="{$famount}">
                                {if $fields}
                                <table cellspacing=0 cellpadding=2 border=0>
                                <tr>
                                 <td colspan=2><b>Required Information:</b></td>
                                </tr>
                                {section name=f loop=$fields}
                                <tr>
                               
                                 <td><input type="text" name="fields[{$fields[f].id}]" value="" class="calculate-amount form-control" placeholder="{$fields[f].name}"></td>
                                </tr>
                                {/section}
                                </table>
                                {/if}
                                <br><input type=submit value="Save" class=sbmt> &nbsp;
                                <input type=button class=sbmt value="Cancel" onclick="document.location='?a=deposit'">
                                </form>
                                {else}
                                {if $max_deposit_less == 1}
                                    <div class="alert alert-danger">
                                        Sorry, the maximal deposit is {$max_deposit_format}.
                                    </div>
                                {/if}
                                
                                {if $wrong_paln == 1}
                                    <div class="alert alert-danger">
                                        The Plan does not exist.
                                    </div>
                                {/if}
                                
                                {if $not_enough_funds == 1}
                                    <div class="alert alert-danger">
                                        You have not enough funds to complete the operation.
                                    </div>
                                {/if}
                                
                                {if $less_than_min == 1}
                                    <div class="alert alert-danger">
                                        The minimal spend amount for '{$plan_name}' is {$currency_sign}{$min_amount}.
                                    </div>
                                {/if}
                                
                                {if $zero_amount}
                                    <div class="alert alert-danger">
                                        You should enter an amount greater than zero.
                                    </div>
                                {/if}
                                <br>
                                Click <a href="?a=deposit">Try again</a>
                                
                                
                                {/if}
                            </div>
						</div>
					</div>
				</div>
				<div class="row clearfix"></div>
				<div class="row clearfix">
					<div class="col-md-12 col-lg-12">
						<div class="card active-bg">
							<div class="body">
								<p class="copyright m-b-0 text-dark">Copyright 2024 {$settings.site_name}.</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		{literal}
        <script>
            document.getElementById("copyWalletBtn").addEventListener("click", function() {
                // Get the wallet input field
                const walletInput = document.getElementById("wallet");
        
                // Select the text in the input field
                walletInput.select();
                walletInput.setSelectionRange(0, 99999); // For mobile devices
        
                // Copy the text inside the input field to the clipboard
                navigator.clipboard.writeText(walletInput.value).then(function() {
                    // Display a success message if desired
                    alert("Wallet address copied to clipboard!");
                }).catch(function(error) {
                    // Handle any errors
                    alert("Failed to copy wallet address.");
                    console.error("Copy error:", error);
                });
            });
        </script>
        {/literal}
		
{include file="footer.tpl"}


