File: /var/www/html/orbidirectory.com/storage/framework/views/fce99d920d47ca3f0f9938946570ab97.php
<?php $__env->startSection('title', 'ORBI Dashboard'); ?>
<?php $__env->startSection('content_header'); ?>
<h1>Registered Business</h1>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title"></h3>
<div class="card-tools">
<a href="<?php echo e(route('business.create')); ?>" class="btn btn-dark float-right">
<i class="fas fa-plus"></i> Add New Booking Record
</a>
</div>
</div>
<div class="card-body">
<table class="table table-bordered registerBusiness-datatable">
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Vehicle</th>
<th>Transporter</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script type="text/javascript">
$(function() {
var dataTable = $('.registerBusiness-datatable').DataTable({
processing: true,
serverSide: true,
pageLength: 10,
searching: false,
'ajax': {
'url': "<?php echo e(route('business')); ?>",
'data': function(data) {
}
},
columns: [
{
data: 'name',
name: 'name'
},
{
data: 'phone_number',
name: 'phone_number',
},
{
data: 'email',
name: 'email',
},
{
data: 'vehicle_name',
name: 'vehicle_name',
},
{
data: 'transporter_name',
name: 'transporter_name',
},
{
data: 'action',
name: 'action',
orderable: false,
searchable: false
},
]
});
$('#search_keyword').keyup(function() {
dataTable.draw();
});
});
$(document).on('click', '.delete-business', function () {
var id = $(this).data('id');
var url = "<?php echo e(route('business.delete', ':id')); ?>".replace(':id', id);
$.ajax({
url: url,
type: 'POST',
data: {
_method: 'POST',
_token: "<?php echo e(csrf_token()); ?>"
},
success: function (response) {
if (response.success) {
sessionStorage.setItem('delete_success', 'Registered Business deleted successfully.');
location.reload(); // Reload page after setting message
}
},
error: function (xhr) {
alert('Something went wrong!');
}
});
});
// Show the message after reload
$(document).ready(function () {
var successMessage = sessionStorage.getItem('delete_success');
if (successMessage) {
$('.card-body').prepend('<div class="alert alert-success">' + successMessage + '</div>');
sessionStorage.removeItem('delete_success'); // Remove message after showing
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/orbidirectory.com/resources/views/admin/business/index.blade.php ENDPATH**/ ?>