<?php 
	include('../config.php');
	$status    	 = $_POST['status'];
	$voucher_no  = 'O'.$_POST['voucher_no'];
	$select  = "SELECT * FROM `opening_balance` WHERE invoice_no = '".$voucher_no."' AND flag = '".$status."' AND company_id = '".$_SESSION['company_id']."' AND branch_id = '".$_SESSION['branch_id']."' ORDER BY id asc";
	$result  = mysqli_query($conn,$select);
	
	if(mysqli_num_rows($result) != 0) {
		$data = array('status' => 1);
	} else {
		$data = array('status' => 0);
	}

	echo json_encode($data);
	die();
?>