QwikClock is an employee time tracking app.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

home.php 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. require_once __DIR__ . '/../required.php';
  6. redirectifnotloggedin();
  7. ?>
  8. <div class="row justify-content-center">
  9. <div class="col-12 col-md-6 col-lg-5 mb-3">
  10. <div class="card">
  11. <div class="card-body text-center">
  12. <h1 id="server_time"><?php echo date(TIME_FORMAT); ?></h1>
  13. <h3 id="server_date"><?php echo date(LONG_DATE_FORMAT); ?></h3>
  14. </div>
  15. <div id="seconds_bar">
  16. <style nonce="<?php echo $SECURE_NONCE; ?>">
  17. #seconds_bar_line {
  18. width: <?php echo round(date('s') * 1 / 60 * 100, 4); ?>%;
  19. }
  20. </style>
  21. <div id="seconds_bar_line"></div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="col-12 col-md-6 col-lg-5">
  26. <div class="card bg-blue text-light">
  27. <div class="card-body">
  28. <h4 class="card-title">
  29. <i class="fas fa-clock"></i> <?php lang("punch in out"); ?>
  30. </h4>
  31. <?php
  32. $in = $database->has('punches', ['AND' => ['uid' => $_SESSION['uid'], 'out' => null]]) === TRUE;
  33. ?>
  34. <h5 class="card-subtitle mb-2 ml-4">
  35. <span id="inmsg"><?php lang("you are punched in"); ?></span>
  36. <span id="outmsg"><?php lang("you are not punched in"); ?></span>
  37. <style nonce="<?php echo $SECURE_NONCE; ?>">
  38. <?php if ($in) { ?>
  39. #outmsg {
  40. display: none;
  41. }
  42. <?php } else { ?>
  43. #inmsg {
  44. display: none;
  45. }
  46. <?php } ?>
  47. </style>
  48. </h5>
  49. <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>
  50. <br />
  51. <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>
  52. </div>
  53. <div class="card-footer">
  54. <a href="app.php?page=punches#punches" class="text-light"><i class="fas fa-arrow-right"></i> <?php lang("view punch card"); ?></a>
  55. </div>
  56. </div>
  57. </div>
  58. </div>