<?php
session_start();
require 'conexao.php';

	$sangria = filter_var( $_POST['sangria'], FILTER_SANITIZE_STRING);
	$valor = $_POST['valor'];
	
	$valor = str_replace(".", "", $valor);
	$valor=str_replace(",",".",$valor);
	
	$loja = $_SESSION['loja'];
	$data =  date('Y/m/d');


	$query = "INSERT INTO cofre (loja,valor,sangria,data) VALUES ('$loja','$valor','$sangria','$data');" ;

	if (mysqli_query($conexao, $query)) {
	header("Location: ../cofre.php");
}