<?php
/* Smarty version 4.5.3, created on 2024-12-03 23:04:33
  from '/var/www/html/admin/ui/ui/voucher.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_674f6451364c17_92929307',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '8b249d8b7c0e0e03c2819b38c24c03f786b244ed' => 
    array (
      0 => '/var/www/html/admin/ui/ui/voucher.tpl',
      1 => 1732056262,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:pagination.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_674f6451364c17_92929307 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<!-- voucher -->
<div class="row" style="padding: 5px">
    <div class="col-lg-3 col-lg-offset-9">
        <div class="btn-group btn-group-justified" role="group">
            <div class="btn-group" role="group">
                <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/add-voucher" class="btn btn-primary"><i class="ion ion-android-add"></i>
                    <?php echo Lang::T('Vouchers');?>
</a>
            </div>
            <div class="btn-group" role="group">
                <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/print-voucher" target="print_voucher" class="btn btn-info"><i
                        class="ion ion-android-print"></i> <?php echo Lang::T('Print');?>
</a>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-hovered mb20 panel-primary">
    <div class="panel-heading">
        <?php if (in_array($_smarty_tpl->tpl_vars['_admin']->value['user_type'],array('SuperAdmin','Admin'))) {?>
        <div class="btn-group pull-right">
            <a class="btn btn-danger btn-xs" title="Remove used Voucher" href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/remove-voucher"
                onclick="return ask(this, 'Delete all used voucher code more than 3 months?')"><span
                    class="glyphicon glyphicon-trash" aria-hidden="true"></span> <?php echo Lang::T('Delete');?>
 &gt; <?php echo Lang::T('3
                Months');?>
</a>
        </div>
        <?php }?>
        &nbsp;
    </div>
    <div class="panel-body">
        <form id="site-search" method="post" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/voucher/">
            <div class="row" style="padding: 5px">
                <div class="col-lg-2">
                    <div class="input-group">
                        <div class="input-group-addon">
                            <span class="fa fa-search"></span>
                        </div>
                        <input type="text" name="search" class="form-control" placeholder="<?php echo Lang::T('Code Voucher');?>
"
                            value="<?php echo $_smarty_tpl->tpl_vars['search']->value;?>
">
                    </div>
                </div>
                <div class="col-lg-2">
                    <select class="form-control" id="router" name="router">
                        <option value=""><?php echo Lang::T('Location');?>
</option>
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['routers']->value, 'r');
$_smarty_tpl->tpl_vars['r']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['r']->value) {
$_smarty_tpl->tpl_vars['r']->do_else = false;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['r']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['router']->value == $_smarty_tpl->tpl_vars['r']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['r']->value;?>

                        </option>
                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
                <div class="col-lg-2">
                    <select class="form-control" id="plan" name="plan">
                        <option value=""><?php echo Lang::T('Plan Name');?>
</option>
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['plans']->value, 'p');
$_smarty_tpl->tpl_vars['p']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['p']->value) {
$_smarty_tpl->tpl_vars['p']->do_else = false;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['p']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['plan']->value == $_smarty_tpl->tpl_vars['p']->value['id']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['p']->value['name_plan'];?>
</option>
                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
                <div class="col-lg-2">
                    <select class="form-control" id="status" name="status">
                        <option value="-"><?php echo Lang::T('Status');?>
</option>
                        <option value="1" <?php if ($_smarty_tpl->tpl_vars['status']->value == 1) {?>selected<?php }?>>Used</option>
                        <option value="0" <?php if ($_smarty_tpl->tpl_vars['status']->value == 0) {?>selected<?php }?>>Not Use</option>
                    </select>
                </div>
                <div class="col-lg-2">
                    <select class="form-control" id="customer" name="customer">
                        <option value=""><?php echo Lang::T('Customer');?>
</option>
                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['customers']->value, 'c');
$_smarty_tpl->tpl_vars['c']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['c']->value) {
$_smarty_tpl->tpl_vars['c']->do_else = false;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['c']->value['user'];?>
" <?php if ($_smarty_tpl->tpl_vars['customer']->value == $_smarty_tpl->tpl_vars['c']->value['user']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['c']->value['user'];?>
</option>
                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </select>
                </div>
                <div class="col-lg-2">
                    <div class="btn-group btn-group-justified" role="group">
                        <div class="btn-group" role="group">
                            <button class="btn btn-success btn-block" type="submit"><span
                                    class="fa fa-search"></span></button>
                        </div>
                        <div class="btn-group" role="group">
                            <a class="btn btn-warning btn-block" title="Clear Search Query"
                                href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/voucher/"><span class="glyphicon glyphicon-remove-circle"></span></a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="table-responsive">
        <div style="margin-left: 5px; margin-right: 5px;">&nbsp;
            <table id="datatable" class="table table-bordered table-striped table-condensed">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th><?php echo Lang::T('Type');?>
</th>
                        <th><?php echo Lang::T('Routers');?>
</th>
                        <th><?php echo Lang::T('Plan Name');?>
</th>
                        <th><?php echo Lang::T('Code Voucher');?>
</th>
                        <th><?php echo Lang::T('Status Voucher');?>
</th>
                        <th><?php echo Lang::T('Customer');?>
</th>
                        <th><?php echo Lang::T('Used Date');?>
</th>
                        <th><?php echo Lang::T('Generated By');?>
</th>
                        <th><?php echo Lang::T('Manage');?>
</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['d']->value, 'ds');
$_smarty_tpl->tpl_vars['ds']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['ds']->value) {
$_smarty_tpl->tpl_vars['ds']->do_else = false;
?>
                    <tr <?php if ($_smarty_tpl->tpl_vars['ds']->value['status'] == '1') {?>class="danger" <?php }?>>
                        <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['type'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['routers'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['name_plan'];?>
</td>
                        <td style="background-color: black; color: black;"
                            onmouseleave="this.style.backgroundColor = 'black';"
                            onmouseenter="this.style.backgroundColor = 'white';">
                            <?php echo $_smarty_tpl->tpl_vars['ds']->value['code'];?>
</td>
                        <td><?php if ($_smarty_tpl->tpl_vars['ds']->value['status'] == '0') {?> <label class="btn-tag btn-tag-success"> Not Use
                            </label> <?php } else { ?> <label class="btn-tag btn-tag-danger">Used</label>
                            <?php }?></td>
                        <td><?php if ($_smarty_tpl->tpl_vars['ds']->value['user'] == '0') {?> -
                            <?php } else { ?><a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/viewu/<?php echo $_smarty_tpl->tpl_vars['ds']->value['user'];?>
"><?php echo $_smarty_tpl->tpl_vars['ds']->value['user'];?>
</a>
                            <?php }?></td>
                        <td><?php if ($_smarty_tpl->tpl_vars['ds']->value['used_date']) {
echo Lang::dateTimeFormat($_smarty_tpl->tpl_vars['ds']->value['used_date']);
}?></td>
                        <td><?php if ($_smarty_tpl->tpl_vars['ds']->value['generated_by']) {?>
                            <a
                                href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/users-view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['generated_by'];?>
"><?php echo $_smarty_tpl->tpl_vars['admins']->value[$_smarty_tpl->tpl_vars['ds']->value['generated_by']];?>
</a>
                            <?php } else { ?> -
                            <?php }?>
                        </td>
                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['ds']->value['status'] != '1') {?>
                            <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/voucher-view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" style="margin: 0px;"
                                class="btn btn-success btn-xs">&nbsp;&nbsp;<?php echo Lang::T('View');?>
&nbsp;&nbsp;</a>
                            <?php }?>
                            <?php if (in_array($_smarty_tpl->tpl_vars['_admin']->value['user_type'],array('SuperAdmin','Admin'))) {?>
                            <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/voucher-delete/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
"
                                class="btn btn-danger btn-xs" onclick="return ask(this, '<?php echo Lang::T('Delete');?>
?')"><i
                                    class="glyphicon glyphicon-trash"></i></a>
                            <?php }?>
                        </td>
                    </tr>
                    <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </tbody>
            </table>
        </div>
    </div>
    <?php $_smarty_tpl->_subTemplateRender("file:pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
</div>
<?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
