Bootstrap and jQuery upgrade for vulnerabilities
This commit is contained in:
649
index.php
649
index.php
@@ -77,54 +77,42 @@
|
||||
$app_current_pagename = $transLang['HOME']; // PAGE SETUP
|
||||
$app_current_pageicon = '<i class="fas fa-home"></i> ';
|
||||
require_once("inc/header.inc.php");
|
||||
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- GUEST CONTENT START -->
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<div class="alert alert-info text-center">
|
||||
<?php echo $transLang['WELCOMETO'] . " " . $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<button class="btn btn-outline-danger btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" disabled><i class="fas fa-4x fa-sign-in-alt"></i><img src="<?php echo $StaticFunctions->getLogoText(); ?>" height="140" width="370"></img><i class="fas fa-4x fa-sign-out-alt"></i><br /><h1><?php echo $transLang['APP_NAME']; ?></h1></button>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm"><hr /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<a href="signin.php" class="btn btn-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true"> <br /> <br /><i class="fas fa-sign-in-alt"></i><br /><?php echo $transLang['CUSTSIGNIN']; ?><br /> <br /> </a>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<a href="signout.php" class="btn btn-info btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true"> <br /> <br /><i class="fas fa-sign-out-alt"></i><br /><?php echo $transLang['CUSTSIGNOUT']; ?><br /> <br /> </a>
|
||||
</div>
|
||||
<?php if ($StaticFunctions->getUserSessionStatus() == false) { ?>
|
||||
<!-- START GUEST CONTENT -->
|
||||
<div class="container-fluid">
|
||||
<div class="row"> </div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<div class="alert alert-info text-center"><?php echo $transLang['WELCOMETO'] . " " . $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GUEST CONTENT END -->
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<button class="btn btn-outline-danger btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" disabled><i class="fas fa-4x fa-sign-in-alt"></i><img src="<?php echo $StaticFunctions->getLogoText(); ?>" height="140" width="370"></img><i class="fas fa-4x fa-sign-out-alt"></i><br /><h1><?php echo $transLang['APP_NAME']; ?></h1></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row"> </div>
|
||||
<div class="row row-cols-2">
|
||||
<div class="col d-grid gap-2">
|
||||
<a href="signin.php" class="btn btn-success btn-lg" tabindex="-1" role="button"> <br /> <br /><i class="fas fa-sign-in-alt"></i><br /><?php echo $transLang['CUSTSIGNIN']; ?><br /> <br /> </a>
|
||||
</div>
|
||||
<div class="col d-grid gap-2">
|
||||
<a href="signout.php" class="btn btn-info btn-lg" tabindex="-1" role="button"> <br /> <br /><i class="fas fa-sign-out-alt"></i><br /><?php echo $transLang['CUSTSIGNOUT']; ?><br /> <br /> </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END GUEST CONTENT -->
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<?php
|
||||
//on login see if user name fields are set and if not copy from saml when using saml, and then reload
|
||||
@@ -133,334 +121,307 @@ if (Registry::AUTHMETHOD == 'SAML') {
|
||||
if (empty($Users->readUserFirstAndLast($uid)[0]["users_lastname"])) {
|
||||
$Users->updateSamlFirstAndLast($uid, $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'][0], $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'][0]);
|
||||
?>
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<a class="btn btn-outline-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" href="index.php"><?php echo $transLang['REFRESH']; ?></a>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
|
||||
</div>
|
||||
<!-- START USER INIT CONTENT -->
|
||||
<div class="container-fluid">
|
||||
<div class="row"> </div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<a class="btn btn-outline-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" href="index.php"><?php echo $transLang['REFRESH']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<!-- END USER INIT CONTENT -->
|
||||
<?php die; } } } ?>
|
||||
|
||||
|
||||
<!-- USER CONTENT START -->
|
||||
<?php
|
||||
$post_outtime = filter_input(INPUT_POST, 'outtime');
|
||||
if (!empty($_POST['endvisit'])) {
|
||||
<?php
|
||||
$post_outtime = filter_input(INPUT_POST, 'outtime');
|
||||
if (!empty($_POST['endvisit'])) {
|
||||
if (!empty($_POST['outtime'])) {
|
||||
$newdate = new DateTime($_POST['outtime'], new DateTimeZone($timezone));
|
||||
$newdate->setTimeZone(new DateTimeZone('UTC'));
|
||||
$postdate=$newdate->format('Y-m-d H:i:s');
|
||||
echo $VisitActions->endVisit($_POST['endvisit'], $postdate);
|
||||
$newdate = new DateTime($_POST['outtime'], new DateTimeZone($timezone));
|
||||
$newdate->setTimeZone(new DateTimeZone('UTC'));
|
||||
$postdate=$newdate->format('Y-m-d H:i:s');
|
||||
echo $VisitActions->endVisit($_POST['endvisit'], $postdate);
|
||||
} else {
|
||||
echo $VisitActions->endVisit($_POST['endvisit'], $StaticFunctions->getUTC());
|
||||
echo $VisitActions->endVisit($_POST['endvisit'], $StaticFunctions->getUTC());
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST['voidvisit'])) {
|
||||
}
|
||||
if (!empty($_POST['voidvisit'])) {
|
||||
echo $VisitActions->voidVisit($_POST['voidvisit'], "0", $_POST['voidnotes']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If post is approved, save after error checking.
|
||||
if (!empty($_POST['approvevisit'])) {
|
||||
if (empty($_POST['id_type'])) { $id_type_error="1"; }
|
||||
else { $id_type_error="0";
|
||||
if (empty($_POST['badge'])) { $badge_error="1"; }
|
||||
else { $badge_error="0";
|
||||
if (empty($_POST['initials'])) { $initials_error="1"; }
|
||||
else { $initials_error="0";
|
||||
if (empty($_POST['citizen'])) { $citizen_error="1"; }
|
||||
elseif ($_POST['citizen'] === "00") { $citizen_error="1"; }
|
||||
else { $citizen_error="0";
|
||||
|
||||
if (isset($_POST['id_type']) && $_POST['id_type'] === 1 && isset($_POST['id_reference'])) { $id_reference_error="0"; }
|
||||
elseif (isset($_POST['id_type']) && $_POST['id_type'] === 1 && empty($_POST['id_reference'])) { $id_reference_error="1"; }
|
||||
|
||||
$approved="2";
|
||||
echo $VisitActions->approveVisit($_POST['approvevisit'], $_POST['id_type'], $_POST['id_reference'], $_POST['citizen'], $_POST['badge'], $_POST['initials'], $approved);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If post is approved, save after error checking.
|
||||
if (!empty($_POST['approvevisit'])) {
|
||||
if (empty($_POST['id_type'])) { $id_type_error="1"; }
|
||||
else { $id_type_error="0";
|
||||
if (empty($_POST['badge'])) { $badge_error="1"; }
|
||||
else { $badge_error="0";
|
||||
if (empty($_POST['initials'])) { $initials_error="1"; }
|
||||
else { $initials_error="0";
|
||||
if (empty($_POST['citizen'])) { $citizen_error="1"; }
|
||||
elseif ($_POST['citizen'] === "00") { $citizen_error="1"; }
|
||||
else { $citizen_error="0";
|
||||
if (isset($_POST['id_type']) && $_POST['id_type'] === 1 && isset($_POST['id_reference'])) { $id_reference_error="0"; }
|
||||
elseif (isset($_POST['id_type']) && $_POST['id_type'] === 1 && empty($_POST['id_reference'])) { $id_reference_error="1"; }
|
||||
$approved="2";
|
||||
echo $VisitActions->approveVisit($_POST['approvevisit'], $_POST['id_type'], $_POST['id_reference'], $_POST['citizen'], $_POST['badge'], $_POST['initials'], $approved);
|
||||
}
|
||||
}
|
||||
|
||||
// check all unapproved or approved
|
||||
$approval = "1";
|
||||
|
||||
// Set up pagination
|
||||
$page_num = 1;
|
||||
if(!empty($_GET['pnum'])):
|
||||
$page_num = filter_input(INPUT_GET, 'pnum', FILTER_VALIDATE_INT);
|
||||
if(false === $page_num):
|
||||
$page_num = 1;
|
||||
endif;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check all unapproved or approved
|
||||
$approval = "1";
|
||||
// Set up pagination
|
||||
$page_num = 1;
|
||||
if(!empty($_GET['pnum'])):
|
||||
$page_num = filter_input(INPUT_GET, 'pnum', FILTER_VALIDATE_INT);
|
||||
if(false === $page_num):
|
||||
$page_num = 1;
|
||||
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;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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;
|
||||
?>
|
||||
<!-- 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>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- START VOID MODAL -->
|
||||
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="termsModalLongTitle"><?php echo $transLang['DECLINE']; ?></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form form-approve" method="post">
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><?php echo $transLang['NOTES']; ?></span>
|
||||
<input type="hidden" name="voidvisit" id="voidvisit" value="" />
|
||||
<textarea class="form-control" id="voidnotes" name="voidnotes" placeholder="<?php echo $transLang['NOTES_PLACEHOLDER']; ?>"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
|
||||
<!-- END VOID MODAL -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row"> <br>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<h2><i class="fas fa-home"></i> <?php echo $transLang['ACTIVEVISITS']; ?></h2>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<a href="index.php" type="button" class="btn btn-success btn-lg btn-block"><?php echo $transLang['REFRESH']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?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-sm table-responsive-sm text-nowrap">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th class="small col-xs-1"><?php echo $transLang['TIMEREASON']; ?></th><th class="small col-xs-2"><?php echo $transLang['NAME']; ?></th><th class="small col-xs-2"><?php echo $transLang['ESCORT']; ?></th><th class="small col-xs-2"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small col-xs-2"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small col-xs-1"><?php echo $transLang['CARNUM'] . " / " . $transLang['SSANUM']; ?></th><?php }; ?><th class="small col-xs-1"><?php echo $transLang['ACTIONS']; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $offset) as $row):
|
||||
$visitid = $row['visits_id'];
|
||||
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
|
||||
$timein->setTimezone(new DateTimeZone("$timezone"));
|
||||
$timein_disp = $timein->format('Y-m-d H:i:s');
|
||||
if(!empty($row['visits_carnum'])) { $carnum=$row['visits_carnum']; } else { $carnum="";};
|
||||
if(!empty($row['visits_ssanum'])) { $ssanum=$row['visits_ssanum']; } else { $ssanum="";};
|
||||
?>
|
||||
<?php if($row['visits_approved']==2) { ?>
|
||||
<tr class="alert alert-success">
|
||||
<?php } else { ?>
|
||||
<tr class="alert alert-warning">
|
||||
<?php }; ?>
|
||||
<form class="form form-approve" method="post">
|
||||
<td class="small"><div><span class="badge badge-light"><?php echo $timein_disp; ?></span></div><div><span class="badge badge-light"><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]["visittypes_name"]]; ?></span></div></td>
|
||||
<td class="small"><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50"></img></td>
|
||||
<td class="small"><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50"></img>'; } ?></td>
|
||||
<td class="small">
|
||||
<?php if($row['visits_approved'] === 2) { ?>
|
||||
<div>
|
||||
<span class="badge badge-light"><?php echo $transLang['ID_TYPE']; ?></span> <?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]["idtypes_name"]]; ?>
|
||||
</div>
|
||||
<?php if($row['visits_id_type'] === 1) { ?>
|
||||
<div>
|
||||
<span class="badge badge-light"><?php echo $transLang['TICKET']; ?></span> <?php echo $row['visits_id_reference']; ?>
|
||||
</div>
|
||||
<?php }; ?>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
|
||||
<div>
|
||||
<span class="badge badge-light"><?php echo $transLang['COUNTRY']; ?>?</span> <?php echo $VisitInfo->getCountryInfo($row['visits_citizen'])[0]["countries_name"]; ?>
|
||||
</div>
|
||||
<?php }; ?>
|
||||
</td>
|
||||
<td class="small">
|
||||
<div>
|
||||
<span class="badge badge-light"><?php echo $transLang['BADGE']; ?></span> <?php echo $row['visits_badge']; ?>
|
||||
</div>
|
||||
<div>
|
||||
<span class="badge badge-light"><?php echo $transLang['SIGNINBY']; ?></span> <?php echo $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_firstname"] . " " . $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_lastname"]; ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
|
||||
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
|
||||
<!-- START VISITS LIST -->
|
||||
<div class="container-fluid">
|
||||
<div class="row"> </div>
|
||||
<div class="row row-cols-2">
|
||||
<div class="col d-grid gap-2">
|
||||
<h2><i class="fas fa-home"></i> <?php echo $transLang['ACTIVEVISITS']; ?></h2>
|
||||
</div>
|
||||
<div class="col d-grid gap-2">
|
||||
<a href="index.php" type="button" class="btn btn-success btn-lg"><?php echo $transLang['REFRESH']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<table class="table table-sm table-responsive-sm text-nowrap">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th class="small col-xs-1"><?php echo $transLang['TIMEREASON']; ?></th><th class="small col-xs-2"><?php echo $transLang['NAME']; ?></th><th class="small col-xs-2"><?php echo $transLang['ESCORT']; ?></th><th class="small col-xs-2"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small col-xs-2"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small col-xs-1"><?php echo $transLang['CARNUM'] . " / " . $transLang['SSANUM']; ?></th><?php }; ?><th class="small col-xs-1"><?php echo $transLang['ACTIONS']; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $offset) as $row):
|
||||
$visitid = $row['visits_id'];
|
||||
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
|
||||
$timein->setTimezone(new DateTimeZone("$timezone"));
|
||||
$timein_disp = $timein->format('Y-m-d H:i:s');
|
||||
if(!empty($row['visits_carnum'])) { $carnum=$row['visits_carnum']; } else { $carnum="";};
|
||||
if(!empty($row['visits_ssanum'])) { $ssanum=$row['visits_ssanum']; } else { $ssanum="";};
|
||||
?>
|
||||
<?php if($row['visits_approved']==2) { ?>
|
||||
<tr class="alert alert-success">
|
||||
<?php } else { ?>
|
||||
<tr class="alert alert-warning">
|
||||
<?php }; ?>
|
||||
<form class="form form-approve" method="post">
|
||||
<td class="small">
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $timein_disp; ?></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]["visittypes_name"]]; ?></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="small"><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50"></img></td>
|
||||
<td class="small"><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50"></img>'; } ?></td>
|
||||
<td class="small">
|
||||
<?php if($row['visits_approved'] === 2) { ?>
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang['ID_TYPE']; ?></span> <?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]["idtypes_name"]]; ?>
|
||||
</div>
|
||||
<?php if($row['visits_id_type'] === 1) { ?>
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang['TICKET']; ?></span> <?php echo $row['visits_id_reference']; ?>
|
||||
</div>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block btn-sm"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></button>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><i class="fas fa-clock"></i></span></div>
|
||||
<input placeholder="<?php echo $transLang['OPTIONAL']; ?>" name="outtime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-<?php echo $row['visits_id']; ?>" id="datetimepicker-<?php echo $row['visits_id']; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $row['visits_id']; ?>"/>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.datetimepicker-<?php echo $row['visits_id']; ?>').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss'});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['ID_TYPE']; ?></span></div>
|
||||
<select class="form-control form-control-sm bg-white custom-select<?php if( isset($id_type_error) && $id_type_error === 1 && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="id_type-<?php echo $row['visits_id']; ?>" aria-label="ID Type" name="id_type">
|
||||
<option value="" selected><?php echo $transLang['SELECTID']; ?></option>
|
||||
<?php foreach($IDTypeInfo->getIDTypeInfo("%") as $row): ?>
|
||||
<option value="<?php echo $row['idtypes_id']; ?>"><?php echo $transLang[$row['idtypes_name']]; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
|
||||
<div id="ticket-<?php echo $visitid; ?>" name="ticket-<?php echo $visitid; ?>" class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['TICKET']; ?></span></div>
|
||||
<input class="form-control form-control-sm bg-white<?php if( isset($id_reference_error) && $id_reference_error === 1 && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" type="text" id="id_reference-<?php echo $visitid; ?>" name="id_reference">
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#id_type-<?php echo $visitid; ?>').change(function() {
|
||||
if ($(this).val() === "1") {
|
||||
$('#ticket-<?php echo $visitid; ?>').show();
|
||||
$('#id_reference-<?php echo $visitid; ?>').attr('required', '');
|
||||
$('#id_reference-<?php echo $visitid; ?>').attr('data-error', 'This field is required.');
|
||||
} else {
|
||||
$('#ticket-<?php echo $visitid; ?>').hide();
|
||||
$('#id_reference-<?php echo $visitid; ?>').removeAttr('required');
|
||||
$('#id_reference-<?php echo $visitid; ?>').removeAttr('data-error');
|
||||
}
|
||||
});
|
||||
$('#id_type-<?php echo $visitid; ?>').trigger("change");
|
||||
</script>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
|
||||
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['COUNTRY']; ?></span></div>
|
||||
<select class="form-control form-control-sm bg-white custom-select<?php if( isset($citizen_error) && $citizen_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="citizen-<?php echo $visitid; ?>" name="citizen">
|
||||
<option value="00" selected><?php echo $transLang['COUNTRY']; ?></option>
|
||||
<?php foreach ($VisitInfo->getCountryInfo('%') as $row) { ?>
|
||||
<option value="<?php echo $row['countries_id']; ?>" data-sanctioned="<?php echo $row['countries_ban']; ?>"><?php echo $row['countries_name']; ?></option>
|
||||
<?php }; ?>
|
||||
</select>
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="citizen-ban-<?php echo $visitid; ?>" name="ban-<?php echo $visitid; ?>" class="input-group input-group-sm mb-0">
|
||||
<span class="badge badge-danger"><?php echo $transLang['SANCTIONED']; ?></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#citizen-<?php echo $visitid; ?>').change(function() {
|
||||
var controlbox = $(this);
|
||||
var isSanctioned = controlbox.find(':selected').data('sanctioned');
|
||||
if (isSanctioned === 1) {
|
||||
$('#citizen-ban-<?php echo $visitid; ?>').show();
|
||||
$('#approvevisit-<?php echo $visitid; ?>').attr('disabled', '');
|
||||
} else {
|
||||
$('#citizen-ban-<?php echo $visitid; ?>').hide();
|
||||
$('#approvevisit-<?php echo $visitid; ?>').removeAttr('disabled', '');
|
||||
}
|
||||
});
|
||||
$('#citizen-<?php echo $visitid; ?>').trigger("change");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang['COUNTRY']; ?>?</span> <?php echo $VisitInfo->getCountryInfo($row['visits_citizen'])[0]["countries_name"]; ?>
|
||||
</div>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['BADGE']; ?></span></div>
|
||||
<input type="text" id="badge" name="badge" class="form-control form-control-sm bg-white<?php if( isset($badge_error) && $badge_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" autofocus maxlength="15">
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<input type="hidden" id="initials" name="initials" placeholder="<?php echo $uid; ?>" value="<?php echo $uid; ?>">
|
||||
</td>
|
||||
</td>
|
||||
<td class="small">
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang['BADGE']; ?></span> <?php echo $row['visits_badge']; ?>
|
||||
</div>
|
||||
<div>
|
||||
<span class="badge bg-light text-dark"><?php echo $transLang['SIGNINBY']; ?></span> <?php echo $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_firstname"] . " " . $Users->readUserFirstAndLast($row['visits_initials'])[0]["users_lastname"]; ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
|
||||
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
|
||||
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<button type="submit" name="approvevisit" id="approvevisit-<?php echo $visitid; ?>" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i> <?php echo $transLang['APPROVE']; ?></button>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<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>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><i class="fas fa-clock"></i></span></div>
|
||||
<input placeholder="<?php echo $transLang['OPTIONAL']; ?>" name="outtime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-<?php echo $visitid; ?>" id="datetimepicker-<?php echo $visitid; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $visitid; ?>" />
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.datetimepicker-<?php echo $visitid; ?>').datetimepicker({'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss'});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
<?php }; ?>
|
||||
</form>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0 d-grid gap-2">
|
||||
<button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block btn-sm"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></button>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><i class="fas fa-clock"></i></span>
|
||||
<input placeholder="<?php echo $transLang['OPTIONAL']; ?>" name="outtime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-<?php echo $row['visits_id']; ?>" id="datetimepicker-<?php echo $row['visits_id']; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $row['visits_id']; ?>"/>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.datetimepicker-<?php echo $row['visits_id']; ?>').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss'});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><?php echo $transLang['ID_TYPE']; ?></span>
|
||||
<select class="form-control form-control-sm bg-white form-select<?php if( isset($id_type_error) && $id_type_error === 1 && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="id_type-<?php echo $row['visits_id']; ?>" aria-label="ID Type" name="id_type">
|
||||
<option value="" selected><?php echo $transLang['SELECTID']; ?></option>
|
||||
<?php foreach($IDTypeInfo->getIDTypeInfo("%") as $row): ?>
|
||||
<option value="<?php echo $row['idtypes_id']; ?>"><?php echo $transLang[$row['idtypes_name']]; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<div id="ticket-<?php echo $visitid; ?>" name="ticket-<?php echo $visitid; ?>" class="input-group input-group-sm mb-0"><span class="input-group-text"><?php echo $transLang['TICKET']; ?></span>
|
||||
<input class="form-control form-control-sm bg-white<?php if( isset($id_reference_error) && $id_reference_error === 1 && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" type="text" id="id_reference-<?php echo $visitid; ?>" name="id_reference">
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#id_type-<?php echo $visitid; ?>').change(function() {
|
||||
if ($(this).val() === "1") {
|
||||
$('#ticket-<?php echo $visitid; ?>').show();
|
||||
$('#id_reference-<?php echo $visitid; ?>').attr('required', '');
|
||||
$('#id_reference-<?php echo $visitid; ?>').attr('data-error', 'This field is required.');
|
||||
} else {
|
||||
$('#ticket-<?php echo $visitid; ?>').hide();
|
||||
$('#id_reference-<?php echo $visitid; ?>').removeAttr('required');
|
||||
$('#id_reference-<?php echo $visitid; ?>').removeAttr('data-error');
|
||||
}
|
||||
});
|
||||
$('#id_type-<?php echo $visitid; ?>').trigger("change");
|
||||
</script>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><?php echo $transLang['COUNTRY']; ?></span>
|
||||
<select class="form-control form-control-sm bg-white form-select<?php if( isset($citizen_error) && $citizen_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="citizen-<?php echo $visitid; ?>" name="citizen">
|
||||
<option value="00" selected><?php echo $transLang['COUNTRY']; ?></option>
|
||||
<?php foreach ($VisitInfo->getCountryInfo('%') as $row) { ?>
|
||||
<option value="<?php echo $row['countries_id']; ?>" data-sanctioned="<?php echo $row['countries_ban']; ?>"><?php echo $row['countries_name']; ?></option>
|
||||
<?php }; ?>
|
||||
</select>
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<div id="citizen-ban-<?php echo $visitid; ?>" name="ban-<?php echo $visitid; ?>" class="input-group input-group-sm mb-0">
|
||||
<span class="badge bg-danger"><?php echo $transLang['SANCTIONED']; ?></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#citizen-<?php echo $visitid; ?>').change(function() {
|
||||
var controlbox = $(this);
|
||||
var isSanctioned = controlbox.find(':selected').data('sanctioned');
|
||||
if (isSanctioned === 1) {
|
||||
$('#citizen-ban-<?php echo $visitid; ?>').show();
|
||||
$('#approvevisit-<?php echo $visitid; ?>').attr('disabled', '');
|
||||
} else {
|
||||
$('#citizen-ban-<?php echo $visitid; ?>').hide();
|
||||
$('#approvevisit-<?php echo $visitid; ?>').removeAttr('disabled', '');
|
||||
}
|
||||
});
|
||||
$('#citizen-<?php echo $visitid; ?>').trigger("change");
|
||||
</script>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><?php echo $transLang['BADGE']; ?></span>
|
||||
<input type="text" id="badge" name="badge" class="form-control form-control-sm bg-white<?php if( isset($badge_error) && $badge_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" autofocus maxlength="15">
|
||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||
</div>
|
||||
<input class="form-control form-control-sm" type="hidden" id="initials" name="initials" placeholder="<?php echo $uid; ?>" value="<?php echo $uid; ?>">
|
||||
</td>
|
||||
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
|
||||
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
|
||||
<?php }; ?>
|
||||
<td class="small">
|
||||
<div class="input-group input-group-sm mb-0 d-grid gap-2">
|
||||
<button type="submit" name="approvevisit" id="approvevisit-<?php echo $visitid; ?>" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i> <?php echo $transLang['APPROVE']; ?></button>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0 d-grid gap-2">
|
||||
<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>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<span class="input-group-text"><i class="fas fa-clock"></i></span>
|
||||
<input placeholder="<?php echo $transLang['OPTIONAL']; ?>" name="outtime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-<?php echo $visitid; ?>" id="datetimepicker-<?php echo $visitid; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $visitid; ?>" />
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.datetimepicker-<?php echo $visitid; ?>').datetimepicker({'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss'});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
<?php }; ?>
|
||||
</form>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- END VISITS LIST -->
|
||||
|
||||
|
||||
<!-- USER CONTENT END -->
|
||||
<?php }; require_once("inc/footer.inc.php");
|
||||
<?php }; require_once("inc/footer.inc.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user