Approve/void. Breaking changes to schema. Backend updates.

This commit is contained in:
Josh North 2021-04-29 10:58:48 -04:00
parent 2664bd9e23
commit 3eb9932448
9 changed files with 362 additions and 80 deletions

View File

@ -100,9 +100,9 @@ CREATE TABLE `lsio_visits` (
`outtime` datetime DEFAULT NULL,
`signature` blob,
`escort_signature` blob,
`citizen` tinyint(3) UNSIGNED DEFAULT NULL,
`citizen` varchar(3) UNSIGNED DEFAULT NULL,
`id_type` int(10) UNSIGNED DEFAULT NULL,
`id_checked` tinyint(3) UNSIGNED DEFAULT NULL,
`id_reference` varchar(30) UNSIGNED DEFAULT NULL,
`initials` varchar(5) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`badge` varchar(15) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`notes` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
@ -152,7 +152,7 @@ ALTER TABLE `lsio_visits`
ADD PRIMARY KEY (`id`),
ADD KEY `site_id` (`site_id`),
ADD KEY `reason` (`reason`),
ADD KEY `id_checked` (`id_checked`),
ADD KEY `id_reference` (`id_reference`),
ADD KEY `citizen` (`citizen`),
ADD KEY `id_type` (`id_type`);
ALTER TABLE `lsio_visittypes`

166
index.php
View File

@ -119,12 +119,16 @@
else { $badge_error="0";
if (empty($_POST['initials'])) { $initials_error="1"; }
else { $initials_error="0";
if (isset($_POST['id_checked']) && $_POST['id_checked'] == '1') { $id_checked="1"; }
else { $id_checked="0"; }
if (isset($_POST['citizen']) && $_POST['citizen'] == '1') { $citizen="1"; }
else { $citizen="0"; }
$approved="2";
echo $VisitActions->approveVisit($_POST['approvevisit'], $_POST['id_type'], $id_checked, $citizen, $_POST['badge'], $_POST['initials'], $approved);
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);
}
}
}
}
@ -218,14 +222,14 @@ $(document).on("click", ".open-voidModal", function (e) {
<h2><i class="fas fa-home"></i> <?php echo $transLang['ACTIVEVISITS']; ?></h2>
</div>
<div class="col-sm">
<input type="button" class="btn btn-success btn-lg btn-block" onClick="window.location.reload()" value="<?php echo $transLang['REFRESH']; ?>">
<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"><?php echo $transLang['TIMEREASON']; ?></th><th class="small"><?php echo $transLang['NAME']; ?></th><th class="small"><?php echo $transLang['ESCORT']; ?></th><th class="small"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small"><?php echo $transLang['CARNUM'] . " / " . $transLang['SSANUM']; ?></th><?php }; ?><th class="small"><?php echo $transLang['ACTIONS']; ?></th><th class="small">&nbsp</th>
<th class="small"><?php echo $transLang['TIMEREASON']; ?></th><th class="small"><?php echo $transLang['NAME']; ?></th><th class="small"><?php echo $transLang['ESCORT']; ?></th><th class="small"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small"><?php echo $transLang['CARNUM'] . " / " . $transLang['SSANUM']; ?></th><?php }; ?><th class="small"><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
@ -247,89 +251,114 @@ $(document).on("click", ".open-voidModal", function (e) {
<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) { ?>
<input class="form-control form-control-sm" type="text" id="id_type" name="id_type" disabled value="<?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]["idtypes_name"]]; ?>">
<?php if($row['visits_id_checked']==1) { ?>
<div class="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked" checked disabled>
<?php } else { ?>
<div class="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked" disabled>
<?php if($row['visits_approved'] === 2) { ?>
<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>
<input class="form-control form-control-sm bg-white" type="text" id="id_type" name="id_type" disabled value="<?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]["idtypes_name"]]; ?>">
</div>
<?php if($row['visits_id_type'] === 1) { ?>
<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['REFERENCE']; ?></span></div>
<input class="form-control form-control-sm bg-white" type="text" id="id_reference" name="id_reference" disabled value="<?php echo $row['visits_id_reference']; ?>">
</div>
<?php }; ?>
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label>
</div>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { if($row['visits_citizen']==1) { ?>
<div class="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" checked disabled>
<?php } else { ?>
<div class="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" disabled>
<?php }; ?>
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label>
</div>
<?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['CITIZEN']; ?></span></div>
<input class="form-control form-control-sm bg-white" type="text" id="citizen" name="citizen" disabled value="<?php echo $row['visits_citizen']; ?>">
</div>
<?php }; ?>
</td>
<td class="small"><input type="text" id="badge" name="badge" class="form-control form-control-sm" autofocus disabled value="<?php echo $row['visits_badge']; ?>"><br><?php echo $Users->getUserInitials($row['visits_initials'])[0]["users_firstname"] . " " . $Users->getUserInitials($row['visits_initials'])[0]["users_lastname"]; ?></td>
<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 class="form-control form-control-sm bg-white" type="text" id="badge" name="badge" disabled value="<?php echo $row['visits_badge']; ?>">
</div>
<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['USERNAME']; ?></span></div>
<input class="form-control form-control-sm bg-white" type="text" id="who" name="who" disabled value="<?php echo $Users->getUserInitials($row['visits_initials'])[0]["users_firstname"] . " " . $Users->getUserInitials($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>
<?php }; ?>
<td class="small"> </td>
<td class="small"><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block"><i class="fas fa-sign-out-alt"></i>&nbsp<?php echo $transLang['SIGNOUT']; ?></button><br>
<div>
<div class="row">
<div class="col">
<input placeholder=" / / : : " name="outtime" type="text" class="form-control form-control-sm 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']; ?>"/>
</div>
<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 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>&nbsp<?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 { ?>
<select class="form-control form-control-sm custom-select<?php if( isset($id_type_error) && $id_type_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="id_type" aria-label="ID Type" name="id_type">
<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 class="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked">
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label>
</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['REFERENCE']; ?></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="form-check form-group-sm">
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen">
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label>
<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['CITIZEN']; ?></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" name="citizen">
<option value="00" selected><?php echo $transLang['COUNTRY']; ?></option>
<?php
foreach ($VisitInfo->countries as $key => $value) { ?>
<option value="<?php echo $key; ?>"><?php echo $value['country']; ?></option><?php }; ?>
</select>
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
</div>
<?php }; ?>
<td class="small">
<input type="text" id="badge" name="badge" class="form-control form-control-sm<?php if( isset($badge_error) && $badge_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" placeholder="<?php echo $transLang['BADGE']; ?>" autofocus maxlength="15">
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
<input type="hidden" id="initials" name="initials" class="form-control<?php if( isset($initials_error) && $initials_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" placeholder="<?php echo $uid; ?>" value="<?php echo $uid; ?>" autofocus maxlength="5">
<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>
<?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">
<button type="submit" name="approvevisit" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i>&nbsp;<?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>&nbsp;<?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>&nbsp;<?php echo $transLang['SIGNOUT']; ?></button>
<br>
<div>
<div class="row">
<div class="col">
<input placeholder=" / / : : " name="outtime" type="text" class="form-control form-control-sm datetimepicker-input datetimepicker-<?php echo $visitid; ?>" id="datetimepicker-<?php echo $visitid; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $visitid; ?>" />
</div>
<script type="text/javascript">
$(function () {
$('.datetimepicker-<?php echo $visitid; ?>').datetimepicker({'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss'});
});
</script>
</div>
<div class="input-group input-group-sm mb-0">
<button type="submit" name="approvevisit" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm"><i class="fas fa-thumbs-up"></i>&nbsp;<?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>&nbsp;<?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 }; ?>
@ -340,7 +369,8 @@ $(document).on("click", ".open-voidModal", function (e) {
</table>
</div>
<!-- USER CONTENT END -->
<?php }; require_once("inc/footer.inc.php");

View File

@ -132,13 +132,13 @@
<?php if (isset($_POST['reporttype'])): ?>
<?php if ($_POST['reporttype'] == "Default"): ?>
<div class="container-fluid">
<table id="report" class="table table-striped table-bordered">
<thead><tr><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['OUT']; ?></th><th><?php echo $transLang['SITE']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['REASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['INITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th><?php echo $transLang['CARNUM']; ?></th><th><?php echo $transLang['SSANUM']; ?></th><?php } ?><?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?><th><?php echo $transLang['CITIZEN']; ?></th><?php } ?><th><?php echo $transLang['ID_TYPE']; ?></th><th><?php echo $transLang['ID_CHECKED']; ?></th></tr></thead>
<table id="report" class="table table-striped table-bordered table-sm table-responsive-sm text-nowrap">
<thead><tr><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['OUT']; ?></th><th><?php echo $transLang['SITE']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['REASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['INITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th><?php echo $transLang['CARNUM']; ?></th><th><?php echo $transLang['SSANUM']; ?></th><?php } ?><?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?><th><?php echo $transLang['CITIZEN']; ?></th><?php } ?><th><?php echo $transLang['ID_TYPE']; ?></th><th><?php echo $transLang['ID_CHECKED']; ?></th><th><?php echo $transLang['DECLINE']; ?></th></tr></thead>
<tbody>
<?php
$approval = "2";
if ($_POST['repsite'] == "all") { $selsite="%"; } else { $selsite=$_POST['repsite'];}
foreach ($VisitInfo->getVisitInfo($selsite, $approval, "%", "%", "%", $_POST['starttime'], $_POST['endtime'], "%", "%") as $row):
foreach ($VisitInfo->getVisitInfo($selsite, "%", "%", "%", "%", $_POST['starttime'], $_POST['endtime'], "%", "%") as $row):
$timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC'));
$timeout = new DateTime($row['visits_outtime'], new DateTimeZone('UTC'));
$timein->setTimezone(new DateTimeZone("$timezone"));
@ -162,9 +162,10 @@
<td><?php echo $carnum; ?></td>
<td><?php echo $ssanum; ?></td>
<?php } ?>
<?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <td><?php if($row['visits_citizen']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; } ?></td> <?php } ?>
<?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <td><?php echo $row['visits_citizen']; ?></td> <?php } ?>
<td><?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]['idtypes_name']]; ?></td>
<td><?php if($row['visits_id_checked']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; } ?></td>
<td><?php if($row['visits_id_reference']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; } ?></td>
<td><?php echo $row['visits_notes']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>

