<?php
@session_start();
include_once("../class/class.MySQL.php");
require '../class/resizeImage.php';
include_once("showpath.php");
$db	=new MySQL();
$action = $_GET['action'];
//error_reporting(-1);
if($action == 'insertDetails'){
	
	$data['pf_leaving_date'] =$_REQUEST['pf_date_leaving'];
	$data['reason_leaving_pf'] = $_REQUEST['reason_pf_leaving'];
	$data['pfremarks'] = $_REQUEST['pf_remarks'];
	if($_REQUEST['pf_date_leaving']!='' || $_REQUEST['reason_pf_leaving']!='' || $_REQUEST['pf_remarks']!='' )
	{
		$data['pf_service_status'] = '1';
	}	
	else
	{
		$data['pf_service_status'] = '0';
	}
		
	$empwhere['e_id'] = $_REQUEST['empid'];
	$db->Update('employee',$data,$empwhere);
		
}

if($action == 'loadstst'){
	$whereas['e_id']			= $_GET['empids'];
	$deductions = $db->fetchAll('employee',$whereas);
	echo '{"pfleftservice":'.json_encode($deductions).'}';	
}

if($action == 'checkdetails'){

	$wheres['emp_id']			= $_GET['empids'];
	$checkdts = $db->fetchAll('employee',$wheres);
	echo '{"terminateresigndts":'.json_encode($checkdts).'}';
	
}

?>