Browse Source

Upgrade to Bootstrap 4.0, FontAwesome 5.0, jQuery 3.3.1

master
Skylar Ittner 1 year ago
parent
commit
37e6d3e7ce
56 changed files with 1576 additions and 3942 deletions
  1. 104
    143
      app.php
  2. 57
    74
      index.php
  3. 3
    3
      lib/getjobhistorytable.php
  4. 2
    2
      lib/getpunchtable.php
  5. 1
    1
      lib/getshifttable.php
  6. 15
    15
      pages.php
  7. 2
    2
      pages/404.php
  8. 16
    18
      pages/assignshift.php
  9. 21
    25
      pages/editjob.php
  10. 21
    23
      pages/editjobhistory.php
  11. 7
    7
      pages/editjobs.php
  12. 22
    25
      pages/editpunch.php
  13. 44
    54
      pages/editshift.php
  14. 55
    58
      pages/export.php
  15. 33
    35
      pages/home.php
  16. 15
    15
      pages/jobs.php
  17. 34
    36
      pages/punches.php
  18. 29
    24
      pages/shifts.php
  19. 31
    133
      static/css/app.css
  20. 159
    0
      static/css/app.old.css
  21. 0
    5
      static/css/bootstrap-datetimepicker.min.css
  22. 9
    7
      static/css/bootstrap.min.css
  23. 5
    5
      static/css/datatables.min.css
  24. 343
    0
      static/css/fa-svg-with-js.css
  25. 0
    4
      static/css/font-awesome.min.css
  26. 11
    0
      static/css/index.css
  27. 1
    1
      static/css/material-color
  28. 20
    12
      static/css/tables.css
  29. 204
    0
      static/css/tempusdominus-bootstrap-4.min.css
  30. BIN
      static/fonts/FontAwesome.otf
  31. BIN
      static/fonts/fontawesome-webfont.eot
  32. 0
    2671
      static/fonts/fontawesome-webfont.svg
  33. BIN
      static/fonts/fontawesome-webfont.ttf
  34. BIN
      static/fonts/fontawesome-webfont.woff
  35. BIN
      static/fonts/fontawesome-webfont.woff2
  36. BIN
      static/fonts/glyphicons-halflings-regular.eot
  37. 0
    288
      static/fonts/glyphicons-halflings-regular.svg
  38. BIN
      static/fonts/glyphicons-halflings-regular.ttf
  39. BIN
      static/fonts/glyphicons-halflings-regular.woff
  40. BIN
      static/fonts/glyphicons-halflings-regular.woff2
  41. 1
    0
      static/img/minus-square.svg
  42. 1
    0
      static/img/search-plus.svg
  43. 0
    14
      static/js/addshift.js
  44. 4
    2
      static/js/assignshift.js
  45. 0
    2
      static/js/bootstrap-datetimepicker.min.js
  46. 6
    6
      static/js/bootstrap.min.js
  47. 216
    215
      static/js/datatables.min.js
  48. 1
    6
      static/js/editjob.js
  49. 14
    2
      static/js/editjobhistory.js
  50. 14
    2
      static/js/editpunch.js
  51. 26
    0
      static/js/editshift.js
  52. 15
    3
      static/js/export.js
  53. 5
    0
      static/js/fontawesome-all.min.js
  54. 0
    4
      static/js/jquery-3.2.1.min.js
  55. 2
    0
      static/js/jquery-3.3.1.min.js
  56. 7
    0
      static/js/tempusdominus-bootstrap-4.min.js

+ 104
- 143
app.php View File

@@ -1,11 +1,10 @@
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

require_once __DIR__ . "/required.php";

redirectIfNotLoggedIn();
if ($_SESSION['loggedin'] != true) {
header('Location: index.php');
die("Session expired. Log in again to continue.");
}

require_once __DIR__ . "/pages.php";

