Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/includes/adminnav.php b/src/includes/adminnav.php
new file mode 100644
index 0000000..9f05730
--- /dev/null
+++ b/src/includes/adminnav.php
@@ -0,0 +1,44 @@
+<?php
+require_once(__DIR__."/../core.php");
+security::checkType(security::ADMIN, security::METHOD_NOTFOUND);
+
+$pending = incidents::numPending();
+?>
+<header class="mdl-layout__header mdl-layout__header--scroll<?=(visual::isMDColor() ? security::htmlsafe(" mdl-color--".$conf["backgroundColor"]) : "")?>"<?=(!visual::isMDColor() ? " style=\"background-color: ".security::htmlsafe($conf["backgroundColor"]).";\"" : "")?>>
+ <div class="mdl-layout__header-row">
+ <!-- Title -->
+ <?php if (isset($mdHeaderRowBefore)) { echo $mdHeaderRowBefore; } ?>
+ <span class="mdl-layout-title">Panel de control</span>
+ <?php if (isset($mdHeaderRowMore)) { echo $mdHeaderRowMore; } ?>
+ </div>
+ <?php if (isset($mdHeaderMore)) { echo $mdHeaderMore; } ?>
+</header>
+<div class="mdl-layout__drawer">
+ <span class="mdl-layout-title"><?=(!empty($conf["logo"] ?? "") ? "<img class=\"logo\" src=\"".security::htmlsafe($conf["logo"])."\">" : "")?> <?=security::htmlsafe($conf["appName"])?></span>
+ <span class="subtitle mdl-color-text--grey-700"><?=security::htmlsafe(people::userData("name"))?></span>
+ <nav class="mdl-navigation">
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="home.php"><i class="material-icons">dashboard</i> <span>Panel de Control</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="users.php"><i class="material-icons">group</i> <span>Personas</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workers.php"><i class="material-icons">work</i> <span>Trabajadores</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="incidents.php?goTo=today"><i class="material-icons mdl-badge<?=($pending > 0 ? ' mdl-badge--overlap' : '')?>" <?=($pending > 0 ? 'data-badge="'.$pending.'"' : '')?>>assignment_late</i> <span>Incidencias</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="registry.php"><i class="material-icons">list</i> <span>Registro</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="export.php"><i class="material-icons">cloud_download</i> <span>Exportar registro</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="settings.php"><i class="material-icons">settings</i> <span>Configuración</span></a>
+ <?php
+ if ($conf["enableWorkerUI"]) {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workerhome.php"><i class="material-icons">open_in_browser</i> <span>Vista de trabajador</span></a>
+ <?php
+ } elseif (secondFactor::isAvailable()) {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="security.php"><i class="material-icons">security</i> <span>Seguridad</span></a>
+ <?php
+ } else {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="changepassword.php"><i class="material-icons">account_circle</i> <span>Cambiar contraseña</span></a>
+ <?php
+ }
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" class="mdl-navigation__link" href="logout.php"><i class="material-icons">power_settings_new</i> <span>Cerrar sesión</span></a>
+ </nav>
+</div>
diff --git a/src/includes/head.php b/src/includes/head.php
new file mode 100644
index 0000000..f375ecf
--- /dev/null
+++ b/src/includes/head.php
@@ -0,0 +1,18 @@
+<meta charset="UTF-8">
+<meta name="description" content="">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+
+<!-- Chrome for Android theme color -->
+<meta name="theme-color" content="#4caf50">
+
+<link rel="stylesheet" href="node_modules/material-design-lite/dist/material.green-pink.min.css">
+<script src="node_modules/material-design-lite/material.min.js"></script>
+<link rel="stylesheet" href="node_modules/material-icons/iconfont/material-icons.css">
+<link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,300' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" href="node_modules/mdl-ext/lib/mdl-ext.min.css">
+<script src="node_modules/mdl-ext/lib/mdl-ext.min.js"></script>
+
+<script src="node_modules/dialog-polyfill/dist/dialog-polyfill.js"></script>
+<link rel="stylesheet" type="text/css" href="node_modules/dialog-polyfill/dist/dialog-polyfill.css">
+
+<script src="js/common.js"></script>
diff --git a/src/includes/workernav.php b/src/includes/workernav.php
new file mode 100644
index 0000000..51b6794
--- /dev/null
+++ b/src/includes/workernav.php
@@ -0,0 +1,45 @@
+<?php
+require_once(__DIR__."/../core.php");
+security::checkType(security::WORKER, security::METHOD_NOTFOUND);
+
+$pending = validations::numPending();
+?>
+<header class="mdl-layout__header mdl-layout__header--scroll<?=(visual::isMDColor() ? security::htmlsafe(" mdl-color--".$conf["backgroundColor"]) : "")?>"<?=(!visual::isMDColor() ? "style=\"background-color: ".security::htmlsafe($conf["backgroundColor"]).";\"" : "")?>>
+ <div class="mdl-layout__header-row">
+ <!-- Title -->
+ <?php if (isset($mdHeaderRowBefore)) { echo $mdHeaderRowBefore; } ?>
+ <span class="mdl-layout-title"><?=(security::isAllowed(security::ADMIN) ? "Vista de trabajador" : "Panel de control")?></span>
+ <?php if (isset($mdHeaderRowMore)) { echo $mdHeaderRowMore; } ?>
+ </div>
+ <?php if (isset($mdHeaderMore)) { echo $mdHeaderMore; } ?>
+</header>
+<div class="mdl-layout__drawer">
+ <span class="mdl-layout-title"><?=(!empty($conf["logo"] ?? "") ? "<img class=\"logo\" src=\"".security::htmlsafe($conf["logo"])."\">" : "")?> <?=security::htmlsafe($conf["appName"])?></span>
+ <span class="subtitle mdl-color-text--grey-700"><?=security::htmlsafe(people::userData("name"))?></span>
+ <nav class="mdl-navigation">
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workerhome.php"><i class="material-icons">dashboard</i> <span>Panel de Control</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workerschedule.php"><i class="material-icons">timelapse</i> <span>Horario actual</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="userincidents.php?id=<?=(int)$_SESSION["id"]?>"><i class="material-icons mdl-badge">assignment_late</i> <span>Incidencias</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="userregistry.php?id=<?=(int)$_SESSION["id"]?>"><i class="material-icons mdl-badge">list</i> <span>Registro</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="validations.php"><i class="material-icons mdl-badge<?=($pending > 0 ? ' mdl-badge--overlap' : '')?>" <?=($pending > 0 ? 'data-badge="'.$pending.'"' : '')?>>verified_user</i> <span>Validaciones</span></a>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="export4worker.php?id=<?=(int)$_SESSION["id"]?>"><i class="material-icons mdl-badge">cloud_download</i> <span>Exportar registro</span></a>
+ <?php
+ if (secondFactor::isAvailable()) {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="security.php"><i class="material-icons">security</i> <span>Seguridad</span></a>
+ <?php
+ } else {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="changepassword.php"><i class="material-icons">account_circle</i> <span>Cambiar contraseña</span></a>
+ <?php
+ }
+
+ if (security::isAllowed(security::ADMIN)) {
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="home.php"><i class="material-icons">open_in_browser</i> <span>Vista de administrador</span></a>
+ <?php
+ }
+ ?>
+ <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" class="mdl-navigation__link" href="logout.php"><i class="material-icons">power_settings_new</i> <span>Cerrar sesión</span></a>
+ </nav>
+</div>