<?php
	require "../commonincludefiles.php";
	$str1 = $str2 = $str3 = $str4 = $str5 = $str6 = $str7 = $str8 = $str12 = "";
	
	$objBook = new BookMgmt();
	$objGroup = new MemberMgmt();
	
	/* language combo */
	$result = $objBook->getDistinctLanguage();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str1 .= "['".$record['book_language']."'],";	
		}
	}
	
	/* category combo */
	$result = $objBook->getDistinctCategory();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str2 .= "['".$record['book_category']."'],";	
		}
	}
	
	/* name combo */
	$result = $objBook->getDistinctName();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str3 .= '["'.stripcslashes($record['book_name']).'"],';	
		}
	}
	
	/* namesearch combo */
	$result = $objBook->getDistinctName();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str4 .= '["'.$record['book_registerno'].'","'.stripcslashes($record['book_name']).'"],';	
		}
	}
	
	/* edition combo */
	$result = $objBook->getDistinctEdition();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str5 .= "['".$record['book_edition']."'],";	
		}
	}

	/* author combo */
	$result = $objBook->getDistinctAuthor();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str6 .= "['".$record['book_author']."'],";	
		}
	}

	/* publishername combo */
	/*$result = $objBook->getDistinctPublisherName();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str7 .= "['".$record['book_publishername']."'],";	
		}
	}*/

	/* vender combo */
	$result = $objBook->getDistinctVender();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str8 .= "['".$record['book_vender']."'],";	
		}
	}

	/* register combo */
	$result = $objBook->getBookRegister();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str9 .= "['".$record['register_id']."','".$record['register_name']."'],";	
		}
	}
	
	/* member group combo */
	$result = $objGroup->getDistinctGroup();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str10 .= "['".$record['member_group']."'],";	
		}
	}
	
	/* classno combo */
	$result = $objBook->getDistinctClassno();
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str11 .= "['".$record['book_classno']."'],";	
		}
	}

	
	
	$str1 = substr($str1, 0, strlen($str1)-1);
	$str2 = substr($str2, 0, strlen($str2)-1);
	$str3 = substr($str3, 0, strlen($str3)-1);
	$str4 = substr($str4, 0, strlen($str4)-1);
	$str5 = substr($str5, 0, strlen($str5)-1);
	$str6 = substr($str6, 0, strlen($str6)-1);
	$str7 = substr($str7, 0, strlen($str7)-1);
	$str8 = substr($str8, 0, strlen($str8)-1);
	$str9 = substr($str9, 0, strlen($str9)-1);
	$str10 = substr($str10, 0, strlen($str10)-1);
	$str11 = substr($str11, 0, strlen($str11)-1);
	
?>
<script type="text/javascript" language="javascript">
	Ext.namespace('Ext.library');
	Ext.library.language = [<?php echo $str1; ?>]; 
	Ext.library.category = [<?php echo $str2; ?>];
	Ext.library.name = [<?php echo $str3; ?>];
	Ext.library.namesearch = [<?php echo $str4; ?>];
	Ext.library.edition = [<?php echo $str5; ?>];
	Ext.library.author = [<?php echo $str6; ?>];
	Ext.library.publishername = [<?php echo $str7; ?>];
	Ext.library.vender = [<?php echo $str8; ?>];
	Ext.library.register = [<?php echo $str9; ?>];
	Ext.library.membergroup = [<?php echo $str10; ?>];
	Ext.library.classno = [<?php echo $str11; ?>];

</script>