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

View File

@ -84,24 +84,17 @@
?>
<!doctype html>
<html lang="<?php echo $app_disp_lang; ?>">
<!-- HEADER CONTENT -->
<!-- START HEAD -->
<head>
<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"/>
<link rel="manifest" href="manifest.webmanifest">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Sign-In/Sign-Out">
<meta name="apple-mobile-web-app-title" content="<?php echo $transLang['APP_NAME']; ?>">
<link rel="apple-touch-icon" href="assets/touch-logo.png">
<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']) == 'signout.php'): ?>
<?php if (!empty($_POST['endvisit'])): ?>
<meta http-equiv="refresh" content="5; url=index.php" />
<?php endif; ?>
<?php endif; ?>
<?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']) == 'signout.php'): ?><?php if (!empty($_POST['endvisit'])): ?> <meta http-equiv="refresh" content="5; url=index.php" /><?php endif; ?><?php endif; ?>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/sticky-footer-navbar.css">
<link rel="stylesheet" href="css/all.min.css"/>
@ -109,14 +102,9 @@
<link rel="stylesheet" href="css/datatables.min.css" />
<link rel="stylesheet" href="css/styles.css"/>
<link rel="stylesheet" href="css/tempusdominus-bootstrap-4.min.css"/>
<link rel="stylesheet" href="css/ie10-viewport-bug-workaround.css">
<!-- [if lt IE 9]>
<script src="js/html5shiv.js" type="text/javascript"></script>
<script src="js/respond.min.js" type="text/javascript"></script>
<![endif] -->
<meta name="description" content="<?php echo $transLang['META_DESC']; ?>" />
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/datatables.min.js"></script>
<script src="js/buttons.flash.min.js"></script>
<script src="js/buttons.html5.min.js"></script>
@ -130,48 +118,54 @@
<script src="js/jSignature.min.js"></script>
<title><?php echo $StaticFunctions->getTitle($app_current_pagename, $app_disp_lang); ?></title>
</head>
<!-- END HEAD -->
<!-- START BODY -->
<body>
<!-- NAVBAR START -->
<div class="container">
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
<!-- START NAVBAR -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="index.php"><img src="<?php echo $StaticFunctions->getLogo(); ?>" width="120" height="60" alt=""></a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<?php if ($session_status == true): ?>
<!-- MENU FOR ALL LOGGED IN -->
<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<?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<?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>
<!-- START NAVBAR MENU FOR ALL LOGGED IN -->
<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>
<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>
<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>
<!-- END NAVBAR MENU FOR ALL LOGGED IN -->
<?php endif; ?>
<?php if (isset($session_user)) { if ($session_user["0"]["users_usertype"] == "ADMIN"): ?>
<!-- ADDITIONAL MENU IF LOGGED IN AS ADMIN -->
<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>
<!-- START NAVBAR MENU FOR ADMIN LOGGED IN -->
<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>
<!-- END NAVBAR MENU FOR ADMIN LOGGED IN -->
<?php endif; }; ?>
<?php if ($session_status == false): ?>
<!-- MENU FOR ALL LOGGED OUT -->
<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>
<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>
<!-- START NAVBAR MENU FOR ALL LOGGED OUT - BOTTOM END -->
<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"><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>
</ul>
<ul class="navbar-nav mr-sm-2">
<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-success<?php if ($app_current_pagename==$transLang['LOGIN']): echo " active"; endif; ?>" href="login.php"><i class="fas fa-cogs"></i> </a></li>
<!-- END NAVBAR MENU FOR ALL LOGGED OUT - BOTTOM END -->
<?php endif; ?>
<?php if ($session_status == true): ?>
<!-- MENU FOR ALL LOGGED IN - BOTTOM END -->
<!-- START NAVBAR MENU FOR ALL LOGGED IN - BOTTOM END -->
</ul>
<ul class="navbar-nav mr-sm-2">
<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 if (Registry::AUTHMETHOD == 'SAML') { ?>
<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>
<!-- SAML SESSION BUTTONS -->
<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 } else { ?>
<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>
<!-- BUILTIN SESSION BUTTONS -->
<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>
<?php } ?>
<!-- END NAVBAR MENU FOR ALL LOGGED IN - BOTTOM END -->
<?php endif; ?>
<form action="changelang.php" method="post" name="changelang" class="changelang">
<div class="input-group mb-3">
<select class="form-control custom-select btn btn-outline-secondary" id="app_disp_lang" aria-label="Language" name="app_disp_lang">
<div class="input-group">
<select class="form-select btn-outline-secondary" id="app_disp_lang" 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>
@ -180,32 +174,27 @@
</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>
</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="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<button type="button" class="btn-close" data-bs-dismiss="modal"></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>
<form class="row g-3" action="changesite.php" method="post">
<div class="input-group">
<select class="form-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']; ?>" />
<button class="btn btn-primary" type="submit" value="<?php echo $transLang['SAVE']; ?>"><?php echo $transLang['SAVE']; ?></button>
</div>
</form>
</div>
@ -226,4 +215,4 @@
}
});
</script>
<!-- MODAL END -->
<!-- END MODAL -->

