| Current Path : /var/www/html/LLCF-APP/storage/framework/views/ |
| Current File : /var/www/html/LLCF-APP/storage/framework/views/14bd6b3e63905501fb24a29435835dbd.php |
<?php $__env->startSection('css'); ?>
<style>
.table td {
white-space: unset;
}
.swal2-confirm.red-button {
background-color: red !important;
border-color: red !important;
color: white !important;
}
.select2-container .select2-selection--single {
height: 38px !important;
padding: 6px 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 24px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 36px !important;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!-- Page Header -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Expenses</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard')); ?>">Dashboard</a></li>
<li class="breadcrumb-item active">Expenses</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Content -->
<div class="content">
<div class="container-fluid">
<?php echo $__env->make('include.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<!-- Filter Form -->
<div class="card mb-3">
<div class="card-body pt-3 pb-1">
<form method="GET" action="<?php echo e(route('admin.expenses-llcf.index')); ?>">
<div class="form-row align-items-end">
<div class="col-md-3 mb-2">
<select id="item_id" name="item_id" class="form-control">
<option value="">Select Item</option>
<?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($item->id); ?>" <?php echo e(request('item_id') == $item->id ? 'selected' : ''); ?>>
<?php echo e($item->name); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-3 mb-2">
<label for="date_from" class="form-label">From Date</label>
<input type="date" name="date_from" value="<?php echo e(request('date_from')); ?>" class="form-control">
</div>
<div class="col-md-3 mb-2">
<label for="date_to" class="form-label">To Date</label>
<input type="date" name="date_to" value="<?php echo e(request('date_to')); ?>" class="form-control">
</div>
<div class="col-md-3 mb-2 d-flex gap-2">
<button type="submit" class="btn btn-primary mr-2">
<i class="fas fa-search"></i> Filter
</button>
<a href="<?php echo e(route('admin.expenses-llcf.index')); ?>" class="btn btn-secondary">
<i class="fas fa-times-circle"></i> Reset
</a>
</div>
</div>
</form>
</div>
</div>
<!-- Table -->
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<h3 class="card-title mb-0">Expense Records</h3>
<a class="btn btn-primary" href="<?php echo e(route('admin.expenses-llcf.create')); ?>">
<i class="fas fa-solid fa-plus"></i>
</a>
</div>
</div>
<div class="card-body p-0">
<div class="mb-3 d-flex justify-content-start">
<a href="<?php echo e(route('admin.expenses-llcf.export.excel', request()->query())); ?>" class="btn btn-success mr-2">
<i class="fas fa-file-excel"></i> Export Excel
</a>
<a href="<?php echo e(route('admin.expenses-llcf.export.pdf', request()->query())); ?>" class="btn btn-danger mr-2">
<i class="fas fa-file-pdf"></i> Export PDF
</a>
<a href="<?php echo e(route('admin.expenses-llcf.export.csv', request()->query())); ?>" class="btn btn-success">
<i class="fas fa-file-csv"></i> Export CSV
</a>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Item</th>
<th>Amount</th>
<th>Date</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $expenses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $record): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td><?php echo e($index + 1); ?></td>
<td><?php echo e($record->item->name ?? '-'); ?></td>
<td><?php echo e($record->amount); ?></td>
<td><?php echo e(\Carbon\Carbon::parse($record->date)->format('d M Y')); ?></td>
<td class="text-center">
<div class='btn-group'>
<a href="<?php echo e(route('admin.expenses-llcf.edit', $record->id)); ?>" class="btn btn-default btn-sm">
<i class="fas fa-edit"></i>
</a>
<form class="delete-expense-form" action="<?php echo e(route('admin.expenses-llcf.destroy', $record->id)); ?>" method="POST">
<?php echo csrf_field(); ?>
<?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-default btn-sm">
<i class="fas fa-trash-alt"></i>
</button>
</form>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="5" class="text-center">No expense records found.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php if($expenses->total() > 2): ?>
<div class="card-footer">
<div class="d-flex justify-content-end">
<?php echo e($expenses->appends(request()->query())->links('vendor.pagination.bootstrap-4')); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script>
$(document).ready(function () {
$('#item_id').select2({ placeholder: 'Select Item' });
$('#type').select2({ placeholder: 'Select Type' });
$(".delete-expense-form").on("submit", function (e) {
e.preventDefault();
Swal.fire({
title: "<strong>Are you sure?</strong>",
icon: "warning",
html: `<p>Do you really want to delete this expense record?</p>`,
showCloseButton: true,
showCancelButton: true,
focusConfirm: false,
confirmButtonText: `<i class="fa fa-trash"></i> Yes, delete it!`,
cancelButtonText: `<i class="fa fa-times"></i> Cancel`,
allowOutsideClick: false,
customClass: {
confirmButton: 'red-button'
}
}).then((result) => {
if (result.isConfirmed) {
this.submit();
}
});
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/LLCF-APP/resources/views/admin/llcf-expenses/index.blade.php ENDPATH**/ ?>