{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">Make an Investment</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>
                <br> <br>
                <form method=post name="spendform">
                <input type=hidden name=a value=deposit>
                {if $qplans > 1}{/if}
				<div class="row clearfix">
					<div class="col-xl-4 col-lg-12 col-md-12">
                        <div class="card">
                            <div class="header">
                                <h2><strong>Your </strong> Deposits</h2>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-md-12">
                                        <h2 class="m-b-0">{$currency_sign}{$total}</h2>
                                        <p>Total Deposits</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
					<div class="col-xl-8 col-lg-12 col-md-12">
						<div class="card">
                            <div class="body">
                                
                                {foreach from=$plans item=p}
                                <div class="card mb-4">
                                    <div class="card-header text-center bg-primary text-white">
                                        <b>{$p.name}</b>
                                    </div>
                                    <div class="card-body">
                                        {if !$p.deposits}
                                        <div class="alert alert-warning mt-3">
                                            <b>No deposits for this plan</b>
                                        </div>
                                        {else}
                                        <h5 class="mt-3">Your Deposits</h5>
                                        <table class="table table-striped">
                                            <thead class="thead-light">
                                                <tr>
                                                    <th>Date</th>
                                                    <th>Amount</th>
                                                    {if $p.use_compound}<th>Compounding Percent</th>{/if}
                                                    {if $p.withdraw_principal}<th>Release</th>{/if}
                                                </tr>
                                            </thead>
                                            <tbody>
                                                {foreach from=$p.deposits item=d}
                                                <tr>
                                                    <td>
                                                        <b>{$d.date}</b><br>
                                                        {if $p.q_days == 0}Working {$d.duration} days{else}Expire in {$d.expire_in}{/if}
                                                    </td>
                                                    <td>
                                                        <b>{$d.deposit|fiat:$d.ec} <img src="images/{$d.ec}.gif" alt="{$d.ec}" class="align-middle" height="17"></b>
                                                    </td>
                                                    {if $p.use_compound}
                                                    <td>{$d.compound}% <a href="{"?a=change_compound&deposit=`$d.id`"|encurl}" class="text-primary">[change]</a></td>
                                                    {/if}
                                                    {if $p.withdraw_principal}
                                                    <td>
                                                        {if $d.can_withdraw}
                                                        <a href="{"?a=withdraw_principal&deposit=`$d.id`"|encurl}" class="btn btn-sm btn-success">Release</a>
                                                        {else}
                                                            {if $d.pending_duration > 0}
                                                            {$d.pending_duration} day{if $d.pending_duration > 1}s{/if} left
                                                            {else}
                                                            Not available
                                                            {/if}
                                                        {/if}
                                                    </td>
                                                    {/if}
                                                </tr>
                                                {/foreach}
                                            </tbody>
                                        </table>
                                        {/if}
                                    </div>
                                
                                    {if $p.total_deposit > 0 || $p.today_profit > 0 || $p.total_profit > 0}
                                    <div class="card-footer">
                                        <table class="table table-borderless mb-0">
                                            <tr><td>Deposited Total:</td><td><b>{$p.total_deposit|fiat}</b></td></tr>
                                            <tr><td>Profit Today:</td><td><b>{$p.today_profit|fiat}</b></td></tr>
                                            <tr><td>Total Profit:</td><td><b>{$p.total_profit|fiat}</b></td></tr>
                                        </table>
                                    </div>
                                    {/if}
                                </div>
                                {/foreach}
                            </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>
{include file="footer.tpl"}

