Bootstrap and jQuery upgrade for vulnerabilities

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

7
css/bootstrap.min_1.css vendored Normal file

File diff suppressed because one or more lines are too long

946
inc/Wkhtmltopdf.php Normal file
View File

@ -0,0 +1,946 @@
<?php
/**
* @author aur1mas <aur1mas@devnet.lt>
* @author Charles SANQUER <charles.sanquer@spyrit.net>
* @author Clement Herreman <clement.herreman@pictime.com>
* @copyright aur1mas <aur1mas@devnet.lt>
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see Repository: https://github.com/aur1mas/Wkhtmltopdf
* @version 1.10
*/
class Wkhtmltopdf
{
/**
* Setters / Getters properties.
*/
protected $_html = null;
protected $_url = null;
protected $_orientation = null;
protected $_pageSize = null;
protected $_toc = false;
protected $_copies = 1;
protected $_grayscale = false;
protected $_title = null;
protected $_xvfb = false;
protected $_path; // path to directory where to place files
protected $_zoom = 1;
protected $_headerSpacing;
protected $_headerHtml;
protected $_footerHtml;
protected $_username;
protected $_password;
protected $_windowStatus;
protected $_viewport;
protected $_margins = array('top' => null, 'bottom' => null, 'left' => null, 'right' => null);
protected $_userStyleSheet = null; // path to user style sheet file
protected $_enableSmartShrinking = false; // boolean for smart shrinking, defaults to false
protected $_options = array();
/**
* Path to executable.
*/
protected $_bin = '/usr/local/bin/wkhtmltopdf --enable-local-file-access --footer-font-size 7 --footer-right "Page [page] of [topage]" ';
protected $_filename = null; // filename in $path directory
/**
* Available page orientations.
*/
const ORIENTATION_PORTRAIT = 'Portrait'; // vertical
const ORIENTATION_LANDSCAPE = 'Landscape'; // horizontal
/**
* Page sizes.
*/
const SIZE_A4 = 'A4';
const SIZE_LETTER = 'letter';
/**
* File get modes.
*/
const MODE_DOWNLOAD = 0;
const MODE_STRING = 1;
const MODE_EMBEDDED = 2;
const MODE_SAVE = 3;
/**
* @author aur1mas <aur1mas@devnet.lt>
* @param array $options
*/
public function __construct(array $options = array())
{
if (array_key_exists('html', $options)) {
$this->setHtml($options['html']);
}
if (array_key_exists('orientation', $options)) {
$this->setOrientation($options['orientation']);
} else {
$this->setOrientation(self::ORIENTATION_PORTRAIT);
}
if (array_key_exists('page_size', $options)) {
$this->setPageSize($options['page_size']);
} else {
$this->setPageSize(self::SIZE_A4);
}
if (array_key_exists('toc', $options)) {
$this->setTOC($options['toc']);
}
if (array_key_exists('margins', $options)) {
$this->setMargins($options['margins']);
}
if (array_key_exists('binpath', $options)) {
$this->setBinPath($options['binpath']);
}
if (array_key_exists('window-status', $options)) {
$this->setWindowStatus($options['window-status']);
}
if (array_key_exists('grayscale', $options)) {
$this->setGrayscale($options['grayscale']);
}
if (array_key_exists('title', $options)) {
$this->setTitle($options['title']);
}
if (array_key_exists('footer_html', $options)) {
$this->setFooterHtml($options['footer_html']);
}
if (array_key_exists('xvfb', $options)) {
$this->setRunInVirtualX($options['xvfb']);
}
if (array_key_exists('user-style-sheet', $options)) {
$this->setUserStyleSheet($options['user-style-sheet']);
}
if (array_key_exists('enable-smart-shrinking', $options)) {
$this->setEnableSmartShrinking($options['enable-smart-shrinking']);
}
if (!array_key_exists('path', $options)) {
throw new Exception("Path to directory where to store files is not set");
}
if (!is_writable($options['path']))
{
throw new Exception("Path to directory where to store files is not writable");
}
$this->setPath($options['path']);
$this->_createFile();
}
/**
* Creates file to which will be writen HTML content.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
protected function _createFile()
{
do {
$this->_filename = $this->getPath() . mt_rand() . '.html';
} while(file_exists($this->_filename));
/**
* create an empty file
*/
file_put_contents($this->_filename, $this->getHtml());
chmod($this->_filename, 0777);
return $this->_filename;
}
/**
* Returns file path where HTML content is saved.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
public function getFilePath()
{
return $this->_filename;
}
/**
* Executes command.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param string $cmd command to execute
* @param string $input other input (not arguments)
* @return array
*/
protected function _exec($cmd, $input = "")
{
$result = array('stdout' => '', 'stderr' => '', 'return' => '');
$proc = proc_open($cmd, array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
/**
* We need to asynchronously process streams, as simple sequential stream_get_contents() risks deadlocking if the 2nd pipe's OS pipe buffer fills up before the 1st is fully consumed.
* The input is probably subject to the same risk.
*/
foreach ($pipes as $pipe) {
stream_set_blocking($pipe, 0);
}
$indexPipes = function(array $pipes) { return array_combine(array_map('intval', $pipes), $pipes); };
$allWritables = $indexPipes(array($pipes[0]));
$allReadables = $indexPipes(array($pipes[1], $pipes[2]));
$readablesNames = array((int)$pipes[1] => 'stdout', (int)$pipes[2] => 'stderr');
do {
$readables = $allReadables;
$writables = $allWritables;
$exceptables = null;
$selectTime = microtime(true);
$nStreams = stream_select($readables, $writables, $exceptables, null, null);
$selectTime = microtime(true) - $selectTime;
if ($nStreams === false) {
throw new \Exception('Error reading/writing to WKHTMLTOPDF');
}
foreach ($writables as $writable) {
$nBytes = fwrite($writable, $input);
if ($nBytes === false) {
throw new \Exception('Error writing to WKHTMLTOPDF');
}
if ($nBytes == strlen($input)) {
fclose($writable);
unset($allWritables[(int)$writable]);
$input = '';
} else {
$input = substr($input, $nBytes);
}
}
if (count($readables) > 0) {
if ($selectTime < 30e3) {
usleep(30e3 - $selectTime); // up to 30ms padding, so we don't burn so much time/CPU reading just 1 byte at a time.
}
foreach ($readables as $readable) {
$in = fread($readable, 0x10000);
if ($in === false) {
throw new \Exception('Error reading from WKHTMLTOPDF '.$readablesNames[$readable]);
}
$result[$readablesNames[(int)$readable]] .= $in;
if (feof($readable)) {
fclose($readable);
unset($allReadables[(int)$readable]);
}
}
}
} while (count($allReadables) > 0 || count($allWritables) > 0);
$result['return'] = proc_close($proc);
return $result;
}
/**
* Returns help info.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
public function getHelp()
{
$r = $this->_exec($this->_bin . " --extended-help");
return $r['stdout'];
}
/**
* Sets the PDF margins.
*
* @author Clement Herreman <clement.herreman[at]gmail>
* @param $margins array<position => value> The margins.
* * Possible <position> :
* * top : sets the margin on the top of the PDF
* * bottom : sets the margin on the bottom of the PDF
* * left : sets the margin on the left of the PDF
* * right : sets the margin on the right of the PDF
* * Value : size of the margin (positive integer). Null to leave the default one.
* @return Wkhtmltopdf $this
*/
public function setMargins($margins)
{
$this->_margins = array_merge($this->_margins, $margins);
return $this;
}
/**
* Gets the PDF margins.
*
* @author Clement Herreman <clement.herreman[at]gmail>
* @return array See $this->setMargins()
* @see $this->setMargins()
*/
public function getMargins()
{
return $this->_margins;
}
/**
* Enables the use of an user style sheet.
*
* @author Leo Zandvliet
* @param string $path
* @return Wkthmltopdf
*/
public function setUserStyleSheet($path)
{
$this->_userStyleSheet = (string)$path;
return $this;
}
public function getUserStyleSheet()
{
return $this->_userStyleSheet;
}
/**
* Adds the 'enable-smart-shrinking' option, especially in case it's true.
*
* @author Leo Zandvliet
* @param boolean $value
* @return Wkthmltopdf
*/
public function setEnableSmartShrinking($value)
{
$this->_enableSmartShrinking = (bool)$value;
return $this;
}
public function getEnableSmartShrinking()
{
return $this->_enableSmartShrinking;
}
/**
* Sets additional command line options.
*
* @param $options array<option => value> The additional options to set.
* For command line options with no value, set $options value to NULL.
* @return Wkhtmltopdf $this
*/
public function setOptions($options)
{
$this->_options = array_merge($this->_options, $options);
return $this;
}
/**
* Gets the custom command line options.
*
* @return array See $this->setOptions()
* @see $this->setOptions()
*/
public function getOptions()
{
return $this->_options;
}
/**
* Set wkhtmltopdf to wait when `window.status` on selected page changes to setted status, and after that render PDF.
*
* @author Roman M. Kos <roman[at]c-o-s.name>
* @param string $windowStatus
* we add a `--window-status {$windowStatus}` for execution to `$this->_bin`
* @return Wkthmltopdf
*/
public function setWindowStatus($windowStatus)
{
$this->_windowStatus = (string) $windowStatus;
return $this;
}
/**
* Get the window status.
*
* @author Roman M. Kos <roman[at]c-o-s.name>
* @return string See $this->setWindowStatus()
* @see $this->setWindowStatus()
*/
public function getWindowStatus()
{
return $this->_windowStatus;
}
/**
* Set HTML content to render.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param string $html
* @return Wkthmltopdf
*/
public function setHtml($html)
{
$this->_html = (string)$html;
return $this;
}
/**
* Returns HTML content.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
public function getHtml()
{
return $this->_html;
}
/**
* Set URL to render.
*
* @author Charles SANQUER
* @param string $html
* @return Wkthmltopdf
*/
public function setUrl($url)
{
$this->_url = (string) $url;
return $this;
}
/**
* Returns URL.
*
* @author Charles SANQUER
* @return string
*/
public function getUrl()
{
return $this->_url;
}
/**
* Absolute path where to store files.
*
* @author aur1mas <aur1mas@devnet.lt>
* @throws Exception
* @param string $path
* @return Wkthmltopdf
*/
public function setPath($path)
{
if (realpath($path) === false) {
throw new Exception("Path must be absolute");
}
$this->_path = realpath($path) . DIRECTORY_SEPARATOR;
return $this;
}
/**
* Returns path where to store saved files.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
public function getPath()
{
return $this->_path;
}
/**
* Set page orientation.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param string $orientation
* @return Wkthmltopdf
*/
public function setOrientation($orientation)
{
$this->_orientation = (string)$orientation;
return $this;
}
/**
* Returns page orientation.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
public function getOrientation()
{
return $this->_orientation;
}
/**
* Sets the page size.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param string $size
* @return Wkthmltopdf
*/
public function setPageSize($size)
{
$this->_pageSize = (string)$size;
return $this;
}
/**
* Returns page size.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return int
*/
public function getPageSize()
{
return $this->_pageSize;
}
/**
* Set the zoom level.
*
* @author rikw22 <ricardoa.walter@gmail.com>
* @return string
*/
public function setZoom($zoom)
{
$this->_zoom = $zoom;
return $this;
}
/**
* Returns zoom level.
*
* @author rikw22 <ricardoa.walter@gmail.com>
* @return int
*/
public function getZoom()
{
return $this->_zoom;
}
/**
* Enable / disable generation Table Of Contents.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param boolean $toc
* @return Wkhtmltopdf
*/
public function setTOC($toc = true)
{
$this->_toc = (boolean)$toc;
return $this;
}
/**
* Returns value is enabled Table Of Contents generation or not.
*
* @author aur1nas <aur1mas@devnet.lt>
* @return boolean
*/
public function getTOC()
{
return $this->_toc;
}
/**
* Returns bin path.
*
* @author heliocorreia <dev@heliocorreia.org>
* @return string
*/
public function getBinPath()
{
return $this->_bin;
}
/**
* Returns bin path.
*
* @author heliocorreia <dev@heliocorreia.org>
* @return string
*/
public function setBinPath($path)
{
if (file_exists($path)) {
$this->_bin = (string)$path;
}
return $this;
}
/**
* Set number of copies.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param int $copies
* @return Wkthmltopdf
*/
public function setCopies($copies)
{
$this->_copies = (int)$copies;
return $this;
}
/**
* Returns number of copies to make.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return int
*/
public function getCopies()
{
return $this->_copies;
}
/**
* Whether to print in grayscale or not.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param boolean $mode
* @return Wkthmltopdf
*/
public function setGrayscale($mode)
{
$this->_grayscale = (boolean)$mode;
return $this;
}
/**
* Returns is page will be printed in grayscale format.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return boolean
*/
public function getGrayscale()
{
return $this->_grayscale;
}
/**
* If TRUE, runs wkhtmltopdf in a virtual X session.
*
* @param bool $xvfb
* @return Wkthmltopdf
*/
public function setRunInVirtualX($xvfb)
{
$this->_xvfb = (bool)$xvfb;
return $this;
}
/**
* If TRUE, runs wkhtmltopdf in a virtual X session.
*
* @return bool
*/
public function getRunInVirtualX()
{
if ($this->_xvfb) {
return $this->_xvfb;
}
}
/**
* Set the PDF title.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param string $title
* @return Wkthmltopdf
*/
public function setTitle($title)
{
$this->_title = (string)$title;
return $this;
}
/**
* Returns PDF document title.
*
* @author aur1mas <aur1mas@devnet.lt>
* @throws Exception
* @return string
*/
public function getTitle()
{
if ($this->_title) {
return $this->_title;
}
}
/**
* Set header spacing.
*
* @param string $spacing
* @return Wkthmltopdf
* @author amorriscode <glxyds@gmail.com>
*/
public function setHeaderSpacing($spacing)
{
$this->_headerSpacing = (string)$spacing;
return $this;
}
/**
* Get header spacing.
*
* @return string
* @author amorriscode <glxyds@gmail.com>
*/
public function getHeaderSpacing()
{
return $this->_headerSpacing;
}
/**
* Set header html.
*
* @param string $header
* @return Wkthmltopdf
* @author amorriscode <glxyds@gmail.com>
*/
public function setHeaderHtml($header)
{
$this->_headerHtml = (string)$header;
return $this;
}
/**
* Get header html.
*
* @return string
* @author amorriscode <glxyds@gmail.com>
*/
public function getHeaderHtml()
{
return $this->_headerHtml;
}
/**
* Set footer html.
*
* @param string $footer
* @return Wkthmltopdf
* @author aur1mas <aur1mas@devnet.lt>
*/
public function setFooterHtml($footer)
{
$this->_footerHtml = (string)$footer;
return $this;
}
/**
* Get footer html.
*
* @return string
* @author aur1mas <aur1mas@devnet.lt>
*/
public function getFooterHtml()
{
return $this->_footerHtml;
}
/**
* Set HTTP username.
*
* @param string $username
* @return Wkthmltopdf
* @author aur1mas <aur1mas@devnet.lt>
*/
public function setUsername($username)
{
$this->_username = (string)$username;
return $this;
}
/**
* Get HTTP username.
*
* @return string
* @author aur1mas <aur1mas@devnet.lt>
*/
public function getUsername()
{
return $this->_username;
}
/**
* Set http password.
*
* @param string $password
* @return Wkthmltopdf
* @author aur1mas <aur1mas@devnet.lt>
*/
public function setPassword($password)
{
$this->_password = (string)$password;
return $this;
}
/**
* Get http password.
*
* @return string
* @author aur1mas <aur1mas@devnet.lt>
*/
public function getPassword()
{
return $this->_password;
}
public function getCommand() {
return $this->_getCommand();
}
/**
* Returns command to execute.
*
* @author aur1mas <aur1mas@devnet.lt>
* @return string
*/
protected function _getCommand()
{
$command = $this->_bin;
$command .= ($this->getCopies() > 1) ? " --copies " . $this->getCopies() : "";
$command .= " --orientation " . $this->getOrientation();
$command .= " --page-size " . $this->getPageSize();
$command .= " --zoom " . $this->getZoom();
$command .= ($this->getEnableSmartShrinking()) ? " --enable-smart-shrinking" : "";
foreach($this->getMargins() as $position => $margin) {
$command .= (!is_null($margin)) ? sprintf(' --margin-%s %s', $position, $margin) : '';
}
foreach ($this->getOptions() as $key => $value) {
$command .= " --$key $value";
}
$command .= ($this->getWindowStatus()) ? " --window-status ".$this->getWindowStatus()."" : "";
$command .= ($this->getTOC()) ? " --toc" : "";
$command .= ($this->getGrayscale()) ? " --grayscale" : "";
$command .= (mb_strlen($this->getPassword()) > 0) ? " --password " . $this->getPassword() . "" : "";
$command .= (mb_strlen($this->getUsername()) > 0) ? " --username " . $this->getUsername() . "" : "";
$command .= (mb_strlen($this->getHeaderSpacing()) > 0) ? " --header-spacing " . $this->getHeaderSpacing() . "" : "";
$command .= (mb_strlen($this->getHeaderHtml()) > 0) ? " --header-html \"" . $this->getHeaderHtml() . "\"" : "";
$command .= (mb_strlen($this->getFooterHtml()) > 0) ? " --margin-bottom 20 --footer-left \"" . $this->getFooterHtml() . "\"" : "";
$command .= ($this->getUserStyleSheet()) ? " --user-style-sheet ".$this->getUserStyleSheet()."" : "";
$command .= ($this->getTitle()) ? ' --title "' . $this->getTitle() . '"' : '';
$command .= ' "%input%"';
$command .= " -";
if ($this->getRunInVirtualX()) {
$command = 'xvfb-run ' . $command;
}
return $command;
}
/**
* @todo use file cache
*
* @author aur1mas <aur1mas@devnet.lt>
* @throws Exception
* @return string
*/
protected function _render()
{
if (mb_strlen($this->_html, 'utf-8') === 0 && empty($this->_url)) {
throw new Exception("HTML content or source URL not set");
}
if ($this->getUrl()) {
$input = $this->getUrl();
} else {
file_put_contents($this->getFilePath(), $this->getHtml());
$input = $this->getFilePath();
}
$content = $this->_exec(str_replace('%input%', $input, $this->_getCommand()));
if (strpos(mb_strtolower($content['stderr']), 'error')) {
throw new Exception("System error <pre>" . $content['stderr'] . "</pre>");
}
if (mb_strlen($content['stdout'], 'utf-8') === 0) {
throw new Exception("WKHTMLTOPDF didn't return any data");
}
if ((int)$content['return'] > 1) {
throw new Exception("Shell error, return code: " . (int)$content['return']);
}
return $content['stdout'];
}
/**
* Create the PDF file.
*
* @author aur1mas <aur1mas@devnet.lt>
* @param int $mode
* @param string $filename
*/
public function output($mode, $filename)
{
switch ($mode) {
case self::MODE_DOWNLOAD:
if (!headers_sent()) {
$result = $this->_render();
header("Content-Description: File Transfer");
header("Cache-Control: public; must-revalidate, max-age=0");
header("Pragma: public");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate('D, d m Y H:i:s') . " GMT");
header("Content-Type: application/force-download");
header("Content-Type: application/octec-stream", false);
header("Content-Type: application/download", false);
header("Content-Type: application/pdf", false);
header('Content-Disposition: attachment; filename="' . basename($filename) .'";');
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . strlen($result));
echo $result;
$filepath = $this->getFilePath();
if (!empty($filepath))
unlink($filepath);
exit();
} else {
throw new Exception("Headers already sent");
}
break;
case self::MODE_STRING:
return $this->_render();
break;
case self::MODE_EMBEDDED:
if (!headers_sent()) {
$result = $this->_render();
header("Content-type: application/pdf");
header("Cache-control: public, must-revalidate, max-age=0");
header("Pragme: public");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate('D, d m Y H:i:s') . " GMT");
header("Content-Length: " . strlen($result));
header('Content-Disposition: inline; filename="' . basename($filename) .'";');
echo $result;
$filepath = $this->getFilePath();
if (!empty($filepath)) {
unlink($filepath);
}
exit();
} else {
throw new Exception("Headers already sent");
}
break;
case self::MODE_SAVE:
file_put_contents($this->getPath() . basename($filename), $this->_render());
$filepath = $this->getFilePath();
if (!empty($filepath)) {
unlink($filepath);
}
break;
default:
throw new Exception("Mode: " . $mode . " is not supported");
}
}
}

