<?php
/* Smarty version 3.1.33, created on 2020-07-05 13:09:27
  from '/Users/codeworldweb.com/websites/uvocorp/content/themes/dashboard/payments.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5f01d107bacaf2_43010687',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'f88125d7de295e0bf23f2e5da0c2d3d0689f6e81' => 
    array (
      0 => '/Users/codeworldweb.com/websites/uvocorp/content/themes/dashboard/payments.tpl',
      1 => 1592297058,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5f01d107bacaf2_43010687 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>
 

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_7191475525f01d107b8bbc0_29115156', 'content_wrapper');
$_smarty_tpl->inheritance->endChild($_smarty_tpl, 'dashboard/layout.tpl');
}
/* {block 'content_wrapper'} */
class Block_7191475525f01d107b8bbc0_29115156 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content_wrapper' => 
  array (
    0 => 'Block_7191475525f01d107b8bbc0_29115156',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

    <div class="card">
        <div class="card-header with-icon with-nav">
            <div class="mb20"> 
                <i class="fa fa-money-bill-alt mr10"></i> <strong>Payments</strong> 
            </div>
            <ul class="nav nav-tabs">
                <li <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "overview") {?>class="active"<?php }?>>
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/payments/overview"> 
                        <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "overview") {?><strong class="pr5">Overview</strong><?php } else { ?>Overview<?php }?> 
                    </a>
                </li>

                <li <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "requests") {?>class="active"<?php }?>>
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/payments/requests"> 
                        <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "requests") {?><strong class="pr5">Payment Requests</strong><?php } else { ?>Payment Requests<?php }?> 
                    </a>
                </li>

                <li <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>class="active"<?php }?>>
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/payments/history"> 
                        <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "history") {?><strong class="pr5">Payment History</strong><?php } else { ?>Payment History<?php }?> 
                    </a>
                </li>

            </ul>
        </div>

        <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "overview") {?>

            <div class="card-body">
                <form method="GET" class="mb20" autocomplete="off">
                    <input type="hidden" name="page" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected_page']->value, ENT_QUOTES, 'UTF-8');?>
"/>
                    <div class="row">

                        <div class="form-group col-md-4">
                            <label class="control-label text-left">From (completed date)</label>
                            <div class="input-group date js_datetimepicker" id="from" data-target-input="nearest">
                                <input type='text' class="form-control datetimepicker-input" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['date_from']->value, ENT_QUOTES, 'UTF-8');?>
" data-target="#from" name="from" />
                                <div class="input-group-append" data-target="#from" data-toggle="datetimepicker">
                                    <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label class="control-label text-left">To (completed date)</label>
                            <div class="input-group date js_datetimepicker" id="to" data-target-input="nearest">
                                <input type='text' class="form-control datetimepicker-input" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['date_to']->value, ENT_QUOTES, 'UTF-8');?>
" data-target="#to" name="to" />
                                <div class="input-group-append" data-target="#to" data-toggle="datetimepicker">
                                    <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group col-md-2">
                            <label class="form-label">Employee</label>
                            <select name="employee" class="form-control">
                                <option value="all" <?php if ($_smarty_tpl->tpl_vars['employee_group']->value == "all") {?>selected=""<?php }?>>All</option>
                                <option value="writer" <?php if ($_smarty_tpl->tpl_vars['employee_group']->value == "writer") {?>selected=""<?php }?>>Writer</option>
                                <option value="editor" <?php if ($_smarty_tpl->tpl_vars['employee_group']->value == "editor") {?>selected=""<?php }?>>Editor</option>
                            </select>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-info">Search</button>
                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/payments/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['sub_view']->value, ENT_QUOTES, 'UTF-8');?>
