2023-10-05 15:32:26 +00:00
|
|
|
<x-default-layout>
|
|
|
|
|
|
|
|
@section('title')
|
|
|
|
Cabang
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('breadcrumbs')
|
|
|
|
{{ Breadcrumbs::render('parameter.branches') }}
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<!--begin::Card header-->
|
|
|
|
<div class="card-header border-0 pt-6">
|
|
|
|
<!--begin::Card title-->
|
|
|
|
<div class="card-title">
|
|
|
|
<!--begin::Search-->
|
|
|
|
<div class="d-flex align-items-center position-relative my-1">
|
|
|
|
{!! getIcon('magnifier', 'fs-3 position-absolute ms-5') !!}
|
|
|
|
<input type="text" data-kt-branch-table-filter="search" class="form-control form-control-solid w-250px ps-13" placeholder="Search branch" id="mySearchInput"/>
|
|
|
|
</div>
|
|
|
|
<!--end::Search-->
|
|
|
|
</div>
|
|
|
|
<!--begin::Card title-->
|
|
|
|
|
|
|
|
<!--begin::Card toolbar-->
|
|
|
|
<div class="card-toolbar">
|
|
|
|
<!--begin::Toolbar-->
|
|
|
|
<div class="d-flex justify-content-end" data-kt-branch-table-toolbar="base">
|
|
|
|
<!--begin::Add branch-->
|
|
|
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#kt_modal_add_branch">
|
|
|
|
{!! getIcon('plus', 'fs-2', '', 'i') !!}
|
|
|
|
Add Cabang
|
|
|
|
</button>
|
|
|
|
<!--end::Add branch-->
|
|
|
|
</div>
|
|
|
|
<!--end::Toolbar-->
|
|
|
|
|
|
|
|
<!--begin::Modal-->
|
|
|
|
<livewire:writeoff::branch.branch-modal/>
|
|
|
|
<!--end::Modal-->
|
|
|
|
</div>
|
|
|
|
<!--end::Card toolbar-->
|
|
|
|
</div>
|
|
|
|
<!--end::Card header-->
|
|
|
|
|
|
|
|
<!--begin::Card body-->
|
|
|
|
<div class="card-body py-4">
|
|
|
|
<!--begin::Table-->
|
|
|
|
<div class="table-responsive">
|
|
|
|
{{ $dataTable->table() }}
|
|
|
|
</div>
|
|
|
|
<!--end::Table-->
|
|
|
|
</div>
|
|
|
|
<!--end::Card body-->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
{{ $dataTable->scripts() }}
|
|
|
|
<script>
|
|
|
|
document.getElementById('mySearchInput').addEventListener('keyup', function () {
|
|
|
|
window.LaravelDataTables['branch-table'].search(this.value).draw();
|
|
|
|
});
|
|
|
|
document.addEventListener('livewire:initialized', function () {
|
2023-12-26 07:47:03 +00:00
|
|
|
// Listen for 'success' event emitted by Livewire
|
|
|
|
Livewire.on('success', (message) => {
|
|
|
|
// Reload the users-table datatable
|
|
|
|
Swal.fire({
|
|
|
|
text: message,
|
|
|
|
icon: 'success',
|
|
|
|
buttonsStyling: false,
|
|
|
|
confirmButtonText: 'Ok, got it!',
|
|
|
|
customClass: {
|
|
|
|
confirmButton: 'btn btn-primary',
|
|
|
|
}
|
|
|
|
})
|
2023-10-05 15:32:26 +00:00
|
|
|
$('#kt_modal_add_branch').modal('hide');
|
2023-12-26 07:47:03 +00:00
|
|
|
LaravelDataTables['branch-table'].ajax.reload();
|
2023-10-05 15:32:26 +00:00
|
|
|
});
|
2023-12-26 07:47:03 +00:00
|
|
|
|
|
|
|
Livewire.on('error', (message) => {
|
|
|
|
// Reload the users-table datatable
|
|
|
|
Swal.fire({
|
|
|
|
text: message,
|
|
|
|
icon: 'warning',
|
|
|
|
buttonsStyling: false,
|
|
|
|
confirmButtonText: 'Ok, got it!',
|
|
|
|
customClass: {
|
|
|
|
confirmButton: 'btn btn-primary',
|
|
|
|
}
|
|
|
|
})
|
|
|
|
$('#kt_modal_add_branch').modal('hide');
|
|
|
|
LaravelDataTables['branch-table'].ajax.reload();
|
|
|
|
});
|
|
|
|
|
2023-10-05 15:32:26 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|
|
|
|
|
|
|
|
</x-default-layout>
|