@@ -30,9 +29,13 @@ if (!is_empty($_GET['page'])) {
<title><?php echo SITE_TITLE; ?></title>

<link href="static/css/bootstrap.min.css" rel="stylesheet">
<link href="static/css/font-awesome.min.css" rel="stylesheet">
<link href="static/css/material-color/material-color.min.css" rel="stylesheet">
<link href="static/css/app.css" rel="stylesheet">
<link href="static/css/fa-svg-with-js.css" rel="stylesheet">
<script nonce="<?php echo $SECURE_NONCE; ?>">
FontAwesomeConfig = {autoAddCss: false}
</script>
<script src="static/js/fontawesome-all.min.js"></script>
<?php
// custom page styles
if (isset(PAGES[$pageid]['styles'])) {
@@ -43,151 +46,109 @@ if (!is_empty($_GET['page'])) {
?>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4">
<?php
if ((SHOW_ICON == "both" || SHOW_ICON == "app") && ICON_POSITION != "menu") {
if (MENU_BAR_STYLE != "fixed") {
?>
<img class="img-responsive banner-image" src="static/img/logo.png" />
<?php
}
}
?>

<?php
// Alert messages
if (!is_empty($_GET['msg']) && array_key_exists($_GET['msg'], MESSAGES)) {
// optional string generation argument
if (is_empty($_GET['arg'])) {
$alertmsg = lang(MESSAGES[$_GET['msg']]['string'], false);
} else {
$alertmsg = lang2(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false);
}
$alerttype = MESSAGES[$_GET['msg']]['type'];
$alerticon = "square-o";
switch (MESSAGES[$_GET['msg']]['type']) {
case "danger":
$alerticon = "times";
break;
case "warning":
$alerticon = "exclamation-triangle";
break;
case "info":
$alerticon = "info-circle";
break;
case "success":
$alerticon = "check";
break;
}
echo <<<END
<div class="row justify-content-center" id="msg-alert-box">
<div class="col-11 col-sm-6 col-md-5 col-lg-4 col-xl-4">
<div class="alert alert-dismissible alert-$alerttype">
<button type="button" class="close">&times;</button>
<i class="fas fa-$alerticon"></i> $alertmsg
</div>
</div>
</div>
<nav class="navbar navbar-default navbar-blue navbar-<?php echo MENU_BAR_STYLE; ?>-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php
if (SHOW_ICON == "both" || SHOW_ICON == "app") {
if (MENU_BAR_STYLE == "fixed" || ICON_POSITION == "menu") {
$src = "static/img/logo.png";
if ($pageid != "home") {
$src = "static/img/up-arrow-white.png";
}
END;
}
?>

<?php
// Adjust as needed
$navbar_breakpoint = "md";

// For mobile app
echo "<script nonce=\"$SECURE_NONCE\">var navbar_breakpoint = \"$navbar_breakpoint\";</script>"
?>
<nav class="navbar navbar-expand-<?php echo $navbar_breakpoint; ?> navbar-dark bg-blue fixed-top">
<button class="navbar-toggler my-0 py-0" type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navigation">
<!--<i class="fas fa-bars"></i>-->
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand py-0 mr-auto" href="app.php">
<img src="static/img/logo.svg" alt="" class="d-none d-<?php echo $navbar_breakpoint; ?>-inline brand-img py-0" />
<?php echo SITE_TITLE; ?>
</a>

<div class="collapse navbar-collapse py-0" id="navbar-collapse">
<div class="navbar-nav mr-auto py-0">
<?php
$curpagefound = false;
foreach (PAGES as $id => $pg) {
if ($pg['navbar'] === TRUE) {
if ($pageid == $id) {
$curpagefound = true;
?>
<a class="navbar-brand" href="app.php">
<img src="<?php echo $src; ?>" />
</a>
<span class="nav-item py-<?php echo $navbar_breakpoint; ?>-0 active">
<?php
} else {
?>
<span class="nav-item py-<?php echo $navbar_breakpoint; ?>-0">
<?php
}
?>
<a class="nav-link py-<?php echo $navbar_breakpoint; ?>-0" href="app.php?page=<?php echo $id; ?>">
<?php
if (isset($pg['icon'])) {
?><i class="<?php echo $pg['icon']; ?> fa-fw"></i> <?php
}
lang($pg['title']);
?>
</a>
</span>
<?php
}
}
?>
<a class="navbar-brand" href="app.php">
<?php
echo SITE_TITLE;
?>
</a>
</div>

<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<?php
$counter = 0;
$more = "";
$curpagefound = false;
foreach (PAGES as $id => $pg) {
if ($pg['navbar'] === TRUE) {
$counter++;
if ($counter > ($curpagefound ? 5 : 4) && $pageid != $id) {
$item = '<a href="app.php?page=' . $id . '">';
if (isset($pg['icon'])) {
$item .= '<i class="fa fa-' . $pg['icon'] . ' fa-fw"></i>';
}
$item .= lang($pg['title'], false) . '</a>';
echo '<li class="hidden-sm hidden-md">' . $item . "</li>";
$more .= '<li>' . $item . "</li>";
} else {
if ($pageid == $id) {
$curpagefound = true;
?>
<li class="active">
<?php
} else {
?>
<li>
<?php } ?>
<a href="app.php?page=<?php echo $id; ?>">
<?php
if (isset($pg['icon'])) {
?>
<i class="fa fa-<?php echo $pg['icon']; ?> fa-fw"></i>
<?php } ?>
<?php lang($pg['title']) ?>
</a>
</li>
<?php
}
}
}

if ($counter > 5) {
?>
<li class="dropdown hidden-lg hidden-xs">
<a href="" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v fa-fw"></i> <?php lang("more"); ?></a>
<ul class="dropdown-menu"><?php echo $more; ?></ul>
</li>
<?php } ?>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php echo PORTAL_URL; ?>"><i class="fa fa-user fa-fw"></i> <span class="hidden-sm hidden-md"><?php echo $_SESSION['realname'] ?></span></a></li>
<li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <span class="hidden-sm hidden-md"><?php lang("sign out") ?></span></a></li>
</ul>
</div>
</div>
</nav>
<?php
if (MENU_BAR_STYLE == "fixed") {
?>
<div class="pad-75px"></div>
<?php
}
?>
<?php
// Alert messages
if (!is_empty($_GET['msg']) && array_key_exists($_GET['msg'], MESSAGES)) {
// optional string generation argument
if (is_empty($_GET['arg'])) {
$alertmsg = lang(MESSAGES[$_GET['msg']]['string'], false);
} else {
$alertmsg = lang2(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false);
}
$alerttype = MESSAGES[$_GET['msg']]['type'];
$alerticon = "square-o";
switch (MESSAGES[$_GET['msg']]['type']) {
case "danger":
$alerticon = "times";
break;
case "warning":
$alerticon = "exclamation-triangle";
break;
case "info":
$alerticon = "info-circle";
break;
case "success":
$alerticon = "check";
break;
}
echo <<<END
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4">
<div class="alert alert-dismissible alert-$alerttype">
<button type="button" class="close">&times;</button>
<i class="fa fa-$alerticon"></i> $alertmsg
</div>
<div class="navbar-nav ml-auto py-0" id="navbar-right">
<span class="nav-item py-<?php echo $navbar_breakpoint; ?>-0">
<a class="nav-link py-<?php echo $navbar_breakpoint; ?>-0" href="<?php echo PORTAL_URL; ?>">
<i class="fas fa-user fa-fw"></i><span>&nbsp;<?php echo $_SESSION['realname'] ?></span>
</a>
</span>
<span class="nav-item mr-auto py-<?php echo $navbar_breakpoint; ?>-0">
<a class="nav-link py-<?php echo $navbar_breakpoint; ?>-0" href="action.php?action=signout">
<i class="fas fa-sign-out-alt fa-fw"></i><span>&nbsp;<?php lang("sign out") ?></span>
</a>
</span>
</div>
</div>
END;
}
?>
</nav>

<div class="container" id="main-content">
<div>
<?php
include_once __DIR__ . '/pages/' . $pageid . ".php";
@@ -198,11 +159,11 @@ END;
Copyright &copy; <?php echo date('Y'); ?> <?php echo COPYRIGHT_NAME; ?>
</div>
</div>
<script src="static/js/jquery-3.2.1.min.js"></script>
<script src="static/js/jquery-3.3.1.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/app.js"></script>
<?php
// custom page scripts
// custom page scripts
if (isset(PAGES[$pageid]['scripts'])) {
foreach (PAGES[$pageid]['scripts'] as $script) {
echo "<script src=\"$script\"></script>\n";

+ 57
- 74
index.php View File

@@ -1,15 +1,10 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

require_once __DIR__ . "/required.php";

require_once __DIR__ . "/lib/login.php";

// if we're logged in, we don't need to be here.
if ($_SESSION['loggedin'] && account_has_permission($_SESSION['username'], "QWIKCLOCK")) {
if ($_SESSION['loggedin']) {
header('Location: app.php');
}

@@ -39,17 +34,13 @@ if (checkLoginServer()) {
break;
}
if ($userpass_ok) {
if (account_has_permission($VARS['username'], "QWIKCLOCK") == FALSE) {
$alert = lang("no permission", false);
$_SESSION['passok'] = true; // stop logins using only username and authcode
if (userHasTOTP($VARS['username'])) {
$multiauth = true;
} else {
$_SESSION['passok'] = true; // stop logins using only username and authcode
if (userHasTOTP($VARS['username'])) {
$multiauth = true;
} else {
doLoginUser($VARS['username'], $VARS['password']);
header('Location: app.php');
die("Logged in, go to app.php");
}
doLoginUser($VARS['username'], $VARS['password']);
header('Location: app.php');
die("Logged in, go to app.php");
}
}
} else {
@@ -92,74 +83,66 @@ if (checkLoginServer()) {
<title><?php echo SITE_TITLE; ?></title>

<link href="static/css/bootstrap.min.css" rel="stylesheet">
<link href="static/css/font-awesome.min.css" rel="stylesheet">
<link href="static/css/material-color/material-color.min.css" rel="stylesheet">
<link href="static/css/app.css" rel="stylesheet">
<link href="static/css/index.css" rel="stylesheet">
<?php if (RECAPTCHA_ENABLED) { ?>
<script src='https://www.google.com/recaptcha/api.js'></script>
<?php } ?>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4">
<div>
<div class="row justify-content-center">
<div class="col-auto">
<img class="banner-image" src="static/img/logo.png" />
</div>
</div>
<div class="row justify-content-center">
<div class="card col-11 col-xs-11 col-sm-8 col-md-6 col-lg-4">
<div class="card-body">
<h5 class="card-title"><?php lang("sign in"); ?></h5>
<form action="" method="POST">
<?php
if (SHOW_ICON == "both" || SHOW_ICON == "index") {
if (!is_empty($alert)) {
?>
<img class="img-responsive banner-image" src="static/img/logo.png" />
<?php } ?>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><?php lang("sign in"); ?></h3>
</div>
<div class="panel-body">
<form action="" method="POST">
<?php
if (!is_empty($alert)) {
?>
<div class="alert alert-danger">
<i class="fa fa-fw fa-exclamation-triangle"></i> <?php echo $alert; ?>
</div>
<?php
}
<div class="alert alert-danger">
<i class="fa fa-fw fa-exclamation-triangle"></i> <?php echo $alert; ?>
</div>
<?php
}

if ($multiauth != true) {
?>
<input type="text" class="form-control" name="username" placeholder="<?php lang("username"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
<input type="password" class="form-control" name="password" placeholder="<?php lang("password"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><br />
<?php if (RECAPTCHA_ENABLED) { ?>
<div class="g-recaptcha" data-sitekey="<?php echo RECAPTCHA_SITE_KEY; ?>"></div>
<br />
<?php } ?>
<input type="hidden" name="progress" value="1" />
<?php
} else if ($multiauth) {
?>
<div class="alert alert-info">
<?php lang("2fa prompt"); ?>
</div>
<input type="text" class="form-control" name="authcode" placeholder="<?php lang("authcode"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
<input type="hidden" name="progress" value="2" />
<input type="hidden" name="username" value="<?php echo $VARS['username']; ?>" />
<?php
}
?>
<button type="submit" class="btn btn-primary">
<?php lang("continue"); ?>
</button>
</form>
</div>
</div>
if ($multiauth != true) {
?>
<input type="text" class="form-control" name="username" placeholder="<?php lang("username"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
<input type="password" class="form-control" name="password" placeholder="<?php lang("password"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /><br />
<?php if (RECAPTCHA_ENABLED) { ?>
<div class="g-recaptcha" data-sitekey="<?php echo RECAPTCHA_SITE_KEY; ?>"></div>
<br />
<?php } ?>
<input type="hidden" name="progress" value="1" />
<?php
} else if ($multiauth) {
?>
<div class="alert alert-info">
<?php lang("2fa prompt"); ?>
</div>
<input type="text" class="form-control" name="authcode" placeholder="<?php lang("authcode"); ?>" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus /><br />
<input type="hidden" name="progress" value="2" />
<input type="hidden" name="username" value="<?php echo $VARS['username']; ?>" />
<?php
}
?>
<button type="submit" class="btn btn-primary">
<?php lang("continue"); ?>
</button>
</form>
</div>
</div>
<div class="footer">
<?php echo FOOTER_TEXT; ?><br />
Copyright &copy; <?php echo date('Y'); ?> <?php echo COPYRIGHT_NAME; ?>
</div>
</div>
<script src="static/js/jquery-3.2.1.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
</body>
<div class="footer">
<?php echo FOOTER_TEXT; ?><br />
Copyright &copy; <?php echo date('Y'); ?> <?php echo COPYRIGHT_NAME; ?>
</div>
</div>
<script src="static/js/jquery-3.3.1.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
</body>
</html>

+ 3
- 3
lib/getjobhistorytable.php View File

@@ -112,16 +112,16 @@ for ($i = 0; $i < count($jobs); $i++) {
$jobs[$i][0] = "";
if ($_SESSION['uid'] == $jobs[$i]['uid']) {
if ($editself) {
$jobs[$i][1] = '<a class="btn btn-blue btn-xs" href="app.php?page=editjobhistory&job=' . $jobs[$i]['id'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>';
$jobs[$i][1] = '<a class="btn btn-blue btn-sm" href="app.php?page=editjobhistory&job=' . $jobs[$i]['id'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>';
} else {
$jobs[$i][1] = "";
}
} else if ($showmanaged) {
$jobs[$i][1] = '<a class="btn btn-blue btn-xs" href="app.php?page=editjobhistory&job=' . $jobs[$i]['id'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>';
$jobs[$i][1] = '<a class="btn btn-blue btn-sm" href="app.php?page=editjobhistory&job=' . $jobs[$i]['id'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>';
} else {
$jobs[$i][1] = "";
}
$jobs[$i][2] = '<span class="label label-' . $jobs[$i]['color'] . '">&nbsp;&nbsp;</span> ' . ($jobs[$i]['deleted'] == 1 ? "<s>" : "") . $jobs[$i]['jobname'] . ($jobs[$i]['deleted'] == 1 ? "</s>" : "");
$jobs[$i][2] = '<span class="badge mr-1 px-2 py-1 badge-' . $jobs[$i]['color'] . '">&nbsp;</span> ' . ($jobs[$i]['deleted'] == 1 ? "<s>" : "") . $jobs[$i]['jobname'] . ($jobs[$i]['deleted'] == 1 ? "</s>" : "");
$jobs[$i][3] = date(DATETIME_FORMAT, strtotime($jobs[$i]['start']));
if (is_null($jobs[$i]['end'])) {
$jobs[$i][4] = lang("na", false);

+ 2
- 2
lib/getpunchtable.php View File

@@ -106,12 +106,12 @@ for ($i = 0; $i < count($punches); $i++) {
$punches[$i][0] = "";
if ($_SESSION['uid'] == $punches[$i]['uid']) {
if ($editself) {
$punches[$i][1] = '<a class="btn btn-blue btn-xs" href="app.php?page=editpunch&pid=' . $punches[$i]['punchid'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>';
$punches[$i][1] = '<a class="btn btn-blue btn-sm" href="app.php?page=editpunch&pid=' . $punches[$i]['punchid'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>';
} else {
$punches[$i][1] = "";
}
} else if ($showmanaged) {
$punches[$i][1] = '<a class="btn btn-blue btn-xs" href="app.php?page=editpunch&pid=' . $punches[$i]['punchid'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>';
$punches[$i][1] = '<a class="btn btn-blue btn-sm" href="app.php?page=editpunch&pid=' . $punches[$i]['punchid'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>';
} else {
$punches[$i][1] = "";
}

+ 1
- 1
lib/getshifttable.php View File

@@ -108,7 +108,7 @@ $showeditbtn = account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")
for ($i = 0; $i < count($shifts); $i++) {
$shifts[$i][0] = "";
if ($showeditbtn) {
$shifts[$i][1] = '<a class="btn btn-blue btn-xs" href="app.php?page=editshift&id=' . $shifts[$i]['shiftid'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>';
$shifts[$i][1] = '<a class="btn btn-blue btn-sm" href="app.php?page=editshift&id=' . $shifts[$i]['shiftid'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>';
} else {
$shifts[$i][1] = "";
}

+ 15
- 15
pages.php View File

@@ -10,7 +10,7 @@ define("PAGES", [
"home" => [
"title" => "home",
"navbar" => true,
"icon" => "home",
"icon" => "fas fa-home",
"scripts" => [
"static/js/home.js"
]
@@ -21,7 +21,7 @@ define("PAGES", [
"punches" => [
"title" => "punches",
"navbar" => true,
"icon" => "clock-o",
"icon" => "fas fa-clock",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
@@ -34,7 +34,7 @@ define("PAGES", [
"jobs" => [
"title" => "jobs",
"navbar" => true,
"icon" => "briefcase",
"icon" => "fas fa-briefcase",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
@@ -47,7 +47,7 @@ define("PAGES", [
"editjobs" => [
"title" => "jobs",
"navbar" => false,
"icon" => "briefcase",
"icon" => "fas fa-briefcase",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
@@ -68,12 +68,12 @@ define("PAGES", [
"title" => "edit job",
"navbar" => false,
"styles" => [
"static/css/bootstrap-datetimepicker.min.css",
"static/css/tempusdominus-bootstrap-4.min.css",
"static/css/easy-autocomplete.min.css"
],
"scripts" => [
"static/js/moment.min.js",
"static/js/bootstrap-datetimepicker.min.js",
"static/js/tempusdominus-bootstrap-4.min.js",
"static/js/jquery.easy-autocomplete.min.js",
"static/js/editjobhistory.js"
]
@@ -81,7 +81,7 @@ define("PAGES", [
"shifts" => [
"title" => "shifts",
"navbar" => true,
"icon" => "calendar",
"icon" => "fas fa-calendar",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
@@ -95,24 +95,24 @@ define("PAGES", [
"title" => "new shift",
"navbar" => false,
"styles" => [
"static/css/bootstrap-datetimepicker.min.css"
"static/css/tempusdominus-bootstrap-4.min.css"
],
"scripts" => [
"static/js/moment.min.js",
"static/js/bootstrap-datetimepicker.min.js",
"static/js/addshift.js"
"static/js/tempusdominus-bootstrap-4.min.js",
"static/js/editshift.js"
]
],
"editpunch" => [
"title" => "edit punch",
"navbar" => false,
"styles" => [
"static/css/bootstrap-datetimepicker.min.css",
"static/css/tempusdominus-bootstrap-4.min.css",
"static/css/easy-autocomplete.min.css"
],
"scripts" => [
"static/js/moment.min.js",
"static/js/bootstrap-datetimepicker.min.js",
"static/js/tempusdominus-bootstrap-4.min.js",
"static/js/jquery.easy-autocomplete.min.js",
"static/js/editpunch.js"
]
@@ -120,14 +120,14 @@ define("PAGES", [
"export" => [
"title" => "reports",
"navbar" => true,
"icon" => "download",
"icon" => "fas fa-download",
"styles" => [
"static/css/bootstrap-datetimepicker.min.css",
"static/css/tempusdominus-bootstrap-4.min.css",
"static/css/easy-autocomplete.min.css"
],
"scripts" => [
"static/js/moment.min.js",
"static/js/bootstrap-datetimepicker.min.js",
"static/js/tempusdominus-bootstrap-4.min.js",
"static/js/jquery.easy-autocomplete.min.js",
"static/js/export.js"
]

+ 2
- 2
pages/404.php View File

@@ -5,8 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

?>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4">
<div class="row justify-content-center">
<div class="col-12 col-sm-6 col-md-4 col-lg-4">
<div class="alert alert-warning"><b><?php lang("404 error");?></b><br /> <?php lang("page not found"); ?></div>
</div>
</div>

+ 16
- 18
pages/assignshift.php View File

@@ -27,17 +27,15 @@ if ($VARS['shift'] && $database->has('shifts', ['shiftid' => $VARS['shift']])) {
?>

<form role="form" action="action.php" method="POST">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-calendar-o"></i> <?php lang("assign shift"); ?>
<div class="card border-blue">
<h3 class="card-header text-blue">
<i class="fas fa-calendar"></i> <?php lang("assign shift"); ?>
</h3>
</div>
<div class="panel-body">
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="shift"><i class="fa fa-font"></i> <?php lang("shift"); ?></label><br />
<label for="shift"><i class="fas fa-font"></i> <?php lang("shift"); ?></label><br />
<select name="shift" required="required" class="form-control" id="shift-select">
<option value="" selected><?php lang("choose a shift"); ?></option>
<?php
@@ -55,14 +53,14 @@ if ($VARS['shift'] && $database->has('shifts', ['shiftid' => $VARS['shift']])) {
<?php
if ($shift !== false) {
?>
<div class="col-xs-12 col-md-6">
<label for="people-box"><i class="fa fa-user"></i> <?php lang("people"); ?></label><br />
<div class="row">
<div class="col-xs-8 col-sm-10 col-md-9 col-lg-10">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="people-box"><i class="fa fa-user"></i> <?php lang("people"); ?></label><br />
<div class="input-group">
<input type="text" id="people-box" class="form-control" placeholder="<?php lang("type to add a person") ?>" />
</div>
<div class="col-xs-4 col-sm-2 col-md-3 col-lg-2">
<button class="btn btn-default" type="button" id="addpersonbtn"><i class="fa fa-plus"></i> <?php lang("add") ?></button>
<div class="input-group-append">
<button class="btn btn-default" type="button" id="addpersonbtn"><i class="fa fa-plus"></i> <?php lang("add") ?></button>
</div>
</div>
</div>
<div class="list-group" id="peoplelist">
@@ -70,7 +68,7 @@ if ($VARS['shift'] && $database->has('shifts', ['shiftid' => $VARS['shift']])) {
foreach ($assigned as $user) {
?>
<div class="list-group-item" data-user="<?php echo $user; ?>">
<?php echo $user; ?> <div class="btn btn-danger btn-sm pull-right rmperson"><i class="fa fa-trash-o"></i></div><input type="hidden" name="users[]" value="<?php echo $user; ?>" />
<?php echo $user; ?> <div class="btn btn-danger btn-sm float-right rmperson"><i class="fas fa-trash"></i></div><input type="hidden" name="users[]" value="<?php echo $user; ?>" />
</div>
<?php
}
@@ -86,8 +84,8 @@ if ($VARS['shift'] && $database->has('shifts', ['shiftid' => $VARS['shift']])) {
<input type="hidden" name="action" value="assignshift" />
<input type="hidden" name="source" value="shifts" />

<div class="panel-footer">
<button type="submit" class="btn btn-success"><i class="fa fa-floppy-o"></i> <?php lang("save"); ?></button>
<div class="card-footer">
<button type="submit" class="btn btn-success"><i class="fas fa-save"></i> <?php lang("save"); ?></button>
</div>
</div>
</form>

+ 21
- 25
pages/editjob.php View File

@@ -30,31 +30,29 @@ if (isset($VARS['job']) && $database->has('jobs', ['jobid' => $VARS['job']])) {
?>

<form role="form" action="action.php" method="POST">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<?php if ($editing) { ?>
<i class="fa fa-pencil"></i> <?php lang("edit job"); ?>
<?php } else { ?>
<i class="fa fa-plus"></i> <?php lang("new job"); ?>
<?php } ?>
</h3>
</div>
<div class="panel-body">
<div class="card border-blue">
<h3 class="card-header text-blue">
<?php if ($editing) { ?>
<i class="fas fa-edit"></i> <?php lang("edit job"); ?>
<?php } else { ?>
<i class="fas fa-plus"></i> <?php lang("new job"); ?>
<?php } ?>
</h3>
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="jobname"><i class="fa fa-briefcase"></i> <?php lang("name"); ?></label>
<input type="text" class="form-control" name="jobname" id="jobname" required="required" value="<?php echo $data['jobname']; ?>" />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="jobcode"><i class="fa fa-barcode"></i> <?php lang("code"); ?></label>
<input type="text" class="form-control" name="jobcode" id="jobcode" value="<?php echo $data['jobcode']; ?>" />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="color"><i class="fa fa-paint-brush"></i> <?php lang("color"); ?></label>
<?php
@@ -83,10 +81,9 @@ if (isset($VARS['job']) && $database->has('jobs', ['jobid' => $VARS['job']])) {
</select>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<label for="groups-box"><i class="fa fa-object-group"></i> <?php lang("visible to groups"); ?></label><br />
<div class="row">
<div class="col-xs-8 col-sm-10 col-md-9 col-lg-10">
<div class="input-group">
<select id="groups-box" class="form-control">
<option value=""><?php lang("choose a group"); ?></option>
<option value="-1"><?php lang("all groups"); ?></option>
@@ -115,12 +112,11 @@ if (isset($VARS['job']) && $database->has('jobs', ['jobid' => $VARS['job']])) {
}
?>
</select>
</div>
<div class="col-xs-4 col-sm-2 col-md-3 col-lg-2">
<button class="btn btn-default" type="button" id="addgroupbtn"><i class="fa fa-plus"></i> <?php lang("add") ?></button>
<div class="input-group-append">
<button class="btn btn-default" type="button" id="addgroupbtn"><i class="fas fa-plus"></i> <?php lang("add") ?></button>
</div>
</div>
<div class="panel" id="groupslist-panel">
<div class="card" id="groupslist-panel">
<div class="list-group" id="groupslist">
<?php
$groups = $database->select('job_groups', ['groupid (id)'], ['jobid' => $data['jobid']]);
@@ -132,7 +128,7 @@ if (isset($VARS['job']) && $database->has('jobs', ['jobid' => $VARS['job']])) {
}
?>
<div class="list-group-item" data-groupid="<?php echo $g['id']; ?>">
<?php echo $g['name']; ?> <div class="btn btn-danger btn-sm pull-right rm"><i class="fa fa-trash-o"></i></div><input type="hidden" name="groups[]" value="<?php echo $g['id']; ?>" />
<?php echo $g['name']; ?> <div class="btn btn-danger btn-sm float-right rm"><i class="fas fa-trash"></i></div><input type="hidden" name="groups[]" value="<?php echo $g['id']; ?>" />
</div>
<?php
}
@@ -147,12 +143,12 @@ if (isset($VARS['job']) && $database->has('jobs', ['jobid' => $VARS['job']])) {
<input type="hidden" name="action" value="editjob" />
<input type="hidden" name="source" value="editjobs" />

<div class="panel-footer">
<button type="submit" class="btn btn-success"><i class="fa fa-floppy-o"></i> <?php lang("save"); ?></button>
<div class="card-footer d-flex">
<button type="submit" class="btn btn-success mr-auto"><i class="fas fa-save"></i> <?php lang("save"); ?></button>
<?php
if ($editing && account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="action.php?action=deletejob&source=editjobs&jobid=<?php echo $data['jobid']; ?>" class="btn btn-danger btn-xs pull-right mgn-top-8px"><i class="fa fa-times"></i> <?php lang('delete'); ?></a>
<a href="action.php?action=deletejob&source=editjobs&jobid=<?php echo $data['jobid']; ?>" class="btn btn-danger"><i class="fas fa-times"></i> <?php lang('delete'); ?></a>
<?php
}
?>

+ 21
- 23
pages/editjobhistory.php View File

@@ -30,21 +30,19 @@ if (isset($VARS['job']) && $database->has('job_tracking', ['id' => $VARS['job']]
?>

<form role="form" action="action.php" method="POST">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<?php if ($editing) { ?>
<i class="fa fa-pencil"></i> <?php lang("edit job"); ?>
<?php } else { ?>
<i class="fa fa-plus"></i> <?php lang("new job"); ?>
<?php } ?>
</h3>
</div>
<div class="panel-body">
<div class="card border-blue">
<h3 class="card-header text-blue">
<?php if ($editing) { ?>
<i class="fas fa-edit"></i> <?php lang("edit job"); ?>
<?php } else { ?>
<i class="fas fa-plus"></i> <?php lang("new job"); ?>
<?php } ?>
</h3>
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6 col-lg-4 col-xl-4">
<div class="form-group">
<label for="job"><i class="fa fa-briefcase"></i> <?php lang("job"); ?></label>
<label for="job"><i class="fas fa-briefcase"></i> <?php lang("job"); ?></label>
<select class="form-control" name="job" required>
<option></option>
<?php
@@ -63,23 +61,23 @@ if (isset($VARS['job']) && $database->has('job_tracking', ['id' => $VARS['job']]

foreach ($jobs as $job) {
?>
<option value="<?php echo $job['jobid']; ?>"<?php echo ($job['jobid'] == $data['jobid'] ? " selected" : ""); ?>><?php echo $job['jobname']; ?></option>
<option value="<?php echo $job['jobid']; ?>"<?php echo ($job['jobid'] == $data['jobid'] ? " selected" : ""); ?>><?php echo $job['jobname']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6 col-lg-4 col-xl-4">
<div class="form-group">
<label for="start"><i class="fa fa-play"></i> <?php lang("start"); ?></label>
<input type="text" class="form-control" name="start" id="start" value="<?php echo is_empty($data['start']) ? "" : date("D F j Y g:i a", strtotime($data['start'])); ?>" required />
<label for="start"><i class="fas fa-play"></i> <?php lang("start"); ?></label>
<input type="text" class="form-control" name="start" id="start" data-toggle="datetimepicker" data-target="#start" value="<?php echo is_empty($data['start']) ? "" : date("D F j Y g:i a", strtotime($data['start'])); ?>" required />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6 col-lg-4 col-xl-4">
<div class="form-group">
<label for="end"><i class="fa fa-stop"></i> <?php lang("end"); ?></label>
<input type="text" class="form-control" name="end" id="end" value="<?php echo is_empty($data['end']) ? "" : date("D F j Y g:i a", strtotime($data['end'])); ?>" />
<label for="end"><i class="fas fa-stop"></i> <?php lang("end"); ?></label>
<input type="text" class="form-control" name="end" id="end" data-toggle="datetimepicker" data-target="#end" value="<?php echo is_empty($data['end']) ? "" : date("D F j Y g:i a", strtotime($data['end'])); ?>" />
</div>
</div>
</div>
@@ -89,12 +87,12 @@ if (isset($VARS['job']) && $database->has('job_tracking', ['id' => $VARS['job']]
<input type="hidden" name="action" value="editjobhistory" />
<input type="hidden" name="source" value="jobs" />

<div class="panel-footer">
<button type="submit" class="btn btn-success"><i class="fa fa-floppy-o"></i> <?php lang("save"); ?></button>
<div class="card-footer d-flex">
<button type="submit" class="btn btn-success mr-auto"><i class="fas fa-save"></i> <?php lang("save"); ?></button>
<?php
if ($editing) {
?>
<a href="action.php?action=deletejobhistory&source=jobs&jobid=<?php echo $VARS['job']; ?>" class="btn btn-danger btn-xs pull-right mgn-top-8px"><i class="fa fa-times"></i> <?php lang('delete'); ?></a>
<a href="action.php?action=deletejobhistory&source=jobs&jobid=<?php echo $VARS['job']; ?>" class="btn btn-danger"><i class="fas fa-times"></i> <?php lang('delete'); ?></a>
<?php
}
?>

+ 7
- 7
pages/editjobs.php View File

@@ -7,7 +7,7 @@ require_once __DIR__ . '/../required.php';

redirectifnotloggedin();
?>
<div class="btn-group mgn-btm-10px">
<div class="btn-group mb-4">
<?php
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
@@ -17,20 +17,20 @@ redirectifnotloggedin();
?>
</div>

<table id="jobtable" class="table table-bordered table-striped">
<table id="jobtable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-briefcase hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-barcode hidden-xs"></i> <?php lang('code'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-briefcase d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-barcode d-none d-md-inline"></i> <?php lang('code'); ?></th>
</tr>
</thead>
<tbody>
<?php
$jobs = $database->select('jobs', ['jobid (id)', 'jobname (name)', 'jobcode (code)', 'color'], ['deleted' => 0]);
foreach ($jobs as $j) {
echo "<tr><td></td><td>" . '<a class="btn btn-primary btn-xs" href="app.php?page=editjob&job=' . $j['id'] . '"><i class="fa fa-pencil-square-o"></i> ' . lang("edit", false) . '</a>' . "</td><td>" . '<span class="label label-' . $j['color'] . '">&nbsp;&nbsp;</span> ' . $j['name'] . "</td><td>" . $j['code'] . "</td></tr>";
echo "<tr><td></td><td>" . '<a class="btn btn-primary btn-sm" href="app.php?page=editjob&job=' . $j['id'] . '"><i class="fas fa-edit"></i> ' . lang("edit", false) . '</a>' . "</td><td>" . '<span class="badge mr-1 px-2 py-1 badge-' . $j['color'] . '">&nbsp;</span> ' . $j['name'] . "</td><td>" . $j['code'] . "</td></tr>";
}
?>
</tbody>
@@ -38,8 +38,8 @@ redirectifnotloggedin();
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-briefcase hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-barcode hidden-xs"></i> <?php lang('code'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-briefcase d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-barcode d-none d-md-inline"></i> <?php lang('code'); ?></th>
</tr>
</tfoot>
</table>

+ 22
- 25
pages/editpunch.php View File

@@ -1,5 +1,4 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -62,39 +61,37 @@ if ($data['uid'] != "") {
?>

<form role="form" action="action.php" method="POST">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<?php if ($editing) { ?>
<i class="fa fa-calendar-o"></i> <?php lang("edit punch"); ?>
<?php } else { ?>
<i class="fa fa-calendar-plus-o"></i> <?php lang("new punch"); ?>
<?php } ?>
</h3>
</div>
<div class="panel-body">
<div class="card border-blue">
<h4 class="card-header text-blue">
<?php if ($editing) { ?>
<i class="fas fa-calendar"></i> <?php lang("edit punch"); ?>
<?php } else { ?>
<i class="fas fa-calendar-plus"></i> <?php lang("new punch"); ?>
<?php } ?>
</h4>
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="col-12 col-sm-6 col-md-4">
<div class="form-group">
<label for="user"><i class="fa fa-user"></i> <?php lang("user"); ?></label>
<label for="user"><i class="fas fa-user"></i> <?php lang("user"); ?></label>
<input type="text" class="form-control" name="user" id="user" required="required" value="<?php echo $data['username']; ?>" />
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="col-12 col-sm-6 col-md-4">
<div class="form-group">
<label for="in"><i class="fa fa-play"></i> <?php lang("in"); ?></label>
<input type="text" class="form-control" name="in" id="in" required="required" value="<?php echo is_empty($data['in']) ? "" : date("D F j Y g:i a", strtotime($data['in'])); ?>" />
<label for="in"><i class="fas fa-play"></i> <?php lang("in"); ?></label>
<input type="text" class="form-control" name="in" id="in" required="required" data-toggle="datetimepicker" data-target="#in" value="<?php echo is_empty($data['in']) ? "" : date("D F j Y g:i a", strtotime($data['in'])); ?>" />
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="col-12 col-sm-6 col-md-4">
<div class="form-group">
<label for="out"><i class="fa fa-stop"></i> <?php lang("out"); ?></label>
<input type="text" class="form-control" name="out" id="out" required="required" value="<?php echo is_empty($data['out']) ? "" : date("D F j Y g:i a", strtotime($data['out'])); ?>" />
<label for="out"><i class="fas fa-stop"></i> <?php lang("out"); ?></label>
<input type="text" class="form-control" name="out" id="out" required="required" data-toggle="datetimepicker" data-target="#out" value="<?php echo is_empty($data['out']) ? "" : date("D F j Y g:i a", strtotime($data['out'])); ?>" />
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="col-12 col-sm-6">
<div class="form-group">
<label for="notes"><i class="fa fa-sticky-note-o"></i> <?php lang("notes"); ?></label>
<label for="notes"><i class="fas fa-sticky-note"></i> <?php lang("notes"); ?></label>
<textarea class="form-control" name="notes" maxlength="1000"><?php echo htmlspecialchars($data['notes']); ?></textarea>
</div>
</div>
@@ -105,12 +102,12 @@ if ($data['uid'] != "") {
<input type="hidden" name="action" value="editpunch" />
<input type="hidden" name="source" value="punches" />

<div class="panel-footer">
<button type="submit" class="btn btn-success"><i class="fa fa-floppy-o"></i> <?php lang("save"); ?></button>
<div class="card-footer d-flex">
<button type="submit" class="btn btn-success mr-auto"><i class="fas fa-save"></i> <?php lang("save"); ?></button>
<?php
if ($editing) {
?>
<a href="action.php?action=deletepunch&source=punches&punchid=<?php echo $data['punchid']; ?>" class="btn btn-danger btn-xs pull-right mgn-top-8px"><i class="fa fa-times"></i> <?php lang('delete'); ?></a>
<a href="action.php?action=deletepunch&source=punches&punchid=<?php echo $data['punchid']; ?>" class="btn btn-danger"><i class="fas fa-times"></i> <?php lang('delete'); ?></a>
<?php
}
?>

+ 44
- 54
pages/editshift.php View File

@@ -1,5 +1,4 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -33,75 +32,66 @@ if (isset($VARS['id']) && $database->has('shifts', ['shiftid' => $VARS['id']]))
?>

<form role="form" action="action.php" method="POST">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<?php if ($editing) { ?>
<i class="fa fa-calendar-o"></i> <?php lang("edit shift"); ?>
<?php } else { ?>
<i class="fa fa-calendar-plus-o"></i> <?php lang("new shift"); ?>
<?php } ?>
</h3>
</div>
<div class="panel-body">
<div class="card border-blue">
<h3 class="card-header text-blue">
<?php if ($editing) { ?>
<i class="fas fa-calendar"></i> <?php lang("edit shift"); ?>
<?php } else { ?>
<i class="fas fa-calendar-plus"></i> <?php lang("new shift"); ?>
<?php } ?>
</h3>
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="shiftname"><i class="fa fa-font"></i> <?php lang("name"); ?></label>
<label for="shiftname"><i class="fas fa-font"></i> <?php lang("name"); ?></label>
<input type="text" class="form-control" name="shiftname" id="shiftname" required="required" value="<?php echo $data['shiftname']; ?>" />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="start"><i class="fa fa-play"></i> <?php lang("start"); ?></label>
<input type="text" class="form-control" name="start" id="start" required="required" value="<?php echo $data['start']; ?>" />
<label for="start"><i class="fas fa-play"></i> <?php lang("start"); ?></label>
<input type="text" class="form-control" name="start" id="start" required="required" data-toggle="datetimepicker" data-target="#start" value="<?php echo $data['start']; ?>" />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="end"><i class="fa fa-stop"></i> <?php lang("end"); ?></label>
<input type="text" class="form-control" name="end" id="end" required="required" value="<?php echo $data['end']; ?>" />
<label for="end"><i class="fas fa-stop"></i> <?php lang("end"); ?></label>
<input type="text" class="form-control" name="end" id="end" required="required" data-toggle="datetimepicker" data-target="#end" value="<?php echo $data['end']; ?>" />
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="days"><i class="fa fa-calendar"></i> <?php lang("days"); ?></label>
<label for="days"><i class="fas fa-calendar"></i> <?php lang("days"); ?></label>
<div id="days-list-container">
<div id="days-list">
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Su" <?php if (strpos($data['days'], "Su") !== FALSE) echo "checked"; ?>> <?php lang('sunday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Su" <?php if (strpos($data['days'], "Su") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('sunday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Mo" <?php if (strpos($data['days'], "Mo") !== FALSE) echo "checked"; ?>> <?php lang('monday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Mo" <?php if (strpos($data['days'], "Mo") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('monday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Tu" <?php if (strpos($data['days'], "Tu") !== FALSE) echo "checked"; ?>> <?php lang('tuesday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Tu" <?php if (strpos($data['days'], "Tu") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('tuesday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="We" <?php if (strpos($data['days'], "We") !== FALSE) echo "checked"; ?>> <?php lang('wednesday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="We" <?php if (strpos($data['days'], "We") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('wednesday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Th" <?php if (strpos($data['days'], "Th") !== FALSE) echo "checked"; ?>> <?php lang('thursday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Th" <?php if (strpos($data['days'], "Th") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('thursday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Fr" <?php if (strpos($data['days'], "Fr") !== FALSE) echo "checked"; ?>> <?php lang('friday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Fr" <?php if (strpos($data['days'], "Fr") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('friday'); ?></label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="days[]" value="Sa" <?php if (strpos($data['days'], "Sa") !== FALSE) echo "checked"; ?>> <?php lang('saturday'); ?>
</label>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="days[]" value="Sa" <?php if (strpos($data['days'], "Sa") !== FALSE) echo "checked"; ?>>
<label class="form-check-label"><?php lang('saturday'); ?></label>
</div>
</div>
</div>
@@ -109,17 +99,17 @@ if (isset($VARS['id']) && $database->has('shifts', ['shiftid' => $VARS['id']]))
</div>
</div>
</div>
<input type="hidden" name="shiftid" value="<?php echo $data['shiftid']; ?>" />
<input type="hidden" name="action" value="editshift" />
<input type="hidden" name="source" value="shifts" />

<div class="panel-footer">
<button type="submit" class="btn btn-success"><i class="fa fa-floppy-o"></i> <?php lang("save"); ?></button>
<div class="card-footer d-flex">
<button type="submit" class="btn btn-success mr-auto"><i class="fas fa-save"></i> <?php lang("save"); ?></button>
<?php
if ($editing && account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="action.php?action=deleteshift&source=shifts&shiftid=<?php echo $data['shiftid']; ?>" class="btn btn-danger btn-xs pull-right mgn-top-8px"><i class="fa fa-times"></i> <?php lang('delete'); ?></a>
<a href="action.php?action=deleteshift&source=shifts&shiftid=<?php echo $data['shiftid']; ?>" class="btn btn-danger"><i class="fas fa-times"></i> <?php lang('delete'); ?></a>
<?php
}
?>

+ 55
- 58
pages/export.php View File

@@ -15,14 +15,12 @@ if (!account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") && !accou
?>
<form action="lib/reports.php" method="GET" target="_BLANK">
<div class="row">
<div class="col-xs-12 col-sm-6">
<div class="col-12 col-md-6">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><label for="type"><i class="fa fa-list"></i> <?php lang("report type"); ?></label></h3>
</div>
<div class="panel-body">
<div class="col-12 col-sm-6 col-md-12 col-lg-6">
<div class="card mb-4">
<div class="card-body">
<h4 class="card-title"><label for="type"><i class="fas fa-list"></i> <?php lang("report type"); ?></label></h4>
<select name="type" id="type" class="form-control" required>
<option value="shifts"><?php lang("shifts") ?></option>
<option value="punches"><?php lang("punches") ?></option>
@@ -33,12 +31,10 @@ if (!account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") && !accou
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><label for="format"><i class="fa fa-file"></i> <?php lang("format"); ?></label></h3>
</div>
<div class="panel-body">
<div class="col-12 col-sm-6 col-md-12 col-lg-6">
<div class="card mb-4">
<div class="card-body">
<h4 class="card-title"><label for="format"><i class="fas fa-file"></i> <?php lang("format"); ?></label></h4>
<select name="format" class="form-control" required>
<option value="csv"><?php lang("csv file") ?></option>
<option value="ods"><?php lang("ods file") ?></option>
@@ -47,60 +43,61 @@ if (!account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") && !accou
</div>
</div>
</div>
<div class="col-12">
<button type="submit" class="btn btn-success btn-block d-none d-lg-block genrptbtn"><i class="fas fa-download"></i> <?php lang("generate report"); ?></button>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><label><i class="fa fa-filter"></i> <?php lang("filter"); ?></label></h3>
</div>
<div class="panel-body">
<div id="user-filter">
<div class="radio">
<label>
<input name="users" value="all" checked="" type="radio"> <i class="fa fa-users fa-fw"></i>
<?php lang("all managed users") ?>
</label>
</div>
<div class="radio">
<label>
<input name="users" value="one" type="radio"> <i class="fa fa-user fa-fw"></i>
<?php lang("one user") ?>
<div class="form-group" id="user-selection">
<input type="text" name="user" class="form-control" id="user-box" placeholder="<?php lang("choose user") ?>" />
<label class="control-label" id="user-not-managed-text" for="user-box"><i class="fa fa-warning"></i> <?php lang("not a managed user") ?></label>
<div class="col-12 col-md-6">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="card-title"><label><i class="fas fa-filter"></i> <?php lang("filter"); ?></label></h4>
<div id="user-filter">
<div class="form-check">
<input name="users" value="all" checked="" type="radio" class="form-check-input">
<label class="form-check-label"><i class="fas fa-users fa-fw"></i> <?php lang("all managed users") ?></label>
</div>
</label>
</div>
</div>
<div id="date-filter">
<label><i class="fa fa-calendar"></i> <?php lang("date range") ?></label><br />
<div class="input-group">
<input type="text" id="startdate" name="startdate" class="form-control" />
<span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
<input type="text" id="enddate" name="enddate" class="form-control" />
</div>
</div>
<div id="deleted-filter">
<div class="checkbox">
<label>
<input name="deleted" value="1" checked="1" type="checkbox"> <i class="fa fa-trash fa-fw"></i>
<?php lang("include deleted") ?>
</label>
<div class="form-check">
<input name="users" value="one" type="radio" class="form-check-input">
<label class="form-check-label"><i class="fas fa-user fa-fw"></i> <?php lang("one user") ?>
<div class="form-group mb-0" id="user-selection">
<input type="text" name="user" class="form-control" id="user-box" placeholder="<?php lang("choose user") ?>" />
<label class="control-label" id="user-not-managed-text" for="user-box"><i class="fas fa-warning"></i> <?php lang("not a managed user") ?></label>
</div>
</label>
</div>
</div>
<div id="date-filter">
<label><i class="fas fa-calendar"></i> <?php lang("date range") ?></label><br />
<div class="input-group">
<input type="text" id="startdate" name="startdate" data-toggle="datetimepicker" data-target="#startdate" class="form-control" />
<span class="input-group-text"><i class="fas fa-chevron-right"></i></span>
<input type="text" id="enddate" name="enddate" data-toggle="datetimepicker" data-target="#enddate" class="form-control" />
</div>
</div>
<div id="deleted-filter">
<div class="form-check">
<input name="deleted" value="1" checked="1" type="checkbox" class="form-check-input">
<label class="form-check-label" for="deleted"><i class="fas fa-trash fa-fw"></i> <?php lang("include deleted") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 mt-4">
<?php
$code = uniqid(rand(10000000, 99999999), true);
$database->insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes")), 'uid' => $_SESSION['uid']]);
?>
<input type="hidden" name="code" value="<?php echo $code; ?>" />

<button type="submit" class="btn btn-success btn-block d-lg-none genrptbtn"><i class="fas fa-download"></i> <?php lang("generate report"); ?></button>
</div>
</div>
</div>
</div>
<br />
<?php
$code = uniqid(rand(10000000, 99999999), true);
$database->insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes")), 'uid' => $_SESSION['uid']]);
?>
<input type="hidden" name="code" value="<?php echo $code; ?>" />

<button type="submit" class="btn btn-success" id="genrptbtn"><i class="fa fa-download"></i> <?php lang("generate report"); ?></button>
</form>
<?php
}

+ 33
- 35
pages/home.php View File

@@ -1,5 +1,4 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -8,13 +7,13 @@ require_once __DIR__ . '/../required.php';

redirectifnotloggedin();
?>
<div class="row">
<div class="row justify-content-center">

<div class="col-xs-12 col-sm-6 col-md-4 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-body text-center">
<h2 id="server_time"><?php echo date(TIME_FORMAT); ?></h2>
<h4 id="server_date"><?php echo date(LONG_DATE_FORMAT); ?></h4>
<div class="col-12 col-md-6 col-lg-5 mb-3">
<div class="card">
<div class="card-body text-center">
<h1 id="server_time"><?php echo date(TIME_FORMAT); ?></h1>
<h3 id="server_date"><?php echo date(LONG_DATE_FORMAT); ?></h3>
</div>
<div id="seconds_bar">
<style nonce="<?php echo $SECURE_NONCE; ?>">
@@ -28,38 +27,37 @@ redirectifnotloggedin();
</div>


<div class="col-xs-12 col-sm-6 col-md-4">
<div class="panel panel-blue">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-clock-o"></i> <?php lang("punch in out"); ?>
</h3>
</div>
<div class="panel-body">
<a href="action.php?source=home&action=punchin" class="btn btn-block btn-success btn-lg"><i class="fa fa-play"></i> <?php lang("punch in"); ?></a>
<br />
<a href="action.php?source=home&action=punchout" class="btn btn-block btn-danger btn-lg"><i class="fa fa-stop"></i> <?php lang("punch out"); ?></a>
</div>
<div class="panel-footer">
<div class="col-12 col-md-6 col-lg-5">
<div class="card bg-blue text-light">
<div class="card-body">
<h4 class="card-title">
<i class="fas fa-clock"></i> <?php lang("punch in out"); ?>
</h4>
<?php
$in = $database->has('punches', ['AND' => ['uid' => $_SESSION['uid'], 'out' => null]]) === TRUE;
?>
<i class="fa fa-info-circle"></i>
<span id="inmsg"><?php lang("you are punched in"); ?></span>
<span id="outmsg"><?php lang("you are not punched in"); ?></span>
<style nonce="<?php echo $SECURE_NONCE; ?>">
<?php if ($in) { ?>
#outmsg {
display: none;
}
<?php } else { ?>
#inmsg {
display: none;
}
<?php } ?>
</style>
<h5 class="card-subtitle mb-2 ml-4">

<span id="inmsg"><?php lang("you are punched in"); ?></span>
<span id="outmsg"><?php lang("you are not punched in"); ?></span>
<style nonce="<?php echo $SECURE_NONCE; ?>">
<?php if ($in) { ?>
#outmsg {
display: none;
}
<?php } else { ?>
#inmsg {
display: none;
}
<?php } ?>
</style>
</h5>
<a href="action.php?source=home&action=punchin" class="btn btn-block btn-success btn-lg"><i class="fa fa-play"></i> <?php lang("punch in"); ?></a>
<br />
<a class="dark-text" href="app.php?page=punches#punches" ><i class="fa fa-arrow-right"></i> <?php lang("view punch card"); ?></a>
<a href="action.php?source=home&action=punchout" class="btn btn-block btn-danger btn-lg"><i class="fa fa-stop"></i> <?php lang("punch out"); ?></a>
</div>
<div class="card-footer">
<a href="app.php?page=punches#punches" class="text-light"><i class="fas fa-arrow-right"></i> <?php lang("view punch card"); ?></a>
</div>
</div>
</div>

+ 15
- 15
pages/jobs.php View File

@@ -16,19 +16,19 @@ redirectifnotloggedin();
if (!$currentjob) {
$currentjob = ["color" => "white", "name" => lang("none", false)];
}
echo ' <span class="label label-' . $currentjob['color'] . '">&nbsp;&nbsp;</span> ' . $currentjob['name'];
echo ' <span class="badge ml-1 px-2 py-1 badge-' . $currentjob['color'] . '">&nbsp;</span> ' . $currentjob['name'];
?>
</div>
<?php
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="app.php?page=editjobs" class="btn btn-primary"><i class="fa fa-pencil"></i> <?php lang("edit jobs"); ?></a>
<a href="app.php?page=editjobs" class="btn btn-primary"><i class="fas fa-edit"></i> <?php lang("edit jobs"); ?></a>
<?php
}
?>
</div>

<p class="page-header h5"><i class="fa fa-briefcase fa-fw"></i> <?php lang("select a job") ?></p>
<h2 class="my-4"><i class="fas fa-briefcase fa-fw"></i> <?php lang("select a job") ?></h2>
<div class="container" id="job-btn-bin">
<?php
$jobs = [];
@@ -56,26 +56,26 @@ redirectifnotloggedin();
}
?>
<a class="job-btn" href="action.php?action=setjob&source=jobs&job=<?php echo $job['jobid']; ?>">
<span class="btn btn-<?php echo $color; ?>"><?php echo $job['jobname']; ?></span>
<span class="btn m-1 btn-<?php echo $color; ?>"><?php echo $job['jobname']; ?></span>
</a>
<?php
}
?>
<a class="job-btn" href="action.php?action=setjob&source=jobs&job=-1">
<span class="btn btn-danger"><i class="fa fa-times"></i> <?php lang("none"); ?></span>
<span class="btn btn-danger"><i class="fas fa-times"></i> <?php lang("none"); ?></span>
</a>
</div>

<p class="page-header h5"><i class="fa fa-history fa-fw"></i> <?php lang("job history") ?></p>
<table id="jobtable" class="table table-bordered table-striped">
<h2 class="my-4"><i class="fas fa-history fa-fw"></i> <?php lang("job history") ?></h2>
<table id="jobtable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-briefcase hidden-xs"></i> <?php lang('job'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('start'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('end'); ?></th>
<th data-priority="3"><i class="fa fa-fw fa-user hidden-xs"></i> <?php lang('user'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-briefcase d-none d-md-inline"></i> <?php lang('job'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php lang('start'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-stop d-none d-md-inline"></i> <?php lang('end'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('user'); ?></th>
</tr>
</thead>
<tbody>
@@ -85,10 +85,10 @@ redirectifnotloggedin();
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-briefcase hidden-xs"></i> <?php lang('job'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('start'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('end'); ?></th>
<th data-priority="3"><i class="fa fa-fw fa-user hidden-xs"></i> <?php lang('user'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-briefcase d-none d-md-inline"></i> <?php lang('job'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php lang('start'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-stop d-none d-md-inline"></i> <?php lang('end'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('user'); ?></th>
</tr>
</tfoot>
</table>

+ 34
- 36
pages/punches.php View File

@@ -19,33 +19,31 @@ foreach ($punches as $p) {
$totalseconds = sumelapsedtimearray($punchtimes);
$totalpunches = count($punches);
?>
<p class="page-header h5"><i class="fa fa-calendar fa-fw"></i> <?php lang("this week") ?></p>
<div class="row">

<div class="col-xs-12 col-sm-6 col-md-4 col-md-offset-2">
<div class="panel panel-blue">
<div class="panel-body">
<h4>
<?php
lang2("x on the clock", ["time" => seconds2string($totalseconds, false)]);
?>
</h4>
<h2 class="mb-4"><i class="fas fa-calendar fa-fw"></i> <?php lang("this week") ?></h2>
<div class="row justify-content-center">
<div class="col-12 col-md-10 col-lg-8">
<div class="card-deck">
<div class="card bg-light-blue text-light">
<div class="card-body text-center">
<h4>
<?php
lang2("x on the clock", ["time" => seconds2string($totalseconds, false)]);
?>
</h4>
</div>
</div>
</div>
</div>

<div class="col-xs-12 col-sm-6 col-md-4">
<div class="panel panel-blue">
<div class="panel-body">
<h4>
<?php
if ($totalpunches != 1) {
lang2("x punches", ["count" => $totalpunches]);
} else {
lang("1 punch");
}
?>
</h4>
<div class="card bg-cyan text-light">
<div class="card-body text-center">
<h4>
<?php
if ($totalpunches != 1) {
lang2("x punches", ["count" => $totalpunches]);
} else {
lang("1 punch");
}
?>
</h4>
</div>
</div>
</div>
</div>
@@ -53,16 +51,16 @@ $totalpunches = count($punches);

<a id="punches">&nbsp;</a>

<p class="page-header h5"><i class="fa fa-clock-o fa-fw"></i> <?php lang("punch card") ?></p>
<table id="punchtable" class="table table-bordered table-striped">
<h2 class="mb-4 mt-4"><i class="fas fa-clock fa-fw"></i> <?php lang("punch card") ?></h2>
<table id="punchtable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-user hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('in'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('out'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-sticky-note-o hidden-xs"></i> <?php lang('notes'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-user hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-play hidden-xs"></i> <?php lang('in'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-stop hidden-xs"></i> <?php lang('out'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-sticky-note hidden-xs"></i> <?php lang('notes'); ?></th>
</tr>
</thead>
<tbody>
@@ -72,10 +70,10 @@ $totalpunches = count($punches);
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-user hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('in'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('out'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-sticky-note-o hidden-xs"></i> <?php lang('notes'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-user hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-play hidden-xs"></i> <?php lang('in'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-stop hidden-xs"></i> <?php lang('out'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-sticky-note hidden-xs"></i> <?php lang('notes'); ?></th>
</tr>
</tfoot>
</table>

+ 29
- 24
pages/shifts.php View File

@@ -1,5 +1,4 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -9,32 +8,38 @@ require_once __DIR__ . '/../required.php';
redirectifnotloggedin();
?>

<div class="btn-group mgn-btm-10px">
<?php
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="app.php?page=editshift" class="btn btn-success"><i class="fa fa-calendar-plus-o"></i> <?php lang("new shift"); ?></a>
<?php
}
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="app.php?page=assignshift" class="btn btn-info"><i class="fa fa-calendar-check-o"></i> <?php lang("assign shift"); ?></a>
<div class="btn-toolbar mb-4">
<div class="btn-group mr-2 mb-2">
<?php
}
?>
<span class="btn btn-blue-grey" id="show_btn" data-showall=""><i class="fa fa-filter"></i> <span><?php lang("show all shifts") ?></span></span>
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="app.php?page=editshift" class="btn btn-success"><i class="fas fa-calendar-plus"></i> <?php lang("new shift"); ?></a>
<?php
}
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN")) {
?>
<a href="app.php?page=assignshift" class="btn btn-info"><i class="fas fa-calendar-check"></i> <?php lang("assign shift"); ?></a>
<?php
}
?>
</div>
<div class="btn-group mr-1 mb-2">
<span class="btn btn-blue-grey" id="show_btn" data-showall=""><i class="fas fa-filter"></i> <span><?php lang("show all shifts") ?></span></span>
</div>
<!--<div class="input-group">
<span class="input-group-text text-blue-grey" id="showing-all"><i class="fa fa-info-circle"></i> <?php lang("showing all shifts"); ?></span>
</div>-->
</div>
<div class="text-blue-grey" id="showing-all"><i class="fa fa-info-circle"></i> <?php lang("showing all shifts"); ?></div>

<table id="shifttable" class="table table-bordered table-striped">
<table id="shifttable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="3"></th>
<th data-priority="3"><i class="fa fa-fw fa-font hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('start'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('end'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-calendar hidden-xs"></i> <?php lang('days'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-font d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php lang('start'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-stop d-none d-md-inline"></i> <?php lang('end'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-calendar d-none d-md-inline"></i> <?php lang('days'); ?></th>
</tr>
</thead>
<tbody>
@@ -44,10 +49,10 @@ redirectifnotloggedin();
<tr>
<th data-priority="0"></th>
<th data-priority="3"></th>
<th data-priority="3"><i class="fa fa-fw fa-font hidden-xs"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-play hidden-xs"></i> <?php lang('start'); ?></th>
<th data-priority="1"><i class="fa fa-fw fa-stop hidden-xs"></i> <?php lang('end'); ?></th>
<th data-priority="2"><i class="fa fa-fw fa-calendar hidden-xs"></i> <?php lang('days'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-font d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php lang('start'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-stop d-none d-md-inline"></i> <?php lang('end'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-calendar d-none d-md-inline"></i> <?php lang('days'); ?></th>
</tr>
</tfoot>
</table>

+ 31
- 133
static/css/app.css View File

@@ -1,38 +1,48 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
body {
padding-top: 4rem;
}

.banner-image {
max-height: 100px;
margin: 2em auto;
.brand-img {
border: 1px solid grey;
border-radius: 12px;
border-radius: 12%;
margin-top: -2px;
margin-right: 5px;
margin-bottom: 3px;
height: 25px;
}

.navbar-brand {
font-size: 110%;
.navbar-toggler {
border: none;
padding-right: 1.5rem;
}

.navbar-brand img {
height: 35px;
padding-bottom: 12px;
padding-left: 5px;
.navbar-toggler-icon {
padding: 0px;
margin: 0px;
}

.pad-75px {
height: 75px;
.navbar-brand {
font-size: 120%;
padding-right: 1rem;
margin-top: 0.2rem;
}

.mgn-btm-10px {
margin-bottom: 10px;
#main-content {
padding-top: 1rem;
}

.mgn-top-8px {
margin-top: 8px;
#msg-alert-box {
position: fixed;
left: 0;
right: 0;
top: 4rem;
z-index: 999999;
padding: 0px 5px;
}

.black-text {
color: black;
.footer {
margin-top: 10em;
text-align: center;
}

#seconds_bar {
@@ -44,116 +54,4 @@
#seconds_bar_line {
background-color: #ffc107;
height: 5px;
}

#days-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

#days-list .checkbox:first-child {
margin-top: -6px;
}

#days-list-container {
padding-top: 8px;
}

.inblock {
display: inline-block;
}

.wrap-break-word {
word-wrap: break-word;
}

.dark-text {
color: #01579b;
}

.footer {
margin-top: 10em;
text-align: center;
}

#showing-all {
display: inline-block;
margin-left: 10px;
}

#user-box {
display: inline-block;
}

.red {
color: red;
}

#job-btn-bin {
display: flex;
flex-wrap: wrap;
}

.job-btn {
margin: 5px 5px;
}

/*
==============================
THEMING
==============================

Changing the .navbar-inverse background should be enough on modern browsers.
If this app is to be used on IE < 9 (not supported), also set a background-color
to replace the rgba()s.

To use a material-color.css navbar theme, remove all the theming styles in this
file and add a .navbar-[color] class to the navbar in app.php.
*/

/* navbar background */
.navbar-inverse {
/* background-color: green; */
}

/* Selected page background */
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
background: rgba(0,0,0,.2);
}

.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
border-color: rgba(0,0,0,.2);
}

.navbar-inverse .navbar-toggle .icon-bar {
background-color: white;
}

.navbar-inverse .navbar-brand {
color: white;
}

.navbar-inverse .navbar-nav > li > a {
color: white;
}

.navbar-inverse .navbar-link {
color: white;
}


@media screen and (max-width: 767px) {
button.navbar-toggle[data-toggle="collapse"] {
float: left;
margin-left: 15px;
}

.navbar-header .navbar-brand {
margin-left: -20px;
}

.navbar-header .navbar-brand img {
display: none;
}
}

+ 159
- 0
static/css/app.old.css View File

@@ -0,0 +1,159 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.banner-image {
max-height: 100px;
margin: 2em auto;
border: 1px solid grey;
border-radius: 12px;
}

.navbar-brand {
font-size: 110%;
}

.navbar-brand img {
height: 35px;
padding-bottom: 12px;
padding-left: 5px;
}

.pad-75px {
height: 75px;
}

.mgn-btm-10px {
margin-bottom: 10px;
}

.mgn-top-8px {
margin-top: 8px;
}

.black-text {
color: black;
}

#seconds_bar {
width: 100%;
height: 5px;
padding-bottom: 5px;
}

#seconds_bar_line {
background-color: #ffc107;
height: 5px;
}

#days-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

#days-list .checkbox:first-child {
margin-top: -6px;
}

#days-list-container {
padding-top: 8px;
}

.inblock {
display: inline-block;
}

.wrap-break-word {
word-wrap: break-word;
}

.dark-text {
color: #01579b;
}

.footer {
margin-top: 10em;
text-align: center;
}

#showing-all {
display: inline-block;
margin-left: 10px;
}

#user-box {
display: inline-block;
}

.red {
color: red;
}

#job-btn-bin {
display: flex;
flex-wrap: wrap;
}

.job-btn {
margin: 5px 5px;
}

/*