1 | <!DOCTYPE html> |
2 | <html lang="es"> |
3 | |
4 | <head> |
5 | |
6 | <meta charset="UTF-8"> |
7 | <meta name="viewport" content="width=device-width"> |
8 | |
9 | <title>Modificar</title> |
10 | |
11 | <script type="module" src="lib/js/invocaServicio.js"></script> |
12 | <script type="module" src="lib/js/submitForm.js"></script> |
13 | <script type="module" src="lib/js/muestraError.js"></script> |
14 | <script type="module" src="lib/js/muestraObjeto.js"></script> |
15 | <script type="module" src="lib/js/confirmaEliminar.js"></script> |
16 | |
17 | <script> |
18 | |
19 | const params = new URL(location.href).searchParams |
20 | </script> |
21 | |
22 | </head> |
23 | |
24 | <body onload="if (params.size > 0) { |
25 | invocaServicio('srv/srvRolCheckBoxes.php') |
26 | .then(async checkBoxes => { |
27 | const modelo = await invocaServicio('srv/srvUsuarioBusca.php?' + params) |
28 | await muestraObjeto(document, checkBoxes.body) |
29 | await muestraObjeto(document, modelo.body) |
30 | }) |
31 | .catch(muestraError) |
32 | }"> |
33 | |
34 | <form onsubmit="submitForm('srv/srvUsuarioModifica.php', event) |
35 | .then(modelo => location.href = 'index.html') |
36 | .catch(muestraError)"> |
37 | |
38 | <h1>Modificar</h1> |
39 | |
40 | <p><a href="index.html">Cancelar</a></p> |
41 | |
42 | <input type="hidden" name="id"> |
43 | |
44 | <p> |
45 | <label> |
46 | |
47 | Cue * |
48 | <input name="cue" value="Cargando…"> |
49 | </label> |
50 | </p> |
51 | |
52 | <fieldset> |
53 | <legend>Roles</legend> |
54 | |
55 | <div id="roles"> |
56 | <progress max="100">Cargando…</progress> |
57 | </div> |
58 | |
59 | </fieldset> |
60 | |
61 | <p>* Obligatorio</p> |
62 | |
63 | <p> |
64 | |
65 | <button type="submit">Guardar</button> |
66 | |
67 | <button type="button" onclick="if (params.size > 0 && confirmaEliminar()) { |
68 | invocaServicio('srv/srvUsuarioElimina.php?' + params) |
69 | .then(() => location.href = 'index.html') |
70 | .catch(muestraError) |
71 | }"> |
72 | Eliminar |
73 | </button> |
74 | |
75 | </p> |
76 | |
77 | </form> |
78 | |
79 | </body> |
80 | |
81 | </html> |