View File

@ -1,15 +1,17 @@
<?php <?php
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // INSTANTIATE CLASSES $StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // INSTANTIATE CLASSES
?> ?>
<div class="container"> <!-- START FOOTER CONTENT -->
<div class="row"> <div class="container-fluid">
<div class="col-sm text-muted"><?php echo $transLang['SERVER_TIME'] . ": " . $StaticFunctions->getUTC(); ?></div> <div class="row">&nbsp;</div>
<div class="col-sm text-muted"><?php echo $transLang['LOCAL_TIME'] . ": " . $timenow; ?></div> <div class="row row-cols-3">
<div class="col-sm text-muted"><?php echo $StaticFunctions->getVersion($app_disp_lang); ?></div> <div class="col-sm d-grid gap-2 text-muted text-start"><?php echo $transLang['SERVER_TIME'] . ": " . $StaticFunctions->getUTC(); ?></div>
</div> <div class="col-sm d-grid gap-2 text-muted text-center"><?php echo $transLang['LOCAL_TIME'] . ": " . $timenow; ?></div>
</div> <div class="col-sm d-grid gap-2 text-muted text-end"><?php echo $StaticFunctions->getVersion($app_disp_lang); ?></div>
<script src="js/ie10-viewport-bug-workaround.js"></script> </div>
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script> </div>
<script src="js/bootstrap.min.js"></script> <script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
</body> <script src="js/bootstrap.min.js"></script>
<!-- END FOOTER CONTENT -->
</body>
</html> </html>

