File: /home/imensosw/.trash/storage.2/framework/views/cdc48c424671367d285922befa9ad90927055d44.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.opportunities')); ?></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.opportunities')); ?></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.opportunity')); ?> <?php echo e(trans('global.list')); ?></li>
</ol>
</nav>
</div>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('opportunity_create')): ?>
<div class="ms-auto">
<div class="btn-group">
<a href="<?php echo e(route("admin.opportunities.create")); ?>" class="btn btn-outline-primary"><?php echo e(trans('global.add')); ?> <?php echo e(trans('global.opportunity')); ?></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>Title</th>
<th>Slug</th>
<!--<th>Image</th>-->
<th>Partner</th>
<th>Date</th>
<th>Hours</th>
<th>No. of Volunteer</th>
<th>Status</th>
<th class="text-center sorting-none" width="50"> </th>
</tr>
</thead>
<tbody>
<?php $count = 0; ?>
<?php if($opportunities->count()): ?>
<?php $__currentLoopData = $opportunities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $opportunity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $opportunity_img = URL::asset('images/no_img.png'); ?>
<?php
if(!empty($opportunity->feature_image)){
$opportunity_img = URL::asset('Opportunity/'.$opportunity->partner_id.'/'.$opportunity->opportunity_id.'/'.$opportunity->feature_image);
}
?>
<?php $count++; ?>
<tr data-entry-id="<?php echo e($opportunity->opportunity_id); ?>">
<td><?php echo e($opportunity->opportunity_title); ?></td>
<td><?php echo e($opportunity->slug); ?></td>
<!--<td><img src="<?php echo e($opportunity_img); ?>" class="opportunity_file" height="40" /></td>-->
<td><?php echo e($opportunity->user_name); ?></td>
<td><?php echo e($opportunity->start_date); ?></td>
<td><?php echo e($opportunity->opportunity_hours); ?></td>
<td><?php echo e($opportunity->no_of_volunteers); ?></td>
<td>
<?php /* @can('opportunity_management_access') */ ?>
<?php if($opportunity->opportunity_status == 1): ?>
<a class="btn btn-outline-success approve_this_opportunity approve_opportunity_id_<?php echo e($opportunity->opportunity_id); ?>" href="javascript:;" data_id="<?php echo e($opportunity->opportunity_id); ?>" data_status="0" href="javascript:;"><i class="fadeIn animated bx bx-user-check"></i> <span><?php echo e(trans('global.approved')); ?></span></a>
<?php else: ?>
<a class="btn btn-outline-warning approve_this_opportunity approve_opportunity_id_<?php echo e($opportunity->opportunity_id); ?>" href="javascript:;" data_id="<?php echo e($opportunity->opportunity_id); ?>" data_status="1" href="javascript:;" ><i class="fadeIn animated bx bx-check-square"></i> <span><?php echo e(trans('global.pending')); ?></span></a>
<?php endif; ?>
<?php /* @endcan */ ?>
</td>
<td >
<div class="btn-group">
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('opportunity_show')): ?>
<a class="btn btn-xs btn-outline-primary" href="<?php echo e(route('admin.opportunities.show', $opportunity->opportunity_id)); ?>">
<i class="lni lni-eye"></i>
</a>
<?php endif; ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('opportunity_edit')): ?>
<a class="btn btn-xs btn-outline-success" href="<?php echo e(route('admin.opportunities.edit', $opportunity->opportunity_id)); ?>">
<i class="fadeIn animated bx bx-edit-alt"></i>
</a>
<?php endif; ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('opportunity_delete')): ?>
<form action="<?php echo e(route('admin.opportunities.destroy', $opportunity->opportunity_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($opportunity->opportunity_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($opportunity->opportunity_id); ?>" ><i class="fadeIn animated bx bx-trash-alt"></i></button>
</form>
<?php endif; ?>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</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>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('opportunity_management_access')): ?>
<?php endif; ?>
$(document).ready(function(){
$('.datatable').DataTable();
$('.approve_this_opportunity').on('click', function(){
var op_status = $(this).attr('data_status');
var opportunity_id = $(this).attr('data_id');
var approveOpportunity = "<?php echo e(trans('global.approveOpportunity')); ?>";
var rejectOpportunity = "<?php echo e(trans('global.rejectOpportunity')); ?>";
var approved_text = "<?php echo e(trans('global.approved')); ?>";
var pending_text = "<?php echo e(trans('global.pending')); ?>";
if(op_status == 1){
var op_msg = approveOpportunity;
}else{
var op_msg = rejectOpportunity;
}
if(opportunity_id){
swal({
title: "<?php echo e(trans('global.areYouSure')); ?>",
text: op_msg,
icon: "info", //Success, warning, info, error
buttons: true,
})
.then((willComment) => {
if (willComment) {
var postData=new FormData();
postData.append('opportunity_id',opportunity_id);
postData.append('opportunity_status',op_status);
var url="<?php echo e(route('admin.opportunities.change_opportunity_status')); ?>";
$.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'){
if(op_status == 1){
$('.approve_opportunity_id_'+opportunity_id).removeClass('btn-outline-warning');
$('.approve_opportunity_id_'+opportunity_id).addClass('btn-outline-success');
$('.approve_opportunity_id_'+opportunity_id).attr('data_status',0);
$('.approve_opportunity_id_'+opportunity_id).find('i').attr('class','fadeIn animated bx bx-user-check');
$('.approve_opportunity_id_'+opportunity_id).find('span').html(approved_text);
}else{
$('.approve_opportunity_id_'+opportunity_id).removeClass('btn-outline-success');
$('.approve_opportunity_id_'+opportunity_id).addClass('btn-outline-warning');
$('.approve_opportunity_id_'+opportunity_id).attr('data_status',1);
$('.approve_opportunity_id_'+opportunity_id).find('i').attr('class','fadeIn animated bx bx-trash-alt');
$('.approve_opportunity_id_'+opportunity_id).find('span').html(pending_text);
}
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");
}
});
});
</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/opportunities/index.blade.php ENDPATH**/ ?>