<?
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); 
session_start();
session_cache_limiter('private');
$cache_limiter = session_cache_limiter(); 
/* set the cache expire to 30 minutes */
session_cache_expire(60);
$cache_expire = session_cache_expire(); 
date_default_timezone_set('Asia/Manila');
$CURRENT_DATE = date('Y-m-d H:i:s');   
include_once('../config/minho.php');
include_once('../config/autoloadClass.php');
$autoload	 	=	new autoloadClass(); 
$mecon			=	new condbClass();
$users			=	new userClass();
$username 		= 	$_SESSION['castalia_username'];
$timeStamp		=   date('Y-m-d H:i:s');
$result			=   "";

$reservation_id = isset($_POST['reservation_id']) ? strip_tags(trim($_POST['reservation_id'])) : ""; 
   
$mecon->query("SELECT PDCStatus FROM buyer_payment_monitoring WHERE ReservationId = :id");   
$mecon->bind(':id', $reservation_id);
$main = $mecon->resultset(); 
$counter = count($main); 

$userType	=	$_SESSION['castalia_user_type'];
if($counter!=0){
	
	for($a=0; $a<$counter; $a++){ 
		 	$PDCStatus = $main[$a]['PDCStatus']; 
		 	if($PDCStatus=='fully_paid'){
		 		$output = true;
		 	}else{
		 		$output = false;
		 	}	
	}

}else{
	$output = false;
}


$resultArr 						= array();
$resultArr['output']	  		= $output;
echo json_encode($resultArr);
 
exit();
ob_end_flush();