<?php
/* Smarty version 4.5.3, created on 2024-12-04 05:53:42
  from '/var/www/html/admin/ui/ui/customers.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_674fc436be0ae5_33854786',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '52dc59eb37d743954b4885f85311a75c360b79a5' => 
    array (
      0 => '/var/www/html/admin/ui/ui/customers.tpl',
      1 => 1733093879,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:pagination.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_674fc436be0ae5_33854786 (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);
?>

<style>
    /* Style for pagination buttons */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        display: inline-block;
        padding: 5px 10px;
        margin-right: 5px;
        border: 1px solid #ccc;
        background-color: #fff;
        color: #333;
        cursor: pointer;
    }

    /* Hover effect for pagination buttons */
    .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background-color: #f0f0f0;
        border-color: #888;
    }

    /* Style for table rows */
    .table tbody tr:hover {
        background-color: #f9f9f9;
        cursor: pointer;
    }

    /* Enhanced styling for buttons */
    .btn-xs {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Add spacing for action buttons */
    .table-actions a {
        margin-right: 5px;
    }

    /* Ensure table is fully responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table td, .table th {
        white-space: nowrap;
    }

    /* Ensure form elements are displayed in a single row */
    .md-whiteframe-z1 .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .md-whiteframe-z1 .input-group {
        width: 100%;
    }

    .md-whiteframe-z1 .col-lg-3,
    .md-whiteframe-z1 .col-lg-2 {
        flex: 1 1 22%; /* Adjust width of columns to fit in one row */
        max-width: 22%;
    }

    .md-whiteframe-z1 .input-group-addon {
        min-width: 80px; /* To ensure the labels don't overlap */
    }

    .md-whiteframe-z1 .input-group input,
    .md-whiteframe-z1 .input-group select {
        width: 100%;
    }

    .md-whiteframe-z1 .input-group-btn button {
        margin-left: 5px; /* Add margin between the buttons */
    }

    /* Adjust padding and spacing to ensure proper alignment */
    .md-whiteframe-z1 {
        padding: 15px 10px;
    }

    /* Default Flexbox layout for larger screens */
    .md-whiteframe-z1 .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .md-whiteframe-z1 .col-lg-3,
    .md-whiteframe-z1 .col-lg-2 {
        flex: 1 1 22%; /* Default width for larger screens */
        max-width: 22%;
    }

    /* Adjust the width of input fields to fill their containers */
    .md-whiteframe-z1 .input-group {
        width: 100%;
    }

    /* Ensure the label has enough space without overlapping */
    .md-whiteframe-z1 .input-group-addon {
        min-width: 80px;
    }

    .md-whiteframe-z1 .input-group input,
    .md-whiteframe-z1 .input-group select {
        width: 100%;
    }

    .md-whiteframe-z1 .input-group-btn button {
        margin-left: 5px; /* Add margin between buttons */
    }

    /* For small screens (e.g., mobile) - Stack inputs in a column */
    @media (max-width: 767px) {
        .md-whiteframe-z1 .col-lg-3,
        .md-whiteframe-z1 .col-lg-2 {
            flex: 1 1 100%;  /* Make each input take full width on small screens */
            max-width: 100%;
            margin-bottom: 10px; /* Add space between elements */
        }

        /* Adjust the size of the input group on small screens */
        .md-whiteframe-z1 .input-group {
            margin-bottom: 10px; /* Space between the form fields */
        }

        .md-whiteframe-z1 .input-group-addon {
            min-width: 70px;  /* Reduce label width for smaller screens */
        }
    }

    /* For medium-sized screens (tablets) */
    @media (min-width: 768px) and (max-width: 991px) {
        .md-whiteframe-z1 .col-lg-3,
        .md-whiteframe-z1 .col-lg-2 {
            flex: 1 1 48%;  /* Take up 48% of the row */
            max-width: 48%;
        }
    }

    /* Make the panel title bold */
    .panel-heading .panel-title {
        font-weight: bold; /* Make the title bold */
    }

    /* Fix visibility issues for Package and Online Status columns */
    .table td:nth-child(7),  /* Package column */
    .table td:nth-child(11) { /* Online Status column */
        visibility: visible !important;
        opacity: 1 !important;
        display: table-cell !important;
    }

    /* Ensure that column headers are not hidden */
    .table th:nth-child(7), /* Package header */
    .table th:nth-child(11) { /* Online Status header */
        visibility: visible !important;
        opacity: 1 !important;
        display: table-cell !important;
    }
</style>

<div class="row">
    <div class="col-sm-12">
        <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-primary btn-xs" title="save" href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/csv&token=<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
"
                            onclick="return ask(this, 'This will export to CSV?')">
                            <span class="glyphicon glyphicon-download" aria-hidden="true"></span> CSV
                        </a>
                    </div>
                <?php }?>
                <?php echo Lang::T('Manage Contact');?>

            </div>
            <div class="panel-body">
                <form id="site-search" method="post" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers">
                    <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
