<?php
	define('thisscript','index');
	require_once ('globalad.php');
	
	$_GET['getdata'] = ((empty($_GET['getdata']))?"":$_GET['getdata']);
	
	if ($_GET['getdata'] == 'checktransaction'){
		$view = array(
			"unview_transaction" => 0,
			"unview_payment_confirmation" => 0,
			"unview_topup_confirmation" => 0
		);
		if (!empty($useraccess['manage_transaction'])){
			$dbviewstatus = $db->fetch_one("SELECT COUNT(viewstatus) AS totalview FROM transaction WHERE viewstatus = 'F'");
			$totalview = empty($dbviewstatus['totalview'])?'0':$dbviewstatus['totalview'];
			$view["unview_transaction"] = $totalview;
		}
		if (!empty($useraccess['manage_payment_confirmation'])){
			$dbviewstatus = $db->fetch_one("SELECT COUNT(view_status) AS totalview FROM payment_confirmation WHERE view_status = 'F'");
			$totalview = empty($dbviewstatus['totalview'])?'0':$dbviewstatus['totalview'];
			$view["unview_payment_confirmation"] = $totalview;
		}
		if (!empty($useraccess['manage_topup'])){
			$dbviewstatus = $db->fetch_one("SELECT COUNT(view_status) AS totalview FROM topup WHERE view_status = 'F'");
			$totalview = empty($dbviewstatus['totalview'])?'0':$dbviewstatus['totalview'];
			$view["unview_topup_confirmation"] = $totalview;
		}
		echo json_encode($view);
		exit;
	}

	require_once 'incl/global_template.php';

	//print the HTML
	$theme = gettemplate('index');
	eval("\$theme = \"$theme\";");
	echo $theme;
?>