File: /home/imensosw/.trash/storage.2/framework/views/1158b5211bdf19c5120e4e03aa3d3f48f8f2acc4.php
<?php $__env->startSection("style"); ?>
<link href="<?php echo e(asset('assets/plugins/datatable/css/dataTables.bootstrap5.min.css')); ?>" rel="stylesheet" />
<?php $__env->stopSection(); ?>
<?php $__env->startSection('pageTitle'); ?>
<title><?php echo e(trans('panel.site_title')); ?> <?php echo e(trans('global.volunteers')); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!--start page wrapper -->
<div class="page-wrapper">
<div class="page-content">
<!--breadcrumb-->
<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
<div class="breadcrumb-title pe-3"><?php echo e(trans('global.volunteers')); ?></div>
<div class="ps-3">
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0 p-0">
<li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page"><?php echo e(trans('global.volunteers')); ?> <?php echo e(trans('global.list')); ?></li>
</ol>
</nav>
</div>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('volunteer_create')): ?>
<div class="ms-auto">
<div class="btn-group">
<a href="<?php echo e(route("admin.volunteers.create")); ?>" class="btn btn-outline-primary"><?php echo e(trans('global.add')); ?> <?php echo e(trans('global.volunteer')); ?></a>
</div>
</div>
<?php endif; ?>
</div>
<!--end breadcrumb-->
<hr/>
<div class="card">
<div class="card-body">
<?php echo $__env->make('layouts/notification', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="table-responsive">
<table class="datatable table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>Volunteer Name</th>
<th>Profile</th>
<th>Email</th>
<th>Status</th>
<th class="text-center sorting-none" width="50"> </th>
</tr>
</thead>
<tbody>
<?php $count = 0; ?>
<?php $__currentLoopData = $volunteers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $user_profile_img = URL::asset('images/profile.webp'); ?>
<?php
if(!empty($user->user_profile_img)){
$user_profile_img = URL::asset('Profile/'.$user->id.'/'.$user->user_profile_img);
}
?>
<?php $count++; ?>
<tr data-entry-id="<?php echo e($user->id); ?>">
<td><?php echo e($user->name); ?></td>
<td><img src="<?php echo e($user_profile_img); ?>" class="org_logo_file" height="40" /></td>
<td><a href="mailto:<?php echo e($user->email); ?>" class="btn btn-link"><?php echo e($user->email); ?></a></td>
<td>
<?php if($user->user_status == 1): ?>
<a class="btn btn-outline-success approve_user_id_<?php echo e($user->id); ?>" href="javascript:;"><i class="fadeIn animated bx bx-user-check"></i></a>
<?php else: ?>
<a class="btn btn-outline-warning approve_user_id_<?php echo e($user->id); ?>" href="javascript:;" onclick="approve_this_user('<?php echo e($user->id); ?>');"><i class="fadeIn animated bx bx-check-square"></i></a>
<?php endif; ?>
</td>
<td >
<div class="btn-group">
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('volunteer_show')): ?>
<a class="btn btn-xs btn-outline-primary" href="<?php echo e(route('admin.volunteers.show', $user->id)); ?>">
<i class="lni lni-eye"></i>
</a>
<?php endif; ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('volunteer_edit')): ?>
<a class="btn btn-xs btn-outline-success" href="<?php echo e(route('admin.volunteers.edit', $user->id)); ?>">
<i class="fadeIn animated bx bx-edit-alt"></i>
</a>
<?php endif; ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('volunteer_delete')): ?>
<form action="<?php echo e(route('admin.volunteers.destroy', $user->id)); ?>" method="POST" style="display: inline-block;">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
<button type="button" class="btn btn-xs btn-outline-danger" onclick="confirmdelet('<?php echo e($user->id); ?>');"><i class="fadeIn animated bx bx-trash-alt"></i></button>
<button type="submit" class="btn btn-xs btn-outline-danger hide d-none delete_button_<?php echo e($user->id); ?>" ><i class="fadeIn animated bx bx-trash-alt"></i></button>
</form>
<?php endif; ?>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('assets/plugins/datatable/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatable/js/dataTables.bootstrap5.min.js')); ?>"></script>
<script>
function approve_this_user(user_id){
if(user_id){
swal({
title: "<?php echo e(trans('global.areYouSure')); ?>",
text: "<?php echo e(trans('global.approveUser')); ?>",
icon: "info", //Success, warning, info, error
buttons: true,
dangerMode: true,
})
.then((willComment) => {
if (willComment) {
var postData=new FormData();
postData.append('user_id',user_id);
var url="<?php echo e(route('admin.approve_user')); ?>";
$.ajax({
headers:{'X-CSRF-Token':'<?php echo e(csrf_token()); ?>'},
async:true,
type:"post",
dataType: 'json',
contentType:false,
url:url,
data:postData,
processData:false,
success:function(data){
if(data.status == 'success'){
$('.approve_user_id_'+user_id).removeClass('btn-outline-warning');
$('.approve_user_id_'+user_id).addClass('btn-outline-success');
$('.approve_user_id_'+user_id).removeAttr('onclick');
$('.approve_user_id_'+user_id).find('i').attr('class','fadeIn animated bx bx-user-check');
swal("Done!",data.msg,"success");
}else{
swal("Opps!",data.msg,"error");
}
},
error: function(data, errorThrown)
{
swal("Opps!",errorThrown,"error");
},
});
}
});
}else{
swal("Opps!",'Not Found!',"error");
}
}
$(document).ready(function(){
$('.datatable').DataTable();
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/imensosw/liftcincy.imenso.co/resources/views/admin/volunteers/index.blade.php ENDPATH**/ ?>