">
                    <div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
                        <div class="row">
                            <div class="col-lg-3">
                                <div class="input-group">
                                    <span class="input-group-addon">Order&nbsp;&nbsp;</span>
                                    <select class="form-control" id="order" name="order">
                                        <option value="username" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'username') {?>selected<?php }?>><?php echo Lang::T('Username');?>
</option>
                                        <option value="fullname" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'fullname') {?>selected<?php }?>><?php echo Lang::T('First Name');?>
</option>
                                        <option value="lastname" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'lastname') {?>selected<?php }?>><?php echo Lang::T('Last Name');?>
</option>
                                        <option value="created_at" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'created_at') {?>selected<?php }?>><?php echo Lang::T('Created Date');?>
</option>
                                        <option value="balance" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'balance') {?>selected<?php }?>><?php echo Lang::T('Balance');?>
</option>
                                        <option value="status" <?php if ($_smarty_tpl->tpl_vars['order']->value == 'status') {?>selected<?php }?>><?php echo Lang::T('Status');?>
</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-3">
                                <div class="input-group">
                                    <span class="input-group-addon">Ascending&nbsp;&nbsp;</span>
                                    <select class="form-control" id="orderby" name="orderby">
                                        <option value="asc" <?php if ($_smarty_tpl->tpl_vars['orderby']->value == 'asc') {?>selected<?php }?>><?php echo Lang::T('Ascending');?>
</option>
                                        <option value="desc" <?php if ($_smarty_tpl->tpl_vars['orderby']->value == 'desc') {?>selected<?php }?>><?php echo Lang::T('Descending');?>
</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-2">
                                <div class="input-group">
                                    <span class="input-group-addon">Status&nbsp;&nbsp;</span>
                                    <select class="form-control" id="filter" name="filter">
                                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['statuses']->value, 'status');
