featuring when in pembayaransag.blade the checked button automatically checked
This commit is contained in:
@@ -30,13 +30,17 @@ class HomeController extends Controller
|
||||
{
|
||||
$homeUrl = route('home');
|
||||
$authUser = Auth::user();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
|
||||
// ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
$customer_gadai = array_merge(
|
||||
@@ -75,13 +79,18 @@ class HomeController extends Controller
|
||||
$pembiayaan = $this->pembiayaanService->getPembiayaan($request->filter);
|
||||
|
||||
$authUser = Auth::user();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
|
||||
|
||||
// ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
|
||||
|
||||
Vendored
+47
-5
@@ -1,4 +1,5 @@
|
||||
let checked_rad = () =>{
|
||||
// let checked_rad = () =>{
|
||||
function checked_rad(){
|
||||
const radios = document.querySelectorAll('input[name="radpembayaran"]');
|
||||
// let rad_payment = document.getElementById('radpembayaran');
|
||||
let btn_payment = document.getElementById('bayarsbmt');
|
||||
@@ -9,11 +10,38 @@ let checked_rad = () =>{
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
}else{
|
||||
/* Make default checked */
|
||||
let radpkb = document.getElementById('pkb');
|
||||
let radkopkb = document.getElementById('kopkb');
|
||||
|
||||
if (radpkb && !radpkb.checked) {
|
||||
selected_radiopkb(radpkb);
|
||||
return;
|
||||
}
|
||||
|
||||
if(radkopkb && !radkopkb.checked){
|
||||
selected_radiokopkb(radkopkb);
|
||||
return;
|
||||
}
|
||||
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let selected_radiopkb = (radpkb) => {
|
||||
radpkb.setAttribute('checked', 'checked');
|
||||
radpkb.dispatchEvent(new Event('change'));
|
||||
radpkb.focus();
|
||||
}
|
||||
|
||||
let selected_radiokopkb = (radkopkb) => {
|
||||
radkopkb.setAttribute('checked', 'checked');
|
||||
radkopkb.dispatchEvent(new Event('change'));
|
||||
radkopkb.focus();
|
||||
}
|
||||
|
||||
const radios = document.querySelectorAll('input[name="radpembayaran"]');
|
||||
|
||||
radios.forEach((radio) => {
|
||||
@@ -39,11 +67,19 @@ radios.forEach((radio) => {
|
||||
});
|
||||
content1?.classList.add('blurred');
|
||||
content2?.classList.remove('blurred');
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
|
||||
if(values != 0){
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
|
||||
}else{
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
whole_total.innerHTML = formatter.format(values + 1);
|
||||
whole_total_phone.innerHTML = formatter.format(values + 1);
|
||||
|
||||
|
||||
}else{
|
||||
let inputsdisabled = document.querySelectorAll(`#divkopkb input:not([type="radio"])`);
|
||||
let inputenabled = document.querySelectorAll(`#divpkb input`);
|
||||
@@ -56,8 +92,14 @@ radios.forEach((radio) => {
|
||||
});
|
||||
content2?.classList.add('blurred');
|
||||
content1?.classList.remove('blurred');
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
|
||||
if(values != 0){
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
}else{
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
whole_total.innerHTML = formatter.format(values + 1);
|
||||
whole_total_phone.innerHTML = formatter.format(values + 1);
|
||||
}
|
||||
|
||||
@@ -372,10 +372,14 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="{{ asset('js/miscellaneous/cart.js') }}?v={{ time() }}"></script>
|
||||
<script src="{{ asset('js/miscellaneous/cart.js') }}?v={{ filemtime(public_path('js/miscellaneous/cart.js')) }}"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
/*check radio button enabled*/
|
||||
checked_rad();
|
||||
|
||||
$(window).keydown(function(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
@@ -383,13 +387,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#selepas_tawarruq > tbody > tr').each(function() {
|
||||
$(this).find("td:gt(0)").each(function() {
|
||||
// console.log($(this).html());
|
||||
// console.log($("input[name=txtbayarantawarruq]").val());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
@@ -640,8 +637,6 @@
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
/*check radio button enabled*/
|
||||
checked_rad();
|
||||
|
||||
var inputs = document.querySelectorAll('input[name="txtbayarantawarruq"]:not([disabled])');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user