I. agrega.html

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>Agregar</title>
10
11
 <script src="dompurify/purify.min.js"></script>
12
 <script type="module" src="libclienteweb/manejaErrores.js"></script>
13
14
</head>
15
16
<body>
17
18
 <form id="formulario">
19
20
  <h1>Agregar</h1>
21
22
  <p><a href="index.html">Cancelar</a></p>
23
24
  <input type="hidden" name="id">
25
26
  <p>
27
   <label>
28
    Producto
29
    <output name="producto">
30
     <progress max="100">Cargando…</progress>
31
    </output>
32
   </label>
33
  </p>
34
35
  <p>
36
   <label>
37
    Precio
38
    <output name="precio">
39
     <progress max="100">Cargando…</progress>
40
    </output>
41
   </label>
42
  </p>
43
44
  <p>
45
   <label>
46
    Cantidad *
47
    <input name="cantidad" type="number" min="0" step="0.01">
48
   </label>
49
  </p>
50
51
  <p>* Obligatorio</p>
52
53
  <p><button type="submit">Agregar</button></p>
54
55
 </form>
56
57
 <script type="module">
58
59
  import { descargaVista } from "./libclienteweb/descargaVista.js"
60
  import {
61
   configuraSubmitAccion
62
  } from "./libclienteweb/configuraSubmitAccion.js"
63
64
  const params = new URLSearchParams(location.search)
65
  descargaDatos()
66
67
  async function descargaDatos() {
68
   if (params.size > 0) {
69
    await descargaVista("api/vista-agrega.php?" + params)
70
    configuraSubmitAccion("api/det-venta-agrega.php", formulario, "index.html")
71
   }
72
  }
73
74
 </script>
75
76
</body>
77
78
</html>
skip_previous skip_next