Add EMEA fields

This commit is contained in:
Josh North 2018-10-22 09:59:34 -04:00
parent c4e0fcc8c4
commit 34c531b74c
10 changed files with 59 additions and 7 deletions

View File

@ -154,7 +154,7 @@
<table class="table">
<thead class="thead-dark">
<tr>
<th><?php echo $transLang['TIMEREASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['VALIDATIONS']; ?></th><th><?php echo $transLang['BADGEINITIALS']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th><th>&nbsp</th>
<th><?php echo $transLang['TIMEREASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['VALIDATIONS']; ?></th><th><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th><?php echo $transLang['CARNUM'] . "/" . $transLang['SSANUM']; ?></th><?php }; ?><th><?php echo $transLang['ACTIONS']; ?></th><th>&nbsp</th>
</tr>
</thead>
<tbody>
@ -191,6 +191,9 @@
<?php }; ?>
</td>
<td><input type="text" id="badge" name="badge" class="form-control" autofocus disabled value="<?php echo $row['visits_badge']; ?>"> <input type="text" id="initials" name="initials" class="form-control" autofocus disabled value="<?php echo $row['visits_initials']; ?>"></td>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<td><?php echo $row['visits_carnum']; ?> / <?php echo $row['visits_ssanum']; ?></td>
<?php }; ?>
<td> </td>
<td><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block"><i class="fas fa-sign-out-alt"></i>&nbsp<?php echo $transLang['SIGNOUT']; ?></button><br>
<div>
@ -224,6 +227,9 @@
<input type="text" id="initials" name="initials" class="form-control<?php if( isset($initials_error) && $initials_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" placeholder="<?php echo $transLang['INITIALS']; ?>" autofocus maxlength="5">
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
</td>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<td><?php echo $row['visits_carnum']; ?> / <?php echo $row['visits_ssanum']; ?></td>
<?php }; ?>
<td>
<button type="submit" name="approvevisit" value="<?php echo $visitid; ?>" class="btn btn-success btn-block"><i class="fas fa-thumbs-up"></i>&nbsp;<?php echo $transLang['APPROVE']; ?></button><br /><button type="submit" name="voidvisit" value="<?php echo $visitid; ?>" class="btn btn-danger btn-block" onsubmit="return confirm('<?php echo $transLang['VOID_WARNING']; ?>')"><i class="fas fa-thumbs-down"></i>&nbsp;<?php echo $transLang['VOID']; ?></button>
</td>

View File

@ -68,6 +68,26 @@
</div>
</div>
</div>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<div class="row">
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['CARNUM']; ?></span>
</div>
<input type="text" id="company" name="carnum" class="form-control" placeholder="<?php echo $transLang['CARNUM']; ?>" required autofocus>
</div>
</div>
<div class="col-sm">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon3"><?php echo $transLang['SSANUM']; ?></span>
</div>
<input type="text" id="company" name="ssanum" class="form-control" placeholder="<?php echo $transLang['SSANUM']; ?>" required autofocus>
</div>
</div>
</div>
<?php }; ?>
<div class="row">
<div class="col-sm">
<div class="input-group mb-3">

View File

