<?php
	require_once("../system.engine/system.core.php");
	
	$mPong = array();
	$a = &$mPong;
	$p = &$_POST;
	
	global $systemHandler;
	$systemExecution = $systemHandler->loadHandler("EXECUTION");
	$systemHash = $systemHandler->loadHandler("HASH");
	/* ### DO YOUR CODES ONLY FROM HERE ### */
	
	$mTab = $p["currentTab"];
	
	switch(strtolower($mTab)) {
		case "termsofuse":
			$a["policyContent"] = $systemExecution->runQuery("SELECT terms_of_use FROM web_policy", "")->fetch_object()->terms_of_use;
		break;
		
		case "privacypolicy":
			$a["policyContent"] = $systemExecution->runQuery("SELECT privacy_policy FROM web_policy", "")->fetch_object()->privacy_policy;
		break;
		
		case "disclaimer":
			$a["policyContent"] = $systemExecution->runQuery("SELECT disclaimer FROM web_policy", "")->fetch_object()->disclaimer;
		break;
		
		case "about":
			$a["policyContent"] = $systemExecution->runQuery("SELECT about FROM web_policy", "")->fetch_object()->about;
		break;
	}
	
	/* ### DO NOT CHANGE ANYTHING FROM HERE ### */
	header("Content-Type: application/json");
	echo json_encode($mPong);
?>