247
index.php
View File

@ -77,54 +77,42 @@
$app_current_pagename = $transLang['HOME']; // PAGE SETUP
$app_current_pageicon = '<i class="fas fa-home"></i> ';
require_once("inc/header.inc.php");
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
?>
<!-- GUEST CONTENT START -->
<div class="jumbotron">
<div class="container">
<div class="row">
<div class="col-sm">
<div class="alert alert-info text-center">
<?php echo $transLang['WELCOMETO'] . " " . $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?>
<?php if ($StaticFunctions->getUserSessionStatus() == false) { ?>
<!-- START GUEST CONTENT -->
<div class="container-fluid">
<div class="row">&nbsp;</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<div class="alert alert-info text-center"><?php echo $transLang['WELCOMETO'] . " " . $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm">
&nbsp;
</div>
<div class="col-sm">
<div class="container-fluid">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<button class="btn btn-outline-danger btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" disabled><i class="fas fa-4x fa-sign-in-alt"></i><img src="<?php echo $StaticFunctions->getLogoText(); ?>" height="140" width="370"></img><i class="fas fa-4x fa-sign-out-alt"></i><br /><h1><?php echo $transLang['APP_NAME']; ?></h1></button>
</div>
<div class="col-sm">
&nbsp;
</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 -->
<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>
<!-- GUEST CONTENT END -->
<?php
} else {
?>
<?php } else { ?>
<?php
//on login see if user name fields are set and if not copy from saml when using saml, and then reload
@ -133,29 +121,17 @@ if (Registry::AUTHMETHOD == 'SAML') {
if (empty($Users->readUserFirstAndLast($uid)[0]["users_lastname"])) {
$Users->updateSamlFirstAndLast($uid, $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'][0], $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'][0]);
?>
<div class="jumbotron">
<div class="container">
<div class="row">
<div class="col-sm">
&nbsp;
</div>
<div class="col-sm">
<!-- START USER INIT CONTENT -->
<div class="container-fluid">
<div class="row">&nbsp;</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<a class="btn btn-outline-success btn-lg btn-block" tabindex="-1" role="button" aria-disabled="true" href="index.php"><?php echo $transLang['REFRESH']; ?></a>
</div>
<div class="col-sm">
&nbsp;
</div>
</div>
</div>
</div>
<?php
die;
}
}
}
?>
<!-- END USER INIT CONTENT -->
<?php die; } } } ?>
<!-- USER CONTENT START -->
@ -171,13 +147,9 @@ if (Registry::AUTHMETHOD == 'SAML') {
echo $VisitActions->endVisit($_POST['endvisit'], $StaticFunctions->getUTC());
}
}
if (!empty($_POST['voidvisit'])) {
echo $VisitActions->voidVisit($_POST['voidvisit'], "0", $_POST['voidnotes']);
}
// If post is approved, save after error checking.
if (!empty($_POST['approvevisit'])) {
if (empty($_POST['id_type'])) { $id_type_error="1"; }
@ -189,10 +161,8 @@ if (Registry::AUTHMETHOD == 'SAML') {
if (empty($_POST['citizen'])) { $citizen_error="1"; }
elseif ($_POST['citizen'] === "00") { $citizen_error="1"; }
else { $citizen_error="0";
if (isset($_POST['id_type']) && $_POST['id_type'] === 1 && isset($_POST['id_reference'])) { $id_reference_error="0"; }
elseif (isset($_POST['id_type']) && $_POST['id_type'] === 1 && empty($_POST['id_reference'])) { $id_reference_error="1"; }
$approved="2";
echo $VisitActions->approveVisit($_POST['approvevisit'], $_POST['id_type'], $_POST['id_reference'], $_POST['citizen'], $_POST['badge'], $_POST['initials'], $approved);
}
@ -200,10 +170,8 @@ if (Registry::AUTHMETHOD == 'SAML') {
}
}
}
// check all unapproved or approved
$approval = "1";
// Set up pagination
$page_num = 1;
if(!empty($_GET['pnum'])):
@ -217,84 +185,75 @@ if (Registry::AUTHMETHOD == 'SAML') {
$page_count = 0;
if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctions->getPageRows()); if($page_num > $page_count): $page_num = 1; endif; endif;
?>
<!-- modals -->
<script>
$(document).on("click", ".open-voidModal", function (e) {
e.preventDefault();
var _self = $(this);
var myVoidId = _self.data('id');
$("#voidvisit").val(myVoidId);
$(_self.attr('href')).modal('show');
});
</script>
<!-- void notes -->
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog" aria-labelledby="declinenotesmodal" aria-hidden="true">
<div class="modal-dialog" role="document">
<!-- 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">
<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 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 class="modal-footer">
</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="container-fluid">
<div class="row">&nbsp;<br>&nbsp;
</div>
<div class="row">
<div class="col-sm">
<!-- 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-sm">
<a href="index.php" type="button" class="btn btn-success btn-lg btn-block"><?php echo $transLang['REFRESH']; ?></a>
<div class="col d-grid gap-2">
<a href="index.php" type="button" class="btn btn-success btn-lg"><?php echo $transLang['REFRESH']; ?></a>
</div>
</div>
<?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 class="row row-cols-1">
<div class="col d-grid gap-2">
<ul class="pagination pagination-sm">
<li class="page-item disabled"><a class="page-link" href="#" tabindex="-1"><?php echo $transLang['PAGE']; ?></a></li>
<?php for ($i = 1; $i <= $page_count; $i++): ?>
<li class="page-item<?php if ($i === $page_num): echo ' active'; else: echo ' '; endif; ?>"><a class="page-link" href="<?php echo $_SERVER['PHP_SELF'] . '?pnum=' . $i; ?>"><?php echo $i; ?></a></li>
<?php endfor; ?>
</ul>
</div>
</div>
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<table class="table table-sm table-responsive-sm text-nowrap">
<thead class="thead-dark">
<tr>
@ -316,44 +275,49 @@ $(document).on("click", ".open-voidModal", function (e) {
<tr class="alert alert-warning">
<?php }; ?>
<form class="form form-approve" method="post">
<td class="small"><div><span class="badge badge-light"><?php echo $timein_disp; ?></span></div><div><span class="badge badge-light"><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]["visittypes_name"]]; ?></span></div></td>
<td class="small">
<div>
<span class="badge bg-light text-dark"><?php echo $timein_disp; ?></span>
</div>
<div>
<span class="badge bg-light text-dark"><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]["visittypes_name"]]; ?></span>
</div>
</td>
<td class="small"><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50"></img></td>
<td class="small"><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50"></img>'; } ?></td>
<td class="small">
<?php if($row['visits_approved'] === 2) { ?>
<div>
<span class="badge badge-light"><?php echo $transLang['ID_TYPE']; ?></span> <?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]["idtypes_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>
<?php if($row['visits_id_type'] === 1) { ?>
<div>
<span class="badge badge-light"><?php echo $transLang['TICKET']; ?></span> <?php echo $row['visits_id_reference']; ?>
<span class="badge bg-light text-dark"><?php echo $transLang['TICKET']; ?></span> <?php echo $row['visits_id_reference']; ?>
</div>
<?php }; ?>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<div>
<span class="badge badge-light"><?php echo $transLang['COUNTRY']; ?>?</span> <?php echo $VisitInfo->getCountryInfo($row['visits_citizen'])[0]["countries_name"]; ?>
<span class="badge bg-light text-dark"><?php echo $transLang['COUNTRY']; ?>?</span> <?php echo $VisitInfo->getCountryInfo($row['visits_citizen'])[0]["countries_name"]; ?>
</div>
<?php }; ?>
</td>
<td class="small">
<div>
<span class="badge badge-light"><?php echo $transLang['BADGE']; ?></span> <?php echo $row['visits_badge']; ?>
<span class="badge bg-light text-dark"><?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;
<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") { ?>
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
<?php }; ?>
<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="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>
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><i class="fas fa-clock"></i></span>
<input placeholder="<?php echo $transLang['OPTIONAL']; ?>" name="outtime" type="text" class="form-control form-control-sm bg-white datetimepicker-input datetimepicker-<?php echo $row['visits_id']; ?>" id="datetimepicker-<?php echo $row['visits_id']; ?>" data-toggle="datetimepicker" data-target=".datetimepicker-<?php echo $row['visits_id']; ?>"/>
<script type="text/javascript">
$(function () {
@ -361,11 +325,11 @@ $(document).on("click", ".open-voidModal", function (e) {
});
</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">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['ID_TYPE']; ?></span>
<select class="form-control form-control-sm bg-white form-select<?php if( isset($id_type_error) && $id_type_error === 1 && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="id_type-<?php echo $row['visits_id']; ?>" aria-label="ID Type" name="id_type">
<option value="" selected><?php echo $transLang['SELECTID']; ?></option>
<?php foreach($IDTypeInfo->getIDTypeInfo("%") as $row): ?>
<option value="<?php echo $row['idtypes_id']; ?>"><?php echo $transLang[$row['idtypes_name']]; ?></option>
@ -373,8 +337,7 @@ $(document).on("click", ".open-voidModal", function (e) {
</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>
<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>
@ -393,8 +356,9 @@ $(document).on("click", ".open-voidModal", function (e) {
$('#id_type-<?php echo $visitid; ?>').trigger("change");
</script>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['COUNTRY']; ?></span></div>
<select class="form-control form-control-sm bg-white custom-select<?php if( isset($citizen_error) && $citizen_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" id="citizen-<?php echo $visitid; ?>" name="citizen">
<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>
@ -402,10 +366,8 @@ $(document).on("click", ".open-voidModal", function (e) {
</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>
<span class="badge bg-danger"><?php echo $transLang['SANCTIONED']; ?></span>
</div>
<script type="text/javascript">
$('#citizen-<?php echo $visitid; ?>').change(function() {
@ -421,28 +383,27 @@ $(document).on("click", ".open-voidModal", function (e) {
});
$('#citizen-<?php echo $visitid; ?>').trigger("change");
</script>
<?php }; ?>
<td class="small">
<div class="input-group input-group-sm mb-0"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><?php echo $transLang['BADGE']; ?></span></div>
<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 type="hidden" id="initials" name="initials" placeholder="<?php echo $uid; ?>" value="<?php echo $uid; ?>">
<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">
<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">
<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"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"><i class="fas fa-clock"></i></span></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 () {
@ -458,9 +419,9 @@ $(document).on("click", ".open-voidModal", function (e) {
</tbody>
</table>
</div>
</div>
</div>
<!-- END VISITS LIST -->
<!-- USER CONTENT END -->
<?php }; require_once("inc/footer.inc.php");
<?php }; require_once("inc/footer.inc.php"); ?>

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
*/
(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>",
{"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
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- START CONTENT -->
<?php
// hash password for comparison
require_once("src/Misc/PasswordHash.php");
@ -97,16 +98,15 @@ if (!empty($_POST)):
endif;
endif;
?>
<div class="container">
<div class="row">
<div class="col-sm">
<div class="row row-cols-2">
<div class="col d-grid gap-2">
<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['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 class="col d-grid gap-2">
<button type="button" class="btn btn-block btn-lg btn-success" data-bs-toggle="modal" data-bs-target="#sitetimeModal"><?php echo $transLang['CHANGE']; ?></button>
</div>
</div>
<br />
@ -117,7 +117,7 @@ endif;
<?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="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>
</div>
<?php } else { ?>

View File

@ -76,8 +76,9 @@
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
echo $StaticFunctions->killSession(); // ELSE DIE
} else { ?>
<!-- CONTENT START -->
<!-- START CONTENT -->
<?php
$minpasslength = $StaticFunctions->getMinPass();
if (isset($_POST['saveprofile'])):
@ -101,8 +102,8 @@
endif;
?>
<div class="container">
<div class="row">
<div class="col-sm">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h2><i class="fas fa-user-circle"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2>
</div>
</div>
@ -111,34 +112,70 @@
<?php } ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset>
<div class="form-group row">
<label for="username" class="col-sm-2 col-form-label"><?php echo $transLang['USERNAME']; ?></label>
<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>
<label for="created" class="col-sm-2 col-form-label"><?php echo $transLang['CREATED']; ?></label>
<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>
<label for="usertype" class="col-sm-2 col-form-label"><?php echo $transLang['USERTYPE']; ?></label>
<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 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>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['CREATED']; ?></span>
<input class="form-control form-control-sm" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" 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['USERTYPE']; ?></span>
<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>
</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 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 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="col-sm">
<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>
</div>
<select name="reporttype" class="form-control">
@ -107,7 +107,7 @@
</div>
<div class="col-sm">
<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>
</div>
<?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?>
@ -125,7 +125,7 @@
<div class="form-group row">
<div class='col-sm'>
<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>
<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 class='col-sm'>
<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>
<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,11 +48,11 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- START CONTENT -->
<div class="container">
<div class="row">
<div class="col-sm">
<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>
@ -99,15 +99,15 @@
<div class="invalid-feedback">You must answer to proceed.</div>
</div>
</div>
<div class="row">&nbsp;</div>
<div class="row">
<div class="col">
<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 btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
<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() {
@ -128,7 +128,6 @@
}, false);
})();
</script>
<!-- END CONTENT -->
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php");
<?php }; require_once("inc/footer.inc.php"); ?>

View File

@ -48,64 +48,60 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- START CONTENT -->
<div class="container">
<div class="row">
<div class="col-sm">
<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_2.php" method="post">
<div class="row">
<div class="col-sm">
<div class="row row-cols-1">
<div class="col">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['NAME']; ?>:</span>
</div>
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<input type="text" id="firstname" name="firstname" class="form-control" placeholder="<?php echo $transLang['FIRST']; ?>" required autofocus>
<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="row row-cols-1">
<div class="col">
<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>
<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 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>
<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">
<div class="col-sm">
<div class="row row-cols-1">
<div class="col">
<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>
<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">
<div class="col">
<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 btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
<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,8 +48,10 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- 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'];};
@ -58,43 +60,46 @@
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
?>
<div class="container">
<div class="row">
<div class="col-sm">
<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">
<div class="col-sm">
<div class="row row-cols-1">
<div class="col">
<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>
<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">
<div class="col">
<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 btn-block" name="signin"><?php echo $transLang['NEXT']; ?></button>
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
</div>
<?php } else { // EXIT IF NO POST
?>
<!-- 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,8 +48,10 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- 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'];};
@ -59,25 +61,27 @@
if (empty($_POST['visit_type'])) { $visit_type="";} else {$visit_type=$_POST['visit_type'];};
?>
<div class="container">
<div class="row">
<div class="col-sm">
<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="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="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">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['ENAME']; ?>:</span>
</div>
<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>
<h4><?php echo $transLang['ESIGNATURE']; ?>:</h4>
<div id="esignature-parent">
<div id="esignature"></div>
@ -87,8 +91,8 @@
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<h4><?php echo $transLang['VSIGNATURE']; ?>:</h4>
<div id="vsignature-parent">
<div id="vsignature"></div>
@ -101,7 +105,7 @@
<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>
<button type="submit" id="saveBtn" class="btn btn-lg btn-success" name="signin"><?php echo $transLang['NEXT']; ?></button>
</div>
</div>
</form>
@ -111,7 +115,7 @@
// Init jSignature for Escort field ONLY after we uncollapse the escort bootstrap div
$('#collapseOne').on('shown.bs.collapse', function () {
var $esignature = $("#esignature").jSignature();
true
true;
$('#esignature').change(function() {
var data2 = $esignature.jSignature('getData');
$('#e_signature').val(data2);
@ -119,26 +123,31 @@
});
// Init jSignature for Visitor field, onchange store in text field
var $vsignature = $("#vsignature").jSignature();
true
true;
$('#vsignature').change(function() {
var data = $vsignature.jSignature('getData');
$('#v_signature').val(data);
});
});
$("form").submit(function() {
if($('#v_signature').val() == '') {
if($('#v_signature').val() === '') {
alert("<?php echo $transLang['SIGNATURE']; ?> <?php echo $transLang['REQUIRED']; ?>");
return false;
}
return true;
});
</script>
<?php } else { // EXIT IF NO POST
?>
<!-- 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,8 +48,10 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- 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'];};
@ -62,19 +64,25 @@
if (empty($_POST['escort'])) { $escort="";} else {$escort=$_POST['escort'];};
?>
<div class="container">
<div class="row">
<div class="col-sm">
<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">
<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") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
<?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>
<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>
</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; ?>" />
@ -85,38 +93,38 @@
<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>
<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>
<!-- TERMS MODAL START -->
<div class="modal fade" id="termsModalLong" tabindex="-1" role="dialog" aria-labelledby="termsModalLongTitle" aria-hidden="true">
<!-- 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="close" data-dismiss="modal" aria-label="<?php echo $transLang['CLOSE']; ?>">
<span aria-hidden="true">&times;</span>
</button>
<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 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
?>
<!-- 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 }; ?>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php");
<?php }; require_once("inc/footer.inc.php"); ?>

View File

@ -49,20 +49,23 @@
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
header('Location: index.php'); // ELSE HOME
} else { ?>
<!-- CONTENT START -->
<!-- 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">
<div class="col">
<h2><?php echo $transLang['SIGNIN_THANKYOU']; ?></h2>
<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">
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<table class="table table-striped">
<thead class="thead-dark">
<tr>
@ -76,20 +79,31 @@
</tbody>
</table>
</div>
<div class="row">
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
</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>
<?php } else { // EXIT IF NO POST
?>
<div class="container">
<h2><?php echo $transLang['NOSIGNIN']; ?></h2>
</div>
<?php }; ?>
<div class="container">
<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 }; ?>
<!-- CONTENT END -->
<?php }; require_once("inc/footer.inc.php");
<?php }; require_once("inc/footer.inc.php"); ?>

View File

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

View File

@ -98,13 +98,13 @@
<fieldset id="editor">
<div class="form-row">
<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>
</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 "; } ?>/>
</div>
<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>
</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 "; } ?>/>
@ -112,13 +112,13 @@
</div>
<div class="form-row">
<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>
</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 "; } ?>/>
</div>
<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>
</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 "; } ?>/>
@ -126,10 +126,10 @@
</div>
<div class="form-row">
<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>
</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): ?>
<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; ?>
@ -138,10 +138,10 @@
</div>
<div class="form-row">
<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>
</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): ?>
<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; ?>
@ -385,7 +385,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
<?php } ?>
<div class="row">
<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="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option><?php endforeach; ?>
</select>