<?php

	require_once 'conexao.php';
	
	$numero = filter_var( $_GET['id'], FILTER_SANITIZE_STRING);

	$query = "UPDATE cofre SET baixado = 1 WHERE ID = '$numero';";
	mysqli_query($conexao, $query);

	$query = "INSERT INTO finalizar_cofre (numeroChronos) VALUES ('$numero');" ;

	if (mysqli_query($conexao, $query)) {

		$_SESSION['msg'] = "<div class='alert alert-success'> Finalizado </div>";
	header("Location: ../cofre.php");

	}