- <?php
- include "config/conectar.php";
- $desc = "Nada";
- $P_C = 0;
- $P_V = 0;
- if (isset ($_POST["INSERTAR"]))
- {
- $desc = $_POST["descripcion"];
- $P_C = (int) $_POST["PRE_C"];
- $P_V = (int) $_POST["PRE_V"];
- //PROCESO
- $sql = "INSERT INTO tbl_productos(cdescripcion,cprecio_com,cprecio_ven) VALUES ('$desc','$P_C','$P_V')";
- //ejecuta $sql
- $obj_conexion->query($sql);
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>AGREGAR PRODUCTO</title>
- <!--CSS Bootstrap-->
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
- </head>
- <body>
- <nav></nav>
- <h2>AGREGAR PRODUCTO</h2>
- <form role="form" name="register" action="insertar.php" method="POST">
- <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 = "INSERTAR" type = "submit" id= "INSERTAR" value="ENVIAR"/>
- </form>
- <br /><br />
- <a href='index.php'>[INICIO]</a>
- </body>
- </html>
insertar