View File

@ -51,14 +51,14 @@ class VisitActions {
return $count;
}
public function approveVisit ($approvevisit, $id_type, $id_checked, $citizen, $badge, $initials, $approved) {
public function approveVisit ($approvevisit, $id_type, $id_reference, $citizen, $badge, $initials, $approved) {
$query = "
UPDATE " . Registry::DB_PRFX . "visits
SET
" . Registry::DB_PRFX . "visits.initials = \"$initials\",
" . Registry::DB_PRFX . "visits.approved = \"$approved\",
" . Registry::DB_PRFX . "visits.id_type = \"$id_type\",
" . Registry::DB_PRFX . "visits.id_checked = \"$id_checked\",
" . Registry::DB_PRFX . "visits.id_reference = \"$id_reference\",
" . Registry::DB_PRFX . "visits.badge = \"$badge\",
" . Registry::DB_PRFX . "visits.citizen = \"$citizen\"
WHERE " . Registry::DB_PRFX . "visits.id = \"$approvevisit\"

View File

@ -57,14 +57,15 @@ class VisitInfo {
" . Registry::DB_PRFX . "visits.reason as visits_reason,
" . Registry::DB_PRFX . "visits.citizen as visits_citizen,
" . Registry::DB_PRFX . "visits.id_type as visits_id_type,
" . Registry::DB_PRFX . "visits.id_checked as visits_id_checked,
" . Registry::DB_PRFX . "visits.id_reference as visits_id_reference,
" . Registry::DB_PRFX . "visits.initials as visits_initials,
" . Registry::DB_PRFX . "visits.badge as visits_badge,
" . Registry::DB_PRFX . "visits.site_id as visits_site_id,
" . Registry::DB_PRFX . "visits.company as visits_company,
" . Registry::DB_PRFX . "visits.approved as visits_approved,
" . Registry::DB_PRFX . "visits.carnum as visits_carnum,
" . Registry::DB_PRFX . "visits.ssanum as visits_ssanum
" . Registry::DB_PRFX . "visits.ssanum as visits_ssanum,
" . Registry::DB_PRFX . "visits.notes as visits_notes
FROM " . Registry::DB_PRFX . "visits
WHERE " . $cond_siteid . Registry::DB_PRFX . "visits.approved>=\"$approved\" AND " . $cond_outtime . $cond_intime . Registry::DB_PRFX . "visits.id LIKE \"$visitid\"" . $cond_rowsperpage . $cond_offset;
$database = new \App\LobbySIO\Database\Connect();
@ -72,5 +73,251 @@ class VisitInfo {
return $rows;
}
public $countries = [
"FR" => ["country" => "France", "continent" => "Europe"],
"US" => ["country" => "United States", "continent" => "North America"],
"CN" => ["country" => "China", "continent" => "Asia"],
"ES" => ["country" => "Spain", "continent" => "Europe"],
"IT" => ["country" => "Italy", "continent" => "Europe"],
"TR" => ["country" => "Turkey", "continent" => "Asia"],
"GB" => ["country" => "United Kingdom", "continent" => "Europe"],
"DE" => ["country" => "Germany", "continent" => "Europe"],
"RU" => ["country" => "Russian Federation", "continent" => "Europe"],
"MY" => ["country" => "Malaysia", "continent" => "Asia"],
"AF" => ["country" => "Afghanistan", "continent" => "Asia"],
"AX" => ["country" => "Åland Islands", "continent" => "Europe"],
"AL" => ["country" => "Albania", "continent" => "Europe"],
"DZ" => ["country" => "Algeria", "continent" => "Africa"],
"AS" => ["country" => "American Samoa", "continent" => "Oceania"],
"AD" => ["country" => "Andorra", "continent" => "Europe"],
"AO" => ["country" => "Angola", "continent" => "Africa"],
"AI" => ["country" => "Anguilla", "continent" => "North America"],
"AQ" => ["country" => "Antarctica", "continent" => "Antarctica"],
"AG" => ["country" => "Antigua and Barbuda", "continent" => "North America"],
"AR" => ["country" => "Argentina", "continent" => "South America"],
"AM" => ["country" => "Armenia", "continent" => "Asia"],
"AW" => ["country" => "Aruba", "continent" => "North America"],
"AU" => ["country" => "Australia", "continent" => "Oceania"],
"AT" => ["country" => "Austria", "continent" => "Europe"],
"AZ" => ["country" => "Azerbaijan", "continent" => "Asia"],
"BS" => ["country" => "Bahamas", "continent" => "North America"],
"BH" => ["country" => "Bahrain", "continent" => "Asia"],
"BD" => ["country" => "Bangladesh", "continent" => "Asia"],
"BB" => ["country" => "Barbados", "continent" => "North America"],
"BY" => ["country" => "Belarus", "continent" => "Europe"],
"BE" => ["country" => "Belgium", "continent" => "Europe"],
"BZ" => ["country" => "Belize", "continent" => "North America"],
"BJ" => ["country" => "Benin", "continent" => "Africa"],
"BM" => ["country" => "Bermuda", "continent" => "North America"],
"BT" => ["country" => "Bhutan", "continent" => "Asia"],
"BO" => ["country" => "Bolivia", "continent" => "South America"],
"BA" => ["country" => "Bosnia and Herzegovina", "continent" => "Europe"],
"BW" => ["country" => "Botswana", "continent" => "Africa"],
"BV" => ["country" => "Bouvet Island", "continent" => "Antarctica"],
"BR" => ["country" => "Brazil", "continent" => "South America"],
"IO" => ["country" => "British Indian Ocean Territory", "continent" => "Asia"],
"BN" => ["country" => "Brunei Darussalam", "continent" => "Asia"],
"BG" => ["country" => "Bulgaria", "continent" => "Europe"],
"BF" => ["country" => "Burkina Faso", "continent" => "Africa"],
"BI" => ["country" => "Burundi", "continent" => "Africa"],
"KH" => ["country" => "Cambodia", "continent" => "Asia"],
"CM" => ["country" => "Cameroon", "continent" => "Africa"],
"CA" => ["country" => "Canada", "continent" => "North America"],
"CV" => ["country" => "Cape Verde", "continent" => "Africa"],
"KY" => ["country" => "Cayman Islands", "continent" => "North America"],
"CF" => ["country" => "Central African Republic", "continent" => "Africa"],
"TD" => ["country" => "Chad", "continent" => "Africa"],
"CL" => ["country" => "Chile", "continent" => "South America"],
"CX" => ["country" => "Christmas Island", "continent" => "Asia"],
"CC" => ["country" => "Cocos (Keeling] Islands", "continent" => "Asia"],
"CO" => ["country" => "Colombia", "continent" => "South America"],
"KM" => ["country" => "Comoros", "continent" => "Africa"],
"CG" => ["country" => "Congo", "continent" => "Africa"],
"CD" => ["country" => "The Democratic Republic of The Congo", "continent" => "Africa"],
"CK" => ["country" => "Cook Islands", "continent" => "Oceania"],
"CR" => ["country" => "Costa Rica", "continent" => "North America"],
"CI" => ["country" => "Cote D'ivoire", "continent" => "Africa"],
"HR" => ["country" => "Croatia", "continent" => "Europe"],
"CU" => ["country" => "Cuba", "continent" => "North America"],
"CY" => ["country" => "Cyprus", "continent" => "Asia"],
"CZ" => ["country" => "Czech Republic", "continent" => "Europe"],
"DK" => ["country" => "Denmark", "continent" => "Europe"],
"DJ" => ["country" => "Djibouti", "continent" => "Africa"],
"DM" => ["country" => "Dominica", "continent" => "North America"],
"DO" => ["country" => "Dominican Republic", "continent" => "North America"],
"EC" => ["country" => "Ecuador", "continent" => "South America"],
"EG" => ["country" => "Egypt", "continent" => "Africa"],
"SV" => ["country" => "El Salvador", "continent" => "North America"],
"GQ" => ["country" => "Equatorial Guinea", "continent" => "Africa"],
"ER" => ["country" => "Eritrea", "continent" => "Africa"],
"EE" => ["country" => "Estonia", "continent" => "Europe"],
"ET" => ["country" => "Ethiopia", "continent" => "Africa"],
"FK" => ["country" => "Falkland Islands (Malvinas]", "continent" => "South America"],
"FO" => ["country" => "Faroe Islands", "continent" => "Europe"],
"FJ" => ["country" => "Fiji", "continent" => "Oceania"],
"FI" => ["country" => "Finland", "continent" => "Europe"],
"GF" => ["country" => "French Guiana", "continent" => "South America"],
"PF" => ["country" => "French Polynesia", "continent" => "Oceania"],
"TF" => ["country" => "French Southern Territories", "continent" => "Antarctica"],
"GA" => ["country" => "Gabon", "continent" => "Africa"],
"GM" => ["country" => "Gambia", "continent" => "Africa"],
"GE" => ["country" => "Georgia", "continent" => "Asia"],
"GH" => ["country" => "Ghana", "continent" => "Africa"],
"GI" => ["country" => "Gibraltar", "continent" => "Europe"],
"GR" => ["country" => "Greece", "continent" => "Europe"],
"GL" => ["country" => "Greenland", "continent" => "North America"],
"GD" => ["country" => "Grenada", "continent" => "North America"],
"GP" => ["country" => "Guadeloupe", "continent" => "North America"],
"GU" => ["country" => "Guam", "continent" => "Oceania"],
"GT" => ["country" => "Guatemala", "continent" => "North America"],
"GG" => ["country" => "Guernsey", "continent" => "Europe"],
"GN" => ["country" => "Guinea", "continent" => "Africa"],
"GW" => ["country" => "Guinea-bissau", "continent" => "Africa"],
"GY" => ["country" => "Guyana", "continent" => "South America"],
"HT" => ["country" => "Haiti", "continent" => "North America"],
"HM" => ["country" => "Heard Island and Mcdonald Islands", "continent" => "Antarctica"],
"VA" => ["country" => "Holy See (Vatican City State]", "continent" => "Europe"],
"HN" => ["country" => "Honduras", "continent" => "North America"],
"HK" => ["country" => "Hong Kong", "continent" => "Asia"],
"HU" => ["country" => "Hungary", "continent" => "Europe"],
"IS" => ["country" => "Iceland", "continent" => "Europe"],
"IN" => ["country" => "India", "continent" => "Asia"],
"ID" => ["country" => "Indonesia", "continent" => "Asia"],
"IR" => ["country" => "Iran", "continent" => "Asia"],
"IQ" => ["country" => "Iraq", "continent" => "Asia"],
"IE" => ["country" => "Ireland", "continent" => "Europe"],
"IM" => ["country" => "Isle of Man", "continent" => "Europe"],
"IL" => ["country" => "Israel", "continent" => "Asia"],
"JM" => ["country" => "Jamaica", "continent" => "North America"],
"JP" => ["country" => "Japan", "continent" => "Asia"],
"JE" => ["country" => "Jersey", "continent" => "Europe"],
"JO" => ["country" => "Jordan", "continent" => "Asia"],
"KZ" => ["country" => "Kazakhstan", "continent" => "Asia"],
"KE" => ["country" => "Kenya", "continent" => "Africa"],
"KI" => ["country" => "Kiribati", "continent" => "Oceania"],
"KP" => ["country" => "Democratic People's Republic of Korea", "continent" => "Asia"],
"KR" => ["country" => "Republic of Korea", "continent" => "Asia"],
"KW" => ["country" => "Kuwait", "continent" => "Asia"],
"KG" => ["country" => "Kyrgyzstan", "continent" => "Asia"],
"LA" => ["country" => "Lao People's Democratic Republic", "continent" => "Asia"],
"LV" => ["country" => "Latvia", "continent" => "Europe"],
"LB" => ["country" => "Lebanon", "continent" => "Asia"],
"LS" => ["country" => "Lesotho", "continent" => "Africa"],
"LR" => ["country" => "Liberia", "continent" => "Africa"],
"LY" => ["country" => "Libya", "continent" => "Africa"],
"LI" => ["country" => "Liechtenstein", "continent" => "Europe"],
"LT" => ["country" => "Lithuania", "continent" => "Europe"],
"LU" => ["country" => "Luxembourg", "continent" => "Europe"],
"MO" => ["country" => "Macao", "continent" => "Asia"],
"MK" => ["country" => "Macedonia", "continent" => "Europe"],
"MG" => ["country" => "Madagascar", "continent" => "Africa"],
"MW" => ["country" => "Malawi", "continent" => "Africa"],
"MV" => ["country" => "Maldives", "continent" => "Asia"],
"ML" => ["country" => "Mali", "continent" => "Africa"],
"MT" => ["country" => "Malta", "continent" => "Europe"],
"MH" => ["country" => "Marshall Islands", "continent" => "Oceania"],
"MQ" => ["country" => "Martinique", "continent" => "North America"],
"MR" => ["country" => "Mauritania", "continent" => "Africa"],
"MU" => ["country" => "Mauritius", "continent" => "Africa"],
"YT" => ["country" => "Mayotte", "continent" => "Africa"],
"MX" => ["country" => "Mexico", "continent" => "North America"],
"FM" => ["country" => "Micronesia", "continent" => "Oceania"],
"MD" => ["country" => "Moldova", "continent" => "Europe"],
"MC" => ["country" => "Monaco", "continent" => "Europe"],
"MN" => ["country" => "Mongolia", "continent" => "Asia"],
"ME" => ["country" => "Montenegro", "continent" => "Europe"],
"MS" => ["country" => "Montserrat", "continent" => "North America"],
"MA" => ["country" => "Morocco", "continent" => "Africa"],
"MZ" => ["country" => "Mozambique", "continent" => "Africa"],
"MM" => ["country" => "Myanmar", "continent" => "Asia"],
"NA" => ["country" => "Namibia", "continent" => "Africa"],
"NR" => ["country" => "Nauru", "continent" => "Oceania"],
"NP" => ["country" => "Nepal", "continent" => "Asia"],
"NL" => ["country" => "Netherlands", "continent" => "Europe"],
"AN" => ["country" => "Netherlands Antilles", "continent" => "North America"],
"NC" => ["country" => "New Caledonia", "continent" => "Oceania"],
"NZ" => ["country" => "New Zealand", "continent" => "Oceania"],
"NI" => ["country" => "Nicaragua", "continent" => "North America"],
"NE" => ["country" => "Niger", "continent" => "Africa"],
"NG" => ["country" => "Nigeria", "continent" => "Africa"],
"NU" => ["country" => "Niue", "continent" => "Oceania"],
"NF" => ["country" => "Norfolk Island", "continent" => "Oceania"],
"MP" => ["country" => "Northern Mariana Islands", "continent" => "Oceania"],
"NO" => ["country" => "Norway", "continent" => "Europe"],
"OM" => ["country" => "Oman", "continent" => "Asia"],
"PK" => ["country" => "Pakistan", "continent" => "Asia"],
"PW" => ["country" => "Palau", "continent" => "Oceania"],
"PS" => ["country" => "Palestinia", "continent" => "Asia"],
"PA" => ["country" => "Panama", "continent" => "North America"],
"PG" => ["country" => "Papua New Guinea", "continent" => "Oceania"],
"PY" => ["country" => "Paraguay", "continent" => "South America"],
"PE" => ["country" => "Peru", "continent" => "South America"],
"PH" => ["country" => "Philippines", "continent" => "Asia"],
"PN" => ["country" => "Pitcairn", "continent" => "Oceania"],
"PL" => ["country" => "Poland", "continent" => "Europe"],
"PT" => ["country" => "Portugal", "continent" => "Europe"],
"PR" => ["country" => "Puerto Rico", "continent" => "North America"],
"QA" => ["country" => "Qatar", "continent" => "Asia"],
"RE" => ["country" => "Reunion", "continent" => "Africa"],
"RO" => ["country" => "Romania", "continent" => "Europe"],
"RW" => ["country" => "Rwanda", "continent" => "Africa"],
"SH" => ["country" => "Saint Helena", "continent" => "Africa"],
"KN" => ["country" => "Saint Kitts and Nevis", "continent" => "North America"],
"LC" => ["country" => "Saint Lucia", "continent" => "North America"],
"PM" => ["country" => "Saint Pierre and Miquelon", "continent" => "North America"],
"VC" => ["country" => "Saint Vincent and The Grenadines", "continent" => "North America"],
"WS" => ["country" => "Samoa", "continent" => "Oceania"],
"SM" => ["country" => "San Marino", "continent" => "Europe"],
"ST" => ["country" => "Sao Tome and Principe", "continent" => "Africa"],
"SA" => ["country" => "Saudi Arabia", "continent" => "Asia"],
"SN" => ["country" => "Senegal", "continent" => "Africa"],
"RS" => ["country" => "Serbia", "continent" => "Europe"],
"SC" => ["country" => "Seychelles", "continent" => "Africa"],
"SL" => ["country" => "Sierra Leone", "continent" => "Africa"],
"SG" => ["country" => "Singapore", "continent" => "Asia"],
"SK" => ["country" => "Slovakia", "continent" => "Europe"],
"SI" => ["country" => "Slovenia", "continent" => "Europe"],
"SB" => ["country" => "Solomon Islands", "continent" => "Oceania"],
"SO" => ["country" => "Somalia", "continent" => "Africa"],
"ZA" => ["country" => "South Africa", "continent" => "Africa"],
"GS" => ["country" => "South Georgia and The South Sandwich Islands", "continent" => "Antarctica"],
"LK" => ["country" => "Sri Lanka", "continent" => "Asia"],
"SD" => ["country" => "Sudan", "continent" => "Africa"],
"SR" => ["country" => "Suriname", "continent" => "South America"],
"SJ" => ["country" => "Svalbard and Jan Mayen", "continent" => "Europe"],
"SZ" => ["country" => "Swaziland", "continent" => "Africa"],
"SE" => ["country" => "Sweden", "continent" => "Europe"],
"CH" => ["country" => "Switzerland", "continent" => "Europe"],
"SY" => ["country" => "Syrian Arab Republic", "continent" => "Asia"],
"TW" => ["country" => "Taiwan, Province of China", "continent" => "Asia"],
"TJ" => ["country" => "Tajikistan", "continent" => "Asia"],
"TZ" => ["country" => "Tanzania, United Republic of", "continent" => "Africa"],
"TH" => ["country" => "Thailand", "continent" => "Asia"],
"TL" => ["country" => "Timor-leste", "continent" => "Asia"],
"TG" => ["country" => "Togo", "continent" => "Africa"],
"TK" => ["country" => "Tokelau", "continent" => "Oceania"],
"TO" => ["country" => "Tonga", "continent" => "Oceania"],
"TT" => ["country" => "Trinidad and Tobago", "continent" => "North America"],
"TN" => ["country" => "Tunisia", "continent" => "Africa"],
"TM" => ["country" => "Turkmenistan", "continent" => "Asia"],
"TC" => ["country" => "Turks and Caicos Islands", "continent" => "North America"],
"TV" => ["country" => "Tuvalu", "continent" => "Oceania"],
"UG" => ["country" => "Uganda", "continent" => "Africa"],
"UA" => ["country" => "Ukraine", "continent" => "Europe"],
"AE" => ["country" => "United Arab Emirates", "continent" => "Asia"],
"UM" => ["country" => "United States Minor Outlying Islands", "continent" => "Oceania"],
"UY" => ["country" => "Uruguay", "continent" => "South America"],
"UZ" => ["country" => "Uzbekistan", "continent" => "Asia"],
"VU" => ["country" => "Vanuatu", "continent" => "Oceania"],
"VE" => ["country" => "Venezuela", "continent" => "South America"],
"VN" => ["country" => "Viet Nam", "continent" => "Asia"],
"VG" => ["country" => "Virgin Islands, British", "continent" => "North America"],
"VI" => ["country" => "Virgin Islands, U.S.", "continent" => "North America"],
"WF" => ["country" => "Wallis and Futuna", "continent" => "Oceania"],
"EH" => ["country" => "Western Sahara", "continent" => "Africa"],
"YE" => ["country" => "Yemen", "continent" => "Asia"],
"ZM" => ["country" => "Zambia", "continent" => "Africa"],
"ZW" => ["country" => "Zimbabwe", "continent" => "Africa"]
];
}

View File

@ -28,6 +28,7 @@ CITIZEN = 'Bürger?'
CLOSE = 'Schließen'
COMPANY = 'Firma'
CONFIRM = 'Bestätigen'
COUNTRY = 'Land'
CREATED = 'Erstellt'
CUSTSIGNIN = 'Kundenanmeldung'
CUSTSIGNOUT = 'Kunde Abmelden'

View File

@ -28,6 +28,7 @@ CITIZEN = 'Citizen?'
CLOSE = 'Close'
COMPANY = 'Company'
CONFIRM = 'Confirm'
COUNTRY = 'Country'
CREATED = 'Created'
CUSTSIGNIN = 'Visitor Sign In'
CUSTSIGNOUT = 'Visitor Sign Out'

View File

@ -28,6 +28,7 @@ CITIZEN = 'Ciudadano de estados unidos?'
CLOSE = 'Cerrar'
COMPANY = 'Organización'
CONFIRM = 'Confirmar'
COUNTRY = 'País'
CREATED = 'Creado'
CUSTSIGNIN = 'Llegada del cliente'
CUSTSIGNOUT = 'Salida del cliente'

View File

@ -28,6 +28,7 @@ CITIZEN = 'Citoyen?'
CLOSE = 'Terminer'
COMPANY = 'Organisation'
CONFIRM = 'Confirmer'
COUNTRY = 'Pays'
CREATED = 'Créé'
CUSTSIGNIN = 'Connexion client'
CUSTSIGNOUT = 'Déconnexion du client'