" class="btn btn-default">Clear</a>
                </form>

                <?php if (count($_smarty_tpl->tpl_vars['payment_overview']->value) > 0) {?>
                    <div class="table-responsive">
                        <table class="table <?php if ($_smarty_tpl->tpl_vars['theme_mode_night']->value) {?>table-dark<?php }?> table-striped table-bordered table-hover js_dataTable">
                            <thead>
                                <tr>
                                                
                                    <th>EMPLOYEE</th>
                                    <th>EMAIL</th>
                                    <th>ORDERS</th>
                                    <th>PAGES</th>
                                    <th>TOTAL</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['payment_overview']->value, 'overview');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['overview']->value) {
?>
                                    <tr>
                                        <td>
                                            <strong>
                                            <?php if ($_smarty_tpl->tpl_vars['overview']->value['employee_group'] == "2") {?>Editor<?php } else { ?>Writer<?php }?>
                                            <a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['employee_id'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['last_name'], ENT_QUOTES, 'UTF-8');?>
</a>
                                            </strong>
                                        </td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['email'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['total_orders'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['total_pages'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['overview']->value['employee_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        </td>
                                    </tr>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </tbody>
                        </table>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    </div>
                <?php } else { ?>
                    <div class="text-center x-muted"> 
                        <img class="mb20" width="15%" src="/static/images/no_results.png">
                        <p class="mb10"><strong>The list is empty.</strong></p>
                    </div>
                <?php }?>

            </div>

        <?php } elseif ($_smarty_tpl->tpl_vars['sub_view']->value == "requests") {?>

            <div class="card-body">
                <?php if (count($_smarty_tpl->tpl_vars['requests']->value) > 0) {?>
                    <div class="table-responsive">
                        <table class="table <?php if ($_smarty_tpl->tpl_vars['theme_mode_night']->value) {?>table-dark<?php }?> table-striped table-bordered table-hover js_dataTable">
                            <thead>
                                <tr>
                                    <th>Employee</th>
                                    <th>Date</th>
                                    <th>Done Orders</th>
                                    <th>Approved Orders</th>
                                    <th>Total</th>
                                    <th>Orders</th>
                                    <th>Actions</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['requests']->value, 'request');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['request']->value) {
?>
                                    <tr>
                                        <td>
                                            <strong>
                                                <?php if ($_smarty_tpl->tpl_vars['request']->value['employee']['employee_group'] == "2") {?>Editor<?php } else { ?>Writer<?php }?>
                                                <a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['employee']['id'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['employee']['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['employee']['last_name'], ENT_QUOTES, 'UTF-8');?>
</a>
                                            </strong>
                                        </td>
                                        <td>
                                            <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['date_add'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['date_add'], ENT_QUOTES, 'UTF-8');?>
</span>
                                        </td>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_done_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_completed_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        </td>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        </td>
                                        <td>
                                            <span class="text-link" data-toggle="modal" data-url="/user/payment-requests/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['payment_request_id'], ENT_QUOTES, 'UTF-8');?>
">Show</span>
                                        </td>
                                        <td>
                                            <button data-toggle="tooltip" data-placement="top" title="" class="btn btn-xs btn-success js_admin-withdraw" data-handle="approve" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['payment_request_id'], ENT_QUOTES, 'UTF-8');?>
" data-original-title="Mark as Paid"> 
                                                <i class="fa fa-check"></i> 
                                            </button>
                                            <button data-toggle="tooltip" data-placement="top" title="Decline" class="btn btn-xs btn-danger js_admin-withdraw" data-handle="decline" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['payment_request_id'], ENT_QUOTES, 'UTF-8');?>
"> 
                                                <i class="fa fa-times"></i> 
                                            </button>
                                        </td>
                                    </tr>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </tbody>
                        </table>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    </div>
                <?php } else { ?>
                    <div class="text-center x-muted"> 
                        <img class="mb20" width="15%" src="/static/images/no_results.png">
                        <p class="mb10"><strong>The list is empty.</strong></p>
                    </div>
                <?php }?>
            </div>

        <?php } elseif ($_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>

            <div class="card-body">
                <?php if (count($_smarty_tpl->tpl_vars['requests']->value) > 0) {?>
                    <div class="table-responsive">
                        <table class="table <?php if ($_smarty_tpl->tpl_vars['theme_mode_night']->value) {?>table-dark<?php }?> table-striped table-bordered table-hover js_dataTable">
                            <thead>
                                <tr>
                                    <th>PAID AT</th>
                                    <th>DONE ORDERS</th>
                                    <th>APPROVED ORDERS</th>
                                    <th>TOTAL</th>
                                    <th>ORDERS</th>
                                    <th>STATUS</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['requests']->value, 'request');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['request']->value) {
?>
                                    <tr>
                                        <td>
                                            <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['paid_at'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['paid_at'], ENT_QUOTES, 'UTF-8');?>
</span>
                                        </td>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_done_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_completed_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        </td>
                                        <td class="text-right">
                                            <strong class="text-success">$<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['total_pay'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                        </td>
                                        <td>
                                            <span class="text-link" data-toggle="modal" data-url="/user/payment-requests/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['request']->value['payment_request_id'], ENT_QUOTES, 'UTF-8');?>
">Show</span>
                                        </td>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['request']->value['status'] == "0") {?>
                                                <span class="label label-warning">Pending</span>
                                            <?php } elseif ($_smarty_tpl->tpl_vars['request']->value['status'] == "1") {?>
                                                <span class="label label-success">Paid</span>
                                            <?php } elseif ($_smarty_tpl->tpl_vars['request']->value['status'] == "-1") {?>
                                                <span class="label label-danger">Declined</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </tbody>
                        </table>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    </div>
                <?php } else { ?>
                    <div class="text-center x-muted"> 
                        <img class="mb20" width="15%" src="/static/images/no_results.png">
                        <p class="mb10"><strong>The list is empty.</strong></p>
                    </div>
                <?php }?>
            </div>

        <?php }?>

    </div>
<?php
}
}
/* {/block 'content_wrapper'} */
}
