blob: 51b6794ba2e7253ee86b329aef31c1f748c224e5 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once(__DIR__."/../core.php");
3security::checkType(security::WORKER, security::METHOD_NOTFOUND);
4
5$pending = validations::numPending();
6?>
7<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"]).";\"" : "")?>>
8 <div class="mdl-layout__header-row">
9 <!-- Title -->
10 <?php if (isset($mdHeaderRowBefore)) { echo $mdHeaderRowBefore; } ?>
11 <span class="mdl-layout-title"><?=(security::isAllowed(security::ADMIN) ? "Vista de trabajador" : "Panel de control")?></span>
12 <?php if (isset($mdHeaderRowMore)) { echo $mdHeaderRowMore; } ?>
13 </div>
14 <?php if (isset($mdHeaderMore)) { echo $mdHeaderMore; } ?>
15</header>
16<div class="mdl-layout__drawer">
17 <span class="mdl-layout-title"><?=(!empty($conf["logo"] ?? "") ? "<img class=\"logo\" src=\"".security::htmlsafe($conf["logo"])."\">" : "")?> <?=security::htmlsafe($conf["appName"])?></span>
18 <span class="subtitle mdl-color-text--grey-700"><?=security::htmlsafe(people::userData("name"))?></span>
19 <nav class="mdl-navigation">
20 <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>
21 <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>
22 <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>
23 <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>
24 <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>
25 <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>
26 <?php
27 if (secondFactor::isAvailable()) {
28 ?>
29 <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>
30 <?php
31 } else {
32 ?>
33 <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>
34 <?php
35 }
36
37 if (security::isAllowed(security::ADMIN)) {
38 ?>
39 <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>
40 <?php
41 }
42 ?>
43 <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>
44 </nav>
45</div>