Skip to content
Snippets Groups Projects
Commit 2c627534 authored by Rifqi222's avatar Rifqi222
Browse files

fix: fixing the wallet option

parent b2df882b
Branches
Tags
No related merge requests found
version: '3.3' version: '3.3'
services: services:
web: web:
build: .
image: tubes-1:latest image: tubes-1:latest
ports: ports:
- 8008:80 - 8008:80
......
...@@ -68,21 +68,33 @@ ...@@ -68,21 +68,33 @@
<!-- Payment Details --> <!-- Payment Details -->
<div class="payment-detail" id="payment-details"> <div class="payment-detail" id="payment-details">
<!-- E-WALLET DETAILS --> <!-- E-WALLET DETAILS -->
<div class="detail" id="ewallet-detail"> <div class="detail" id="ewallet-detail">
<div class="title-card"> <div class="title-card">
<svg xmlns="http://www.w3.org/2000/svg" height="1.5em" viewBox="0 0 512 512"> <svg xmlns="http://www.w3.org/2000/svg" height="1.5em" viewBox="0 0 512 512">
<!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --> <!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
<path d="M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H80c-8.8 0-16-7.2-16-16s7.2-16 16-16H448c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM416 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/> <path d="M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H80c-8.8 0-16-7.2-16-16s7.2-16 16-16H448c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM416 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/>
</svg> </svg>
<p class="bold-text title">E-Wallet Details</p> <p class="bold-text title">E-Wallet Details</p>
</div>
<div class="form-group">
<label class="bold-text" for="ewallet">E-Wallet Number</label>
<input type="text" name="ewallet" placeholder="E-Wallet number" id="ewallet-number">
<p id="ewallet-alert" class="alert-hide"></p>
</div>
</div> </div>
<div class="form-group">
<label class="bold-text" for="ewallet">E-Wallet Number</label>
<?php if (!empty($walletNumbers)) : ?>
<select name="ewallet" id="ewallet-number">
<?php
foreach ($walletNumbers as $walletNumber) {
echo "<option value=\"$walletNumber\">$walletNumber</option>";
}
?>
</select>
<?php else : ?>
<p>You don't have an E-Wallet number</p>
<?php endif; ?>
<p id="ewallet-alert" class="alert-hide"></p>
</div>
</div>
<!-- CARD DETAILS --> <!-- CARD DETAILS -->
<div class="detail" id="card-detail"> <div class="detail" id="card-detail">
......
...@@ -77,21 +77,20 @@ function openSection(option) { ...@@ -77,21 +77,20 @@ function openSection(option) {
paymentMethodValid = true; paymentMethodValid = true;
} }
ewalletInput && ewalletInput.addEventListener('keyup', ewalletInput && ewalletInput.addEventListener('change', () => {
debounce(() => { const selectedOption = ewalletInput.value;
const ewallet = ewalletInput.value;
if (!selectedOption || selectedOption === "") {
ewalletAlert.innerText = 'Please select an E-Wallet number';
ewalletAlert.className = 'alert-show';
ewalletValid = false;
} else {
ewalletAlert.innerText = '';
ewalletAlert.className = 'alert-hide';
ewalletValid = true;
}
});
if(!numberRegex.test(ewallet)) {
ewalletAlert.innerText = 'Invalid number';
ewalletAlert.className = 'alert-show';
ewalletValid = false;
} else{
ewalletAlert.innerText = '';
ewalletAlert.className = 'alert-hide';
ewalletValid = true;
}
}, DEBOUNCE_TIMEOUT)
);
cardNumberInput && cardNumberInput.addEventListener('keyup', cardNumberInput && cardNumberInput.addEventListener('keyup',
debounce(() => { debounce(() => {
...@@ -235,7 +234,7 @@ mainForm.addEventListener('submit', async (e) => { ...@@ -235,7 +234,7 @@ mainForm.addEventListener('submit', async (e) => {
if(method=="ewallet" && !ewalletValid) if(method=="ewallet" && !ewalletValid)
{ {
e.preventDefault(); e.preventDefault();
ewalletAlert.innerText = 'Number is required'; ewalletAlert.innerText = 'Select the E-Wallet number';
ewalletAlert.className = 'alert-show'; ewalletAlert.className = 'alert-show';
}else }else
{ {
......
...@@ -273,6 +273,8 @@ ...@@ -273,6 +273,8 @@
display: none; display: none;
} }
.
@media screen and (max-width: 1140px) { @media screen and (max-width: 1140px) {
.gridview { .gridview {
flex-direction: column; flex-direction: column;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment