<?php
include_once("utiles.php");

error_reporting(E_ALL & ~ E_NOTICE & ~ E_WARNING);
date_default_timezone_set("America/Panama");

if (! $connection = connectDb()) { 
	die ( "err db" );
} else {
	$connection->query( "SET NAMES 'utf8';" );
}
header ( 'content-type: application/json' );

session_start(); 
$_SESSION['database'] = $_POST['database'];
$_SESSION['suc_contr'] = $_POST['suc_contr'];
$_SESSION['cte_contr'] = $_POST['cte_contr'];
$_SESSION['num_contr'] = $_POST['num_contr'];
$_SESSION['cod_suc_ap'] = $_POST['cod_suc_ap'];
$_SESSION['cod_est_ap'] = $_POST['cod_est_ap'];
$_SESSION['cod_user_ap'] = $_POST['cod_user_ap'];

$cSql_ln = 'CALL '.$_SESSION['database'].'.`club_anula`('.$_SESSION['cte_contr'].','.$_SESSION['num_contr'].','.$_SESSION['cod_suc_ap'].','.$_SESSION['cod_est_ap'].','.$_SESSION['cod_user_ap'].')';
$resp = mysqli_query($connection, $cSql_ln);

if($resp){
	$msg = array("success"=> "true","detalle"=> "OK");
}
else
{
	$msg = array("success"=> "false","detalle"=> $connection);
	echo "Error: ". $connection->error;
}

print_r(json_encode($msg));

@mysqli_close($connection);
/*
RCTECH SOFTWARE HOUSE
Johnn Gutierrez A.
Programador			 : Sistema de Club RCTECH
Fecha de Creación	 : 2018-11-08
Modificasiones		 : 0
Fecha de Modificacion: 2018-11-11
*/
?>