View File

@ -84,146 +84,135 @@
?> ?>
<!doctype html> <!doctype html>
<html lang="<?php echo $app_disp_lang; ?>"> <html lang="<?php echo $app_disp_lang; ?>">
<!-- HEADER CONTENT --> <!-- START HEAD -->
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <link rel="manifest" href="manifest.webmanifest">
<link rel="manifest" href="manifest.webmanifest"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-title" content="<?php echo $transLang['APP_NAME']; ?>">
<meta name="apple-mobile-web-app-title" content="Sign-In/Sign-Out"> <link rel="apple-touch-icon" href="assets/touch-logo.png">
<link rel="apple-touch-icon" href="assets/touch-logo.png"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <?php if (basename($_SERVER['PHP_SELF']) == 'signin_display.php'): ?> <meta http-equiv="refresh" content="5; url=index.php" /><?php endif; ?>
<?php if (basename($_SERVER['PHP_SELF']) == 'signin_display.php'): ?> <?php if (basename($_SERVER['PHP_SELF']) == 'signout.php'): ?><?php if (!empty($_POST['endvisit'])): ?> <meta http-equiv="refresh" content="5; url=index.php" /><?php endif; ?><?php endif; ?>
<meta http-equiv="refresh" content="5; url=index.php" /> <link rel="stylesheet" href="css/bootstrap.min.css"/>
<?php endif; ?> <link rel="stylesheet" href="css/sticky-footer-navbar.css">
<?php if (basename($_SERVER['PHP_SELF']) == 'signout.php'): ?> <link rel="stylesheet" href="css/all.min.css"/>
<?php if (!empty($_POST['endvisit'])): ?> <link rel="stylesheet" href="css/animate.min.css"/>
<meta http-equiv="refresh" content="5; url=index.php" /> <link rel="stylesheet" href="css/datatables.min.css" />
<?php endif; ?> <link rel="stylesheet" href="css/styles.css"/>
<?php endif; ?> <link rel="stylesheet" href="css/tempusdominus-bootstrap-4.min.css"/>
<link rel="stylesheet" href="css/bootstrap.min.css"/> <meta name="description" content="<?php echo $transLang['META_DESC']; ?>" />
<link rel="stylesheet" href="css/sticky-footer-navbar.css"> <script src="js/jquery.min.js"></script>
<link rel="stylesheet" href="css/all.min.css"/> <script src="js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="css/animate.min.css"/> <script src="js/datatables.min.js"></script>
<link rel="stylesheet" href="css/datatables.min.css" /> <script src="js/buttons.flash.min.js"></script>
<link rel="stylesheet" href="css/styles.css"/> <script src="js/buttons.html5.min.js"></script>
<link rel="stylesheet" href="css/tempusdominus-bootstrap-4.min.css"/> <script src="js/buttons.print.min.js"></script>
<link rel="stylesheet" href="css/ie10-viewport-bug-workaround.css"> <script src="js/dataTables.buttons.min.js"></script>
<!-- [if lt IE 9]> <script src="js/jszip.min.js"></script>
<script src="js/html5shiv.js" type="text/javascript"></script> <script src="js/pdfmake.min.js"></script>
<script src="js/respond.min.js" type="text/javascript"></script> <script src="js/vfs_fonts.js"></script>
<![endif] --> <script src="js/moment.min.js"></script>
<meta name="description" content="<?php echo $transLang['META_DESC']; ?>" /> <script src="js/tempusdominus-bootstrap-4.min.js"></script>
<script src="js/jquery.min.js"></script> <script src="js/jSignature.min.js"></script>
<script src="js/bootstrap.min.js"></script> <title><?php echo $StaticFunctions->getTitle($app_current_pagename, $app_disp_lang); ?></title>
<script src="js/datatables.min.js"></script> </head>
<script src="js/buttons.flash.min.js"></script> <!-- END HEAD -->
<script src="js/buttons.html5.min.js"></script> <!-- START BODY -->
<script src="js/buttons.print.min.js"></script> <body>
<script src="js/dataTables.buttons.min.js"></script> <!-- START NAVBAR -->
<script src="js/jszip.min.js"></script> <nav class="navbar navbar-expand-lg navbar-light bg-light">
<script src="js/pdfmake.min.js"></script> <div class="container-fluid">
<script src="js/vfs_fonts.js"></script> <a class="navbar-brand" href="index.php"><img src="<?php echo $StaticFunctions->getLogo(); ?>" width="120" height="60" alt=""></a>
<script src="js/moment.min.js"></script> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"><span class="navbar-toggler-icon"></span></button>
<script src="js/tempusdominus-bootstrap-4.min.js"></script> <div class="collapse navbar-collapse" id="navbar">
<script src="js/jSignature.min.js"></script> <ul class="navbar-nav me-auto mb-2 mb-lg-0">
<title><?php echo $StaticFunctions->getTitle($app_current_pagename, $app_disp_lang); ?></title> <?php if ($session_status == true): ?>
</head> <!-- START NAVBAR MENU FOR ALL LOGGED IN -->
<body> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['HOME']): echo " active"; endif; ?>" href="index.php"><i class="fas fa-home"></i> <?php echo $transLang['HOME']; ?></a></li>
<!-- NAVBAR START --> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['ACCOUNT']): echo " active"; endif; ?>" href="profile.php"><i class="fas fa-user-circle"></i> <?php echo $transLang['ACCOUNT']; ?></a></li>
<div class="container"> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['REPORTS']): echo " active"; endif; ?>" href="reports.php"><i class="fas fa-chart-pie"></i> <?php echo $transLang['REPORTS']; ?></a></li>
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light"> <!-- END NAVBAR MENU FOR ALL LOGGED IN -->
<a class="navbar-brand" href="index.php"><img src="<?php echo $StaticFunctions->getLogo(); ?>" width="120" height="60" alt=""></a> <?php endif; ?>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar" aria-label="Toggle Navigation"> <?php if (isset($session_user)) { if ($session_user["0"]["users_usertype"] == "ADMIN"): ?>
<span class="navbar-toggler-icon"></span> <!-- START NAVBAR MENU FOR ADMIN LOGGED IN -->
</button> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['ADMINISTRATION']): echo " active"; endif; ?>" href="users.php"><i class="fas fa-users"></i> <?php echo $transLang['ADMINISTRATION']; ?></a></li>
<div id="navbar" class="collapse navbar-collapse"> <!-- END NAVBAR MENU FOR ADMIN LOGGED IN -->
<ul class="navbar-nav mr-auto mt-2 mt-lg-0"> <?php endif; }; ?>
<?php if ($session_status == true): ?> <?php if ($session_status == false): ?>
<!-- MENU FOR ALL LOGGED IN --> <!-- START NAVBAR MENU FOR ALL LOGGED OUT - BOTTOM END -->
<li class="nav-item<?php if ($app_current_pagename==$transLang['HOME']): echo " active"; endif; ?>"><a class="nav-link" href="index.php"><i class="fas fa-home"></i> <?php echo $transLang['HOME']; ?></a></li> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['SIGNIN']): echo " active"; endif; ?>" href="signin.php"><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></a></li>
<li class="nav-item<?php if ($app_current_pagename==$transLang['ACCOUNT']): echo " active"; endif; ?>"><a class="nav-link" href="profile.php"><i class="fas fa-user-circle"></i> <?php echo $transLang['ACCOUNT']; ?></a></li> <li class="nav-item"><a class="nav-link<?php if ($app_current_pagename==$transLang['SIGNOUT']): echo " active"; endif; ?>" href="signout.php"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></a></li>
<li class="nav-item<?php if ($app_current_pagename==$transLang['REPORTS']): echo " active"; endif; ?>"><a class="nav-link" href="reports.php"><i class="fas fa-chart-pie"></i> <?php echo $transLang['REPORTS']; ?></a></li> </ul>
<?php endif; ?> <ul class="navbar-nav mr-sm-2">
<?php if (isset($session_user)) { if ($session_user["0"]["users_usertype"] == "ADMIN"): ?> <li class="nav-item"><a class="nav-link btn btn-sm btn-outline-success<?php if ($app_current_pagename==$transLang['LOGIN']): echo " active"; endif; ?>" href="login.php"><i class="fas fa-cogs"></i> </a></li>
<!-- ADDITIONAL MENU IF LOGGED IN AS ADMIN --> <!-- END NAVBAR MENU FOR ALL LOGGED OUT - BOTTOM END -->
<li class="nav-item<?php if ($app_current_pagename==$transLang['ADMINISTRATION']): echo " active"; endif; ?>"><a class="nav-link" href="users.php"><i class="fas fa-users"></i> <?php echo $transLang['ADMINISTRATION']; ?></a></li> <?php endif; ?>
<?php endif; }; ?> <?php if ($session_status == true): ?>
<?php if ($session_status == false): ?> <!-- START NAVBAR MENU FOR ALL LOGGED IN - BOTTOM END -->
<!-- MENU FOR ALL LOGGED OUT --> </ul>
<li class="nav-item<?php if ($app_current_pagename==$transLang['SIGNIN']): echo " active"; endif; ?>"><a class="nav-link" href="signin.php"><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></a></li> <ul class="navbar-nav mr-sm-2">
<li class="nav-item<?php if ($app_current_pagename==$transLang['SIGNOUT']): echo " active"; endif; ?>"><a class="nav-link" href="signout.php"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></a></li> <li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, "0", "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; }; ?>" href="#" data-toggle="modal" data-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li>
</ul> <?php if (Registry::AUTHMETHOD == 'SAML') { ?>
<ul class="navbar-nav mr-sm-2"> <!-- SAML SESSION BUTTONS -->
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGIN']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-success" href="login.php"><i class="fas fa-cogs"></i> </a></li> <li class="nav-item"><a class="nav-link btn btn-sm btn-outline-danger<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>" href="<?php echo str_replace("http%3A%2F%2F","https%3A%2F%2F",$auth->getLogoutURL()); ?>"><span class="badge bg-light text-dark"><?php echo $session_user["0"]["users_firstname"] . " " . $session_user["0"]["users_lastname"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
<?php endif; ?> <?php } else { ?>
<?php if ($session_status == true): ?> <!-- BUILTIN SESSION BUTTONS -->
<!-- MENU FOR ALL LOGGED IN - BOTTOM END --> <li class="nav-item"><a class="nav-link btn btn-sm btn-outline-danger<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>" href="logout.php"><span class="badge bg-light text-dark"><?php echo $session_user["0"]["users_firstname"] . " " . $session_user["0"]["users_lastname"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
</ul> <?php } ?>
<ul class="navbar-nav mr-sm-2"> <!-- END NAVBAR MENU FOR ALL LOGGED IN - BOTTOM END -->
<li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, "0", "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; }; ?>" href="#" data-toggle="modal" data-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li> <?php endif; ?>
<?php if (Registry::AUTHMETHOD == 'SAML') { ?> <form action="changelang.php" method="post" name="changelang" class="changelang">
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-danger" href="<?php echo str_replace("http%3A%2F%2F","https%3A%2F%2F",$auth->getLogoutURL()); ?>"><span class="badge badge-light"><?php echo $session_user["0"]["users_firstname"] . " " . $session_user["0"]["users_lastname"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li> <div class="input-group">
<?php } else { ?> <select class="form-select btn-outline-secondary" id="app_disp_lang" name="app_disp_lang">
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-danger" href="logout.php"><span class="badge badge-light"><?php echo $session_user["0"]["users_firstname"] . " " . $session_user["0"]["users_lastname"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li> <?php foreach(glob('src/Language/*.ini') as $file){
<?php } ?> if(!is_dir($file)) { $filename=basename(preg_replace('/\.[^.]+$/','',preg_replace('/\.[^.]+$/','',$file))); }; ?>
<?php endif; ?> <option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; }; ?>><?php echo strtoupper($filename); ?></option>
<form action="changelang.php" method="post" name="changelang" class="changelang"> <?php }; ?>
<div class="input-group mb-3"> </select>
<select class="form-control custom-select btn btn-outline-secondary" id="app_disp_lang" aria-label="Language" name="app_disp_lang">
<?php foreach(glob('src/Language/*.ini') as $file){
if(!is_dir($file)) { $filename=basename(preg_replace('/\.[^.]+$/','',preg_replace('/\.[^.]+$/','',$file))); }; ?>
<option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; }; ?>><?php echo strtoupper($filename); ?></option>
<?php }; ?>
</select>
</div>
</form>
</ul>
</div><!--/.nav-collapse -->
</nav>
</div>
<!-- NAVBAR END -->
<!-- MODAL START -->
<div class="modal fade" id="sitetimeModal" tabindex="-1" role="dialog" aria-labelledby="Site" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Site"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['SITE']; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="form-inline my-2 my-lg-0" action="changesite.php" method="post">
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary" type="button"><?php echo $transLang['CHOOSE']; ?></button>
</div>
<select class="custom-select" id="site" aria-label="Site" name="site" required>
<?php foreach($SiteInfo->getSite("0", $uid, "0", "0") as $row): ?>
<option value="<?php echo $row['sites_id']; ?>"<?php if ($row['sites_id']==$siteid) { echo " selected"; } ?>><?php if ($row['sites_name']=="NOSITE") {echo $transLang['NOSITE'];} else { echo $row['sites_name']; } ?></option>
<?php endforeach; ?>
</select>
<input class="btn" type="submit" value="<?php echo $transLang['SAVE']; ?>" />
</div>
</form>
</div>
</div>
</div> </div>
</form>
</ul>
</div>
</div>
</nav>
<!-- END NAVBAR -->
<!-- START MODAL -->
<div class="modal fade" id="sitetimeModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Site"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['SITE']; ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<script> <div class="modal-body">
$(".changelang").change(function(e){ <form class="row g-3" action="changesite.php" method="post">
e.preventDefault(); <div class="input-group">
$(this).closest("form").submit(); <select class="form-select" id="site" aria-label="Site" name="site" required>
}); <?php foreach($SiteInfo->getSite("0", $uid, "0", "0") as $row): ?>
</script> <option value="<?php echo $row['sites_id']; ?>"<?php if ($row['sites_id']==$siteid) { echo " selected"; } ?>><?php if ($row['sites_name']=="NOSITE") {echo $transLang['NOSITE'];} else { echo $row['sites_name']; } ?></option>
<script> <?php endforeach; ?>
$(document).ready(function () { </select>
//POP MODAL IF NO COOKIE <button class="btn btn-primary" type="submit" value="<?php echo $transLang['SAVE']; ?>"><?php echo $transLang['SAVE']; ?></button>
if ( document.cookie.indexOf("app_site=") < 0) { </div>
$("#sitetimeModal").modal("show"); </form>
} </div>
}); </div>
</script> </div>
<!-- MODAL END --> </div>
<script>
$(".changelang").change(function(e){
e.preventDefault();
$(this).closest("form").submit();
});
</script>
<script>
$(document).ready(function () {
//POP MODAL IF NO COOKIE
if ( document.cookie.indexOf("app_site=") < 0) {
$("#sitetimeModal").modal("show");
}
});
</script>
<!-- END MODAL -->

