<?php
error_reporting(0);
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();
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(); 
$utility	=	new utilityClass(); 
$currentVal = isset($_POST['curVal']) ? trim(strip_tags($_POST['curVal'])) : ""; 
$currentId	= isset($_POST['curId']) ? trim(strip_tags($_POST['curId'])) : ""; 
$currentUser 	= $_SESSION['danvillee_username'];
$timeStamp		= date('Y-m-d H:i:s');
$output 	= "";  
$mainArr = array();
$condArr = array();
$condArr['ReservationId'] = $currentId;  
$mainArr['PTOStatus']   = $currentVal; 
$output 						= $mecon->updateQuery($mainArr,"buyer_status_monitoring",$condArr);

//LOG TASK
			$actArr['UserType']			= "assistant_accountant,accountant"; 
			$actArr['Remarks']			= "Update PTO Status : [$currentId]";
			$actArr['Action']			= "edit";
			$actArr['TransId']			= $currentId;
			$actArr['ActionType']		= "buyer_status_monitoring";
			$actArr['ActionContent']	= json_encode($mainArr);
			$actArr['ActionBy'] 		= $currentUser;	
			$actArr['ActionDate']		= $timeStamp;
			$utility->encodeActivityLog($actArr); 
			


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