$_smarty_tpl->tpl_vars['status']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['status']->value) {
$_smarty_tpl->tpl_vars['status']->do_else = false;
?>
                                            <option value="<?php echo $_smarty_tpl->tpl_vars['status']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['filter']->value == $_smarty_tpl->tpl_vars['status']->value) {?>selected<?php }?>><?php echo Lang::T($_smarty_tpl->tpl_vars['status']->value);?>
</option>
                                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-3">
                                <div class="input-group">
                                    <input type="text" name="search" class="form-control" placeholder="<?php echo Lang::T('Search');?>
..." value="<?php echo $_smarty_tpl->tpl_vars['search']->value;?>
">
                                    <div class="input-group-btn">
                                        <button class="btn btn-primary" type="submit"><span class="fa fa-search"></span> <?php echo Lang::T('Search');?>
</button>
                                        <button class="btn btn-info" type="submit" name="export" value="csv">
                                            <span class="glyphicon glyphicon-download" aria-hidden="true"></span> CSV
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-lg-4">
                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/add" class="btn btn-success text-black btn-block" title="<?php echo Lang::T('Add');?>
">
                            <i class="ion ion-android-add"></i><i class="glyphicon glyphicon-user">Add New Client</i>
                        </a>
                    </div>
                </form>
                <br>&nbsp;
                <div class="table-responsive">
                    <table id="customerTable" class="table table-bordered table-striped table-condensed">
                        <thead>
                            <tr>
                                <th><?php echo Lang::T('Username');?>
</th>
                                <th>Photo</th>
                                <th><?php echo Lang::T('Account Type');?>
</th>
                                <th><?php echo Lang::T('Full Name');?>
</th>
                                <th><?php echo Lang::T('Balance');?>
</th>
                                <th><?php echo Lang::T('Contact');?>
</th>
                                <th><?php echo Lang::T('Package');?>
</th>
                                <th><?php echo Lang::T('Service Type');?>
</th>
                                <th>PPPOE</th>
                                <th><?php echo Lang::T('Status');?>
</th>
                                <th><?php echo Lang::T('Created On');?>
</th>
                                <th><?php echo Lang::T('Online Status');?>
</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'] != 'Active') {?>class="danger" <?php }?>>
                                    <td onclick="window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
'" style="cursor:pointer;"><?php echo $_smarty_tpl->tpl_vars['ds']->value['username'];?>
</td>
                                    <td>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['UPLOAD_PATH']->value;
echo $_smarty_tpl->tpl_vars['ds']->value['photo'];?>
" target="photo">
                                            <img src="<?php echo $_smarty_tpl->tpl_vars['UPLOAD_PATH']->value;
echo $_smarty_tpl->tpl_vars['ds']->value['photo'];?>
.thumb.jpg" width="32" alt="">
                                        </a>
                                    </td>
                                    <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['account_type'];?>
</td>
                                    <td onclick="window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
'" style="cursor: pointer;"><?php echo $_smarty_tpl->tpl_vars['ds']->value['fullname'];?>
</td>
                                    <td><?php echo Lang::moneyFormat($_smarty_tpl->tpl_vars['ds']->value['balance']);?>
</td>
                                    <td align="center">
                                        <?php if ($_smarty_tpl->tpl_vars['ds']->value['phonenumber']) {?>
                                            <a href="tel:<?php echo $_smarty_tpl->tpl_vars['ds']->value['phonenumber'];?>
" class="btn btn-default btn-xs" title="<?php echo $_smarty_tpl->tpl_vars['ds']->value['phonenumber'];?>
"><i class="glyphicon glyphicon-earphone"></i></a>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['ds']->value['email']) {?>
                                            <a href="mailto:<?php echo $_smarty_tpl->tpl_vars['ds']->value['email'];?>
" class="btn btn-default btn-xs" title="<?php echo $_smarty_tpl->tpl_vars['ds']->value['email'];?>
"><i class="glyphicon glyphicon-envelope"></i></a>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['ds']->value['coordinates']) {?>
                                            <a href="https://www.google.com/maps/dir//<?php echo $_smarty_tpl->tpl_vars['ds']->value['coordinates'];?>
/" target="_blank" class="btn btn-default btn-xs" title="<?php echo $_smarty_tpl->tpl_vars['ds']->value['coordinates'];?>
"><i class="glyphicon glyphicon-map-marker"></i></a>
                                        <?php }?>
                                    </td>
                                    <td align="center" api-get-text="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
autoload/plan_is_active/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
">
                                        <span class="label label-default">&bull;</span>
                                    </td>
                                    <td><?php echo $_smarty_tpl->tpl_vars['ds']->value['service_type'];?>
</td>
                                    <td>
                                        <?php echo $_smarty_tpl->tpl_vars['ds']->value['pppoe_username'];?>

                                        <?php if (!empty($_smarty_tpl->tpl_vars['ds']->value['pppoe_username']) && !empty($_smarty_tpl->tpl_vars['ds']->value['pppoe_ip'])) {?>:<?php }?>
                                        <?php echo $_smarty_tpl->tpl_vars['ds']->value['pppoe_ip'];?>

                                    </td>
                                    <td><?php echo Lang::T($_smarty_tpl->tpl_vars['ds']->value['status']);?>
</td>
                                    <td><?php echo Lang::dateTimeFormat($_smarty_tpl->tpl_vars['ds']->value['created_at']);?>
</td>
                                    <!-- Online Status Column -->
                                    <td>
                                        <?php if ($_smarty_tpl->tpl_vars['ds']->value['last_seen'] == 'online') {?>
                                            <span class="label label-success"><?php echo Lang::T('Online');?>
</span>
                                        <?php } else { ?>
                                            <span class="label label-default">
                                                <?php echo Lang::T('Last Seen');?>
: <?php echo Lang::dateTimeFormat($_smarty_tpl->tpl_vars['ds']->value['last_seen']);?>

                                            </span>
                                        <?php }?>
                                    </td>
                                    <td align="center" class="table-actions">
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/view/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" class="btn btn-success btn-xs">&nbsp;&nbsp;<?php echo Lang::T('View');?>
&nbsp;&nbsp;</a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/edit/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
&token=<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" class="btn btn-info btn-xs">&nbsp;&nbsp;<?php echo Lang::T('Edit');?>
&nbsp;&nbsp;</a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/sync/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
&token=<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" class="btn btn-success btn-xs">&nbsp;&nbsp;<?php echo Lang::T('Sync');?>
&nbsp;&nbsp;</a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plan/recharge/<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
&token=<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
" id="<?php echo $_smarty_tpl->tpl_vars['ds']->value['id'];?>
" class="btn btn-primary btn-xs"><?php echo Lang::T('Recharge');?>
</a>
                                    </td>
                                </tr>
                            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </tbody>
                    </table>
                </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>
        </div>
    </div>
</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);
?>

<?php }
}
