add crud signer
This commit is contained in:
@ -56,16 +56,22 @@
|
||||
class="path2"></span></i>
|
||||
Export Report
|
||||
</button>
|
||||
<a href="{{ route($route[0] . '.addFasilitas') }}" type="button" class="btn btn-light-info btn-sm fasilitasButton " style="margin-left:5px;display:none">
|
||||
<i class="ki-duotone ki-plus fs-2"><span class="path1"></span><span
|
||||
class="path2"></span></i>
|
||||
Fasilitas
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="formFasilitas" action="{{ route($route[0].'.fasilitas') }}" >
|
||||
@csrf
|
||||
<input type="hidden" style="margin-bottom: 5px" name="cus_no_fasilitas" id="cus_no_fasilitas" />
|
||||
<input type="hidden" style="margin-bottom: 5px" name="batch_date" id="batch_date" />
|
||||
<input type="hidden" style="margin-bottom: 5px" name="company_name" id="company_name" />
|
||||
<input type="hidden" style="margin-bottom: 5px" name="status" value="1" />
|
||||
<button type="submit" class="btn btn-light-info btn-sm fasilitasButton " style="margin-left:5px;display:none">
|
||||
<i class="ki-duotone ki-plus fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Fasilitas
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -198,6 +204,11 @@
|
||||
});
|
||||
|
||||
$(".fasilitasButton").show();
|
||||
var kdcabang = $("#kodecabang").val();
|
||||
var periode = $("#periode").val();
|
||||
$("#cus_no_fasilitas").val(items[0]['CUSTOMER_NO']);
|
||||
$("#company_name").val(kdcabang);
|
||||
$("#batch_date").val(periode);
|
||||
|
||||
},
|
||||
error: function (error) {
|
||||
|
@ -20,11 +20,12 @@
|
||||
@include('konfirmasibank::pages.table_fasilitas')
|
||||
</div>
|
||||
<div class="d-flex justify-content-end ">
|
||||
<a href="{{ route($route[0] . '.index') }}" type="button" class="btn btn-danger btn-sm " style="">
|
||||
<i class="ki-duotone ki-exit-left fs-2"><span class="path1"></span><span
|
||||
class="path2"></span></i>
|
||||
Kembali
|
||||
</a>
|
||||
|
||||
<a href="{{ route($route[0] . '.index') }}" type="button" class="btn btn-danger btn-sm redirectButton" style="margin-top:10px">
|
||||
<i class="ki-duotone ki-exit-left fs-2"><span class="path1"></span><span
|
||||
class="path2"></span></i>
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,20 +47,20 @@
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="myFormInput" action="{{ route($route[0] . '.postFasilitas') }}">
|
||||
<form class="form-horizontal" id="inputFasilitas" action="{{ route($route[0] . '.postFasilitas') }}" method="POST">
|
||||
@csrf
|
||||
<!-- Add your form fields here -->
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-3 col-form-label">No Rekening</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control form-control-sm " name="nomor_rekening"
|
||||
placeholder="Nomor Rekening">
|
||||
<input type="hidden" class="form-control form-control-sm " name="nomor_cif" value="{{$data['fasilitas'][0]['nomor_cif']}}">
|
||||
<input type="text" class="form-control form-control-sm " name="nomor_rekening" placeholder="Nomor Rekening">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-3 col-form-label">Jenis Fasilitas</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-select form-select-sm" aria-label="Small select example">
|
||||
<select class="form-select form-select-sm" aria-label="Small select example" name="jenis_fasilitas">
|
||||
<option selected>Pilih Jenis Fasilitas</option>
|
||||
@foreach ($data['limitReference'] as $item)
|
||||
<option value="{{$item->SHORT_NAME}}">{{$item->SHORT_NAME}}</option>
|
||||
@ -115,7 +116,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm closeButton"
|
||||
data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="submitFormBtn">Submit</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="submitFasilitas">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -143,7 +144,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-3 col-form-label">No Rekening</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="hidden" class="form-control form-control-sm " id="id" name="id">
|
||||
<input type="hidden" class="form-control form-control-sm " id="id" name="id">
|
||||
<input type="text" class="form-control form-control-sm " id="norek" name="nomor_rekening"
|
||||
placeholder="Nomor Rekening">
|
||||
</div>
|
||||
@ -233,10 +234,11 @@
|
||||
});
|
||||
|
||||
// Handle form submission when the "Submit" button inside the modal is clicked
|
||||
$("#submitFormBtn").click(function(e) {
|
||||
$("#submitFasilitas").click(function(e) {
|
||||
// Serialize the form data
|
||||
e.preventDefault();
|
||||
var formData = $("#myFormInput").serialize();
|
||||
var formData = $("#inputFasilitas").serialize();
|
||||
|
||||
// Send an AJAX request to the form submission route
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@ -244,13 +246,14 @@
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
alert('tes');
|
||||
// Handle success response (e.g., show a success message)
|
||||
$("#myModal").modal('hide');
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
form[0].reset();
|
||||
$('#table4').ajax.reload();
|
||||
// Optionally, close the modal
|
||||
$("#myModal").modal('hide');
|
||||
location.reload();
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle error response (if applicable)
|
||||
@ -288,9 +291,10 @@
|
||||
$('input[name="due_date"]').val(response.due_date);
|
||||
$('input[name="jangka_waktu"]').val(response.jangka_waktu);
|
||||
$('input[name="fixed_rate"]').val(response.fixed_rate);
|
||||
|
||||
$('#ket').val(response.keterangan);
|
||||
$('#id').val(response.id);
|
||||
$("#myModalEdit").modal('show');
|
||||
$(".myModalEdit").modal('show');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle error response (if applicable)
|
||||
@ -364,7 +368,6 @@
|
||||
})
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
264
Resources/views/pages/index_signer.blade.php
Normal file
264
Resources/views/pages/index_signer.blade.php
Normal file
@ -0,0 +1,264 @@
|
||||
<x-default-layout>
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
<!--begin::Card-->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||
<!--begin::Card body-->
|
||||
<div class="card-body pt-6">
|
||||
<div class="d-flex justify-content-end ">
|
||||
<button type="button" class="btn btn-primary btn-sm " style="margin-right:35px" id="openModalBtnSigner">
|
||||
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Tambah
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body pt-6">
|
||||
<div class="table-responsive " style="overflow-x:auto;">
|
||||
<div id="user_table">
|
||||
@include('konfirmasibank::pages.table_signer')
|
||||
</div>
|
||||
<div class="d-flex justify-content-end ">
|
||||
|
||||
<a href="{{ route($route[0] . '.index') }}" type="button" class="btn btn-danger btn-sm redirectButton"
|
||||
style="margin-top:10px">
|
||||
<i class="ki-duotone ki-exit-left fs-2"><span class="path1"></span><span class="path2"></span></i>
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Card body-->
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="signerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<!-- Modal header -->
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel">Tambah Signer</h5>
|
||||
<button type="button" class="closeButton" data-dismiss="modal" aria-label="Close"
|
||||
style="display:none">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="formSigner" action="{{ route($route[0] . '.postSigner') }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
<!-- Add your form fields here -->
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Deputy Director</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="deputy_director" placeholder="Nama Deputy Director">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Executive Officer</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="executive_officer" placeholder="Nama Executive Officer">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm closeButtonSigner"
|
||||
data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="submitSigner">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="myModalEditSigner" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<!-- Modal header -->
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel">Edit Signer</h5>
|
||||
<button type="button" class="closeButton" data-dismiss="modal" aria-label="Close"
|
||||
style="display:none">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="formUpdateSigner" action="{{ route($route[0] . '.updateSigner') }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
<!-- Add your form fields here -->
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Deputy Director</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" class="form-control form-control-sm " name="id" placeholder="Nama Deputy Director">
|
||||
<input type="text" class="form-control form-control-sm " name="deputy_director" placeholder="Nama Deputy Director">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Executive Officer</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="executive_officer" placeholder="Nama Executive Officer">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm closeButtonUpdateSigner"
|
||||
data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="submitFormUpdateSigner">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@push('customscript')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Open the modal when the "Open Modal" button is clicked
|
||||
$("#openModalBtnSigner").click(function() {
|
||||
$("#signerModal").modal('show');
|
||||
});
|
||||
$(".closeButtonUpdateSigner").click(function() {
|
||||
$("#myModalEditSigner").modal('hide');
|
||||
});
|
||||
|
||||
// Handle form submission when the "Submit" button inside the modal is clicked
|
||||
$("#submitSigner").click(function(e) {
|
||||
// Serialize the form data
|
||||
e.preventDefault();
|
||||
var formData = $("#formSigner").serialize();
|
||||
|
||||
// Send an AJAX request to the form submission route
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{{ route('konfirmasibank.postSigner') }}",
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
$("#signerModal").modal('hide');
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle error response (if applicable)
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function(key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".btnEditSigner").click(function(e) {
|
||||
// Serialize the form data
|
||||
e.preventDefault();
|
||||
var id = $(this).data('id');
|
||||
var dataToSend = {
|
||||
_token: $('meta[name="csrf-token"]').attr('content'),
|
||||
id: id
|
||||
};
|
||||
// Send an AJAX request to the form submission route
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{{ route('konfirmasibank.editSigner') }}",
|
||||
data: dataToSend,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
$('input[name="executive_officer"]').val(response.executive_officer_name);
|
||||
$('input[name="deputy_director"]').val(response.deputy_director_name);
|
||||
$('input[name="id"]').val(id);
|
||||
$("#myModalEditSigner").modal('show');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle error response (if applicable)
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function(key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#submitFormUpdateSigner").click(function(e) {
|
||||
// Serialize the form data
|
||||
e.preventDefault();
|
||||
var formData = $("#formUpdateSigner").serialize();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{ route('konfirmasibank.updateSigner') }}",
|
||||
data: formData, // serializes the form's elements.
|
||||
success: function(data) {
|
||||
$("#myModalEditSigner").modal('hide');
|
||||
var _data = JSON.parse(data);
|
||||
toastr.success(_data.message);
|
||||
location.reload();
|
||||
|
||||
},
|
||||
error: function(data, textStatus, errorThrown) {
|
||||
var errors = data.responseJSON.errors;
|
||||
$.each(errors, function(key, value) {
|
||||
toastr.error(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(".btnDeleteSigner").click(function(e) {
|
||||
// var form = $(this).closest("form");
|
||||
var id = $(this).data('id');
|
||||
var dataToSend = {
|
||||
_token: $('meta[name="csrf-token"]').attr('content'),
|
||||
id: id
|
||||
};
|
||||
e.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{ route('konfirmasibank.destroySigner') }}",
|
||||
data: dataToSend, // serializes the form's elements.
|
||||
success: function(data) {
|
||||
toastr.success('has been deleted.', 'Success!', {
|
||||
timeOut: 5000
|
||||
});
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
</x-default-layout>
|
@ -48,6 +48,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex">
|
||||
{!! $data['fasilitas']->links() !!}
|
||||
</div>
|
||||
{{ $data['fasilitas']->appends(['cus_no_fasilitas' =>''.$data['fasilitas'][0]['nomor_rekening'].'','company_name' =>''.$data['queryParam']['company_name'].'' ,'batch_date' =>''.$data['queryParam']['batch_date'].'','status'=>1])->links('pagination::bootstrap-5') }}
|
||||
{{-- {!! $data['fasilitas']->links('pagination::bootstrap-5') !!} --}}
|
||||
{{-- {!! $data['fasilitas']->links() !!} --}}
|
||||
|
||||
|
45
Resources/views/pages/table_signer.blade.php
Normal file
45
Resources/views/pages/table_signer.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
<table class="table table-striped " id="table4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">No</th>
|
||||
<th class="text-center">Deputy Director</th>
|
||||
<th class="text-center">Executive Officer</th>
|
||||
<th class="text-center" width="100px">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dataBody">
|
||||
@php
|
||||
$no = 1;
|
||||
@endphp
|
||||
@if (count($data['signer']) > 0)
|
||||
@foreach ($data['signer'] as $item)
|
||||
<tr class="row-none">
|
||||
<td class="text-center">{{($no++ )}}</td>
|
||||
<td class="text-center">{{$item['deputy_director_name']}}</td>
|
||||
<td class="text-center">{{$item['executive_officer_name']}}</td>
|
||||
<td class="text-center">
|
||||
<a href="#" class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-warning btn-sm me-1 btnEditSigner" data-id="{{$item['id']}}">{!!getIcon("pencil", "fs-1 text-warning","duotune") !!}</a>
|
||||
<a href="#" class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-danger btn-sm me-1 btnDeleteSigner"data-id="{{$item['id']}}">{!! getIcon("trash", "fs-1 text-danger","duotune") !!}</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="row-none">
|
||||
<td colspan="10" class="text-center">Tidak Ada Data Yang Ditampilkan</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr style="display:none" class="loading1">
|
||||
<td colspan="10" class="text-center">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{ $data['signer']->appends(['status'=>1])->links('pagination::bootstrap-5') }}
|
||||
{{-- {!! $data['fasilitas']->links('pagination::bootstrap-5') !!} --}}
|
||||
{{-- {!! $data['fasilitas']->links() !!} --}}
|
||||
|
@ -21,6 +21,12 @@
|
||||
<span class="menu-title">Data Nasabah</span>
|
||||
</a>
|
||||
<!--end:Menu link-->
|
||||
<a class="menu-link {{ isset($route[1]) && $route[1] == 'konfirmasibank' ? 'active' : '' }}" href="{{ route('konfirmasibank.signer') }}">
|
||||
<span class="menu-bullet">
|
||||
<span class="bullet bullet-dot"></span>
|
||||
</span>
|
||||
<span class="menu-title">Signer</span>
|
||||
</a>
|
||||
</div>
|
||||
<!--end:Menu item-->
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user