<?php
require "../commonincludefiles.php";

$account_id= Escape($_POST['account_id']);

//$member_id=implode(',',json_decode(stripslashes($_POST['member_id'])));

$present="";

if($account_id != ""){
	
	
	$qry1 = "SELECT am.account_id 
			FROM ams_accountmaster am
			WHERE am.company_id = '".$_SESSION["cCompany_id"]."' AND am.account_id = $account_id ";
	$result = dbQuery($qry1);
	
	dbFreeResult($result);
/*	if(dbRows($result)>0){
		$present .="Account Master,";
	}
	else
	{
		$present .="";
	}
*/	
	$rec = dbArray($result);
	$account_id = $rec['account_id'];
	dbFreeResult($result);
	
	if($account_id!=""){
		$qry2 = "SELECT vd.account_id  
				FROM ams_accountmaster am,ams_voucherdetail vd
				WHERE am.company_id = '".$_SESSION["cCompany_id"]."' 
					AND vd.company_id = '".$_SESSION["cCompany_id"]."' 
					AND am.account_id = vd.account_id 
					AND vd.account_id = $account_id ";
		$result = dbQuery($qry2);
		if(dbRows($result)>0){
			$present .=" Voucher Master,";
		}
		else
		{
			$present .="";
		}
		dbFreeResult($result);
	}
	
	$present = substr($present, 0, strlen($present)-1);
	if($present != ""){
		$present .= ".";
	}
}	
echo $present;	
?>