lang, signout

This commit is contained in:
Josh North 2021-06-18 17:49:10 -04:00
parent 6907d88fcb
commit 5e4b57ebad
4 changed files with 262 additions and 265 deletions

View File

@ -82,35 +82,34 @@
} else { ?> } else { ?>
<!-- START CONTENT -->
<?php <?php // FILTER POSTED DATA
// FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [ $form_data = filter_input_array(INPUT_POST, [
'form_data_saveprofile' => (string)FILTER_SANITIZE_STRING, 'fd_saveProfile' => (string)FILTER_SANITIZE_STRING,
'form_data_passwordinitial' => (string)FILTER_SANITIZE_STRING, 'fd_initialPassword' => (string)FILTER_SANITIZE_STRING,
'form_data_passwordconfirm' => (string)FILTER_SANITIZE_STRING, 'fd_confirmPassword' => (string)FILTER_SANITIZE_STRING,
'form_data_firstname' => (string)FILTER_SANITIZE_STRING, 'fd_firstName' => (string)FILTER_SANITIZE_STRING,
'form_data_lastname' => (string)FILTER_SANITIZE_STRING, 'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'form_data_email' => (string)FILTER_SANITIZE_STRING 'fd_userEmail' => (string)FILTER_SANITIZE_STRING
]); ]);
$minpasslength = $StaticFunctions->getMinPass(); $minpasslength = $StaticFunctions->getMinPass();
if (isset($form_data['form_data_saveprofile'])): if (isset($form_data['fd_saveProfile'])):
if (empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])): if (empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])):
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]); $Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]);
header('Location: profile.php'); header('Location: profile.php');
elseif (strlen($form_data['form_data_passwordinitial']) < $minpasslength): elseif (strlen($form_data['fd_initialPassword']) < $minpasslength):
echo "Password must be at least $minpasslength characters."; echo "Password must be at least $minpasslength characters.";
elseif (!empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])): elseif (!empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])):
echo "Please confirm password if you wish to change it"; echo "Please confirm password if you wish to change it";
elseif ($form_data['form_data_passwordinitial'] != $form_data['form_data_passwordconfirm']): elseif ($form_data['fd_initialPassword'] != $form_data['fd_confirmPassword']):
echo "New passwords do not match"; echo "New passwords do not match";
elseif (!empty($form_data['form_data_passwordinitial']) && ($form_data['form_data_passwordinitial'] = $form_data['form_data_passwordconfirm'])): elseif (!empty($form_data['fd_initialPassword']) && ($form_data['fd_initialPassword'] = $form_data['fd_confirmPassword'])):
// change pass // change pass
require_once("src/Misc/PasswordHash.php"); require_once("src/Misc/PasswordHash.php");
$hasher = new PasswordHash(8, FALSE); $hasher = new PasswordHash(8, FALSE);
$password = $hasher->HashPassword($form_data['form_data_passwordinitial']); $password = $hasher->HashPassword($form_data['fd_initialPassword']);
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $password); $Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $password);
header('Location: profile.php'); header('Location: profile.php');
endif; endif;
endif; endif;
@ -118,24 +117,24 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="container-fluid"> <div class="container-fluid">
<div class="row row-cols-3 mb-2"> <div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-user-circle"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2> <h2><i class="fas fa-user-circle"></i> <?=$transLang['EDIT_PROFILE']?></h2>
</div> </div>
<div class="col d-grid gap-2 text-center"> <div class="col d-grid gap-2 text-center">
</div> </div>
<div class="col text-end"> <div class="col text-end">
<a href="profile.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?php echo $transLang['REFRESH']; ?></a> <a href="profile.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?=$transLang['REFRESH']?></a>
</div> </div>
</div> </div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?> <?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-1 mb-2"> <div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p> <p class="lead"><?=$transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p>
</div> </div>
</div> </div>
<?php } elseif (Registry::AUTHMETHOD == 'SAML') { ?> <?php } elseif (Registry::AUTHMETHOD == 'SAML') { ?>
<div class="row row-cols-1 mb-2"> <div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_AUTHLOCKED']; ?></p> <p class="lead"><?=$transLang['ACCOUNT_INFO_AUTHLOCKED']?></p>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
@ -144,13 +143,13 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="row row-cols-2 mb-2"> <div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-USERNAME']; ?></span> <span class="input-group-text"><?=$transLang['USER-USERNAME']?></span>
<input class="form-control bg-white" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly /> <input class="form-control bg-white" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['CREATED']; ?></span> <span class="input-group-text"><?=$transLang['CREATED']?></span>
<input class="form-control bg-white" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly /> <input class="form-control bg-white" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
</div> </div>
</div> </div>
@ -158,28 +157,28 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="row row-cols-2 mb-2"> <div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-TYPE']; ?></span> <span class="input-group-text"><?=$transLang['USER-TYPE']?></span>
<input class="form-control bg-white" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly /> <input class="form-control bg-white" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['EMAIL']; ?></span> <span class="input-group-text"><?=$transLang['EMAIL']?></span>
<input class="form-control bg-white" type="text" name="form_data_email" id="form_data_email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/> <input class="form-control bg-white" type="text" name="fd_userEmail" id="fd_userEmail" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div> </div>
</div> </div>
</div> </div>
<div class="row row-cols-2 mb-2"> <div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['FIRSTNAME']; ?></span> <span class="input-group-text"><?=$transLang['FIRSTNAME']?></span>
<input class="form-control bg-white" type="text" name="form_data_firstname" id="form_data_firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/> <input class="form-control bg-white" type="text" name="fd_firstName" id="fd_firstName" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['LASTNAME']; ?></span> <span class="input-group-text"><?=$transLang['LASTNAME']?></span>
<input class="form-control bg-white" type="text" name="form_data_lastname" id="form_data_lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/> <input class="form-control bg-white" type="text" name="fd_lastName" id="fd_lastName" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div> </div>
</div> </div>
</div> </div>
@ -187,19 +186,19 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="row row-cols-3 mb-2"> <div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span> <span class="input-group-text"><?=$transLang['NEW'] . " " . $transLang['PASSWORD']?></span>
<input class="form-control bg-white" type="password" name="form_data_passwordinitial" id="form_data_passwordinitial" /> <input class="form-control bg-white" type="password" name="fd_initialPassword" id="fd_initialPassword" />
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span> <span class="input-group-text"><?=$transLang['STR_COMMON_CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']?></span>
<input class="form-control bg-white" type="password" name="form_data_passwordconfirm" id="form_data_passwordconfirm" /> <input class="form-control bg-white" type="password" name="fd_confirmPassword" id="fd_confirmPassword" />
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group"> <div class="input-group">
<button type="submit" name="form_data_saveprofile" id="form_data_saveprofile" class="form-control btn btn-success"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['STR_COMMON_SAVE']; ?></button> <button type="submit" name="fd_saveProfile" id="fd_saveProfile" class="form-control btn btn-success"><i class="fas fa-save"></i>&nbsp;<?=$transLang['STR_COMMON_SAVE']?></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -64,43 +64,42 @@
<?php
// FILTER POSTED DATA <?php // FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [ $form_data = filter_input_array(INPUT_POST, [
'form_data_stage' => (string)FILTER_SANITIZE_STRING, 'fd_formAction' => (string)FILTER_SANITIZE_STRING,
'form_data_siteid' => (int)FILTER_VALIDATE_INT, 'fd_siteId' => (int)FILTER_VALIDATE_INT,
'form_data_isvendor' => (int)FILTER_VALIDATE_INT, 'fd_isVendor' => (int)FILTER_VALIDATE_INT,
'form_data_firstname' => (string)FILTER_SANITIZE_STRING, 'fd_firstName' => (string)FILTER_SANITIZE_STRING,
'form_data_lastname' => (string)FILTER_SANITIZE_STRING, 'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'form_data_carnum' => (string)FILTER_SANITIZE_STRING, 'fd_carNum' => (string)FILTER_SANITIZE_STRING,
'form_data_ssanum' => (string)FILTER_SANITIZE_STRING, 'fd_ssaNum' => (string)FILTER_SANITIZE_STRING,
'form_data_company' => (string)FILTER_SANITIZE_STRING, 'fd_visitorCompany' => (string)FILTER_SANITIZE_STRING,
'form_data_contact1' => (string)FILTER_SANITIZE_STRING, 'fd_vendorContact1' => (string)FILTER_SANITIZE_STRING,
'form_data_contact2' => (string)FILTER_SANITIZE_STRING, 'fd_vendorContact2' => (string)FILTER_SANITIZE_STRING,
'form_data_workstart' => (string)FILTER_SANITIZE_STRING, 'fd_workStartTime' => (string)FILTER_SANITIZE_STRING,
'form_data_workend' => (string)FILTER_SANITIZE_STRING, 'fd_workEndTime' => (string)FILTER_SANITIZE_STRING,
'form_data_customerimpacted' => (string)FILTER_SANITIZE_STRING, 'fd_clientImpacted' => (string)FILTER_SANITIZE_STRING,
'form_data_visittype' => (int)FILTER_VALIDATE_INT, 'fd_visitType' => (int)FILTER_VALIDATE_INT,
'form_data_escortrequired' => (int)FILTER_VALIDATE_INT, 'fd_escortRequired' => (int)FILTER_VALIDATE_INT,
'form_data_v_signature' => (string)FILTER_SANITIZE_STRING, 'fd_visitorSignature' => (string)FILTER_SANITIZE_STRING,
'form_data_e_signature' => (string)FILTER_SANITIZE_STRING, 'fd_escortSignature' => (string)FILTER_SANITIZE_STRING,
'form_data_escortname' => (string)FILTER_SANITIZE_STRING 'fd_escortName' => (string)FILTER_SANITIZE_STRING
]); ]);
// SET INITIAL STAGE if(empty($form_data['fd_formAction'])){ // SET INITIAL STAGE
if(empty($form_data['form_data_stage'])){ $form_data['fd_formAction'] = 'covidack';
$form_data['form_data_stage'] = 'covidack';
} }
?> ?>
<!-- CONTENT --> <!-- CONTENT -->
<?php if($form_data['form_data_stage'] === "covidack"){ ?> <?php if($form_data['fd_formAction'] === "covidack"){ ?>
<!-- START INITIAL STAGE CONTENT --> <!-- START INITIAL STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="needs-validation" method="post" novalidate> <form name="form-signin" class="needs-validation" method="post" novalidate>
@ -108,51 +107,51 @@ if(empty($form_data['form_data_stage'])){
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q1" required> <input class="form-check-input" type="checkbox" value="" id="q1" required>
<label class="form-check-label" for="q1"><b><?php echo $transLang['COVID-Q1-TITLE']; ?></b><br><?php echo $transLang['COVID-Q1-DESC']; ?></label> <label class="form-check-label" for="q1"><b><?=$transLang['COVID-Q1-TITLE']?></b><br><?=$transLang['COVID-Q1-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q2" required> <input class="form-check-input" type="checkbox" value="" id="q2" required>
<label class="form-check-label" for="q2"><b><?php echo $transLang['COVID-Q2-TITLE']; ?></b><br><?php echo $transLang['COVID-Q2-DESC']; ?></label> <label class="form-check-label" for="q2"><b><?=$transLang['COVID-Q2-TITLE']?></b><br><?=$transLang['COVID-Q2-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q3" required> <input class="form-check-input" type="checkbox" value="" id="q3" required>
<label class="form-check-label" for="q3"><b><?php echo $transLang['COVID-Q3-TITLE']; ?></b><br><?php echo $transLang['COVID-Q3-DESC']; ?></label> <label class="form-check-label" for="q3"><b><?=$transLang['COVID-Q3-TITLE']?></b><br><?=$transLang['COVID-Q3-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q4" required> <input class="form-check-input" type="checkbox" value="" id="q4" required>
<label class="form-check-label" for="q4"><b><?php echo $transLang['COVID-Q4-TITLE']; ?></b><br><?php echo $transLang['COVID-Q4-DESC']; ?></label> <label class="form-check-label" for="q4"><b><?=$transLang['COVID-Q4-TITLE']?></b><br><?=$transLang['COVID-Q4-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q5" required> <input class="form-check-input" type="checkbox" value="" id="q5" required>
<label class="form-check-label" for="q5"><b><?php echo $transLang['COVID-Q5-TITLE']; ?></b><br><?php echo $transLang['COVID-Q5-DESC']; ?></label> <label class="form-check-label" for="q5"><b><?=$transLang['COVID-Q5-TITLE']?></b><br><?=$transLang['COVID-Q5-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q6" required> <input class="form-check-input" type="checkbox" value="" id="q6" required>
<label class="form-check-label" for="q6"><b><?php echo $transLang['COVID-Q6-TITLE']; ?></b><br><?php echo $transLang['COVID-Q6-DESC']; ?></label> <label class="form-check-label" for="q6"><b><?=$transLang['COVID-Q6-TITLE']?></b><br><?=$transLang['COVID-Q6-DESC']?></label>
<div class="invalid-feedback"><?php echo $transLang['STR_COMMON_REQUIRED']; ?></div> <div class="invalid-feedback"><?=$transLang['STR_COMMON_REQUIRED']?></div>
</div> </div>
</div> </div>
<div class="row">&nbsp;</div> <div class="row">&nbsp;</div>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $siteid; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?php echo $siteid; ?>" />
<input type="hidden" name="form_data_stage" id="form_data_stage" value="customerorvendor" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="customerorvendor" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?php echo $transLang['NEXT']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?=$transLang['NEXT']?></button>
</div> </div>
</div> </div>
</form> </form>
@ -179,43 +178,43 @@ if(empty($form_data['form_data_stage'])){
</script> </script>
<!-- END INITIAL STAGE CONTENT --> <!-- END INITIAL STAGE CONTENT -->
<?php }elseif($form_data['form_data_stage'] === "customerorvendor"){ ?> <?php }elseif($form_data['fd_formAction'] === "customerorvendor"){ ?>
<!-- START CUSTOMERORVENDOR STAGE CONTENT --> <!-- START CUSTOMERORVENDOR STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post"> <form name="form-signin" class="form-signin" method="post">
<?php echo Csrf::getInputToken('home') ?> <?php echo Csrf::getInputToken('home') ?>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<?php echo $transLang['STR_VENDORINFO_CUSTOMERORVENDOR_DESC']; ?> <?=$transLang['STR_VENDORINFO_CUSTOMERORVENDOR_DESC']?>
</div> </div>
</div> </div>
<div class="row row-cols-2 mb-4"> <div class="row row-cols-2 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="nameandcompany" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="nameandcompany" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<button type="submit" id="form_data_isvendor" class="btn btn-lg btn-outline-primary" name="form_data_isvendor" value="0">&nbsp;<br><?php echo $transLang['CUSTOMER']; ?><br>&nbsp;</button> <button type="submit" id="fd_isVendor" class="btn btn-lg btn-outline-primary" name="fd_isVendor" value="0">&nbsp;<br><?=$transLang['CUSTOMER']?><br>&nbsp;</button>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<button type="submit" id="form_data_isvendor" class="btn btn-lg btn-outline-primary" name="form_data_isvendor" value="1">&nbsp;<br><?php echo $transLang['STR_VENDORINFO_VENDOR_TITLE']; ?><br>&nbsp;</button> <button type="submit" id="fd_isVendor" class="btn btn-lg btn-outline-primary" name="fd_isVendor" value="1">&nbsp;<br><?=$transLang['STR_VENDORINFO_VENDOR_TITLE']?><br>&nbsp;</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- END CUSTOMERORVENDOR STAGE CONTENT --> <!-- END CUSTOMERORVENDOR STAGE CONTENT -->
<?php }elseif($form_data['form_data_stage'] === "nameandcompany"){ ?> <?php }elseif($form_data['fd_formAction'] === "nameandcompany"){ ?>
<!-- START NAMEANDCOMPANY STAGE CONTENT --> <!-- START NAMEANDCOMPANY STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post"> <form name="form-signin" class="form-signin" method="post">
@ -223,24 +222,24 @@ if(empty($form_data['form_data_stage'])){
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span> <span class="input-group-text"><?=$transLang['NAME']?></span>
<input type="text" id="form_data_firstname" name="form_data_firstname" class="form-control" placeholder="<?php echo $transLang['FIRST']; ?>" required autofocus> <input type="text" id="fd_firstName" name="fd_firstName" class="form-control" placeholder="<?=$transLang['FIRST']?>" required autofocus>
<input type="text" id="form_data_lastname" name="form_data_lastname" class="form-control" placeholder="<?php echo $transLang['LAST']; ?>" required autofocus> <input type="text" id="fd_lastName" name="fd_lastName" class="form-control" placeholder="<?=$transLang['LAST']?>" required autofocus>
</div> </div>
</div> </div>
</div> </div>
<?php if($SiteInfo->getSite($form_data['form_data_siteid'], $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?> <?php if($SiteInfo->getSite($form_data['fd_siteId'], $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<div class="row row-cols-2 mb-4"> <div class="row row-cols-2 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['CARNUM']; ?></span> <span class="input-group-text"><?=$transLang['CARNUM']?></span>
<input type="text" id="form_data_carnum" name="form_data_carnum" class="form-control" placeholder="<?php echo $transLang['CARNUM']; ?>" required autofocus> <input type="text" id="fd_carNum" name="fd_carNum" class="form-control" placeholder="<?=$transLang['CARNUM']?>" required autofocus>
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['SSANUM']; ?></span> <span class="input-group-text"><?=$transLang['SSANUM']?></span>
<input type="text" id="form_data_ssanum" name="form_data_ssanum" class="form-control" placeholder="<?php echo $transLang['SSANUM']; ?>" required autofocus> <input type="text" id="fd_ssaNum" name="fd_ssaNum" class="form-control" placeholder="<?=$transLang['SSANUM']?>" required autofocus>
</div> </div>
</div> </div>
</div> </div>
@ -248,41 +247,41 @@ if(empty($form_data['form_data_stage'])){
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['COMPANY']; ?></span> <span class="input-group-text"><?=$transLang['COMPANY']?></span>
<input type="text" id="form_data_company" name="form_data_company" class="form-control" placeholder="<?php echo $transLang['COMPANY']; ?>" required autofocus> <input type="text" id="fd_visitorCompany" name="fd_visitorCompany" class="form-control" placeholder="<?=$transLang['COMPANY']?>" required autofocus>
</div> </div>
</div> </div>
</div> </div>
<?php if($form_data['form_data_isvendor']===1) { ?> <?php if($form_data['fd_isVendor']===1) { ?>
<div class="row row-cols-2 mb-4"> <div class="row row-cols-2 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['STR_VENDORINFO_CONTACT1_TITLE']; ?></span> <span class="input-group-text"><?=$transLang['STR_VENDORINFO_CONTACT1_TITLE']?></span>
<input type="text" id="form_data_contact1" name="form_data_contact1" class="form-control" required autofocus> <input type="text" id="fd_vendorContact1" name="fd_vendorContact1" class="form-control" required autofocus>
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['STR_VENDORINFO_CONTACT2_TITLE']; ?></span> <span class="input-group-text"><?=$transLang['STR_VENDORINFO_CONTACT2_TITLE']?></span>
<input type="text" id="form_data_contact2" name="form_data_contact2" class="form-control" required autofocus> <input type="text" id="fd_vendorContact2" name="fd_vendorContact2" class="form-control" required autofocus>
</div> </div>
</div> </div>
</div> </div>
<div class="row row-cols-2 mb-4"> <div class="row row-cols-2 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text" data-bs-toggle="datetimepicker" data-target=".datetimepicker-form_data_workstart"><?php echo $transLang['STR_VENDORINFO_WORKSTART_TITLE']; ?>&nbsp;<i class="fas fa-clock"></i></span> <span class="input-group-text" data-bs-toggle="datetimepicker" data-target=".datetimepicker-fd_workStartTime"><?=$transLang['STR_VENDORINFO_WORKSTART_TITLE']?>&nbsp;<i class="fas fa-clock"></i></span>
<input name="form_data_workstart" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-form_data_workstart" id="datetimepicker-form_data_workstart" data-toggle="datetimepicker" data-target=".datetimepicker-form_data_workstart"/> <input name="fd_workStartTime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-fd_workStartTime" id="datetimepicker-fd_workStartTime" data-toggle="datetimepicker" data-target=".datetimepicker-fd_workStartTime"/>
</div> </div>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text" data-bs-toggle="datetimepicker" data-target=".datetimepicker-form_data_workend"><?php echo $transLang['STR_VENDORINFO_WORKEND_TITLE']; ?>&nbsp;<i class="fas fa-clock"></i></span> <span class="input-group-text" data-bs-toggle="datetimepicker" data-target=".datetimepicker-fd_workEndTime"><?=$transLang['STR_VENDORINFO_WORKEND_TITLE']?>&nbsp;<i class="fas fa-clock"></i></span>
<input name="form_data_workend" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-form_data_workend" id="datetimepicker-form_data_workend" data-toggle="datetimepicker" data-target=".datetimepicker-form_data_workend"/> <input name="fd_workEndTime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-fd_workEndTime" id="datetimepicker-fd_workEndTime" data-toggle="datetimepicker" data-target=".datetimepicker-fd_workEndTime"/>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('.datetimepicker-form_data_workstart').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss', 'allowInputToggle': true, 'defaultDate':'<?php echo $timenow; ?>' }); $('.datetimepicker-fd_workStartTime').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss', 'allowInputToggle': true, 'defaultDate':'<?php echo $timenow; ?>' });
$('.datetimepicker-form_data_workend').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss', 'allowInputToggle': true, 'defaultDate':'<?php echo date('Y-m-d H:i:s', time()+43200); ?>' }); $('.datetimepicker-fd_workEndTime').datetimepicker({'timeZone': '<?php echo $timezone; ?>', 'sideBySide':true, 'format':'YYYY-MM-DD HH:mm:ss', 'allowInputToggle': true, 'defaultDate':'<?php echo date('Y-m-d H:i:s', time()+43200); ?>' });
}); });
</script> </script>
</div> </div>
@ -291,31 +290,31 @@ if(empty($form_data['form_data_stage'])){
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['STR_VENDORINFO_CUSTOMERIMPACTED_TITLE']; ?></span> <span class="input-group-text"><?=$transLang['STR_VENDORINFO_CUSTOMERIMPACTED_TITLE']?></span>
<input type="text" id="form_data_customerimpacted" name="form_data_customerimpacted" class="form-control" required autofocus> <input type="text" id="fd_clientImpacted" name="fd_clientImpacted" class="form-control" required autofocus>
</div> </div>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="reasonforvisit" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="reasonforvisit" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<input type="hidden" name="form_data_isvendor" id="form_data_isvendor" value="<?php echo $form_data['form_data_isvendor']; ?>" /> <input type="hidden" name="fd_isVendor" id="fd_isVendor" value="<?=$form_data['fd_isVendor']?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?php echo $transLang['NEXT']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?=$transLang['NEXT']?></button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- END NAMEANDCOMPANY STAGE CONTENT --> <!-- END NAMEANDCOMPANY STAGE CONTENT -->
<?php }elseif($form_data['form_data_stage'] === "reasonforvisit"){ ?> <?php }elseif($form_data['fd_formAction'] === "reasonforvisit"){ ?>
<!-- START REASONFORVISIT STAGE CONTENT --> <!-- START REASONFORVISIT STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post"> <form name="form-signin" class="form-signin" method="post">
@ -323,68 +322,68 @@ if(empty($form_data['form_data_stage'])){
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['REASON']; ?></span> <span class="input-group-text"><?=$transLang['REASON']?></span>
<select class="form-select" id="form_data_visittype" name="form_data_visittype" required> <select class="form-select" id="fd_visitType" name="fd_visitType" required>
<option value="" selected><?php echo $transLang['SELECTREASON']; ?></option><?php foreach($VisitTypeInfo->getInfoVisitType($form_data['form_data_isvendor'],"%") as $row): ?> <option value="" selected><?=$transLang['SELECTREASON']?></option><?php foreach($VisitTypeInfo->getInfoVisitType($form_data['fd_isVendor'],"%") as $row): ?>
<option value="<?php echo $row['visittypes_id']; ?>"><?php echo $transLang[$row['visittypes_name']]; ?></option><?php endforeach; ?> <option value="<?php echo $row['visittypes_id']?>"><?php echo $transLang[$row['visittypes_name']]; ?></option><?php endforeach; ?>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="visitorsignature" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="visitorsignature" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<input type="hidden" name="form_data_isvendor" id="form_data_isvendor" value="<?php echo $form_data['form_data_isvendor']; ?>" /> <input type="hidden" name="fd_isVendor" id="fd_isVendor" value="<?=$form_data['fd_isVendor']?>" />
<input type="hidden" name="form_data_firstname" id="form_data_firstname" value="<?php echo $form_data['form_data_firstname']; ?>" /> <input type="hidden" name="fd_firstName" id="fd_firstName" value="<?=$form_data['fd_firstName']?>" />
<input type="hidden" name="form_data_lastname" id="form_data_lastname" value="<?php echo $form_data['form_data_lastname']; ?>" /> <input type="hidden" name="fd_lastName" id="fd_lastName" value="<?=$form_data['fd_lastName']?>" />
<input type="hidden" name="form_data_carnum" id="form_data_carnum" value="<?php echo $form_data['form_data_carnum']; ?>" /> <input type="hidden" name="fd_carNum" id="fd_carNum" value="<?=$form_data['fd_carNum']?>" />
<input type="hidden" name="form_data_ssanum" id="form_data_ssanum" value="<?php echo $form_data['form_data_ssanum']; ?>" /> <input type="hidden" name="fd_ssaNum" id="fd_ssaNum" value="<?=$form_data['fd_ssaNum']?>" />
<input type="hidden" name="form_data_company" id="form_data_company" value="<?php echo $form_data['form_data_company']; ?>" /> <input type="hidden" name="fd_visitorCompany" id="fd_visitorCompany" value="<?=$form_data['fd_visitorCompany']?>" />
<input type="hidden" name="form_data_contact1" id="form_data_contact1" value="<?php echo $form_data['form_data_contact1']; ?>" /> <input type="hidden" name="fd_vendorContact1" id="fd_vendorContact1" value="<?=$form_data['fd_vendorContact1']?>" />
<input type="hidden" name="form_data_contact2" id="form_data_contact2" value="<?php echo $form_data['form_data_contact2']; ?>" /> <input type="hidden" name="fd_vendorContact2" id="fd_vendorContact2" value="<?=$form_data['fd_vendorContact2']?>" />
<input type="hidden" name="form_data_workstart" id="form_data_workstart" value="<?php echo $form_data['form_data_workstart']; ?>" /> <input type="hidden" name="fd_workStartTime" id="fd_workStartTime" value="<?=$form_data['fd_workStartTime']?>" />
<input type="hidden" name="form_data_workend" id="form_data_workend" value="<?php echo $form_data['form_data_workend']; ?>" /> <input type="hidden" name="fd_workEndTime" id="fd_workEndTime" value="<?=$form_data['fd_workEndTime']?>" />
<input type="hidden" name="form_data_customerimpacted" id="form_data_customerimpacted" value="<?php echo $form_data['form_data_customerimpacted']; ?>" /> <input type="hidden" name="fd_clientImpacted" id="fd_clientImpacted" value="<?=$form_data['fd_clientImpacted']?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?php echo $transLang['NEXT']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?=$transLang['NEXT']?></button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- END REASONFORVISIT STAGE CONTENT --> <!-- END REASONFORVISIT STAGE CONTENT -->
<?php }elseif($form_data['form_data_stage'] === "visitorsignature"){ ?> <?php }elseif($form_data['fd_formAction'] === "visitorsignature"){ ?>
<!-- START VISITORSIGNATURE STAGE CONTENT --> <!-- START VISITORSIGNATURE STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post"> <form name="form-signin" class="form-signin" method="post">
<?php echo Csrf::getInputToken('home') ?> <?php echo Csrf::getInputToken('home') ?>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h4><?php echo $transLang['STR_COMMON_VSIGNATURE']; ?>:</h4> <h4><?=$transLang['STR_COMMON_VSIGNATURE']?>:</h4>
<div id="vsignature-parent sigs"> <div id="vsignature-parent sigs">
<div id="vsignature"></div> <div id="vsignature"></div>
</div> </div>
</div> </div>
</div> </div>
<?php if($form_data['form_data_isvendor'] === (int)"0") { ?> <?php if($form_data['fd_isVendor'] === (int)"0") { ?>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h4><?php echo $transLang['ESECTION']; ?>?</h4> <h4><?=$transLang['ESECTION']?>?</h4>
</div> </div>
</div> </div>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="btn-group"> <div class="btn-group">
<input type="radio" class="btn-check btn-lg" name="form_data_escortrequired" id="no-outlined" autocomplete="off" value="0" required> <input type="radio" class="btn-check btn-lg" name="fd_escortRequired" id="no-outlined" autocomplete="off" value="0" required>
<label class="btn btn-outline-primary btn-lg" for="no-outlined"><?php echo $transLang['STR_COMMON_NO']; ?></label> <label class="btn btn-outline-primary btn-lg" for="no-outlined"><?=$transLang['STR_COMMON_NO']?></label>
<input type="radio" class="btn-check btn-lg" name="form_data_escortrequired" id="yes-outlined" autocomplete="off" value="1" required> <input type="radio" class="btn-check btn-lg" name="fd_escortRequired" id="yes-outlined" autocomplete="off" value="1" required>
<label class="btn btn-outline-primary btn-lg" for="yes-outlined"><?php echo $transLang['STR_COMMON_YES']; ?></label> <label class="btn btn-outline-primary btn-lg" for="yes-outlined"><?=$transLang['STR_COMMON_YES']?></label>
</div> </div>
</div> </div>
</div> </div>
@ -396,12 +395,12 @@ if(empty($form_data['form_data_stage'])){
true; true;
$('#vsignature').change(function() { $('#vsignature').change(function() {
var data = $vsignature.jSignature('getData'); var data = $vsignature.jSignature('getData');
$('#form_data_v_signature').val(data); $('#fd_visitorSignature').val(data);
}); });
}); });
$("form").submit(function() { $("form").submit(function() {
if($('#form_data_v_signature').val() === '') { if($('#fd_visitorSignature').val() === '') {
alert("<?php echo $transLang['STR_COMMON_SIGNATURE']; ?> <?php echo $transLang['STR_COMMON_REQUIRED']; ?>"); alert("<?=$transLang['STR_COMMON_SIGNATURE']?> <?=$transLang['STR_COMMON_REQUIRED']?>");
return false; return false;
} }
return true; return true;
@ -409,35 +408,35 @@ if(empty($form_data['form_data_stage'])){
</script> </script>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="escortorterms" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="escortorterms" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<input type="hidden" name="form_data_isvendor" id="form_data_isvendor" value="<?php echo $form_data['form_data_isvendor']; ?>" /> <input type="hidden" name="fd_isVendor" id="fd_isVendor" value="<?=$form_data['fd_isVendor']?>" />
<input type="hidden" name="form_data_firstname" id="form_data_firstname" value="<?php echo $form_data['form_data_firstname']; ?>" /> <input type="hidden" name="fd_firstName" id="fd_firstName" value="<?=$form_data['fd_firstName']?>" />
<input type="hidden" name="form_data_lastname" id="form_data_lastname" value="<?php echo $form_data['form_data_lastname']; ?>" /> <input type="hidden" name="fd_lastName" id="fd_lastName" value="<?=$form_data['fd_lastName']?>" />
<input type="hidden" name="form_data_carnum" id="form_data_carnum" value="<?php echo $form_data['form_data_carnum']; ?>" /> <input type="hidden" name="fd_carNum" id="fd_carNum" value="<?=$form_data['fd_carNum']?>" />
<input type="hidden" name="form_data_ssanum" id="form_data_ssanum" value="<?php echo $form_data['form_data_ssanum']; ?>" /> <input type="hidden" name="fd_ssaNum" id="fd_ssaNum" value="<?=$form_data['fd_ssaNum']?>" />
<input type="hidden" name="form_data_company" id="form_data_company" value="<?php echo $form_data['form_data_company']; ?>" /> <input type="hidden" name="fd_visitorCompany" id="fd_visitorCompany" value="<?=$form_data['fd_visitorCompany']?>" />
<input type="hidden" name="form_data_contact1" id="form_data_contact1" value="<?php echo $form_data['form_data_contact1']; ?>" /> <input type="hidden" name="fd_vendorContact1" id="fd_vendorContact1" value="<?=$form_data['fd_vendorContact1']?>" />
<input type="hidden" name="form_data_contact2" id="form_data_contact2" value="<?php echo $form_data['form_data_contact2']; ?>" /> <input type="hidden" name="fd_vendorContact2" id="fd_vendorContact2" value="<?=$form_data['fd_vendorContact2']?>" />
<input type="hidden" name="form_data_workstart" id="form_data_workstart" value="<?php echo $form_data['form_data_workstart']; ?>" /> <input type="hidden" name="fd_workStartTime" id="fd_workStartTime" value="<?=$form_data['fd_workStartTime']?>" />
<input type="hidden" name="form_data_workend" id="form_data_workend" value="<?php echo $form_data['form_data_workend']; ?>" /> <input type="hidden" name="fd_workEndTime" id="fd_workEndTime" value="<?=$form_data['fd_workEndTime']?>" />
<input type="hidden" name="form_data_customerimpacted" id="form_data_customerimpacted" value="<?php echo $form_data['form_data_customerimpacted']; ?>" /> <input type="hidden" name="fd_clientImpacted" id="fd_clientImpacted" value="<?=$form_data['fd_clientImpacted']?>" />
<input type="hidden" name="form_data_visittype" id="form_data_visittype" value="<?php echo $form_data['form_data_visittype']; ?>" /> <input type="hidden" name="fd_visitType" id="fd_visitType" value="<?=$form_data['fd_visitType']?>" />
<input type="hidden" name="form_data_v_signature" id="form_data_v_signature" /> <input type="hidden" name="fd_visitorSignature" id="fd_visitorSignature" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?php echo $transLang['NEXT']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?=$transLang['NEXT']?></button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- END VISITORSIGNATURE STAGE CONTENT --> <!-- END VISITORSIGNATURE STAGE CONTENT -->
<?php }elseif($form_data['form_data_stage'] === (string)"escortorterms" && $form_data['form_data_escortrequired'] === (int)"1"){ ?> <?php }elseif($form_data['fd_formAction'] === (string)"escortorterms" && $form_data['fd_escortRequired'] === (int)"1"){ ?>
<!-- START ESCORTSIGNATURE STAGE CONTENT --> <!-- START ESCORTSIGNATURE STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post"> <form name="form-signin" class="form-signin" method="post">
@ -445,14 +444,14 @@ if(empty($form_data['form_data_stage'])){
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['ENAME']; ?></span> <span class="input-group-text"><?=$transLang['ENAME']?></span>
<input type="text" id="form_data_escortname" name="form_data_escortname" class="form-control" placeholder="<?php echo $transLang['ETAG']; ?>" autofocus> <input type="text" id="fd_escortName" name="fd_escortName" class="form-control" placeholder="<?=$transLang['ETAG']?>" autofocus>
</div> </div>
</div> </div>
</div> </div>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h4><?php echo $transLang['STR_COMMON_ESIGNATURE']; ?>:</h4> <h4><?=$transLang['STR_COMMON_ESIGNATURE']?>:</h4>
<div id="esignature-parent sigs"> <div id="esignature-parent sigs">
<div id="esignature"></div> <div id="esignature"></div>
</div> </div>
@ -465,12 +464,12 @@ if(empty($form_data['form_data_stage'])){
true; true;
$('#esignature').change(function() { $('#esignature').change(function() {
var data = $esignature.jSignature('getData'); var data = $esignature.jSignature('getData');
$('#form_data_e_signature').val(data); $('#fd_escortSignature').val(data);
}); });
}); });
$("form").submit(function() { $("form").submit(function() {
if($('#form_data_e_signature').val() === '') { if($('#fd_escortSignature').val() === '') {
alert("<?php echo $transLang['STR_COMMON_SIGNATURE']; ?> <?php echo $transLang['STR_COMMON_REQUIRED']; ?>"); alert("<?=$transLang['STR_COMMON_SIGNATURE']?> <?=$transLang['STR_COMMON_REQUIRED']?>");
return false; return false;
} }
return true; return true;
@ -478,82 +477,82 @@ if(empty($form_data['form_data_stage'])){
</script> </script>
<div class="row row-cols-1 mb-4"> <div class="row row-cols-1 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="terms" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="terms" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<input type="hidden" name="form_data_isvendor" id="form_data_isvendor" value="<?php echo $form_data['form_data_isvendor']; ?>" /> <input type="hidden" name="fd_isVendor" id="fd_isVendor" value="<?=$form_data['fd_isVendor']?>" />
<input type="hidden" name="form_data_firstname" id="form_data_firstname" value="<?php echo $form_data['form_data_firstname']; ?>" /> <input type="hidden" name="fd_firstName" id="fd_firstName" value="<?=$form_data['fd_firstName']?>" />
<input type="hidden" name="form_data_lastname" id="form_data_lastname" value="<?php echo $form_data['form_data_lastname']; ?>" /> <input type="hidden" name="fd_lastName" id="fd_lastName" value="<?=$form_data['fd_lastName']?>" />
<input type="hidden" name="form_data_carnum" id="form_data_carnum" value="<?php echo $form_data['form_data_carnum']; ?>" /> <input type="hidden" name="fd_carNum" id="fd_carNum" value="<?=$form_data['fd_carNum']?>" />
<input type="hidden" name="form_data_ssanum" id="form_data_ssanum" value="<?php echo $form_data['form_data_ssanum']; ?>" /> <input type="hidden" name="fd_ssaNum" id="fd_ssaNum" value="<?=$form_data['fd_ssaNum']?>" />
<input type="hidden" name="form_data_company" id="form_data_company" value="<?php echo $form_data['form_data_company']; ?>" /> <input type="hidden" name="fd_visitorCompany" id="fd_visitorCompany" value="<?=$form_data['fd_visitorCompany']?>" />
<input type="hidden" name="form_data_contact1" id="form_data_contact1" value="<?php echo $form_data['form_data_contact1']; ?>" /> <input type="hidden" name="fd_vendorContact1" id="fd_vendorContact1" value="<?=$form_data['fd_vendorContact1']?>" />
<input type="hidden" name="form_data_contact2" id="form_data_contact2" value="<?php echo $form_data['form_data_contact2']; ?>" /> <input type="hidden" name="fd_vendorContact2" id="fd_vendorContact2" value="<?=$form_data['fd_vendorContact2']?>" />
<input type="hidden" name="form_data_workstart" id="form_data_workstart" value="<?php echo $form_data['form_data_workstart']; ?>" /> <input type="hidden" name="fd_workStartTime" id="fd_workStartTime" value="<?=$form_data['fd_workStartTime']?>" />
<input type="hidden" name="form_data_workend" id="form_data_workend" value="<?php echo $form_data['form_data_workend']; ?>" /> <input type="hidden" name="fd_workEndTime" id="fd_workEndTime" value="<?=$form_data['fd_workEndTime']?>" />
<input type="hidden" name="form_data_customerimpacted" id="form_data_customerimpacted" value="<?php echo $form_data['form_data_customerimpacted']; ?>" /> <input type="hidden" name="fd_clientImpacted" id="fd_clientImpacted" value="<?=$form_data['fd_clientImpacted']?>" />
<input type="hidden" name="form_data_visittype" id="form_data_visittype" value="<?php echo $form_data['form_data_visittype']; ?>" /> <input type="hidden" name="fd_visitType" id="fd_visitType" value="<?=$form_data['fd_visitType']?>" />
<input type="hidden" name="form_data_v_signature" id="form_data_v_signature" value="<?php echo $form_data['form_data_v_signature']; ?>" /> <input type="hidden" name="fd_visitorSignature" id="fd_visitorSignature" value="<?=$form_data['fd_visitorSignature']?>" />
<input type="hidden" name="form_data_escortrequired" id="form_data_escortrequired" value="<?php echo $form_data['form_data_escortrequired']; ?>" /> <input type="hidden" name="fd_escortRequired" id="fd_escortRequired" value="<?=$form_data['fd_escortRequired']?>" />
<input type="hidden" name="form_data_e_signature" id="form_data_e_signature" /> <input type="hidden" name="fd_escortSignature" id="fd_escortSignature" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?php echo $transLang['NEXT']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><?=$transLang['NEXT']?></button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- END ESCORTSIGNATURE STAGE CONTENT --> <!-- END ESCORTSIGNATURE STAGE CONTENT -->
<?php }elseif(($form_data['form_data_stage'] === (string)"escortorterms" && $form_data['form_data_escortrequired'] === (int)"0") || ($form_data['form_data_stage'] === (string)"escortorterms" && $form_data['form_data_isvendor'] === (int)"1") || $form_data['form_data_stage'] === (string)"terms"){ ?> <?php }elseif(($form_data['fd_formAction'] === (string)"escortorterms" && $form_data['fd_escortRequired'] === (int)"0") || ($form_data['fd_formAction'] === (string)"escortorterms" && $form_data['fd_isVendor'] === (int)"1") || $form_data['fd_formAction'] === (string)"terms"){ ?>
<!-- START TERMS STAGE CONTENT --> <!-- START TERMS STAGE CONTENT -->
<div class="container"> <div class="container">
<div class="row row-cols-1 mb-2"> <div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN']?></h2>
</div> </div>
</div> </div>
<form name="form-signin" class="form-signin" method="post" action="signin_display.php"> <form name="form-signin" class="form-signin" method="post" action="signin_display.php">
<?php echo Csrf::getInputToken('home') ?> <?php echo Csrf::getInputToken('home') ?>
<div class="row row-cols-1 mb-2"> <div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<?php if($SiteInfo->getSite($form_data['form_data_siteid'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <?php if($SiteInfo->getSite($form_data['fd_siteId'], $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<p><?php echo $transLang['ACKNOWLEDGEMENT']; ?></p> <p><?=$transLang['ACKNOWLEDGEMENT']?></p>
<?php } ?> <?php } ?>
<p><?php echo $transLang['COVID_ACKNOWLEDGEMENT']; ?><p> <p><?=$transLang['COVID_ACKNOWLEDGEMENT']?><p>
<p><?php echo $transLang['GDPR_TEXT']; ?><p> <p><?=$transLang['GDPR_TEXT']?><p>
</div> </div>
</div> </div>
<div class="row row-cols-1 mb-2"> <div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<a class="btn btn-outline-secondary btn-block" data-bs-toggle="modal" data-bs-target="#termsModalLong" href="<?php echo $StaticFunctions->getRules(); ?>"><?php echo $transLang['REFERENCE']; ?>:&nbsp;(<?php echo $transLang['ACKNOWLEDGEMENT_DOC_NAME']; ?>)</a> <a class="btn btn-outline-secondary btn-block" data-bs-toggle="modal" data-bs-target="#termsModalLong" href="<?php echo $StaticFunctions->getRules(); ?>"><?=$transLang['REFERENCE']?>:&nbsp;(<?=$transLang['ACKNOWLEDGEMENT_DOC_NAME']?>)</a>
<?php if($form_data['form_data_isvendor'] === (int)"1") { ?> <?php if($form_data['fd_isVendor'] === (int)"1") { ?>
<a class="btn btn-outline-secondary btn-block" data-bs-toggle="modal" data-bs-target="#termsVendorModalLong" href="<?php echo $StaticFunctions->getVendorRules(); ?>"><?php echo $transLang['REFERENCE']; ?>:&nbsp;(<?php echo $transLang['ACKNOWLEDGEMENT_VENDOR_DOC_NAME']; ?>)</a> <a class="btn btn-outline-secondary btn-block" data-bs-toggle="modal" data-bs-target="#termsVendorModalLong" href="<?php echo $StaticFunctions->getVendorRules(); ?>"><?=$transLang['REFERENCE']?>:&nbsp;(<?=$transLang['ACKNOWLEDGEMENT_VENDOR_DOC_NAME']?>)</a>
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
<div class="row row-cols-2 mb-4"> <div class="row row-cols-2 mb-4">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<input type="hidden" name="form_data_stage" id="form_data_stage" value="terms" /> <input type="hidden" name="fd_formAction" id="fd_formAction" value="terms" />
<input type="hidden" name="form_data_siteid" id="form_data_siteid" value="<?php echo $form_data['form_data_siteid']; ?>" /> <input type="hidden" name="fd_siteId" id="fd_siteId" value="<?=$form_data['fd_siteId']?>" />
<input type="hidden" name="form_data_isvendor" id="form_data_isvendor" value="<?php echo $form_data['form_data_isvendor']; ?>" /> <input type="hidden" name="fd_isVendor" id="fd_isVendor" value="<?=$form_data['fd_isVendor']?>" />
<input type="hidden" name="form_data_firstname" id="form_data_firstname" value="<?php echo $form_data['form_data_firstname']; ?>" /> <input type="hidden" name="fd_firstName" id="fd_firstName" value="<?=$form_data['fd_firstName']?>" />
<input type="hidden" name="form_data_lastname" id="form_data_lastname" value="<?php echo $form_data['form_data_lastname']; ?>" /> <input type="hidden" name="fd_lastName" id="fd_lastName" value="<?=$form_data['fd_lastName']?>" />
<input type="hidden" name="form_data_carnum" id="form_data_carnum" value="<?php echo $form_data['form_data_carnum']; ?>" /> <input type="hidden" name="fd_carNum" id="fd_carNum" value="<?=$form_data['fd_carNum']?>" />
<input type="hidden" name="form_data_ssanum" id="form_data_ssanum" value="<?php echo $form_data['form_data_ssanum']; ?>" /> <input type="hidden" name="fd_ssaNum" id="fd_ssaNum" value="<?=$form_data['fd_ssaNum']?>" />
<input type="hidden" name="form_data_company" id="form_data_company" value="<?php echo $form_data['form_data_company']; ?>" /> <input type="hidden" name="fd_visitorCompany" id="fd_visitorCompany" value="<?=$form_data['fd_visitorCompany']?>" />
<input type="hidden" name="form_data_contact1" id="form_data_contact1" value="<?php echo $form_data['form_data_contact1']; ?>" /> <input type="hidden" name="fd_vendorContact1" id="fd_vendorContact1" value="<?=$form_data['fd_vendorContact1']?>" />
<input type="hidden" name="form_data_contact2" id="form_data_contact2" value="<?php echo $form_data['form_data_contact2']; ?>" /> <input type="hidden" name="fd_vendorContact2" id="fd_vendorContact2" value="<?=$form_data['fd_vendorContact2']?>" />
<input type="hidden" name="form_data_workstart" id="form_data_workstart" value="<?php echo $form_data['form_data_workstart']; ?>" /> <input type="hidden" name="fd_workStartTime" id="fd_workStartTime" value="<?=$form_data['fd_workStartTime']?>" />
<input type="hidden" name="form_data_workend" id="form_data_workend" value="<?php echo $form_data['form_data_workend']; ?>" /> <input type="hidden" name="fd_workEndTime" id="fd_workEndTime" value="<?=$form_data['fd_workEndTime']?>" />
<input type="hidden" name="form_data_customerimpacted" id="form_data_customerimpacted" value="<?php echo $form_data['form_data_customerimpacted']; ?>" /> <input type="hidden" name="fd_clientImpacted" id="fd_clientImpacted" value="<?=$form_data['fd_clientImpacted']?>" />
<input type="hidden" name="form_data_visittype" id="form_data_visittype" value="<?php echo $form_data['form_data_visittype']; ?>" /> <input type="hidden" name="fd_visitType" id="fd_visitType" value="<?=$form_data['fd_visitType']?>" />
<input type="hidden" name="form_data_v_signature" id="form_data_v_signature" value="<?php echo $form_data['form_data_v_signature']; ?>" /> <input type="hidden" name="fd_visitorSignature" id="fd_visitorSignature" value="<?=$form_data['fd_visitorSignature']?>" />
<input type="hidden" name="form_data_escortrequired" id="form_data_escortrequired" value="<?php echo $form_data['form_data_escortrequired']; ?>" /> <input type="hidden" name="fd_escortRequired" id="fd_escortRequired" value="<?=$form_data['fd_escortRequired']?>" />
<input type="hidden" name="form_data_e_signature" id="form_data_e_signature" value="<?php echo $form_data['form_data_e_signature']; ?>" /> <input type="hidden" name="fd_escortSignature" id="fd_escortSignature" value="<?=$form_data['fd_escortSignature']?>" />
<input type="hidden" name="form_data_escortname" id="form_data_escortname" value="<?php echo $form_data['form_data_escortname']; ?>" /> <input type="hidden" name="fd_escortName" id="fd_escortName" value="<?=$form_data['fd_escortName']?>" />
<a class="btn btn-lg btn-danger" href="index.php"><i class="fas fa-ban"></i>&nbsp;<?php echo $transLang['STR_COMMON_CANCEL']; ?></a> <a class="btn btn-lg btn-danger" href="index.php"><i class="fas fa-ban"></i>&nbsp;<?=$transLang['STR_COMMON_CANCEL']?></a>
</div> </div>
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['SIGNIN']; ?></button> <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="saveBtn"><i class="fas fa-save"></i>&nbsp;<?=$transLang['SIGNIN']?></button>
</div> </div>
</div> </div>
</form> </form>
@ -563,7 +562,7 @@ if(empty($form_data['form_data_stage'])){
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="termsModalLongTitle"><?php echo $transLang['TERMSTITLE']; ?></h5> <h5 class="modal-title" id="termsModalLongTitle"><?=$transLang['TERMSTITLE']?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -578,7 +577,7 @@ if(empty($form_data['form_data_stage'])){
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="termsVendorModalLongTitle"><?php echo $transLang['TERMSTITLE']; ?></h5> <h5 class="modal-title" id="termsVendorModalLongTitle"><?=$transLang['TERMSTITLE']?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -65,53 +65,52 @@
<?php <?php // FILTER POSTED DATA
// FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [ $form_data = filter_input_array(INPUT_POST, [
'form_data_stage' => (string)FILTER_SANITIZE_STRING, 'fd_formAction' => (string)FILTER_SANITIZE_STRING,
'form_data_siteid' => (int)FILTER_VALIDATE_INT, 'fd_siteId' => (int)FILTER_VALIDATE_INT,
'form_data_isvendor' => (int)FILTER_VALIDATE_INT, 'fd_isVendor' => (int)FILTER_VALIDATE_INT,
'form_data_firstname' => (string)FILTER_SANITIZE_STRING, 'fd_firstName' => (string)FILTER_SANITIZE_STRING,
'form_data_lastname' => (string)FILTER_SANITIZE_STRING, 'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'form_data_carnum' => (string)FILTER_SANITIZE_STRING, 'fd_carNum' => (string)FILTER_SANITIZE_STRING,
'form_data_ssanum' => (string)FILTER_SANITIZE_STRING, 'fd_ssaNum' => (string)FILTER_SANITIZE_STRING,
'form_data_company' => (string)FILTER_SANITIZE_STRING, 'fd_visitorCompany' => (string)FILTER_SANITIZE_STRING,
'form_data_contact1' => (string)FILTER_SANITIZE_STRING, 'fd_vendorContact1' => (string)FILTER_SANITIZE_STRING,
'form_data_contact2' => (string)FILTER_SANITIZE_STRING, 'fd_vendorContact2' => (string)FILTER_SANITIZE_STRING,
'form_data_workstart' => (string)FILTER_SANITIZE_STRING, 'fd_workStartTime' => (string)FILTER_SANITIZE_STRING,
'form_data_workend' => (string)FILTER_SANITIZE_STRING, 'fd_workEndTime' => (string)FILTER_SANITIZE_STRING,
'form_data_customerimpacted' => (string)FILTER_SANITIZE_STRING, 'fd_clientImpacted' => (string)FILTER_SANITIZE_STRING,
'form_data_visittype' => (int)FILTER_VALIDATE_INT, 'fd_visitType' => (int)FILTER_VALIDATE_INT,
'form_data_escortrequired' => (int)FILTER_VALIDATE_INT, 'fd_escortRequired' => (int)FILTER_VALIDATE_INT,
'form_data_v_signature' => (string)FILTER_SANITIZE_STRING, 'fd_visitorSignature' => (string)FILTER_SANITIZE_STRING,
'form_data_e_signature' => (string)FILTER_SANITIZE_STRING, 'fd_escortSignature' => (string)FILTER_SANITIZE_STRING,
'form_data_escortname' => (string)FILTER_SANITIZE_STRING 'fd_escortName' => (string)FILTER_SANITIZE_STRING
]); ]);
if (empty($form_data['form_data_carnum'])) { $carnum="";} else {$carnum=$form_data['form_data_carnum'];} if (empty($form_data['fd_carNum'])) { $carnum="";} else {$carnum=$form_data['fd_carNum'];}
if (empty($form_data['form_data_ssanum'])) { $ssanum="";} else {$ssanum=$form_data['form_data_ssanum'];} if (empty($form_data['fd_ssaNum'])) { $ssanum="";} else {$ssanum=$form_data['fd_ssaNum'];}
if (empty($form_data['form_data_isvendor'])) { $isvendor="0";} else {$isvendor=$form_data['form_data_isvendor'];} if (empty($form_data['fd_isVendor'])) { $isvendor="0";} else {$isvendor=$form_data['fd_isVendor'];}
if (empty($form_data['form_data_contact1'])) { $db_vendorinfo_contact1="";} else {$db_vendorinfo_contact1=$form_data['form_data_contact1'];} if (empty($form_data['fd_vendorContact1'])) { $db_vendorinfo_contact1="";} else {$db_vendorinfo_contact1=$form_data['fd_vendorContact1'];}
if (empty($form_data['form_data_contact2'])) { $db_vendorinfo_contact2="";} else {$db_vendorinfo_contact2=$form_data['form_data_contact2'];} if (empty($form_data['fd_vendorContact2'])) { $db_vendorinfo_contact2="";} else {$db_vendorinfo_contact2=$form_data['fd_vendorContact2'];}
if (empty($form_data['form_data_workstart'])) { $db_vendorinfo_workstart="";} else {$db_vendorinfo_workstart=$form_data['form_data_workstart'];} if (empty($form_data['fd_workStartTime'])) { $db_vendorinfo_workstart="";} else {$db_vendorinfo_workstart=$form_data['fd_workStartTime'];}
if (empty($form_data['form_data_workend'])) { $db_vendorinfo_workend="";} else {$db_vendorinfo_workend=$form_data['form_data_workend'];} if (empty($form_data['fd_workEndTime'])) { $db_vendorinfo_workend="";} else {$db_vendorinfo_workend=$form_data['fd_workEndTime'];}
if (empty($form_data['form_data_customerimpacted'])) { $db_vendorinfo_customerimpacted="";} else {$db_vendorinfo_customerimpacted=$form_data['form_data_customerimpacted'];} if (empty($form_data['fd_clientImpacted'])) { $db_vendorinfo_customerimpacted="";} else {$db_vendorinfo_customerimpacted=$form_data['fd_clientImpacted'];}
$visitid = $VisitActions->newVisit($form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_company'], $form_data['form_data_visittype'], $StaticFunctions->getUTC(), $form_data['form_data_v_signature'], $form_data['form_data_siteid'], "1", $form_data['form_data_e_signature'], $form_data['form_data_escortname'], $carnum, $ssanum, $isvendor); $visitid = $VisitActions->newVisit($form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_visitorCompany'], $form_data['fd_visitType'], $StaticFunctions->getUTC(), $form_data['fd_visitorSignature'], $form_data['fd_siteId'], "1", $form_data['fd_escortSignature'], $form_data['fd_escortName'], $carnum, $ssanum, $isvendor);
if($form_data['form_data_isvendor'] === (int)"1") { if($form_data['fd_isVendor'] === (int)"1") {
$vendorid = $VisitActions->setInfoVendorVisitNew($visitid, $db_vendorinfo_contact1, $db_vendorinfo_contact2, $db_vendorinfo_workstart, $db_vendorinfo_workend, $db_vendorinfo_customerimpacted); $vendorid = $VisitActions->setInfoVendorVisitNew($visitid, $db_vendorinfo_contact1, $db_vendorinfo_contact2, $db_vendorinfo_workstart, $db_vendorinfo_workend, $db_vendorinfo_customerimpacted);
} }
// SET INITIAL STAGE if(!empty($form_data['fd_formAction'])){ // SET INITIAL STAGE
if(!empty($form_data['form_data_stage'])){ $form_data['fd_formAction'] = 'readytosubmit';
$form_data['form_data_stage'] = 'readytosubmit'; }
}?> ?>
<!-- CONTENT --> <!-- CONTENT -->
<?php if($form_data['form_data_stage'] === "readytosubmit"){ ?> <?php if($form_data['fd_formAction'] === "readytosubmit"){ ?>
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN_THANKYOU']; ?></h2> <h2><i class="fas fa-sign-in-alt"></i> <?=$transLang['SIGNIN_THANKYOU']?></h2>
</div> </div>
</div> </div>
<div class="row row-cols-1"> <div class="row row-cols-1">
@ -119,12 +118,12 @@ if(!empty($form_data['form_data_stage'])){
<table class="table table-striped"> <table class="table table-striped">
<thead class="thead-dark"> <thead class="thead-dark">
<tr> <tr>
<th><?php echo $transLang['TIMEREASON']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th> <th><?=$transLang['TIMEREASON']?></th><th><?=$transLang['COMPANY']?></th><th><?=$transLang['NAME']?></th><th><?=$transLang['ESCORT']?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><?php echo $timenow; ?><br><?php echo $transLang[$VisitTypeInfo->getInfoVisitType("%", $form_data['form_data_visittype'])[0]["visittypes_name"]]; ?></td><td><?php echo $form_data['form_data_company']; ?></td><td><?php echo $form_data['form_data_lastname']; ?>, <?php echo $form_data['form_data_firstname']; ?><br><img src="<?php echo $form_data['form_data_v_signature']; ?>" width="200" height="50" /></td><td><?php if (!empty($form_data['form_data_escortname'])): echo $form_data['form_data_escortname']; endif; ?><br /><?php if (!empty($form_data['form_data_e_signature'])): ?><img src="<?php echo $form_data['form_data_e_signature']; ?>" width="200" height="50" /><?php endif; ?></td> <td><?php echo $timenow; ?><br><?php echo $transLang[$VisitTypeInfo->getInfoVisitType("%", $form_data['fd_visitType'])[0]["visittypes_name"]]; ?></td><td><?=$form_data['fd_visitorCompany']?></td><td><?=$form_data['fd_lastName']?>, <?=$form_data['fd_firstName']?><br><img src="<?=$form_data['fd_visitorSignature']?>" width="200" height="50" /></td><td><?php if (!empty($form_data['fd_escortName'])): echo $form_data['fd_escortName']; endif; ?><br /><?php if (!empty($form_data['fd_escortSignature'])): ?><img src="<?=$form_data['fd_escortSignature']?>" width="200" height="50" /><?php endif; ?></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -132,15 +131,15 @@ if(!empty($form_data['form_data_stage'])){
</div> </div>
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<?php if($SiteInfo->getSite($form_data['form_data_siteid'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <?php if($SiteInfo->getSite($form_data['fd_siteId'], $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<p><?php echo $transLang['ACKNOWLEDGEMENT']; ?></p> <p><?=$transLang['ACKNOWLEDGEMENT']?></p>
<?php } ?> <?php } ?>
<p><?php echo $transLang['GDPR_TEXT']; ?><p> <p><?=$transLang['GDPR_TEXT']?><p>
</div> </div>
</div> </div>
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<a href="index.php" class="btn btn-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true">&nbsp<br /><?php echo $transLang['STR_COMMON_HOME']; ?><br />&nbsp</a> <a href="index.php" class="btn btn-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true">&nbsp<br /><?=$transLang['STR_COMMON_HOME']?><br />&nbsp</a>
</div> </div>
</div> </div>
<!-- END CONTENT --> <!-- END CONTENT -->
@ -149,7 +148,7 @@ if(!empty($form_data['form_data_stage'])){
<div class="container"> <div class="container">
<div class="row row-cols-1"> <div class="row row-cols-1">
<div class="col d-grid gap-2"> <div class="col d-grid gap-2">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2> <h2><?=$transLang['NOSIGNIN']?></h2>
</div> </div>
</div> </div>
</div> </div>

View File

@ -67,12 +67,12 @@
<?php // FILTER POSTED DATA <?php // FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [ $form_data = filter_input_array(INPUT_POST, [
'fd_formAction' => (string)FILTER_SANITIZE_STRING, 'fd_formAction' => (string)FILTER_SANITIZE_STRING,
'fd_pageNumber' => (int)FILTER_VALIDATE_INT, 'fd_pageNumber' => (int)FILTER_VALIDATE_INT,
'fd_endVisitForId' => (int)FILTER_VALIDATE_INT 'fd_endVisitForId' => (int)FILTER_VALIDATE_INT
]); ]);
if(empty($form_data['fd_formAction'])){ if(empty($form_data['fd_formAction'])){ // SET INITIAL STAGE
$form_data['fd_formAction'] = 'fa_initial'; // SET INITIAL STAGE $form_data['fd_formAction'] = 'fa_initial';
} }
?> ?>