 <?php

if (isset($_SERVER['HTTP_ORIGIN'])) {
    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
    header('Access-Control-Allow-Credentials: true');
    header('Access-Control-Max-Age: 86400'); // cache for 1 day
}

error_reporting(E_ERROR | E_PARSE);

$_SESSION['database'] = $_GET['database'];

include 'conn.php';
include 'funciones.php';

$montoesql2 = "select suc_corre_e from " . $_GET['database'] . ".sucursales limit 1";

$qur = $connection->query($montoesql2);
$corre = '0';
while ($r = mysqli_fetch_assoc($qur)) {

    $corre = $r['suc_corre_e'];}

$json->correprod = $corre;

print_r(json_encode($json));

//echo $_SESSION['codigo']."@".$_SESSION['costo']."@".$_SESSION['precio1']."@".$_SESSION['precio6']."@".$_SESSION['itbm']."@".$_SESSION['familia'];

$qur=null;
@mysqli_close($connection);
?>