Bootstrap and jQuery upgrade for vulnerabilities

This commit is contained in:
2021-05-28 11:33:45 -04:00
parent ef97a2d265
commit 65dcef930e
18 changed files with 2010 additions and 1027 deletions

View File

@@ -49,61 +49,71 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<?php
if (!empty($_POST['endvisit'])) { // PROCESS POST
echo $VisitActions->endVisit($_POST['endvisit'], $StaticFunctions->getUTC());
?>
<div class="container">
<div class="row">
<div class="col-sm">
<h2><?php echo $transLang['SIGNOUT_THANKYOU']; ?></h2>
</div>
</div>
</div>
<?php } else { // OR SHOW LIST
$approval = "2"; // ONLY SHOW APPROVED
$page_num = 1; // PAGINATION
if(!empty($_GET['pnum'])):
$page_num = filter_input(INPUT_GET, 'pnum', FILTER_VALIDATE_INT);
if(false === $page_num):
$page_num = 1;
endif;
endif;
$offset = ($page_num - 1) * $StaticFunctions->getPageRows();
$row_count = count($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", "%", "%"));
$page_count = 0;
if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctions->getPageRows()); if($page_num > $page_count): $page_num = 1; endif; endif;
?>
<div class="container">
<div class="row">
<div class="col-sm">
<h2><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></h2>
</div>
<div class="col-sm">
<a href="index.php" class="btn btn-info btn-block" tabindex="-1" role="button" aria-disabled="true"><?php echo $transLang['BACK']; ?></a>
</div>
</div>
<form class="form-signout" method="post" onsubmit="return confirm('<?php echo $transLang['END_VISIT_WARNING']; ?>')">
<?php echo '<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1">'.$transLang['PAGE'].'</a></li>'; for ($i = 1; $i <= $page_count; $i++): echo '<li class="page-item'; if ($i === $page_num): echo ' active'; else: echo ' '; endif; echo '"><a class="page-link" href="' . $_SERVER['PHP_SELF'] . '?pnum=' . $i . '">' . $i . '</a></li>'; endfor; echo '</ul>'; ?>
<table class="table table-striped">
<thead class="thead-dark">
<tr><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th></tr>
</thead>
<tbody>
<?php $approval="2"; foreach ($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $offset) as $row):
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
$timein->setTimezone(new DateTimeZone("$timezone"));
$timein_disp = $timein->format('Y-m-d H:i:s');
?>
<tr><td><?php echo $row['visits_badge']; ?></td><td><?php echo $timein_disp; ?></td><td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50"></img></td><td><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50"></img>'; } ?></td><td><nobr><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-lg btn-block"><i class="fas fa-sign-out-alt"></i><?php echo $transLang['SIGNOUT']; ?></button> </nobr></td></tr>
<?php endforeach; ?>
</tbody>
</table>
</form>
</div>
<?php }; ?>
<!-- START CONTENT -->
<?php
if (!empty($_POST['endvisit'])) { // PROCESS POST
echo $VisitActions->endVisit($_POST['endvisit'], $StaticFunctions->getUTC());
?>
<!-- START SIGNOUT ACK -->
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT_THANKYOU']; ?></h2>
</div>
</div>
</div>
<!-- END SIGNOUT ACK -->
<?php } else { // OR SHOW LIST
$approval = "2"; // ONLY SHOW APPROVED
$page_num = 1; // PAGINATION
if(!empty($_GET['pnum'])):
$page_num = filter_input(INPUT_GET, 'pnum', FILTER_VALIDATE_INT);
if(false === $page_num):
$page_num = 1;
endif;
endif;
$offset = ($page_num - 1) * $StaticFunctions->getPageRows();
$row_count = count($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", "%", "%"));
$page_count = 0;
if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctions->getPageRows()); if($page_num > $page_count): $page_num = 1; endif; endif;
?>
<!-- START SIGNOUT LIST -->
<div class="container">
<div class="row row-cols-2">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></h2>
</div>
<div class="col d-grid gap-2">
<a href="index.php" class="btn btn-info" tabindex="-1" role="button" aria-disabled="true"><?php echo $transLang['BACK']; ?></a>
</div>
</div>
<form class="form-signout" method="post" onsubmit="return confirm('<?php echo $transLang['END_VISIT_WARNING']; ?>')">
<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1"><?php echo $transLang['PAGE']; ?></a></li>
<?php for ($i = 1; $i <= $page_count; $i++): ?>
<li class="page-item<?php if ($i === $page_num): echo ' active'; else: echo ' '; endif; ?>"><a class="page-link" href="<?php echo $_SERVER['PHP_SELF'] . '?pnum=' . $i; ?>"><?php echo $i; ?></a></li>
<?php endfor; ?>
</ul>
<table class="table table-striped">
<thead class="thead-dark">
<tr><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th></tr>
</thead>
<tbody>
<?php $approval="2"; foreach ($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $offset) as $row):
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
$timein->setTimezone(new DateTimeZone("$timezone"));
$timein_disp = $timein->format('Y-m-d H:i:s');
?>
<tr><td><?php echo $row['visits_badge']; ?></td><td><?php echo $timein_disp; ?></td><td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50"></img></td><td><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50"></img>'; } ?></td><td><nobr><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-lg"><i class="fas fa-sign-out-alt"></i><?php echo $transLang['SIGNOUT']; ?></button> </nobr></td></tr>
<?php endforeach; ?>
</tbody>
</table>
</form>
</div>
<?php }; ?>
<!-- END SIGNOUT LIST -->
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php");