blob: 712c3f6cd01a4c150e3a5d111e5b90fee778d6d4 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once(__DIR__."/../core.php");
3security::checkType(security::ADMIN, security::METHOD_NOTFOUND);
4
5if (!isset($_GET["id"])) {
6 security::notFound();
7}
8
9$id = (int)$_GET["id"];
10
11$worker = workers::get($id);
12if ($worker === false) security::notFound();
13?>
14
15<dynscript>
16document.getElementById("cancel").addEventListener("click", e => {
17 e.preventDefault();
18 dynDialog.load("dynamic/workhistory.php?id="+parseInt(document.getElementById("cancel").getAttribute("data-worker-id")));
19});
20</dynscript>
21
22<form action="doaddworkhistoryitem.php" method="POST" autocomplete="off">
23 <input type="hidden" name="id" value="<?=(int)$worker["id"]?>">
24 <h4 class="mdl-dialog__title">Añadir alta/baja</h4>
25 <div class="mdl-dialog__content">
26 <p><b>Persona:</b> <?=security::htmlsafe($worker["name"])?><br>
27 <b>Empresa:</b> <?=security::htmlsafe($worker["companyname"])?></p>
28
29 <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
30 <input class="mdl-textfield__input" type="date" name="day" id="day" autocomplete="off" data-required>
31 <label class="mdl-textfield__label" for="day">Fecha</label>
32 </div>
33 <br>
34 <div class="mdlext-selectfield mdlext-js-selectfield mdlext-selectfield--floating-label">
35 <select name="status" id="status" class="mdlext-selectfield__select" data-required>
36 <option></option>
37 <?php
38 foreach (workers::$affiliationStatusesManual as $status) {
39 echo '<option value="'.(int)$status.'">'.security::htmlsafe(workers::affiliationStatusHelper($status)).'</option>';
40 }
41 ?>
42 </select>
43 <label for="status" class="mdlext-selectfield__label">Tipo</label>
44 </div>
45 </div>
46 <div class="mdl-dialog__actions">
47 <button type="submit" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent">Añadir</button>
48 <button id="cancel" class="mdl-button mdl-js-button mdl-js-ripple-effect" data-worker-id="<?=(int)$worker["id"]?>">Cancelar</button>
49 </div>
50</form>