1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 00:53:22 -05:00
This commit is contained in:
Jonathan Rosenbaum 2017-11-26 05:35:50 +00:00
parent e99d2863b8
commit a7decc5735
3 changed files with 17 additions and 6 deletions

View File

@ -135,7 +135,7 @@ input[value=Save]:focus, input[value=Close]:focus {
font-size: .9em; font-size: .9em;
} }
#original_price, #membership_discount, #membership_discount_price { #original_price, #membership_discount, #membership_discount_price, #volunteer_hours_to_membership_discount {
display: none; display: none;
color: blueviolet; color: blueviolet;
} }

View File

@ -1154,7 +1154,8 @@ $(function() {
if (obj.volunteer && current_membership === true) { if (obj.volunteer && current_membership === true) {
if (remaining === ui.value && remaining !== 0 && ui.value !== 0) { if (remaining === ui.value && remaining !== 0 && ui.value !== 0) {
if ( typeof amount.val() !== 'undefined') { if ( typeof amount.val() !== 'undefined') {
var price = amount.cleanVal(); var price = amount.cleanVal();
$("#volunteer_hours_to_membership_discount").text("true");
volunteer_hours_to_membership_discount(price, membership_obj); volunteer_hours_to_membership_discount(price, membership_obj);
} }
} }
@ -1201,6 +1202,7 @@ $(function() {
if (remaining === Number(val) && remaining !== 0 && Number(val) !== 0) { if (remaining === Number(val) && remaining !== 0 && Number(val) !== 0) {
if ( typeof amount.val() !== 'undefined') { if ( typeof amount.val() !== 'undefined') {
var price = amount.cleanVal(); var price = amount.cleanVal();
$("#volunteer_hours_to_membership_discount").text("true");
volunteer_hours_to_membership_discount(price, membership_obj); volunteer_hours_to_membership_discount(price, membership_obj);
} }
} }
@ -1427,9 +1429,17 @@ $(function() {
// handle history for membership discount price // handle history for membership discount price
var price, original_price; var price, original_price;
if ($("#membership_discount_price").text()) { if ($("#membership_discount_price").text()) {
price = $("#membership_discount_price").text();
original_price = $("#amount").val(); if ($("#volunteer_hours_to_membership_discount").text()) {
$("#amount").val(price); price = $("#membership_discount_price").text();
original_price = $("#original_price").text() + " (" + $("#amount").val() + ")";
$("#amount").val(price);
} else {
price = $("#membership_discount_price").text();
original_price = $("#amount").val();
$("#amount").val(price);
}
// update database to reflect change .. hopefully // update database to reflect change .. hopefully
$.post("json/transaction.php",{discount_update: 1, transaction_id: transaction_id, price: price }); $.post("json/transaction.php",{discount_update: 1, transaction_id: transaction_id, price: price });
} else { } else {

View File

@ -509,6 +509,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<span id="original_price"></span> <span id="original_price"></span>
<span id="membership_discount"></span> <span id="membership_discount"></span>
<span id="membership_discount_price"></span> <span id="membership_discount_price"></span>
<span id="volunteer_hours_to_membership_discount"></span>
</td> </td>
</tr> </tr>
<?php } // end show_amount ?> <?php } // end show_amount ?>
@ -689,7 +690,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<td <?php echo "title='Description: " . htmlspecialchars($row_Recordset1['description_with_locations'], ENT_QUOTES) . "'"; ?> ><?php echo $row_Recordset1['description_with_locations']; ?>&nbsp;</td> <td <?php echo "title='Description: " . htmlspecialchars($row_Recordset1['description_with_locations'], ENT_QUOTES) . "'"; ?> ><?php echo $row_Recordset1['description_with_locations']; ?>&nbsp;</td>
<td><?php echo $row_Recordset1['payment_type']; ?>&nbsp;</td> <td><?php echo $row_Recordset1['payment_type']; ?>&nbsp;</td>
<td <?php <td <?php
$history = json_decode($row_Recordset1['history']); $history = json_decode($row_Recordset1['history']);
if ($history) { if ($history) {
end($history); end($history);
$key = key($history); $key = key($history);