<!DOCTYPE html>
<html>
<head>
<meta content="width=device-width, initial-scale=100%">
	<meta name="viewport" content="width=device-width, initial-scale=100%">
	<link rel="stylesheet" type="text/css" href="css/estilo.css"> 
	<title>Salto materiales</title>
</head>
<body>
  
      </div>
      
    <?php 
	
    include "../conexion_a.php";
if (!empty($_POST)) {
    $alert = "";
    if (empty($_POST['precio']) || empty($_POST['id_prod'])) {
        $alert = '<div class="alert alert-danger" role="alert">Todo los campos son requeridos</div>';
    } else {
        $precio = $_POST['precio'];
        $id_prod = $_POST['id_prod'];
           //$fechaa = date('m-d-Y h:i:s a');
			 $sql_update = mysqli_query($conexion, "UPDATE product_to_store SET purchase_price = $precio, sell_price = $precio  WHERE product_id = $id_prod ");

            if ($sql_update) {
                $alert = '<div class="alert alert-success" role="alert">rango de precios Actualizado correctamente</div>';
            } else {
                $alert = '<div class="alert alert-danger" role="alert">Error al Actualizar los precios</div>';
            }
    }
}

 





?>
      
<section class="principal">

	  <div class="formulario">
    <label for="caja_busqueda">Buscar</label>
<input type="text" name="caja_busqueda" id="caja_busqueda"></input>
	  <label for="caja_cantidad"></label>
	  </input>
    </div>
	<div id="datos"></div>
</section>



<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>

</html>