649
index.php
View File

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

View File

@ -183,7 +183,7 @@ h.each(n,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
©2011-2017 SpryMedia Ltd - datatables.net/license ©2011-2017 SpryMedia Ltd - datatables.net/license
*/ */
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
renderer:"bootstrap"});b.extend(f.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault(); renderer:"bootstrap"});b.extend(f.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-select form-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();
!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="&#x2026;";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>", !b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="&#x2026;";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",
{"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex,"class":"page-link"}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f}); {"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex,"class":"page-link"}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});

View File

@ -76,8 +76,9 @@
if ($StaticFunctions->getUserSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getUserSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<!-- START CONTENT -->
<?php <?php
// hash password for comparison // hash password for comparison
require_once("src/Misc/PasswordHash.php"); require_once("src/Misc/PasswordHash.php");
@ -97,27 +98,26 @@ if (!empty($_POST)):
endif; endif;
endif; endif;
?> ?>
<div class="container">
<div class="container"> <div class="row row-cols-2">
<div class="row"> <div class="col d-grid gap-2">
<div class="col-sm"> <p><b><?php echo $transLang['SITE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?>
<p><b><?php echo $transLang['SITE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?>
<br><b><?php echo $transLang['TIMEZONE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_timezone"]; ?> <br><b><?php echo $transLang['TIMEZONE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_timezone"]; ?>
<br><b><?php echo $transLang['REGION']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"]; ?></p> <br><b><?php echo $transLang['REGION']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"]; ?></p>
</div>
<div class="col-sm">
<button type="button" class="btn btn-block btn-lg btn-success" data-toggle="modal" data-target="#sitetimeModal"><?php echo $transLang['CHANGE']; ?></button>
</div>
</div> </div>
<br /> <div class="col d-grid gap-2">
<hr /> <button type="button" class="btn btn-block btn-lg btn-success" data-bs-toggle="modal" data-bs-target="#sitetimeModal"><?php echo $transLang['CHANGE']; ?></button>
<br /> </div>
<form class="form-signin" action="login.php" method="post"> </div>
<br />
<hr />
<br />
<form class="form-signin" action="login.php" method="post">
<div class="input-group input-group-lg"> <div class="input-group input-group-lg">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?> <?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<input type="text" class="form-control" aria-describedby="button-addon2" id="username" name="username" placeholder="<?php echo $transLang['USERNAME']; ?>" required autofocus> <input type="text" class="form-control" aria-describedby="button-addon2" id="username" name="username" placeholder="<?php echo $transLang['USERNAME']; ?>" required autofocus>
<input type="password" class="form-control" aria-describedby="button-addon2" id="password" name="password" placeholder="<?php echo $transLang['PASSWORD']; ?>" required autofocus> <input type="password" class="form-control" aria-describedby="button-addon2" id="password" name="password" placeholder="<?php echo $transLang['PASSWORD']; ?>" required autofocus>
<div class="input-group-append"> <div class="input-group-text">
<button class="btn btn-success btn-block" type="submit" id="button-addon2" name="login"><?php echo $transLang['LOGIN']; ?></button> <button class="btn btn-success btn-block" type="submit" id="button-addon2" name="login"><?php echo $transLang['LOGIN']; ?></button>
</div> </div>
<?php } else { ?> <?php } else { ?>

View File

@ -76,69 +76,106 @@
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
echo $StaticFunctions->killSession(); // ELSE DIE echo $StaticFunctions->killSession(); // ELSE DIE
} else { ?> } else { ?>
<!-- CONTENT START -->
<?php
$minpasslength = $StaticFunctions->getMinPass(); <!-- START CONTENT -->
if (isset($_POST['saveprofile'])): <?php
if (empty($_POST['password']) && empty($_POST['newpassword2'])): $minpasslength = $StaticFunctions->getMinPass();
$Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]); if (isset($_POST['saveprofile'])):
header('Location: ' . $_SERVER['PHP_SELF']); if (empty($_POST['password']) && empty($_POST['newpassword2'])):
elseif (strlen($_POST['password']) < $minpasslength): $Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]);
echo "Password must be at least $minpasslength characters."; header('Location: ' . $_SERVER['PHP_SELF']);
elseif (!empty($_POST['password']) && empty($_POST['newpassword2'])): elseif (strlen($_POST['password']) < $minpasslength):
echo "Please confirm password if you wish to change it"; echo "Password must be at least $minpasslength characters.";
elseif ($_POST['password'] != $_POST['newpassword2']): elseif (!empty($_POST['password']) && empty($_POST['newpassword2'])):
echo "New passwords do not match"; echo "Please confirm password if you wish to change it";
elseif (!empty($_POST['password']) && ($_POST['password'] = $_POST['newpassword2'])): elseif ($_POST['password'] != $_POST['newpassword2']):
// change pass echo "New passwords do not match";
require_once("src/Misc/PasswordHash.php"); elseif (!empty($_POST['password']) && ($_POST['password'] = $_POST['newpassword2'])):
$hasher = new PasswordHash(8, FALSE); // change pass
$password = $hasher->HashPassword($_POST['password']); require_once("src/Misc/PasswordHash.php");
$Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $password); $hasher = new PasswordHash(8, FALSE);
header('Location: ' . $_SERVER['PHP_SELF']); $password = $hasher->HashPassword($_POST['password']);
endif; $Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $password);
endif; header('Location: ' . $_SERVER['PHP_SELF']);
?> endif;
<div class="container"> endif;
<div class="row"> ?>
<div class="col-sm"> <div class="container">
<h2><i class="fas fa-user-circle"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2> <div class="row row-cols-1">
</div> <div class="col d-grid gap-2">
<h2><i class="fas fa-user-circle"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p>
<?php } ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['USERNAME']; ?></span>
<input class="form-control form-control-sm" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
</div> </div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?> </div>
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p> <div class="col">
<?php } ?> <div class="input-group input-group-sm mb-0">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <span class="input-group-text bg-info text-dark"><?php echo $transLang['CREATED']; ?></span>
<fieldset> <input class="form-control form-control-sm" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
<div class="form-group row"> </div>
<label for="username" class="col-sm-2 col-form-label"><?php echo $transLang['USERNAME']; ?></label> </div>
<div class="col-sm-2"><input class="form-control" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly /></div> <div class="col">
<label for="created" class="col-sm-2 col-form-label"><?php echo $transLang['CREATED']; ?></label> <div class="input-group input-group-sm mb-0">
<div class="col-sm-2"><input class="form-control" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly /></div> <span class="input-group-text bg-info text-dark"><?php echo $transLang['USERTYPE']; ?></span>
<label for="usertype" class="col-sm-2 col-form-label"><?php echo $transLang['USERTYPE']; ?></label> <input class="form-control form-control-sm" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
<div class="col-sm-2"><input class="form-control" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly /></div> </div>
</div> </div>
<div class="form-group row">
<label for="firstname" class="col-sm-2 col-form-label"><?php echo $transLang['FIRSTNAME']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
<label for="lastname" class="col-sm-2 col-form-label"><?php echo $transLang['LASTNAME']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
<label for="email" class="col-sm-2 col-form-label"><?php echo $transLang['EMAIL']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="form-group row">
<label for="password" class="col-sm-2 col-form-label"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></label>
<div class="col-sm-2"><input class="form-control" type="password" name="password" id="password" /></div>
<label for="newpassword2" class="col-sm-2 col-form-label"><?php echo $transLang['CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></label>
<div class="col-sm-2"><input class="form-control" type="password" name="newpassword2" id="newpassword2" /></div>
<div class="col-sm-4"><button type="submit" name="saveprofile" id="saveprofile" class="form-control btn btn-block btn-primary"><?php echo $transLang['SAVE']; ?></button></div>
</div>
<?php } ?>
</fieldset>
</form>
</div> </div>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['FIRSTNAME']; ?></span>
<input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['LASTNAME']; ?></span>
<input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['EMAIL']; ?></span>
<input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control" type="password" name="password" id="password" />
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control" type="password" name="newpassword2" id="newpassword2" />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<button type="submit" name="saveprofile" id="saveprofile" class="form-control btn btn-primary"><?php echo $transLang['SAVE']; ?></button>
</div>
</div>
</div>
<?php } ?>
</fieldset>
</form>
</div>
<!-- END CONTENT -->
<!-- CONTENT END --> <?php }; require_once("inc/footer.inc.php"); ?>
<?php }; require_once("inc/footer.inc.php");

