MINI Sh3ll
<?php $__env->startSection('title', 'SCPL Users'); ?>
<?php $__env->startSection('content'); ?>
<div class="m-content">
<div class="row" >
<div class="m-portlet m-portlet--mobile filter_row">
<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<h3 class="m-portlet__head-text">
Admin & SCPL User Filter
</h3>
</div>
</div>
</div>
<form class="m-form m-form--fit m-form--label-align-right" autocomplete="off" id="roleForm" role="form" data-parsley-validate="parsley">
<div class="m-portlet__body">
<div class="row">
<div class="col-md-6">
<div class="form-group m-form__group">
<label class="show_status"> Name </label>
<input type="text" class="form-control m-input" id="user_name">
</div>
</div>
<div class="col-md-6">
<div class="form-group m-form__group">
<label class="show_status"> Select Role </label>
<select class="form-control m-input" id="user_role">
<option value="" >All</option>
<?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($role->id); ?>" ><?php echo e($role->role_name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
</div>
</div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions">
<button type="button" id="roleBtn" class="btn btn-sm btn-accent m-btn m-btn--custom m-btn--icon m-btn--air search_plant">
Search <i class="la la-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="m-portlet m-portlet--mobile filter_row">
<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<h3 class="m-portlet__head-text">
Admin & SCPL User List
</h3>
</div>
</div>
<div class="m-portlet__head-tools">
<a href="<?php echo e(route('user.create')); ?>" class="btn btn-sm btn-accent m-btn m-btn--custom m-btn--icon m-btn--air">
<span>
<i class="la la-user"></i>
<span>
Add User
</span>
</span>
</a>
</div>
</div>
<div class="m-portlet__body">
<!--begin: Datatable -->
<div class="m_datatable" id="local_data">
<table id="user_data" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>OTP</th>
<th>Status</th>
<th>Role</th>
<th>Created Date</th>
<th>Action</th>
</tr>
</thead>
</table>
</div>
<!--end: Datatable -->
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<!--begin::Page Resources -->
<script>
var base_url = window.location.origin;
var url = '<?php echo e(route('getUser')); ?>';
loadDataTable(url);
function loadDataTable(url) {
$('#user_data').DataTable({
"order": [],
"bAutoWidth": false,
"processing": false,
"serverSide": false,
"bDestroy": true,
"scrollX": true,
"aLengthMenu": [[10, 20, 50, -1], [10, 20, 50, "All"]],
"pageLength": 10,
"columnDefs": [{
"targets": 'no-sort',
"orderable": false,
}],
"ajax": url,
language: {
search: "_INPUT_",
searchPlaceholder: "Search...",
"lengthMenu": "Show _MENU_"
}
})
}
$(document).on('click', '.delete_user', function (event) {
var id = $(this).attr("data-id");
var deleteUrl = '<?php echo e(route("delete")); ?>';
$('#deleteModal').modal('show');
$(".delete").click(function (e) {
e.preventDefault();
$.ajax({
type: "POST",
url: deleteUrl,
dataType: "json",
data: {
"id": id,
"_token": "<?php echo e(csrf_token()); ?>",
},
success: function (response) {
if (response.status == 1) {
$('#deleteModal').modal('hide');
location.reload(true);
toastr.success(response.success);
}
}
});
});
});
$(document).on("click", "#roleBtn", function () {
var role = $('#user_role').val();
var user_name = $('#user_name').val();
var url = '<?php echo e(route('getUser')); ?>';
url = url + "?role=" + role + "&user_name="+user_name;
loadDataTable(url);
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
OHA YOOOO