update Index_signer
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<!--begin::Card-->
|
<!--begin::Card-->
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
<meta name="csrf-token" content="{{ csrf_token() }}" />fsddsfsf
|
||||||
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
||||||
<!--begin::Card body-->
|
<!--begin::Card body-->
|
||||||
<div class="card-body pt-6">
|
<div class="card-body pt-6">
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<!-- Modal body -->
|
<!-- Modal body -->
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form class="form-horizontal" id="formSigner" action="{{ route($route[0] . '.postSigner') }}"
|
<form class="form-horizontal" id="formSigner"
|
||||||
method="POST">
|
method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<!-- Add your form fields here -->
|
<!-- Add your form fields here -->
|
||||||
@ -98,8 +98,7 @@
|
|||||||
|
|
||||||
<!-- Modal body -->
|
<!-- Modal body -->
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form class="form-horizontal" id="formUpdateSigner" action="{{ route($route[0] . '.updateSigner') }}"
|
<form class="form-horizontal" id="formUpdateSigner" >
|
||||||
method="POST">
|
|
||||||
@csrf
|
@csrf
|
||||||
<!-- Add your form fields here -->
|
<!-- Add your form fields here -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
@ -123,8 +122,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Modal footer -->
|
<!-- Modal footer -->
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary btn-sm closeButtonUpdateSigner"
|
<button type="button" class="btn btn-secondary btn-sm closeButtonUpdateSigner" data-dismiss="modal">Close</button>
|
||||||
data-dismiss="modal">Close</button>
|
|
||||||
<button type="button" class="btn btn-primary btn-sm" id="submitFormUpdateSigner">Submit</button>
|
<button type="button" class="btn btn-primary btn-sm" id="submitFormUpdateSigner">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -133,150 +131,143 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@push('customscript')
|
@push('customscript')
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(function () {
|
||||||
// Open the modal when the "Open Modal" button is clicked
|
// Open the modal when the "Open Modal" button is clicked
|
||||||
$("#openModalBtnSigner").click(function() {
|
$("#openModalBtnSigner").click(function() {
|
||||||
$("#signerModal").modal('show');
|
$("#signerModal").modal("show");
|
||||||
});
|
});
|
||||||
|
$(".closeButtonSigner").click(function() {
|
||||||
|
$("#signerModal").modal("hide");
|
||||||
|
});
|
||||||
|
|
||||||
$(".closeButtonSigner").click(function() {
|
$(".closeButtonUpdateSigner").click(function() {
|
||||||
$("#signerModal").modal('hide');
|
$("#myModalEditSigner").modal("hide");
|
||||||
});
|
});
|
||||||
$(".closeButtonUpdateSigner").click(function() {
|
|
||||||
$("#myModalEditSigner").modal('hide');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle form submission when the "Submit" button inside the modal is clicked
|
// Handle form submission when the "Submit" button inside the modal is clicked
|
||||||
$("#submitSigner").click(function(e) {
|
$("#submitSigner").click(function(e) {
|
||||||
// Serialize the form data
|
// Serialize the form data
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var formData = $("#formSigner").serialize();
|
var formData = $("#formSigner").serialize();
|
||||||
|
|
||||||
// Send an AJAX request to the form submission route
|
// Send an AJAX request to the form submission route
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "{{ route('konfirmasibank.postSigner') }}",
|
url: "{{ route('konfirmasibank.postSigner') }}",
|
||||||
data: formData,
|
data: formData,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$("#signerModal").modal('hide');
|
$("#signerModal").modal('hide');
|
||||||
// var _data = JSON.parse(data);
|
// var _data = JSON.parse(data);
|
||||||
toastr.success(data.message);
|
toastr.success(data.message);
|
||||||
location.reload();
|
|
||||||
|
|
||||||
},
|
|
||||||
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="signer_type"]').val(response.signer_type);
|
|
||||||
$('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();
|
location.reload();
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
},
|
||||||
})
|
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="signer_type"]').val(response.signer_type);
|
||||||
|
$('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) {
|
||||||
</script>
|
// 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
|
@endpush
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</x-default-layout>
|
</x-default-layout>
|
||||||
|
Reference in New Issue
Block a user