View File

@ -93,7 +93,7 @@
<div class="form-group row"> <div class="form-group row">
<div class="col-sm"> <div class="col-sm">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['REPORTS']; ?></span> <span class="input-group-text" id="basic-addon3"><?php echo $transLang['REPORTS']; ?></span>
</div> </div>
<select name="reporttype" class="form-control"> <select name="reporttype" class="form-control">
@ -107,7 +107,7 @@
</div> </div>
<div class="col-sm"> <div class="col-sm">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['SITE']; ?>:</span> <span class="input-group-text" id="basic-addon3"><?php echo $transLang['SITE']; ?>:</span>
</div> </div>
<?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?> <?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?>
@ -125,7 +125,7 @@
<div class="form-group row"> <div class="form-group row">
<div class='col-sm'> <div class='col-sm'>
<div class="input-group date" id="datetimepicker-1" data-target-input="#datetimepicker-1"> <div class="input-group date" id="datetimepicker-1" data-target-input="#datetimepicker-1">
<div class="input-group-prepend " data-target=".datetimepicker-1" data-toggle="datetimepicker"> <div class="input-group-text " data-target=".datetimepicker-1" data-toggle="datetimepicker">
<div class="input-group-text "><i class="fa fa-calendar"></i>&nbsp <?php echo $transLang['START']; ?></div> <div class="input-group-text "><i class="fa fa-calendar"></i>&nbsp <?php echo $transLang['START']; ?></div>
</div> </div>
<input name="starttime" type="text" class="datetimepicker-input form-control datetimepicker-1" id="datetimepicker-1" data-target=".datetimepicker-1" autocomplete="new-password" required /> <input name="starttime" type="text" class="datetimepicker-input form-control datetimepicker-1" id="datetimepicker-1" data-target=".datetimepicker-1" autocomplete="new-password" required />
@ -133,7 +133,7 @@
</div> </div>
<div class='col-sm'> <div class='col-sm'>
<div class="input-group date" id="datetimepicker-2" data-target-input="#datetimepicker-2"> <div class="input-group date" id="datetimepicker-2" data-target-input="#datetimepicker-2">
<div class="input-group-prepend" data-target=".datetimepicker-2" data-toggle="datetimepicker"> <div class="input-group-text" data-target=".datetimepicker-2" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i>&nbsp <?php echo $transLang['END']; ?></div> <div class="input-group-text"><i class="fa fa-calendar"></i>&nbsp <?php echo $transLang['END']; ?></div>
</div> </div>
<input name="endtime" type="text" class="datetimepicker-input form-control datetimepicker-2" id="datetimepicker-2" data-target=".datetimepicker-2" autocomplete="new-password" required /> <input name="endtime" type="text" class="datetimepicker-input form-control datetimepicker-2" id="datetimepicker-2" data-target=".datetimepicker-2" autocomplete="new-password" required />

