Commit d7f8627c authored by primayoriko's avatar primayoriko
Browse files

Merge branch 'master' of...

Merge branch 'master' of https://gitlab.informatika.org/if3110-2020-01-k03-02/tugas-besar-1-2020 into master
parents 4a704866 d23c6c6a
Pipeline #28532 canceled with stages
......@@ -94,43 +94,34 @@ if (isset($_GET['id'])) {
</div>
<div style="display: none" id='ori-price'>
<?php echo $price ?></div>
<div>
<form id="buyChocolate" action="buy_chocolate.php" method="POST" class="amount-modifier text-content">
<?php
if ($amount === 0) {
echo "<div> Items is currently sold out.. </div>";
} else {
echo '
<div>
<div>Amount to buy:</div>
<div class="mod text-subtitle">
<button type="button" id="minus"> - </button>
<input class="mod-number text-subtitle" type="number" id="quantity" name="quantity" min="1" max="' . $amount . '">
<button type="button" id="plus"> + </button>
</div>
</div>
';
}
?>
<!-- <div class="total-container">
<div>Total Price</div>
<div class="total-display text-title">Rp <a id="total-price"><a>,00</div>
</div> -->
</form>
</div>
<div>
</div>
<!-- price_block -->
</div>
</div>
<form class="form-bawah" id="buyChocolate" action="buy_chocolate.php" method="POST">
<?php
if ($amount === 0) {
echo "<div> Items is currently sold out.. </div>";
} else {
echo '
<div>
<div class="text-title">Amount to buy:</div>
<div class="mod text-subtitle">
<button type="button" id="minus"> - </button>
<input class="mod-number text-subtitle" type="number" id="amountchanged" name="amoungchanged" min="1" max="' . $amount . '">
<button type="button" id="plus"> + </button>
</div>
</div>
';
}
?>
<input type="hidden" id="id" name="id" value="<?php echo $id ?>">
<div class="address-block text-subtitle">
<label> Address: </label>
<textarea class="address-input" name="address" id="address" cols="40" rows="3" placeholder="insert your address"></textarea>
</div>
<div class="btn-group ">
<button class="btn-secondary text-subtitle"> Cancel </button>
<button class="btn-primary text-subtitle" id="btn-buy">Buy</button>
<a href="/src/detail_chocolate.php?id=<?php echo $id ?>"><button class="btn-secondary text-subtitle" type="button"> Cancel </button></a>
<button class="btn-primary text-subtitle" id="btn-buy" type="submit">Buy</button>
</div>
</form>
</div>
......@@ -144,11 +135,11 @@ if (isset($_GET['id'])) {
// console.log(total);
// console.log(quantity);
document.getElementById('plus').addEventListener('click', function() {
document.getElementById('quantity').stepUp();
document.getElementById('amountchanged').stepUp();
// document.getElementById('total-price').innerHTML = total + quantity * price;
})
document.getElementById('minus').addEventListener('click', function() {
document.getElementById('quantity').stepDown();
document.getElementById('amountchanged').stepDown();
// document.getElementById('total-price').innerHTML = total - quantity * price;
})
</script>
......
Supports Markdown
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