Add current job indicator

This commit is contained in:
Skylar Ittner 2018-01-06 22:56:55 -07:00
parent 15ebdccd00
commit c0fab1e596
2 changed files with 13 additions and 1 deletions

View File

@ -155,5 +155,6 @@ define("STRINGS", [
"choose a group" => "Choose a group", "choose a group" => "Choose a group",
"all groups" => "All Groups", "all groups" => "All Groups",
"shift name" => "Shift Name", "shift name" => "Shift Name",
"workers" => "Workers" "workers" => "Workers",
"current job" => "Current job: "
]); ]);

View File

@ -8,6 +8,17 @@ require_once __DIR__ . '/../required.php';
redirectifnotloggedin(); redirectifnotloggedin();
?> ?>
<div class="btn-group mgn-btm-10px"> <div class="btn-group mgn-btm-10px">
<div class="btn btn-default">
<?php
lang("current job");
$currentjob = $database->get('job_tracking', ['[>]jobs' => ['jobid']], ['jobname (name)', 'color'], ["AND" => ["uid" => $_SESSION['uid'], 'end' => null]]);
if (!$currentjob) {
$currentjob = ["color" => "white", "name" => lang("none", false)];
}
echo ' <span class="label label-' . $currentjob['color'] . '">&nbsp;&nbsp;</span> ' . $currentjob['name'];
?>
</div>
<?php <?php
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) { if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?> ?>