View File

@ -48,87 +48,86 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<div class="container"> <!-- START CONTENT -->
<div class="row"> <div class="container">
<div class="col-sm"> <div class="row row-cols-1">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <div class="col d-grid gap-2">
</div> <h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div> </div>
<form name="form-signin" class="needs-validation" action="signin_1.php" method="post" novalidate> </div>
<div class="form-group form-row"> <form name="form-signin" class="needs-validation" action="signin_1.php" method="post" novalidate>
<div class="form-check"> <div class="form-group form-row">
<input class="form-check-input" type="checkbox" value="" id="q1" required> <div class="form-check">
<label class="form-check-label" for="q1"><b>I have NOT experienced any of the following symptoms in the past 48 hours.</b><br>Fever, chills, cough, shortness of breath, fatigue, muscle or body aches, headache, new loss of taste or smell, sore throat, congestion or runny nose, nausea or vomiting, diarrhea.</label> <input class="form-check-input" type="checkbox" value="" id="q1" required>
<div class="invalid-feedback">You must answer to proceed.</div> <label class="form-check-label" for="q1"><b>I have NOT experienced any of the following symptoms in the past 48 hours.</b><br>Fever, chills, cough, shortness of breath, fatigue, muscle or body aches, headache, new loss of taste or smell, sore throat, congestion or runny nose, nausea or vomiting, diarrhea.</label>
</div> <div class="invalid-feedback">You must answer to proceed.</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q2" required>
<label class="form-check-label" for="q2"><b>I am NOT isolating or quarantining due to a positive test for COVID-19 nor do I believe that I may be sick with COVID-19.</b></label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q3" required>
<label class="form-check-label" for="q3"><b>I have NOT been in close physical contact in the last 14 days with:</b><br>Anyone who is known to have laboratory-confirmed COVID-19? OR Anyone who has any symptoms consistent with COVID-19?</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q4" required>
<label class="form-check-label" for="q4"><b>I am NOT currently waiting on the results of a COVID-19 test.</b><br>IMPORTANT: ANSWER "NO" IF YOU ARE WAITING ON THE RESULTS OF A PRE-TRAVEL OR POST-TRAVEL COVID-19 TEST</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q5" required>
<label class="form-check-label" for="q5"><b>I have NOT traveled in the past 10 days.</b><br>Travel is defined as any trip that is overnight AND on public transportation (plane, train, bus, Uber, Lyft, cab, etc.) OR any trip that is overnight AND with people who are not in your household.</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q6" required>
<label class="form-check-label" for="q6"><b>I certify that my responses are true and correct.</b><br>All visitors must answer the above questions and then certify their answers are true and correct.</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="row">
<div class="col">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div> </div>
</div>
<script> <div class="form-group form-row">
// Example starter JavaScript for disabling form submissions if there are invalid fields <div class="form-check">
(function() { <input class="form-check-input" type="checkbox" value="" id="q2" required>
'use strict'; <label class="form-check-label" for="q2"><b>I am NOT isolating or quarantining due to a positive test for COVID-19 nor do I believe that I may be sick with COVID-19.</b></label>
window.addEventListener('load', function() { <div class="invalid-feedback">You must answer to proceed.</div>
// Fetch all the forms we want to apply custom Bootstrap validation styles to </div>
var forms = document.getElementsByClassName('needs-validation'); </div>
// Loop over them and prevent submission <div class="form-group form-row">
var validation = Array.prototype.filter.call(forms, function(form) { <div class="form-check">
form.addEventListener('submit', function(event) { <input class="form-check-input" type="checkbox" value="" id="q3" required>
if (form.checkValidity() === false) { <label class="form-check-label" for="q3"><b>I have NOT been in close physical contact in the last 14 days with:</b><br>Anyone who is known to have laboratory-confirmed COVID-19? OR Anyone who has any symptoms consistent with COVID-19?</label>
event.preventDefault(); <div class="invalid-feedback">You must answer to proceed.</div>
event.stopPropagation(); </div>
} </div>
form.classList.add('was-validated'); <div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q4" required>
<label class="form-check-label" for="q4"><b>I am NOT currently waiting on the results of a COVID-19 test.</b><br>IMPORTANT: ANSWER "NO" IF YOU ARE WAITING ON THE RESULTS OF A PRE-TRAVEL OR POST-TRAVEL COVID-19 TEST</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q5" required>
<label class="form-check-label" for="q5"><b>I have NOT traveled in the past 10 days.</b><br>Travel is defined as any trip that is overnight AND on public transportation (plane, train, bus, Uber, Lyft, cab, etc.) OR any trip that is overnight AND with people who are not in your household.</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="form-group form-row">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="q6" required>
<label class="form-check-label" for="q6"><b>I certify that my responses are true and correct.</b><br>All visitors must answer the above questions and then certify their answers are true and correct.</label>
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="row">&nbsp;</div>
<div class="row">
<div class="col d-grid gap-2">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div>
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false); }, false);
}); })();
}, false); </script>
})(); <!-- END CONTENT -->
</script>
<?php }; require_once("inc/footer.inc.php"); ?>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php");

View File

@ -48,64 +48,60 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<div class="container">
<div class="row">
<div class="col-sm"> <!-- START CONTENT -->
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <div class="container">
</div> <div class="row row-cols-1">
</div> <div class="col d-grid gap-2">
<form name="form-signin" class="form-signin" action="signin_2.php" method="post"> <h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
<div class="row"> </div>
<div class="col-sm"> </div>
<div class="input-group mb-3"> <form name="form-signin" class="form-signin" action="signin_2.php" method="post">
<div class="input-group-prepend"> <div class="row row-cols-1">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['NAME']; ?>:</span> <div class="col">
</div> <div class="input-group mb-3">
<input type="text" id="firstname" name="firstname" class="form-control" placeholder="<?php echo $transLang['FIRST']; ?>" required autofocus> <span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<input type="text" id="lastname" name="lastname" class="form-control" placeholder="<?php echo $transLang['LAST']; ?>" required autofocus> <input type="text" id="firstname" name="firstname" class="form-control" placeholder="<?php echo $transLang['FIRST']; ?>" required autofocus>
</div> <input type="text" id="lastname" name="lastname" class="form-control" placeholder="<?php echo $transLang['LAST']; ?>" required autofocus>
</div> </div>
</div>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<div class="row">
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['CARNUM']; ?></span>
</div>
<input type="text" id="company" name="carnum" class="form-control" placeholder="<?php echo $transLang['CARNUM']; ?>" required autofocus>
</div>
</div>
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['SSANUM']; ?></span>
</div>
<input type="text" id="company" name="ssanum" class="form-control" placeholder="<?php echo $transLang['SSANUM']; ?>" required autofocus>
</div>
</div>
</div>
<?php }; ?>
<div class="row">
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['COMPANY']; ?></span>
</div>
<input type="text" id="company" name="company" class="form-control" placeholder="<?php echo $transLang['COMPANY']; ?>" required autofocus>
</div>
</div>
</div>
<div class="row">
<div class="col">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div> </div>
</div>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['CARNUM']; ?></span>
<input type="text" id="company" name="carnum" class="form-control" placeholder="<?php echo $transLang['CARNUM']; ?>" required autofocus>
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['SSANUM']; ?></span>
<input type="text" id="company" name="ssanum" class="form-control" placeholder="<?php echo $transLang['SSANUM']; ?>" required autofocus>
</div>
</div>
</div>
<?php }; ?>
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['COMPANY']; ?></span>
<input type="text" id="company" name="company" class="form-control" placeholder="<?php echo $transLang['COMPANY']; ?>" required autofocus>
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div>
<!-- END CONTENT -->
<!-- CONTENT END --> <?php }; require_once("inc/footer.inc.php"); ?>
<?php }; require_once("inc/footer.inc.php");

