{include file="sections/header.tpl"}
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="card card-hovered mb20 card-primary">
                            <div class="card-header">
                                {if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
                                    <div class="btn-group pull-right">
                                        <a class="btn btn-danger btn-xs" title="Remove used Voucher" href="{$_url}plan/remove-voucher"
                                            onclick="return confirm('Delete all used voucher code?')"><span
                                                class="fa fa-trash" aria-hidden="true"></span> Delete All</a>
                                    </div>
                                {/if}
                                &nbsp;
                            </div>
                            <div class="card-body">
                                <div class="md-whiteframe-z1 mb20 text-center row">
                                    <div class="col-md-8 mb-3">
                                        <form id="site-search" method="post" action="{$_url}plan/voucher/">
                                            <div class="input-group">
                                                <div class="input-group-text">
                                                    <span class="fa fa-search"></span>
                                                </div>
                                                <input type="text" name="search" class="form-control" placeholder="{Lang::T('Search by Code Voucher')}..." value="{$search}">
                                                <button class="btn btn-success input-group-btn" type="submit">{Lang::T('Search')}</button>
                                                <!-- <div class="">
                                                </div> -->
                                            </div>
                                        </form>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="btn-group btn-group-justified mb-3" role="group">
                                            <div class="btn-group" role="group">
                                                <a href="{$_url}plan/add-voucher" class="btn btn-primary btn-block"><i class="ion ion-android-add"></i> {Lang::T('Add Vouchers')}</a>
                                            </div>
                                        </div>
                                        <div class="btn-group btn-group-justified" role="group">
                                            <div class="btn-group" role="group">
                                                <a href="{$_url}plan/print-voucher" target="print_voucher" class="btn btn-info btn-block"><i class="ion ion-android-print"></i> Print</a>
                                            </div>
                                        </div>
                                    </div>&nbsp;
                                </div>
                                <div class="table-responsive">
                                    <table id="datatable" class="table table-bordered table-striped table-condensed">
                                        <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>{Lang::T('Type')}</th>
                                                <th>{Lang::T('Routers')}</th>
                                                <th>{Lang::T('Plan Name')}</th>
                                                <th>{Lang::T('Code Voucher')}</th>
                                                <th>{Lang::T('Status Voucher')}</th>
                                                <th>{Lang::T('Customer')}</th>
                                                <th>{Lang::T('Generated By')}</th>
                                                <th>{Lang::T('Manage')}</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {foreach $d as $ds}
                                                <tr {if $ds['status'] eq '1'}class="danger" {/if}>
                                                    <td>{$ds['id']}</td>
                                                    <td>{$ds['type']}</td>
                                                    <td>{$ds['routers']}</td>
                                                    <td>{$ds['name_plan']}</td>
                                                    <td style="background-color: black; color: black;"
                                                        onmouseleave="this.style.backgroundColor = 'black';"
                                                        onmouseenter="this.style.backgroundColor = 'white';">
                                                        {$ds['code']}</td>
                                                    <td>{if $ds['status'] eq '0'} <label class="btn-tag btn-tag-success">Not
                                                            Use</label> {else} <label class="btn-tag btn-tag-danger">Used</label>
                                                        {/if}</td>
                                                    <td>{if $ds['user'] eq '0'} -
                                                        {else}<a href="{$_url}customers/viewu/{$ds['user']}">{$ds['user']}</a>
                                                        {/if}</td>
                                                    <td>{if $ds['generated_by']}
                                                            <a
                                                                href="{$_url}settings/users-view/{$ds['generated_by']}">{$admins[$ds['generated_by']]}</a>
                                                        {else} -
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if $ds['status'] neq '1'}
                                                            <a href="{$_url}plan/voucher-view/{$ds['id']}" id="{$ds['id']}"
                                                                style="margin: 0px;"
                                                                class="btn btn-success btn-xs mb-2">&nbsp;&nbsp;{Lang::T('View')}&nbsp;&nbsp;</a>
                                                        {/if}
                                                        {if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
                                                            <a href="{$_url}plan/voucher-delete/{$ds['id']}" id="{$ds['id']}"
                                                                class="btn btn-danger btn-xs"
                                                                onclick="return confirm('{Lang::T('Delete')}?')"><i
                                                                    class="fa fa-trash"></i></a>
                                                        {/if}
                                                    </td>
                                                </tr>
                                            {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                                <ul class="pagination pagination-sm">
                                    {if $page>0}
                                        <li><a href="{$_url}plan/voucher&p={$page-1}&code={$_code}">{Lang::T('Prev')}</a></li>
                                    {/if}
                                    {if $d}
                                        <li><a href="{$_url}plan/voucher&p={$page+1}&code={$_code}">{Lang::T('Next')}</a></li>
                                    {/if}
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
{include file="sections/footer.tpl"}