Void/decline
This commit is contained in:
parent
916a208a99
commit
2664bd9e23
72
index.php
72
index.php
@ -106,7 +106,7 @@
|
||||
}
|
||||
|
||||
if (!empty($_POST['voidvisit'])) {
|
||||
echo $VisitActions->voidVisit($_POST['voidvisit'], "0");
|
||||
echo $VisitActions->voidVisit($_POST['voidvisit'], "0", $_POST['voidnotes']);
|
||||
}
|
||||
|
||||
|
||||
@ -148,6 +148,70 @@
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- modals -->
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).on("click", ".open-voidModal", function (e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var _self = $(this);
|
||||
|
||||
var myVoidId = _self.data('id');
|
||||
$("#voidvisit").val(myVoidId);
|
||||
|
||||
$(_self.attr('href')).modal('show');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- void notes -->
|
||||
|
||||
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog" aria-labelledby="declinenotesmodal" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
<form class="form form-approve" method="post">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<input type="hidden" name="voidvisit" id="voidvisit" value="" />
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><?php echo $transLang['NOTES']; ?></span>
|
||||
</div>
|
||||
<textarea class="form-control" id="voidnotes" name="voidnotes" placeholder="<?php echo $transLang['NOTES_PLACEHOLDER']; ?>"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal"><?php echo $transLang['CANCEL']; ?></button>
|
||||
<button type="submit" class="btn btn-danger btn-sm"><i class="fas fa-thumbs-down"></i> <?php echo $transLang['DECLINE']; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
@ -250,7 +314,7 @@
|
||||
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<button type="submit" name="approvevisit" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i> <?php echo $transLang['APPROVE']; ?></button><br /><button type="submit" name="voidvisit" value="<?php echo $visitid; ?>" class="btn btn-danger btn-block btn-sm" onsubmit="return confirm('<?php echo $transLang['VOID_WARNING']; ?>')"><i class="fas fa-thumbs-down"></i> <?php echo $transLang['DECLINE']; ?></button>
|
||||
<button type="submit" name="approvevisit" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i> <?php echo $transLang['APPROVE']; ?></button><br /><a data-toggle="modal" data-target="#voidModal" data-id="<?php echo $visitid; ?>" href="#voidModal" name="voidvisit" value="<?php echo $visitid; ?>" class="btn btn-danger btn-block btn-sm open-voidModal"><i class="fas fa-thumbs-down"></i> <?php echo $transLang['DECLINE']; ?></a>
|
||||
</td>
|
||||
<td class="small">
|
||||
<button type="submit" name="endvisit" value="<?php echo $visitid; ?>" class="btn btn-warning btn-block btn-sm"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></button>
|
||||
@ -275,6 +339,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- USER CONTENT END -->
|
||||
<?php }; require_once("inc/footer.inc.php");
|
||||
|
@ -38,10 +38,12 @@ class VisitActions {
|
||||
return $count;
|
||||
}
|
||||
|
||||
public function voidVisit ($visitid, $approved) {
|
||||
public function voidVisit ($visitid, $approved, $notes) {
|
||||
$query = "
|
||||
UPDATE " . Registry::DB_PRFX . "visits
|
||||
SET " . Registry::DB_PRFX . "visits.approved = \"$approved\"
|
||||
SET
|
||||
" . Registry::DB_PRFX . "visits.approved = \"$approved\",
|
||||
" . Registry::DB_PRFX . "visits.notes = \"$notes\"
|
||||
WHERE " . Registry::DB_PRFX . "visits.id = \"$visitid\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
|
Loading…
Reference in New Issue
Block a user