View File

@ -48,53 +48,58 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
?>
<div class="container">
<div class="row">
<div class="col-sm">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div>
</div>
<form name="form-signin" class="form-signin" action="signin_3.php" method="post">
<div class="row">
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['REASON']; ?></span>
</div>
<select class="custom-select" id="visit_type" aria-label="Visit Type" name="visit_type" required>
<option value="" selected><?php echo $transLang['SELECTREASON']; ?></option><?php foreach($VisitTypeInfo->getVisitTypeInfo("%") as $row): ?>
<option value="<?php echo $row['visittypes_id']; ?>"><?php echo $transLang[$row['visittypes_name']]; ?></option><?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
<input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
<input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
<input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
<input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div>
<?php } else { // EXIT IF NO POST
?>
<div class="container">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
<?php }; ?>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php"); <!-- START CONTENT -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
?>
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div>
</div>
<form name="form-signin" class="form-signin" action="signin_3.php" method="post">
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['REASON']; ?></span>
<select class="form-select" id="visit_type" aria-label="Visit Type" name="visit_type" required>
<option value="" selected><?php echo $transLang['SELECTREASON']; ?></option><?php foreach($VisitTypeInfo->getVisitTypeInfo("%") as $row): ?>
<option value="<?php echo $row['visittypes_id']; ?>"><?php echo $transLang[$row['visittypes_name']]; ?></option><?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
<input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
<input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
<input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
<input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div>
<!-- END CONTENT -->
<?php } else { ?>
<!-- START ERROR -->
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
</div>
</div>
<!-- END ERROR -->
<?php }; ?>
<?php }; require_once("inc/footer.inc.php"); ?>

View File

@ -48,97 +48,106 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];}; <!-- START CONTENT -->
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];}; <?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];}; if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];}; if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
if (empty($_POST['visit_type'])) { $visit_type="";} else {$visit_type=$_POST['visit_type'];}; if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
?> if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
<div class="container"> if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
<div class="row"> if (empty($_POST['visit_type'])) { $visit_type="";} else {$visit_type=$_POST['visit_type'];};
<div class="col-sm"> ?>
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2> <div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div>
</div>
<form name="form-signin" class="form-signin" action="signin_4.php" method="post">
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h5 class="accordion-header" id="headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne"><?php echo $transLang['ESECTION']; ?></button>
</h5>
<div id="collapseOne" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text"><?php echo $transLang['ENAME']; ?></span>
<input type="text" id="escort" name="escort" class="form-control" placeholder="<?php echo $transLang['ETAG']; ?>" autofocus>
</div>
</div> </div>
</div>
<h4><?php echo $transLang['ESIGNATURE']; ?>:</h4>
<div id="esignature-parent">
<div id="esignature"></div>
</div>
<input type="hidden" name="e_signature" id="e_signature"></input>
</div> </div>
<form name="form-signin" class="form-signin" action="signin_4.php" method="post"> </div>
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0"><button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne"><?php echo $transLang['ESECTION']; ?></button></h5>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['ENAME']; ?>:</span>
</div>
<input type="text" id="escort" name="escort" class="form-control" placeholder="<?php echo $transLang['ETAG']; ?>" autofocus>
</div>
<h4><?php echo $transLang['ESIGNATURE']; ?>:</h4>
<div id="esignature-parent">
<div id="esignature"></div>
</div>
<input type="hidden" name="e_signature" id="e_signature"></input>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h4><?php echo $transLang['VSIGNATURE']; ?>:</h4>
<div id="vsignature-parent">
<div id="vsignature"></div>
</div>
<input type="hidden" name="v_signature" id="v_signature" required />
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
<input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
<input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
<input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
<input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
<input type="hidden" name="visit_type" id="visit_type" value="<?php echo $visit_type; ?>" />
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div> </div>
<script> </div>
$(document).ready(function() { <div class="row row-cols-1">
// Init jSignature for Escort field ONLY after we uncollapse the escort bootstrap div <div class="col d-grid gap-2">
$('#collapseOne').on('shown.bs.collapse', function () { <h4><?php echo $transLang['VSIGNATURE']; ?>:</h4>
var $esignature = $("#esignature").jSignature(); <div id="vsignature-parent">
true <div id="vsignature"></div>
$('#esignature').change(function() { </div>
var data2 = $esignature.jSignature('getData'); <input type="hidden" name="v_signature" id="v_signature" required />
$('#e_signature').val(data2); <input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
}); <input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
}); <input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
// Init jSignature for Visitor field, onchange store in text field <input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
var $vsignature = $("#vsignature").jSignature(); <input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
true <input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
$('#vsignature').change(function() { <input type="hidden" name="visit_type" id="visit_type" value="<?php echo $visit_type; ?>" />
var data = $vsignature.jSignature('getData'); <button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
$('#v_signature').val(data);
});
});
$("form").submit(function() {
if($('#v_signature').val() == '') {
alert("<?php echo $transLang['SIGNATURE']; ?> <?php echo $transLang['REQUIRED']; ?>");
return false;
}
return true;
});
</script>
<?php } else { // EXIT IF NO POST
?>
<div class="container">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div> </div>
<?php }; ?> </div>
</form>
</div>
<script>
$(document).ready(function() {
// Init jSignature for Escort field ONLY after we uncollapse the escort bootstrap div
$('#collapseOne').on('shown.bs.collapse', function () {
var $esignature = $("#esignature").jSignature();
true;
$('#esignature').change(function() {
var data2 = $esignature.jSignature('getData');
$('#e_signature').val(data2);
});
});
// Init jSignature for Visitor field, onchange store in text field
var $vsignature = $("#vsignature").jSignature();
true;
$('#vsignature').change(function() {
var data = $vsignature.jSignature('getData');
$('#v_signature').val(data);
});
});
$("form").submit(function() {
if($('#v_signature').val() === '') {
alert("<?php echo $transLang['SIGNATURE']; ?> <?php echo $transLang['REQUIRED']; ?>");
return false;
}
return true;
});
</script>
<!-- END CONTENT -->
<?php } else { ?>
<!-- START ERROR -->
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
</div>
</div>
<!-- END ERROR -->
<?php }; ?>
<!-- CONTENT END --> <?php }; require_once("inc/footer.inc.php"); ?>
<?php }; require_once("inc/footer.inc.php");

View File

