<?php 
session_start();
include_once '../config.php';
$user_id = $_SESSION['Admin']['id'];
if($_POST['action'] == 'billDetails'){
$BillNo = addslashes(trim($_REQUEST['BillNo']));
$sql = "SELECT * FROM tbl_optical_receipts WHERE BillNo='$BillNo'";
$rncnt = getRow($sql);
if($rncnt > 0){
	$row = getRecord($sql);
}
else{	
$sql = "SELECT * FROM tbl_sale_bills WHERE BillNo='$BillNo'";
$row = getRecord($sql);
}
echo json_encode($row);
}
?>