- <?php
- include "config/conectar.php";
- $id = 0;
- $desc = "Nada";
- $P_C = 0;
- $P_V = 0;
- if (isset ($_POST["MODIFICAR"]))
- {
- $id = (int) $_POST["IDS"];
- $desc = $_POST["descripcion"];
- $P_C = (int) $_POST["PRE_C"];
- $P_V = (int) $_POST["PRE_V"];
- //PROCESO
- $sql = "UPDATE tbl_productos SET cdescripcion='$desc', cprecio_com='$P_C', cprecio_ven='$P_V' WHERE id='$id'";
- //ejecuta $sql
- $obj_conexion->query($sql);
- }
- ?>
- <html>
- <head>
- <title>MODIFICAR</title>
- <!--CSS Bootstrap-->
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
- </head>
- <body>
- <nav></nav>
- <h2>MODIFICAR PRODUCTO</h2>
- <form role="form" name="register" action="modificar.php" method="POST">
- <div class="form-group">
- <label for="username">ID</label>
- <input type="text" class="form-control" id="IDS" name="IDS">
- </div>
- <div class="form-group">
- <label for="username">Descripcion</label>
- <input type="text" class="form-control" id="descripcion" name="descripcion">
- </div>
- <div class="form-group">
- <label for="username">Precio_Compra</label>
- <input type="text" class="form-control" id="PRE_C" name="PRE_C">
- </div>
- <div class="form-group">
- <label for="username">Precio_Venta</label>
- <input type="text" class="form-control" id="PRE_V" name="PRE_V">
- </div>
- <input name = "MODIFICAR" type = "submit" id= "MODIFICAR" value="ENVIAR"/>
- </form>
- <br /><br />
- <a href='index.php'>[INICIO]</a>
- </body>
- </html>
modificar