wip
This commit is contained in:
25
resources/js/vendor/nova/js/additional.js
vendored
25
resources/js/vendor/nova/js/additional.js
vendored
@@ -3,6 +3,31 @@ function csrf_token()
|
||||
return document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
||||
}
|
||||
|
||||
async function fetchLoanRemaining(containerID, passport_serie, passport_id) {
|
||||
if (! passport_serie || ! passport_id || ! account_number) {
|
||||
Nova.error('Maglumat ýetmezçiligi bar');
|
||||
return;
|
||||
}
|
||||
|
||||
let cardHistoryDetailContainer = document.getElementById(containerID);
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('passport_serie', passport_serie);
|
||||
formData.append('passport_id', passport_id);
|
||||
formData.append('account_number', account_number);
|
||||
|
||||
Nova.$progress.start()
|
||||
|
||||
Nova.request().post('/api/fetch-loan-remaining', formData).then(response => {
|
||||
let result = response.data;
|
||||
console.log(result)
|
||||
})
|
||||
.catch(error => console.log('error', error))
|
||||
.finally(() => {
|
||||
Nova.$progress.done()
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchLoanHistory(containerID, passport_serie, passport_id) {
|
||||
if (! passport_serie || ! passport_id) {
|
||||
Nova.error('Maglumat ýetmezçiligi bar');
|
||||
|
||||
40
resources/views/orders/loan/mobile/loan-remaining.blade.php
Normal file
40
resources/views/orders/loan/mobile/loan-remaining.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@php
|
||||
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.loan-history-container {
|
||||
display: grid;
|
||||
grid-template-columns: 15% 1fr;
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
.loan-history-container {
|
||||
display: block !important;
|
||||
}
|
||||
#loan-history-item-container {
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="loan-history-container">
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
style="width: max-content;"
|
||||
class="border text-left appearance-none cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 relative disabled:cursor-not-allowed inline-flex items-center justify-center shadow h-9 px-3 bg-primary-500 border-primary-500 hover:[&:not(:disabled)]:bg-primary-400 hover:[&:not(:disabled)]:border-primary-400 text-white dark:text-gray-900"
|
||||
onclick="fetchLoanRemaining(
|
||||
'loan-remaining-item-container',
|
||||
'{{ $resource->passport_serie }}',
|
||||
'{{ $resource->passport_id }}',
|
||||
'{{ $resource->account_number }}',
|
||||
)">
|
||||
<span class="flex items-center gap-1">Karz galyndysyny gör</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="loan-remaining-item-container">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user