Add buttons to remove people
This commit is contained in:
parent
1c205b6558
commit
453831c611
@ -50,6 +50,7 @@ if (isset($personid) && $database->has('people', ['personid' => $personid])) {
|
||||
?>
|
||||
|
||||
<div class="list-group-item person-list-item" data-persontype="<?php echo $type; ?>">
|
||||
<div class="btn btn-outline-danger btn-sm rmpersonbtn"><i class="fas fa-trash"></i> Remove</div>
|
||||
<input type="hidden" name="people[ids][]" value="<?php echo $personid; ?>" />
|
||||
<input type="hidden" name="people[type][<?php echo $personid; ?>]" value="<?php echo $type; ?>" />
|
||||
<div class="row">
|
||||
|
@ -61,6 +61,11 @@ $("#adult_list").on("change", "input[data-name=days]", function () {
|
||||
updateTotal();
|
||||
});
|
||||
|
||||
$(".list-group").on("click", ".rmpersonbtn", function () {
|
||||
$(this).parent().remove();
|
||||
updateTotal();
|
||||
});
|
||||
|
||||
function updateTotal() {
|
||||
totalcharge = $(".person-list-item[data-persontype=camper] input[data-name=firstname]").filter(function () {
|
||||
return $(this).val() != '';
|
||||
|
@ -14,4 +14,12 @@ body, html {
|
||||
|
||||
.person-list-item {
|
||||
border: 1.5px solid var(--teal);
|
||||
}
|
||||
|
||||
.rmpersonbtn {
|
||||
position: absolute;
|
||||
right: 1em;
|
||||
top: 1em;
|
||||
cursor: pointer;
|
||||
z-index: 99999999;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user