<?php $__env->startSection('content'); ?>
<div class="content-wrapper">
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0">Select Team Member </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('event.list')); ?>">Event List</a></li>
                        <li class="breadcrumb-item active">Select Team Member </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <!-- Default box -->
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">Select Members </h3>
                            <div class="card-tools">
                                <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                                    <i class="fas fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="card-body">
                            <div id="example2_wrapper" class="dataTables_wrapper dt-bootstrap4">
                                <div class="row">
                                    <div class="col-sm-12 col-md-6"></div>
                                    <div class="col-sm-12 col-md-6"></div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12">
                                        <table id="example2"
                                            class="table table-bordered table-hover dataTable dtr-inline"
                                            aria-describedby="example2_info">
                                            <thead>
                                                <tr>
                                                    <th>
                                                        Customer_id</th>
                                                    <th>
                                                        Name
                                                    </th>
                                                    <th>
                                                        Action
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td class="dtr-control sorting_1" tabindex="0">
                                                        <?php echo e($val->CustomerID); ?>

                                                    </td>
                                                    <td class="dtr-control sorting_1" tabindex="0">
                                                        <?php echo e($val->CustomerName); ?>

                                                    </td>
                                                    <td>
                                                        <input type="checkbox" class="btn bg-gradient-success btn-sm"
                                                            id="<?php echo e($val->id); ?>" onclick="storeadminassign(this)"
                                                            value="<?php echo e($val->is_admin); ?>" <?php if($val->is_admin == "true"): ?>
                                                        checked <?php endif; ?>>
                                                    </td>
                                                </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="isadmin-modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="modal-title"></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <form method="post" action="<?php echo e(route('event.storeadminassign')); ?>"><?php echo csrf_field(); ?>
                <div class="modal-body">
                    <input type="hidden" name="id" id="id">
                    <input type="hidden" name="isadminvalue" id="isadminvalue">
                </div>
                <div class="modal-footer justify-content-between">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">OK</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
function storeadminassign(elm) {
    var id = $(elm).attr('id');
    var isadminvalue = elm.value;
    if (isadminvalue != "true") {
        $("#modal-title").html("Are you sure? you want to make it admin?");
    } else {
        $("#modal-title").html("Are you sure? you want to remove admin?");
    }

    $("#id").val(id);
    $("#isadminvalue").val(isadminvalue);
    $("#isadmin-modal").modal('show');
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/asojsoftcaps/public_html/frenzincrm.asojsoftcaps.com/frenzincrm/resources/views/events/eventassignadmin.blade.php ENDPATH**/ ?>