<?php
/* Smarty version 3.1.33, created on 2020-08-11 08:08:39
  from '/Users/codeworldweb.com/websites/uvocorp/content/themes/dashboard/financial-overview.tpl' */

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

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

<div class="card">
    <div class="card-header with-icon with-nav">
        <div class="mb20"> 

            <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "unrequested" && ($_smarty_tpl->tpl_vars['user']->value['is_writer'] || $_smarty_tpl->tpl_vars['user']->value['is_editor'])) {?>
                <div class="pull-right flip">
                    <button type="button" data-toggle="popover" data-html="1" data-trigger="hover" data-placement="bottom" data-content="You can request payment on these dates - <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['payment_dates']->value, ENT_QUOTES, 'UTF-8');?>
</strong>" class="btn <?php if ($_smarty_tpl->tpl_vars['can_request_payment']->value) {?>btn-success js_request-payment<?php } else { ?>btn-default disabled<?php }?>">
                        <i class="fa fa-check-circle"></i> Request payment
                    </button>
                </div>
            <?php }?>

            <i class="fa fa-money-bill-alt mr10"></i> <strong>Financial overview</strong> 
        </div>
        <ul class="nav nav-tabs">
            <li <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "unrequested") {?>class="active"<?php }?>>
                <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/financial-overview/unrequested"> 
                    <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "unrequested") {?><strong class="pr5">Unrequested</strong><?php } else { ?>Unrequested<?php }?> 
                </a>
            </li>
            <li <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "requested") {?>class="active"<?php }?>> 
                <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/financial-overview/requested">
                    <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "requested") {?><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');?>
/financial-overview/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 == "unrequested") {?>

        <div class="card-body">
            <?php if (count($_smarty_tpl->tpl_vars['orders']->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>DATE</th>
                                <th>ORDER</th>
                                <th>TRANSACTION TYPE</th>
                                <th>COMMENTS</th>
                                <th>AMOUNT</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['orders']->value, 'order');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['order']->value) {
?>
                                <tr>
                                    <td>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "10") {?>
                                            <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['approvedAt'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['approvedAt'], ENT_QUOTES, 'UTF-8');?>
</span>
                                        <?php } elseif ($_smarty_tpl->tpl_vars['order']->value['status'] == "11") {?>
                                            <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['finishedAt'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['finishedAt'], ENT_QUOTES, 'UTF-8');?>
</span>
                                        <?php }?>
                                    </td>
                                    <td>
                                        <strong><a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
</a></strong>
                                    </td>
                                    <td>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "10") {?>
                                            order approved (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages'], ENT_QUOTES, 'UTF-8');?>
 pages)
                                        <?php } elseif ($_smarty_tpl->tpl_vars['order']->value['status'] == "11") {?>
                                            order completed (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages'], ENT_QUOTES, 'UTF-8');?>
 pages)
                                        <?php }?>
                                    </td>
                                    <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['topcat'], ENT_QUOTES, 'UTF-8');?>
</td>
                                    <td class="text-right">
                                        <?php if ($_smarty_tpl->tpl_vars['user']->value['is_writer']) {?>
                                            <strong class="text-success">+ <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['writerPay']), ENT_QUOTES, 'UTF-8');?>
</strong>
                                        <?php } elseif ($_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
                                            <strong class="text-success">+ <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['editorPay']), ENT_QUOTES, 'UTF-8');?>
</strong>
                                        <?php } else { ?>
                                            <strong class="text-danger">+ $0.00</strong>
                                        <?php }?>
                                    </td>
                                </tr>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </tbody>
                        <tfoot>
                            <?php if ($_smarty_tpl->tpl_vars['pay_delivered_orders']->value) {?>
                                <tr style="display: table-row;">
                                    <th class="text-right" align="right" colspan="4">Completed orders:</th>
                                    <td class="text-right">
                                        <strong class="text-success">+ $<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['done_orders_pay']->value, ENT_QUOTES, 'UTF-8');?>
</strong>
                                    </td>
                                </tr>
                            <?php }?>
                            <tr style="display: table-row;">
                                <th class="text-right" align="right" colspan="4">Approved orders:</th>
                                <td class="text-right">
                                    <strong class="text-success">+ $<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['completed_orders_pay']->value, ENT_QUOTES, 'UTF-8');?>
</strong>
                                </td>
                            </tr>
                            <tr style="display: table-row;">
                                <th class="text-right" align="right" colspan="4">Total:</th>
                                <td class="text-right">
                                    <strong class="text-success">+ $<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['total_pay']->value, ENT_QUOTES, 'UTF-8');?>
</strong>
                                </td>
                            </tr>
                        </tfoot>
                    </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 == "requested") {?>

        <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>DATE</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['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>
                                        <?php if ($_smarty_tpl->tpl_vars['request']->value['status'] == "-1") {?>
                                            <span>N/A</span>
                                        <?php } else { ?>
                                            <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>
                                        <?php }?>
                                    </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 } 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>
                                        <span class="label label-success">Paid</span>
                                    </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'} */
}
