<?php 
	  error_reporting(E_ALL);
	  header("Access-Control-Allow-Origin: *");
	  require_once "./includes/common.php";
	  require_once $config['SiteClassPath']."class.Staff.php";
	  include_once $config['SiteClassPath']."class.index.php";
	//  require_once $config['SiteClassPath']."class.CustomerLogin.php";
	
		//$objStaff	= new Staff();
		$ObjIndex	= new Index();
		//$objStaff->chkStaffLogin($_POST);
		$ObjIndex->new_books();
		$ObjIndex->famous_authors();
		$ObjIndex->recom_books();
		$ObjIndex->media_list();
		$url = "http://localhost/easwari/api/newBooks_api.php";
		$jsonD = file_get_contents($url);
		try {
			$array = json_decode($jsonD, true, 512);
			$objSmarty->assign('JsonData', $array);
			//printf('Valid JSON output: %s', print_r($array, true));
		} catch (\JsonException $exception) {
			printf('Invalid JSON input: %s', print_r($exception, true));
		}
	
	//	$jsonData = json_decode($jsonD, true);
		
		//return $JsonData;
		//exit;
		$objSmarty->assign('IncludeTpl', 'index.tpl');
		$objSmarty->assign('OverallSiteTitle', $config['SiteTitle'].'- Easwari Lending  Library');
		$objSmarty->assign('author','suresh@adroitsolutionz.com');
		$objSmarty->assign('document-state','dynamic');
		$objSmarty->assign('address',$config['SiteGlobalPath']); 
	   
		/*Display page*/
		$objSmarty->assign('HeaderTpl', 'header.tpl');
		$objSmarty->assign('FooterTpl', 'footer.tpl');
		$objSmarty->display('pagetemplate.tpl');
			
?>