<?php
/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 *  contact@earworks.co.id
 */
defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->title = $this->lang->line('admins');
$this->load->add_map($this->load->title);
?>
<a type="button" href="<?php echo base_url('backoffice/admins/create') ?>" class="btn btn-primary pull-right mt-ladda-btn ladda-button" data-style="zoom-in" style='margin-top: -52px;'>
    <span class="ladda-label">
        <i class="icon-plus"></i>&nbsp;
    <?php echo $this->lang->line('create') ?>
    </span>
    <span class="ladda-spinner"></span>
 </a>
<div class="portlet light bordered">
    <div class="portlet-body">
        <table class="table table-striped table-bordered table-hover dt-responsive dataTable no-footer dtr-inline collapsed" style="width: 100%;">
            <thead>
                <tr>
                    <th class="all sorting">
                        <?php echo $this->lang->line('profilename') ?>
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('useremail') ?>
                    </th>
                    <th class="min-tablet sorting" style="display: none;">
                        <?php echo $this->lang->line('userstatus') ?>
                    </th>
                    <th class="min-phone1 sorting" style="display: none;">
                        <?php echo $this->lang->line('created') ?>
                    </th>
                    <th class="none sorting" style="width: 0px; display: none;">
                        <?php echo $this->lang->line('profileaddress') ?>
                    </th>
                    <th class="none sorting" style="width: 0px; display: none;">
                        <?php echo $this->lang->line('profilemobile') ?>
                    </th>
                    <th class="none sorting" style="display: none;">
                        <?php echo $this->lang->line('rolename') ?>
                    </th>
                    <th class="min-phone1" style="width: 140px;">
                        <?php echo $this->lang->line('action') ?>
                    </th>
                </tr>
            </thead>
            <tbody>
                <?php
                $odd_even_class = array('odd', 'even');
                ?>
                <?php foreach ($data as $k => $v) : ?>
                    <tr class="<?php echo $odd_even_class[($k % 2 == 0) ? 1 : 0] ?>">
                        <td tabindex="0"><?php echo $v['profilename'] ?></td>
                        <td><?php echo $v['useremail'] ?></td>
                        <td><?php echo $this->lang->line(($v['userstatus']) ? 'active' : 'inactive') ?></td>
                        <td style="display: none;"><?php echo date('Y-m-d', $v['created']) ?></td>
                        <td style="display: none;"><?php echo $v['profileaddress'] ?></td>
                        <td style="display: none;"><?php echo $v['profilemobile'] ?></td>
                        <td style="display: none;"><?php echo $v['rolename'] ?></td>
                        <td style="display: none;">
                            <a type="button" href="<?php echo base_url('backoffice/admins/update/' . $v['userid']) ?>" class="btn btn-info btn-sm mt-ladda-btn ladda-button" data-style="zoom-in" style="margin-bottom: 5px;">
                                <span class="ladda-label">
                                    <i class="icon-pencil"></i>
                                    <?php echo $this->lang->line('edit') ?>
                                </span>
                                <span class="ladda-spinner"></span>
                            </a>
                            <a type="button" href="<?php echo base_url('backoffice/admins/delete/' . $v['userid']) ?>" data-verify="<?php echo $this->lang->line('verifydelete') ?>" class="btn btn-warning btn-sm mt-ladda-btn ladda-button" data-style="zoom-in" style="margin-bottom: 5px;">
                                <span class="ladda-label">
                                    <i class="icon-close"></i>
                                    <?php echo $this->lang->line('delete') ?>
                                </span>
                                <span class="ladda-spinner"></span>
                            </a>
                            <a type="button" href="<?php echo base_url('backoffice/admins/suspend/' . $v['userid']) ?>" data-verify="<?php echo $this->lang->line('verifysuspend') ?>" class="btn btn-default btn-sm mt-ladda-btn ladda-button" data-style="zoom-in" style="margin-bottom: 5px;">
                                <span class="ladda-label">
                                    <i class="icon-ban"></i>
                                    <?php echo $this->lang->line('suspend') ?>
                                </span>
                                <span class="ladda-spinner"></span>
                            </a>
                            <a type="button" href="<?php echo base_url('backoffice/admins/unsuspend/' . $v['userid']) ?>" data-verify="<?php echo $this->lang->line('verifyunsuspend') ?>" class="btn btn-primary btn-sm mt-ladda-btn ladda-button" data-style="zoom-in" style="margin-bottom: 5px;">
                                <span class="ladda-label">
                                    <i class="icon-check"></i>
                                    <?php echo $this->lang->line('unsuspend') ?>
                                </span>
                                <span class="ladda-spinner"></span>
                            </a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>