<?php
include_once "../conn.php";
include_once "../funciones.php";

date_default_timezone_set("America/Panama");
session_start();

$_SESSION['database'] = $_POST['database'];
$_SESSION['op_id'] = $_POST['op_id'];
$_SESSION["newsession"] = $_GET['database'];

$info = $_SESSION["newsession"];
/*session created*/
//echo $_SESSION["newsession"];

$hoynow = getdate();
$SQLupdate = "update  " . $_SESSION['database'] . ".operacion set id_status=1 where op_tipo=8  and op_id='" . $_SESSION['op_id'] . "'";
//echo "sql: " . $SQLupdate;

if ($connection->query($SQLupdate) === true) {
    $msg = array("success" => "true", "detalle" => "procesado");
} else {
    $msg = array("success" => "false", "detalle" => $conn);
    // echo "Error: " . $SQLupdate . "<br>" . $conn->error;
}
$jsonData[] = $msg;

header('content-type: application/json');
echo json_encode($jsonData);

@mysqli_close($connection);
?>