@ -48,75 +48,83 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
if (empty($_POST['visit_type'])) { $visit_type="";} else {$visit_type=$_POST['visit_type'];};
if (empty($_POST['v_signature'])) { $v_signature="";} else {$v_signature=$_POST['v_signature'];};
if (empty($_POST['e_signature'])) { $e_signature="";} else {$e_signature=$_POST['e_signature'];};
if (empty($_POST['escort'])) { $escort="";} else {$escort=$_POST['escort'];};
?>
<div class="container">
<div class="row">
<div class="col-sm">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div>
</div>
<form name="form-signin" class="form-signin" action="signin_display.php" method="post">
<div class="row">
<div class="col">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
<p><?php echo $transLang['COVID_ACKNOWLEDGEMENT']; ?><p>
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
<p><a class="btn btn-outline-secondary btn-block" data-toggle="modal" data-target="#termsModalLong" href="<?php echo $StaticFunctions->getRules(); ?>"><?php echo $transLang['REFERENCE']; ?>:&nbsp;(<?php echo $transLang['ACKNOWLEDGEMENT_DOC_NAME']; ?>)</a></p>
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
<input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
<input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
<input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
<input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
<input type="hidden" name="visit_type" id="visit_type" value="<?php echo $visit_type; ?>" />
<input type="hidden" name="v_signature" id="v_signature" value="<?php echo $v_signature; ?>" />
<input type="hidden" name="e_signature" id="e_signature" value="<?php echo $e_signature; ?>" />
<input type="hidden" name="escort" id="escort" value="<?php echo $escort; ?>" />
<a class="btn btn-lg btn-danger btn-block" href="index.php"><?php echo $transLang['CANCEL']; ?></a>
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['SIGNIN']; ?></button>
</div>
</div>
</form>
</div>
<!-- TERMS MODAL START -->
<div class="modal fade" id="termsModalLong" tabindex="-1" role="dialog" aria-labelledby="termsModalLongTitle" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="termsModalLongTitle"><?php echo $transLang['TERMSTITLE']; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo $transLang['CLOSE']; ?>">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<object type="application/pdf" data="<?php echo $StaticFunctions->getRules(); ?>" width="700" height="600">_</object>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $transLang['CLOSE']; ?></button>
</div>
</div>
</div>
</div>
<!-- TERMS MODAL END -->
<?php } else { // EXIT IF NO POST
?>
<div class="container">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
<?php }; ?>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php"); <!-- START CONTENT -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
if (empty($_POST['visit_type'])) { $visit_type="";} else {$visit_type=$_POST['visit_type'];};
if (empty($_POST['v_signature'])) { $v_signature="";} else {$v_signature=$_POST['v_signature'];};
if (empty($_POST['e_signature'])) { $e_signature="";} else {$e_signature=$_POST['e_signature'];};
if (empty($_POST['escort'])) { $escort="";} else {$escort=$_POST['escort'];};
?>
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN']; ?></h2>
</div>
</div>
<form name="form-signin" class="form-signin" action="signin_display.php" method="post">
<div class="row row-cols-1">
<div class="col">
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<p><?php echo $transLang['ACKNOWLEDGEMENT']; ?></p>
<?php } ?>
<p><?php echo $transLang['COVID_ACKNOWLEDGEMENT']; ?><p>
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
</div>
</div>
<div class="row row-cols-1">
<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>
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
<input type="hidden" name="carnum" id="carnum" value="<?php echo $carnum; ?>" />
<input type="hidden" name="ssanum" id="ssanum" value="<?php echo $ssanum; ?>" />
<input type="hidden" name="firstname" id="firstname" value="<?php echo $firstname; ?>" />
<input type="hidden" name="lastname" id="lastname" value="<?php echo $lastname; ?>" />
<input type="hidden" name="company" id="company" value="<?php echo $company; ?>" />
<input type="hidden" name="visit_type" id="visit_type" value="<?php echo $visit_type; ?>" />
<input type="hidden" name="v_signature" id="v_signature" value="<?php echo $v_signature; ?>" />
<input type="hidden" name="e_signature" id="e_signature" value="<?php echo $e_signature; ?>" />
<input type="hidden" name="escort" id="escort" value="<?php echo $escort; ?>" />
<a class="btn btn-lg btn-danger" href="index.php"><?php echo $transLang['CANCEL']; ?></a>
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['SIGNIN']; ?></button>
</div>
</div>
</form>
</div>
<!-- END CONTENT -->
<!-- START TERMS MODAL -->
<div class="modal fade" id="termsModalLong" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="termsModalLongTitle"><?php echo $transLang['TERMSTITLE']; ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<object type="application/pdf" data="<?php echo $StaticFunctions->getRules(); ?>" width="700" height="600">_</object>
</div>
</div>
</div>
</div>
<!-- END TERMS MODAL -->
<?php } else { ?>
<!-- START ERROR -->
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
</div>
</div>
<!-- END ERROR -->
<?php }; ?>
<?php }; require_once("inc/footer.inc.php"); ?>

View File

@ -49,47 +49,61 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME header('Location: index.php'); // ELSE HOME
} else { ?> } else { ?>
<!-- CONTENT START -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
echo $VisitActions->newVisit($_POST['firstname'], $_POST['lastname'], $_POST['company'], $_POST['visit_type'], $StaticFunctions->getUTC(), $_POST['v_signature'], $_POST['siteid'], "1", $_POST['e_signature'], $_POST['escort'], $carnum, $ssanum);
?>
<div class="container">
<div class="row">
<div class="col">
<h2><?php echo $transLang['SIGNIN_THANKYOU']; ?></h2>
</div>
</div>
<div class="row">
<table class="table table-striped">
<thead class="thead-dark">
<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>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $timenow; ?><br><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($_POST['visit_type'])[0]["visittypes_name"]]; ?></td><td><?php echo $_POST['company']; ?></td><td><?php echo $_POST['lastname']; ?>, <?php echo $_POST['firstname']; ?><br><img src="<?php echo $_POST['v_signature']; ?>" width="200" height="50" /></td><td><?php if (!empty($_POST['escort'])): echo $_POST['escort']; endif; ?><br /><?php if (!empty($_POST['e_signature'])): ?><img src="<?php echo $_POST['e_signature']; ?>" width="200" height="50" /><?php endif; ?></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
</div>
</div>
<?php } else { // EXIT IF NO POST
?>
<div class="container">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
<?php }; ?>
<div class="container">
<a href="index.php" class="btn btn-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true">&nbsp<br /><?php echo $transLang['HOME']; ?><br />&nbsp</a>
</div>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php"); <!-- START CONTENT -->
<?php if (!empty($_POST)) { // PROCESS POST
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
echo $VisitActions->newVisit($_POST['firstname'], $_POST['lastname'], $_POST['company'], $_POST['visit_type'], $StaticFunctions->getUTC(), $_POST['v_signature'], $_POST['siteid'], "1", $_POST['e_signature'], $_POST['escort'], $carnum, $ssanum);
?>
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-sign-in-alt"></i> <?php echo $transLang['SIGNIN_THANKYOU']; ?></h2>
</div>
</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<table class="table table-striped">
<thead class="thead-dark">
<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>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $timenow; ?><br><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($_POST['visit_type'])[0]["visittypes_name"]]; ?></td><td><?php echo $_POST['company']; ?></td><td><?php echo $_POST['lastname']; ?>, <?php echo $_POST['firstname']; ?><br><img src="<?php echo $_POST['v_signature']; ?>" width="200" height="50" /></td><td><?php if (!empty($_POST['escort'])): echo $_POST['escort']; endif; ?><br /><?php if (!empty($_POST['e_signature'])): ?><img src="<?php echo $_POST['e_signature']; ?>" width="200" height="50" /><?php endif; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<p><?php echo $transLang['ACKNOWLEDGEMENT']; ?></p>
<?php } ?>
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
</div>
</div>
<div class="row row-cols-1">
<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['HOME']; ?><br />&nbsp</a>
</div>
</div>
<!-- END CONTENT -->
<?php } else { ?>
<!-- START ERROR -->
<div class="container">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
</div>
</div>
<!-- END ERROR -->
<?php }; ?>
<?php }; require_once("inc/footer.inc.php"); ?>

View File

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

View File

@ -98,13 +98,13 @@
<fieldset id="editor"> <fieldset id="editor">
<div class="form-row"> <div class="form-row">
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="firstname"><?php echo $transLang['FIRSTNAME']; ?></span> <span class="input-group-text" id="firstname"><?php echo $transLang['FIRSTNAME']; ?></span>
</div> </div>
<input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/> <input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div> </div>
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="lastname"><?php echo $transLang['LASTNAME']; ?></span> <span class="input-group-text" id="lastname"><?php echo $transLang['LASTNAME']; ?></span>
</div> </div>
<input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/> <input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
@ -112,13 +112,13 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['USERNAME']; ?></span> <span class="input-group-text" id="username"><?php echo $transLang['USERNAME']; ?></span>
</div> </div>
<input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/> <input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div> </div>
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="email"><?php echo $transLang['EMAIL']; ?></span> <span class="input-group-text" id="email"><?php echo $transLang['EMAIL']; ?></span>
</div> </div>
<input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/> <input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
@ -126,10 +126,10 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['ACCESS_LEVEL']; ?></span> <span class="input-group-text" id="username"><?php echo $transLang['ACCESS_LEVEL']; ?></span>
</div> </div>
<select class="custom-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required> <select class="form-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
<?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?> <?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"<?php if ($row['usertypes_id']==$edituser["0"]["users_usertypeid"]) { echo " selected"; } ?>><?php echo $transLang[$row['usertypes_name']]; ?></option> <option value="<?php echo $row['usertypes_id']; ?>"<?php if ($row['usertypes_id']==$edituser["0"]["users_usertypeid"]) { echo " selected"; } ?>><?php echo $transLang[$row['usertypes_name']]; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
@ -138,10 +138,10 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col input-group"> <div class="col input-group">
<div class="input-group-prepend"> <div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['SITE']; ?></span> <span class="input-group-text" id="username"><?php echo $transLang['SITE']; ?></span>
</div> </div>
<select id="sitepermissions" name="sitepermissions[]" class="custom-select" multiple size="5"> <select id="sitepermissions" name="sitepermissions[]" class="form-select" multiple size="5">
<?php foreach($SiteInfo->listSite("0", "0") as $row): ?> <?php foreach($SiteInfo->listSite("0", "0") as $row): ?>
<option value="<?php echo $row['sites_id']; ?>"<?php if ($SiteInfo->readSitePermissionBySiteAndUser($row['sites_id'], $edituser["0"]["users_id"])=="1") { echo " selected"; } ?>><?php echo $row['sites_name']; ?></option> <option value="<?php echo $row['sites_id']; ?>"<?php if ($SiteInfo->readSitePermissionBySiteAndUser($row['sites_id'], $edituser["0"]["users_id"])=="1") { echo " selected"; } ?>><?php echo $row['sites_name']; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
@ -385,7 +385,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
<?php } ?> <?php } ?>
<div class="row"> <div class="row">
<div class="col-sm"> <div class="col-sm">
<select class="custom-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required> <select class="form-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
<option value="" selected><?php echo $transLang['CHOOSE']; ?> <?php echo $transLang['ACCESS_LEVEL']; ?></option><?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?> <option value="" selected><?php echo $transLang['CHOOSE']; ?> <?php echo $transLang['ACCESS_LEVEL']; ?></option><?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option><?php endforeach; ?> <option value="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option><?php endforeach; ?>
</select> </select>