blob: c6cf09e01417841ee24c78ce598f4f0d82bb73f3 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::HYPERADMIN);
4
5$companies = companies::getAll();
6
7$mdHeaderRowBefore = visual::backBtn("powertools.php");
8?>
9<!DOCTYPE html>
10<html>
11<head>
12 <title><?php echo $conf["appName"]; ?></title>
13 <?php visual::includeHead(); ?>
14 <link rel="stylesheet" href="css/dashboard.css">
15</head>
16<?php visual::printBodyTag(); ?>
17 <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--fixed-drawer">
18 <?php visual::includeNav(); ?>
19 <main class="mdl-layout__content">
20 <div class="page-content">
21 <div class="main mdl-shadow--4dp">
22 <h2>Invalidar registros en masa</h2>
23 <p>Selecciona los trabajadores de los cuales quieres invalidar sus registros, y el periodo de tiempo aplicable:</p>
24 <form action="doinvalidatebulkrecords.php" method="POST">
25 <h5>Periodo de tiempo</h5>
26 <p>Del <input type="date" name="begins" required> al <input type="date" name="ends" required></p>
27
28 <h5>Personas</h5>
29
30 <div class="overflow-wrapper overflow-wrapper--for-table">
31 <table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
32 <thead>
33 <tr>
34 <?php
35 if ($conf["debug"]) {
36 ?>
37 <th class="extra">ID</th>
38 <?php
39 }
40 ?>
41 <th class="mdl-data-table__cell--non-numeric">Nombre</th>
42 <th class="mdl-data-table__cell--non-numeric">Empresa</th>
43 <th class="mdl-data-table__cell--non-numeric extra">Categoría</th>
44 </tr>
45 </thead>
46 <tbody>
47 <?php
48 $workers = people::getAll(false, true);
49 foreach ($workers as $w) {
50 ?>
51 <tr data-worker-id="<?=(int)$w["workerid"]?>">
52 <?php
53 if ($conf["debug"]) {
54 ?>
55 <td class="extra"><?=(int)$w["workerid"]?></td>
56 <?php
57 }
58 ?>
59 <td class="mdl-data-table__cell--non-numeric"><?=security::htmlsafe($w["name"])?></td>
60 <td class="mdl-data-table__cell--non-numeric"><?=security::htmlsafe($companies[$w["companyid"]])?></td>
61 <td class="mdl-data-table__cell--non-numeric extra"><?=security::htmlsafe($w["category"])?></td>
62 </tr>
63 <?php
64 }
65 ?>
66 </tbody>
67 </table>
68 </div>
69 <br>
70 <button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent mdl-js-ripple-effect">Invalidar</button>
71 </form>
72 </div>
73 </div>
74 </main>
75 </div>
76
77 <?php
78 visual::smartSnackbar([
79 ["empty", "Faltan datos por introducir en el formulario."],
80 ["unexpected", "Ha ocurrido un error inesperado. Inténtelo de nuevo en unos segundos."],
81 ["inverted", "La fecha de inicio debe ser igual o anterior a la de fin."],
82 ["success", "Se han invalidado todos los registros correspondientes correcamente."],
83 ["partialortotalfailure", "Varios (o todos) los registros no se han podido invalidar correctamente."]
84 ]);
85 ?>
86 <script src="js/invalidatebulkrecords.js"></script>
87</body>
88</html>