@ -52,7 +52,9 @@
<!-- CONTENT START -->
<?php if (!empty($_POST)) { // PROCESS POST
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']);
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">

10
src/Database/VisitActions.php Executable file → Normal file
View File

@ -35,6 +35,7 @@ class VisitActions {
";
$database = new \App\LobbySIO\Database\Connect();
$count = $database->runQuery($query);
return $count;
}
public function voidVisit ($visitid, $approved) {
@ -45,6 +46,7 @@ class VisitActions {
";
$database = new \App\LobbySIO\Database\Connect();
$count = $database->runQuery($query);
return $count;
}
public function approveVisit ($approvevisit, $id_type, $id_checked, $citizen, $badge, $initials, $approved) {
@ -61,18 +63,20 @@ class VisitActions {
";
$database = new \App\LobbySIO\Database\Connect();
$count = $database->runQuery($query);
return $count;
}
public function newVisit ($firstname, $lastname, $company, $reason, $intime, $signature, $siteid, $approved, $escort_signature, $escort) {
public function newVisit ($firstname, $lastname, $company, $reason, $intime, $signature, $siteid, $approved, $escort_signature, $escort, $carnum, $ssanum) {
$query = "
INSERT INTO " . Registry::DB_PRFX . "visits (" . Registry::DB_PRFX . "visits.firstname, " . Registry::DB_PRFX . "visits.lastname,
" . Registry::DB_PRFX . "visits.company, " . Registry::DB_PRFX . "visits.reason, " . Registry::DB_PRFX . "visits.intime,
" . Registry::DB_PRFX . "visits.signature, " . Registry::DB_PRFX . "visits.site_id, " . Registry::DB_PRFX . "visits.approved,
" . Registry::DB_PRFX . "visits.escort_signature, " . Registry::DB_PRFX . "visits.escort)
" . Registry::DB_PRFX . "visits.escort_signature, " . Registry::DB_PRFX . "visits.escort, " . Registry::DB_PRFX . "visits.carnum, " . Registry::DB_PRFX . "visits.ssanum)
VALUES (\"$firstname\", \"$lastname\", \"$company\", \"$reason\", \"$intime\", \"$signature\", \"$siteid\",
\"$approved\", \"$escort_signature\", \"$escort\")
\"$approved\", \"$escort_signature\", \"$escort\", \"$carnum\", \"$ssanum\")
";
$database = new \App\LobbySIO\Database\Connect();
$count = $database->runQuery($query);
return $count;
}
}

View File

@ -62,7 +62,9 @@ class VisitInfo {
" . Registry::DB_PRFX . "visits.badge as visits_badge,
" . Registry::DB_PRFX . "visits.site_id as visits_site_id,
" . Registry::DB_PRFX . "visits.company as visits_company,
" . Registry::DB_PRFX . "visits.approved as visits_approved
" . Registry::DB_PRFX . "visits.approved as visits_approved,
" . Registry::DB_PRFX . "visits.approved as visits_carnum,
" . Registry::DB_PRFX . "visits.approved as visits_regnum
FROM " . Registry::DB_PRFX . "visits
WHERE " . $cond_siteid . Registry::DB_PRFX . "visits.approved>=\"$approved\" AND " . $cond_outtime . $cond_intime . Registry::DB_PRFX . "visits.id LIKE \"$visitid\"" . $cond_rowsperpage . $cond_offset;
$database = new \App\LobbySIO\Database\Connect();

View File

@ -19,6 +19,7 @@ APP_NAME = 'Empfangshalle Einloggen / Ausloggen'
BACK = 'Zurückkehren'
BADGE = 'Abzeichen-Nummer'
BADGEINITIALS = 'Abzeichen-Nummer & Initialen'
CARNUM = 'Autokennzeichen'
CHANGE = 'Wechseln'
CHOOSE = 'Wählen'
CITIZEN = 'Bürger?'
@ -114,6 +115,7 @@ SIGNOUT_THANKYOU = 'Danke - Sie wurden erfolgreich abgemeldet.'
SINCE = 'seit'
SITE = 'Site'
SOFTWARE_VERSION = 'Version'
SSANUM = 'SSA-Ticketnummer'
START = 'Anfang'
STATEID = 'Staat ID'
TERMSTITLE = 'Unsere Regeln'

View File

@ -19,6 +19,7 @@ APP_NAME = 'Lobby Sign-In/Sign-Out'
BACK = 'Back'
BADGE = 'Badge#'
BADGEINITIALS = 'Badge & Initials'
CARNUM = 'Car Registration #'
CHANGE = 'Change'
CHOOSE = 'Choose'
CITIZEN = 'Citizen?'
@ -114,6 +115,7 @@ SIGNOUT_THANKYOU = 'Thank you - you have been successfully signed out.'
SINCE = 'since'
SITE = 'Site'
SOFTWARE_VERSION = 'Version'
SSANUM = 'SSA Ticket #'
START = 'Start'
STATEID = 'State ID'
TERMSTITLE = 'Our Rules'

View File

@ -19,6 +19,7 @@ APP_NAME = 'Lobby de inicio / cierre de sesión'
BACK = 'Inicia'
BADGE = 'Numero de placa'
BADGEINITIALS = 'Numero de placa & Sigla'
CARNUM = 'Numero de registro del carro'
CHANGE = 'Cambiar'
CHOOSE = 'Por favor seleccione'
CITIZEN = 'Ciudadano de estados unidos?'
@ -114,6 +115,7 @@ SIGNOUT_THANKYOU = 'Gracias, te has desconectado.'
SINCE = 'desde'
SITE = 'Sitio'
SOFTWARE_VERSION = 'Versión del software'
SSANUM = 'Número de boleto de la SSA'
START = 'Comienzo'
STATEID = 'Identificación del estado'
TERMSTITLE = 'Nuestras reglas'

View File

@ -19,6 +19,7 @@ APP_NAME = 'Vestibule register/se désinscrire'
BACK = 'Retour'
BADGE = 'Numéro de badge'
BADGEINITIALS = 'Numéro de badge & Initiales'
CARNUM = 'Numéro d&#39;immatriculation'
CHANGE = 'Changement'
CHOOSE = 'Choisir'
CITIZEN = 'Citoyen?'
@ -114,6 +115,7 @@ SIGNOUT_THANKYOU = 'Merci - vous avez été déconnecté avec succès.'
SINCE = 'depuis'
SITE = 'Site'
SOFTWARE_VERSION = 'Version'
SSANUM = 'Numéro de billet SSA'
START = 'Début'
STATEID = 'State ID'
TERMSTITLE = 'Nos règles'

View File

@ -51,6 +51,16 @@
<?php if (isset($session_user)) { if($session_user["0"]["users_usertype"] !== "ADMIN") { header("Location: index.php"); ?><h2 class="content-subhead"><?php echo $transLang['NOT_AUTHORIZED']; ?></h2><?php }; }; ?>
<?php if (!empty($_POST['edituser'])): // NEW SITE
//$SiteInfo->addSite($_POST['sitename'], $_POST['timezone'], $_POST['region']);
//header('Location: ' . $_SERVER['PHP_SELF']);
endif;
?>
<?php // POST ACTIONS
if (!empty($_POST['newsite'])): // NEW SITE
@ -126,7 +136,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
<tbody>
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
<tr>
<td><?php echo $row['users_lastname'] . ", " . $row['users_firstname']; ?></td><td><?php echo $row['users_username']; ?></td><td><?php echo $row['users_email']; ?></td><td><?php echo $row['users_created']; ?></td><td><?php echo $transLang[$row['users_usertype']]; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row['users_id']; ?>" /><button class="btn btn-danger btn-sm" id="deluser" name="deluser" value="deluser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-trash"></i> </button></form></td>
<td><?php echo $row['users_lastname'] . ", " . $row['users_firstname']; ?></td><td><?php echo $row['users_username']; ?></td><td><?php echo $row['users_email']; ?></td><td><?php echo $row['users_created']; ?></td><td><?php echo $transLang[$row['users_usertype']]; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row['users_id']; ?>" /><button class="btn btn-primary btn-sm" id="edituser" name="edituser" value="edituser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-edit"></i> </button><button class="btn btn-danger btn-sm" id="deluser" name="deluser" value="deluser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-trash"></i> </button></form></td>
</tr>
<?php endforeach; ?>
</tbody>