

<?php $__env->startSection('title'); ?>
<?php echo e(__('Role')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<div class="row page-title align-items-center">
    <div class="col-12 col-xl-12">
        <h3 class="mb-1 mt-0 text-left"><?php echo e(__('Role list')); ?>

            <span style="float:right;"> 
            <a href="javascript:;" role="button" class="btn custom-button " data-toggle="modal"
                data-target="#createRoleModal"><i
                    class="uil-plus mr-1"></i> 
                <?php echo e(__('Create role')); ?></a></span>
        </h3>
        <nav aria-label="breadcrumb" class="float-left mt-1">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>"><?php echo e(__('Home')); ?></a></li>
                <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('Role list')); ?></li>
            </ol>
        </nav>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<!-- products -->
<div class="row">
    <div class="col-xl-12">
        <div class="card">
            <div class="card-body">

                <div class="table-responsive mt-4">
                    <table class="table table-hover table-nowrap mb-0">
                        <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col"><?php echo e(__('Role')); ?></th>
                                <th scope="col"><?php echo e(__('Status')); ?></th>
                                <th scope="col"><?php echo e(__('Action')); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>#1</td>
                                <td>Admin</td>
                                <td><span class="badge badge-soft-success py-1">Active</span></td>
                                <td>
                                    <a href="#" class="text-warning d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Edit Role">
                                        <i class="uil uil-edit " data-toggle="modal" data-target="#editRoleModal"></i>
                                    </a>
                                    <a href="<?php echo e(route('permission')); ?>" class="text-info d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Role permissions">
                                        <i class="uil uil-dna"></i>
                                    </a>
                                    <a href="#" class="text-danger d-inline-block btnDelete" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Delete Role">
                                        <i class="uil uil-trash "></i>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td>#2</td>
                                <td>Customer</td>
                                <td><span class="badge badge-soft-success py-1">Customer</span>
                                </td>
                                <td>
                                    <a href="#" class="text-warning d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Edit Role">
                                        <i class="uil uil-edit " data-toggle="modal" data-target="#editRoleModal"></i>
                                    </a>
                                    <a href="<?php echo e(route('permission')); ?>" class="text-info d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Role permissions">
                                        <i class="uil uil-dna"></i>
                                    </a>
                                    <a href="#" class="text-danger d-inline-block btnDelete" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Delete Role">
                                        <i class="uil uil-trash "></i>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td>#3</td>
                                <td>Contractor</td>
                                <td><span class="badge badge-soft-danger py-1">Decline</span>
                                </td>
                                <td>
                                    <a href="#" class="text-warning d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Edit Role">
                                        <i class="uil uil-edit " data-toggle="modal" data-target="#editRoleModal"></i>
                                    </a>
                                    <a href="<?php echo e(route('permission')); ?>" class="text-info d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Role permissions">
                                        <i class="uil uil-dna"></i>
                                    </a>
                                    <a href="#" class="text-danger d-inline-block btnDelete" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Delete Role">
                                        <i class="uil uil-trash "></i>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td>#4</td>
                                <td>Sub contractor</td>
                                <td><span class="badge badge-soft-warning py-1">Pending</span>
                                </td>
                                <td>
                                    <a href="#" class="text-warning d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Edit Role">
                                        <i class="uil uil-edit " data-toggle="modal" data-target="#editRoleModal"></i>
                                    </a>
                                    <a href="<?php echo e(route('permission')); ?>" class="text-info d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Role permissions">
                                        <i class="uil uil-dna"></i>
                                    </a>
                                    <a href="#" class="text-danger d-inline-block btnDelete" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Delete Role">
                                        <i class="uil uil-trash "></i>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td>#5</td>
                                <td>Construction</td>
                                <td><span class="badge badge-soft-success py-1">Customer</span>
                                </td>
                                <td>
                                    <a href="#" class="text-warning d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Edit Role">
                                        <i class="uil uil-edit " data-toggle="modal" data-target="#editRoleModal"></i>
                                    </a>
                                    <a href="<?php echo e(route('permission')); ?>" class="text-info d-inline-block" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Role permissions">
                                        <i class="uil uil-dna"></i>
                                    </a>
                                    <a href="#" class="text-danger d-inline-block btnDelete" data-toggle="tooltip"
                                        data-placement="top" title="" data-original-title="Delete Role">
                                        <i class="uil uil-trash "></i>
                                    </a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div> <!-- end table-responsive-->
            </div> <!-- end card-body-->
        </div> <!-- end card-->
    </div> <!-- end col-->
