<?php
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 * PHP version 5
 *
 * @category Admin_Tool
 * @package  Admin_Tool
 * @author   Aum Infosys <admin@auminfosys.com>
 * @license  ACE
 * @version  CVS:1.0.1
 * @link     http://auminfosys.com/
 * @filesource
 */
 
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 */
 require "../commonincludefiles.php";

 if($_REQUEST['bookregno']!="" && $_REQUEST['bookregid']!="")
 {
	$bookregno = Escape($_REQUEST['bookregno']);
	$bookregid = Escape($_REQUEST['bookregid']);
	
	$condition ="";
	
	$condition .= " and book_registerno='$bookregno' ";
	$condition .= " and book_registerid='$bookregid' ";
		
	$objBookMgmt = new BookMgmt();	
	$out = $objBookMgmt ->getAllRecords(1,0,$condition,"","");
	
	$count=dbRows($out);
	if($count > 0){
		$row=dbArray($out);
		extract($row);
		if($book_available==1){
			echo "{success:true,data:{book_id:'".$book_id."',txtbookname:'".$book_name
				   /*."',book_returnlastdate:'".FormatDate($issue_returnlastdate,'m/d/Y')
				   ."',bookissueno:'".$issue_id
				   ."',issuedate:'".$issue_date*/
				   ."' }}";	
		}
		else{
			echo "{success:false,msg:1}";
		}
	}else {
		echo "{success:false,msg:2}";
	}
}
?>