{include file="mheader.tpl"}
<div class="wrapper">
        <div class="container-fluid">
            <!-- Page-Title -->
            <div class="page-title-box">
                <div class="row align-items-center">
                    <div class="col-sm-6">
                        <h4 class="page-title">Deposit List</h4>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-right">
                            <li class="breadcrumb-item"><a href="javascript:void(0);">{$settings.site_name}</a></li>
                            <li class="breadcrumb-item active">Deposit List</li>
                        </ol>
                    </div>
                </div>
                <!-- end row -->
            </div>
<div class="col-sm-12">

<div class="card">
     <h5 class="card-header bg-primary text-white">Deposit List</h5>
<div class="card-body">
   <br/>
<b>Total: {$currency_sign}{$total}</b><br><br>

{foreach from=$plans item=p}
<div class="table-responsive">
<table class="table">
    <tr>
        <td class=item>
<table class="table">
<tr>
 <td colspan=3 align=center><div class="alert alert-success" role="alert"><b>{$p.name}</b></div></td>
</tr>
<thead>
<tr>
 <th class=inheader>Plan</th>
 <th class=inheader >Amount Spent ({$currency_sign})</th>
 <th class=inheader ><nobr>{$p.period} Profit (%)</nobr></th>
</tr>
</thead>
{foreach from=$p.plans item=o}
<tr>
 <td class=item>{$o.name}</td>
 <td class=item >{$o.deposit}</td>
 <td class=item >{$o.percent}</td>
</tr>
{/foreach}
</table>
<br>
<table class="table">
{if !$p.deposits}
<tr>
 <td colspan=4><div class="alert alert-warning m-b-lg" role="alert"><b>No deposits for this plan</b></div></td>
</tr>           
{else}
<tr>
 <td  class=inheader >Your deposits:</td>
</tr>
<thead>
<tr>
 <th class=inheader>Date</th>
 <th class=inheader>Amount</th>
{if $p.use_compound}
 <th class=inheader>Compounding Percent</th>
{/if}
{if $p.withdraw_principal}
 <th class=inheader>Release</th>
{/if}
</tr>   
</thead>
{foreach from=$p.deposits item=d}
<tr>
 <td class=item><b>{$d.date}</b><br>{if $p.q_days == 0}Working {$d.duration} days{else}Expire in {$d.expire_in} days{/if}</td>
 <td  class=item><b>{$currency_sign}{$d.deposit} <img src="images/{$d.ec}.gif"  hspace=1 height=17></b></td>
{if $p.use_compound}
 <td class=item>{$d.compound}% <a href="{"?a=change_compound&deposit=`$d.id`"|encurl}">[change]</a></td>
{/if}
{if $p.withdraw_principal}
 <td class=item>
  {if $d.can_withdraw}
   <a href="{"?a=withdraw_principal&deposit=`$d.id`"|encurl}">[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}
{/if}
</table>
{if $p.total_deposit > 0 || $p.today_profit > 0 || $p.total_profit > 0}
<table class="table">
<tr><td>Deposited Total:</td><td><b>{$currency_sign}{$p.total_deposit}</b></td></tr>
<tr><td>Profit Today:</td><td><b>{$currency_sign}{$p.today_profit}</b></td></tr>
<tr><td>Total Profit:</td><td><b>{$currency_sign}{$p.total_profit}</b></td></tr>
</table>
{/if}
<br>
</td></tr></table>
<br>
{/foreach}
</div></div></div></div></div></div>
{include file="mfooter.tpl"}