</div>
<!-- end row -->

<!-- Role modal content -->
<div id="createRoleModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createRoleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="createRoleModalLabel"><?php echo e(__('Create role')); ?></h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-group mb-3">
                    <label><?php echo e(__('Name')); ?></label>
                    <input type="text" id="name" name="name" class="form-control" placeholder="<?php echo e(__('Enter name')); ?>">
                </div>
                <div class="form-group mb-3">
                    <label><?php echo e(__('Status')); ?></label>
                    <select class="custom-select mb-2">
                        <option selected><?php echo e(__('Select status')); ?></option>
                        <option value="1">Active</option>
                        <option value="2">Pending</option>
                        <option value="3">Decline</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn custom-button"><?php echo e(__('Save changes')); ?></button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- Role modal content -->
<div id="editRoleModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="editRoleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="editRoleModalLabel"><?php echo e(__('Edit role')); ?></h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-group mb-3">
                    <label><?php echo e(__('Name')); ?></label>
                    <input type="text" id="name" name="name" class="form-control" placeholder="Enter name">
                </div>
                <div class="form-group mb-3">
                    <label><?php echo e(__('Status')); ?></label>
                    <select class="custom-select mb-2">
                        <option selected><?php echo e(__('Select status')); ?></option>
                        <option value="1">Active</option>
                        <option value="2">Pending</option>
                        <option value="3">Decline</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn custom-button"><?php echo e(__('Save changes')); ?></button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- end row -->


<div class="row">
    <div class="col-4"></div>
    <div class="col-4">
        <ul class="pagination  mb-3 flex-wrap">
            <li class="page-item page-prev disabled">
                <a class="page-link" href="#" tabindex="-1"><?php echo e(__('Prev')); ?></a>
            </li>
            <li class="page-item active"><a class="page-link" href="#">1</a></li>
            <li class="page-item"><a class="page-link" href="#">2</a></li>
            <li class="page-item"><a class="page-link" href="#">3</a></li>
            <li class="page-item"><a class="page-link" href="#">4</a></li>
            <li class="page-item"><a class="page-link" href="#">5</a></li>
            <li class="page-item"><a class="page-link" href="#">6</a></li>
            <li class="page-item page-next">
                <a class="page-link" href="#"><?php echo e(__('Next')); ?></a>
            </li>
        </ul>
    </div>
    <div class="col-4"></div>
</div>
<!-- end row -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('script-bottom'); ?>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.1.10/dist/sweetalert2.all.min.js"></script>

<script type="text/javascript">
    // Delete

    $(document).on('click', '.btnDelete', function (e) {
        var member = $(this).attr('id');
        Swal.fire({
                title: "Are you sure?",
                text: "You will not be able to recover this Role!",
                type: "warning",
                buttons: true,
                confirmButtonColor: "#ff5e5e",
                confirmButtonText: "Yes, delete it!",
                closeOnConfirm: false,
                dangerMode: true,
                showCancelButton: true
            })
            .then((deleteThis) => {
                if (deleteThis.isConfirmed) {
                    $.ajax({
                        url: '',
                        type: "GET",
                        dataType: "JSON",
                        data: {
                            member: member

                        },
                        success: function (response) {

                            if (response["status"] == "fail") {
                                Swal.fire("Failed!", "Failed to delete role.", "error");
                            } else if (response["status"] == "success") {
                                Swal.fire("Deleted!", "role has been deleted.",
                                    "success");

                                // Using .reload() method.
                                location.reload();
                            }
                        },
                        error: function (error) {
                            console.log(error);
                        },
                        async: false
                    });
                } else {
                    Swal.close();
                }
            });
    });
</script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\php\www\laravel\baramdat\hvg\hvg\resources\views/general/user/user-role.blade.php ENDPATH**/ ?>