{include file="header.tpl"}
   <!-- PAGE-NAVIGATOR -->
        <section id="page-navigator">
            <div class="container-fluid">
                <div aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="/">Home</a></li>
                        <li class="breadcrumb-item"><a href="/" class="cursor-inherit">History</a>
                        </li>
                    </ol>
                </div>
            </div>
        </section>
        <!-- /PAGE-NAVIGATOR -->
        </header>
    <!-- DASHBOARD-HEADER -->
        <main id="page-container">
    {include file="left.tpl"}

{literal}
<script language=javascript>
function go(p)
{
  document.opts.page.value = p;
  document.opts.submit();
}
</script>
{/literal}
 <section id="dashboard">
        <div class="dashboard-wrapper add-fund pb-50">
            <div class="row justify-content-center">
                <div class="col-md-12">
                    <div class="card secbg form-block p-0 br-4">
                        <div class="card-body">
<form method=post name=opts>
<input type=hidden name=a value=history>
<input type=hidden name=page value={$current_page}>
<div class="row justify-content-between">
<div class="col-md-3">
<div class="form-group mb-2">
<select name=type class="form-control" onchange="document.opts.submit();">
<option value="">All transactions</option>
{section name=opt loop=$options}
<option value="{$options[opt].type}" {if $options[opt].selected}selected{/if}>{$options[opt].type_name}</option>
{/section}
   </select></div>
                                    </div>
<div class="col-md-3">
<div class="form-group mb-2">
{if $ecs}
<select name=ec class="form-control" >
     <option value=-1>All eCurrencies</option>
{section name=ec loop=$ecs}
 <option value={$ecs[ec].id} {if $frm.ec eq $ecs[ec].id}selected{/if}>{$ecs[ec].name}</option>
{/section}
   </select></div>
                                    </div>
{/if}
<div class="col-md-3">
<div class="form-group mb-2">
<select name=month_from class="form-control">
<option value="">Form</option>
{section name=month_from loop=$month}
<option value={$smarty.section.month_from.index+1} {if $smarty.section.month_from.index+1 == $frm.month_from}selected{/if}>{$month[month_from]}
{/section}
</select></div></div>
<div class="col-md-3">
<div class="form-group mb-2">
<select name=day_from class="form-control">
{section name=day_from loop=$day}
<option value={$smarty.section.day_from.index+1} {if $smarty.section.day_from.index+1 == $frm.day_from}selected{/if}>{$day[day_from]}
{/section}
</select></div></div>
<div class="col-md-3">
<div class="form-group mb-2">
<select name=year_from class="form-control">
{section name=year_from loop=$year}
<option value={$year[year_from]} {if $year[year_from] == $frm.year_from}selected{/if}>{$year[year_from]}
{/section}
</select></div></div>
<div class="col-md-3">
<div class="form-group mb-2">
<select name=month_to class="form-control">
<option value="">To</option>
{section name=month_to loop=$month}
<option value={$smarty.section.month_to.index+1} {if $smarty.section.month_to.index+1 == $frm.month_to}selected{/if}>{$month[month_to]}
{/section}
</select></div></div>
<div class="col-md-3">
<div class="form-group mb-2">
<select name=day_to class="form-control">
{section name=day_to loop=$day}
<option value={$smarty.section.day_to.index+1} {if $smarty.section.day_to.index+1 == $frm.day_to}selected{/if}>{$day[day_to]}
{/section}
</select></div></div>
<div class="col-md-3">
<div class="form-group mb-2">
<select name=year_to class="form-control">
{section name=year_to loop=$year}
<option value={$year[year_to]} {if $year[year_to] == $frm.year_to}selected{/if}>{$year[year_to]}
{/section}
</select></div></div>
 <div class="col-md-2">
<div class="form-group mb-2">
<button type="submit" class="btn btn-primary">
<i class="fas fa-search"></i> Search</button></div>
                                    </div>
                                </div>

</form>
<br><br>

</div>
                    </div>
                </div>
            </div>
            <div class="row mt-30">
                <div class="col-md-12">
                    <div class="card secbg ">
                        <div class="card-body ">

                            <div class="table-responsive">
<table class="table table-hover table-striped text-white">
<thead class="thead-dark">
<tr>
<th scope="col">Type</th>
<th scope="col">Amount</th>
<th scope="col">Date</th>
</tr>
</thead>
<tbody>
{foreach from=$trans item=t}
<tr>
 <td><b>{$t.transtype}</b></td>
 <td width=200 align=left><b>{$t.amount|fiat:$t.ec}</b> <img src="images/{$t.ec}.gif" align=absmiddle hspace=1 height=17>{if $t.type == 'withdraw_pending'}<a href="{"?a=cancelwithdraw&id=`$t.id`&return=`$return`&"|encurl}" onclick="return confirm('Are you sure you want to delete this request?')">[cancel]</a>{/if}</td>
 <td width=170 align=left valign=bottom><b><small>{$t.d}</small></b></td>
</tr>
<tr>
 <td colspan=3 class=gray><small>{$t.description|escape:html}</small></td>
</tr>
{foreachelse}
<tr>
 <td colspan=3 align=center>No transactions found</td>
</tr>
{/foreach}
<tr><td colspan=3>&nbsp;</td>

{if $totals}
<tr>
 <td><b>Total for selected options:</b></td>
 <td align=right nowrap>
  {foreach from=$totals item=t}{$t.amount|fiat:$t.ec} <img src="images/{$t.ec}.gif" align=absmiddle><br>{/foreach}
 </td>
 <td></td>
</tr>
{/if}

{*
{if $trans}
<tr>
    <td colspan=2>For this period:</td>
 <td align=right><b>{$currency_sign} {$periodsum}</b></td>
</tr>
{/if}
<tr>
    <td colspan=2>Total:</td>
 <td align=right><b>{$currency_sign} {$allsum}</b></td>
</tr>
*} </tbody>
</table>
 </div>

{paginator col=$paginator.col cur=$paginator.cur url="javascript:go('%s')"}


                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    </main>
</div>
<!-- /DASHBOARD-PAGE-LAYOUT -->
{include file="footer.tpl"}