<?php $__env->startSection('title', trans('admin.customer.actions.index')); ?>

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

    <customer-listing
        :data="<?php echo e($data->toJson()); ?>"
        :url="'<?php echo e(url('admin/customers')); ?>'"
        inline-template>

        <div class="row">
            <div class="col">
                <div class="card">
                    <div class="card-header">
                        <i class="ti-align-justify"></i> <?php echo e(trans('admin.customer.actions.index')); ?>

                        <a class="btn btn-primary btn-spinner btn-sm pull-right m-b-0" href="<?php echo e(url('admin/customers/create')); ?>" role="button"><i class="ti-plus"></i>&nbsp; <?php echo e(trans('admin.customer.actions.create')); ?></a>
                    </div>
                    <div class="card-content" v-cloak>
                        <div class="card-block">
                            <form @submit.prevent="">
                                <div class="row justify-content-md-between">
                                        <div class="col col-lg-12 col-xl-5 form-group search-box">
                                            <div class="input-group search-bar">
                                                <input class="form-control" placeholder="<?php echo e(trans('brackets/admin-ui::admin.placeholder.search')); ?>" v-model="search" @keyup.enter="filter('search', $event.target.value)" />
                                                <span class="btn btn-primary input-group-addon search-logo" @click="filter('search', search)"><i class="ti-search"></i></span>
                                            </div>

                                            <label>
                                                <select class="form-control" v-model="pagination.state.per_page">
                                                    <option value="200">200</option>
                                                    <option value="250">250</option>
                                                    <option value="300">300</option>
                                                </select>
                                            </label>
                                        </div>
                                </div>


                            </form>

                            <table class="table table-hover table-listing">
                                <thead>
                                    <tr>
                                        <th class="bulk-checkbox">
                                            <input class="form-check-input" id="enabled" type="checkbox" v-model="isClickedAll" v-validate="''" data-vv-name="enabled"  name="enabled_fake_element" @click="onBulkItemsClickedAllWithPagination()">
                                            <label class="form-check-label" for="enabled">
                                                #
                                            </label>
                                        </th>

                                        <th is='sortable' :column="'id'"><?php echo e(trans('admin.customer.columns.id')); ?></th>
                                        <th is='sortable' :column="'first_name'"><?php echo e(trans('admin.customer.columns.first_name')); ?></th>
                                        <th is='sortable' :column="'last_name'"><?php echo e(trans('admin.customer.columns.last_name')); ?></th>
                                        
                                        
                                        <th is='sortable' :column="'number'"><?php echo e(trans('admin.customer.columns.number')); ?></th>
                                        <th is='sortable' :column="'email'"><?php echo e(trans('admin.customer.columns.email')); ?></th>
                                        <th is='sortable' :column="'status'"><?php echo e(trans('admin.customer.columns.status')); ?></th>

                                        <th is='sortable' :column="'actions'"><?php echo e(trans('Actions')); ?></th>
                                    </tr>
                                    <tr v-show="(clickedBulkItemsCount > 0) || isClickedAll">
                                        <td class="bg-bulk-info d-table-cell text-center" colspan="14">
                                            <span class="align-middle font-weight-light text-dark"><?php echo e(trans('brackets/admin-ui::admin.listing.selected_items')); ?> {{ clickedBulkItemsCount }}.  <a href="#" class="text-primary" @click="onBulkItemsClickedAll('/admin/customers')" v-if="(clickedBulkItemsCount < pagination.state.total)"> <i class="fa" :class="bulkCheckingAllLoader ? 'fa-spinner' : ''"></i> <?php echo e(trans('brackets/admin-ui::admin.listing.check_all_items')); ?> {{ pagination.state.total }}</a> <span class="text-primary">|</span> <a
                                                        href="#" class="text-primary" @click="onBulkItemsClickedAllUncheck()"><?php echo e(trans('brackets/admin-ui::admin.listing.uncheck_all_items')); ?></a>  </span>

                                            <span class="pull-right pr-2">
                                                <button class="btn btn-sm btn-danger pr-3 pl-3" @click="bulkDelete('/admin/customers/bulk-destroy')"><?php echo e(trans('brackets/admin-ui::admin.btn.delete')); ?></button>
                                            </span>

                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr v-for="(item, index) in collection" :key="item.id" :class="bulkItems[item.id] ? 'bg-bulk' : ''">
                                        <td class="bulk-checkbox">
                                            <input class="form-check-input" :id="'enabled' + item.id" type="checkbox" v-model="bulkItems[item.id]" v-validate="''" :data-vv-name="'enabled' + item.id"  :name="'enabled' + item.id + '_fake_element'" @click="onBulkItemClicked(item.id)" :disabled="bulkCheckingAllLoader">
                                            <label class="form-check-label" :for="'enabled' + item.id">
                                            </label>
                                        </td>

                                    <td>{{ item.customer_id }}</td>
                                        <td>{{ item.first_name }}</td>
                                        <td>{{ item.last_name }}</td>
                                        
                                        
                                        <td>{{ item.number }}</td>
                                        <td>{{ item.email }}</td>
                                        <td>
                                            <label class="switch switch-3d switch-success">
                                                <input type="checkbox" class="switch-input" v-model="collection[index].status" @change="toggleSwitch(item.resource_url, 'status', collection[index])">
                                                <span class="switch-slider"></span>
                                            </label>
                                        </td>
                                        
                                        <td>
                                            <div class="table-icons">
                                                    <a class="btn btn-simple btn-info btn-icon table-action view" :href="item.resource_url + '/edit'" title="<?php echo e(trans('brackets/admin-ui::admin.btn.edit')); ?>" role="button"><i class="ti-pencil-alt"></i></a>
                                           
                                                <form class="btn btn-simple btn-info btn-icon table-action view" @submit.prevent="deleteItem(item.resource_url)">
                                                    <button type="submit" class="btn btn-simple btn-danger btn-icon table-action remove" title="<?php echo e(trans('brackets/admin-ui::admin.btn.delete')); ?>"><i class="ti-close"></i></button>
                                                </form>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

                            <div class="row pagination-margin" v-if="pagination.state.total > 0">
                                <div class="col-sm">
                                    <span class="pagination-caption"><?php echo e(trans('brackets/admin-ui::admin.pagination.overview')); ?></span>
                                </div>
                                <div class="col-sm-auto">
                                    <pagination></pagination>
                                </div>
                            </div>

                            <div class="no-items-found" v-if="!collection.length > 0">
                                <i class="icon-magnifier"></i>
                                <h3><?php echo e(trans('brackets/admin-ui::admin.index.no_items')); ?></h3>
                                <p><?php echo e(trans('brackets/admin-ui::admin.index.try_changing_items')); ?></p>
                                <a class="btn btn-primary btn-spinner" href="<?php echo e(url('admin/customers/create')); ?>" role="button"><i class="ti-plus"></i>&nbsp; <?php echo e(trans('admin.customer.actions.create')); ?></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </customer-listing>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.paper-theme-layout.default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\diamond\resources\views/admin/customer/index.blade.php ENDPATH**/ ?>