<?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 ### */
	
	$mReportType = $p["reportType"];
	$mReportId = $p["reportId"];
	
	switch($mReportType) {
		case "comment":
			$mReportType = "comment";
		break;
		
		case "container":
			$mReportType = "container";
		break;
		
		default:
			$mReportType = -1;
		break;
	}
	
	if($mReportType !== -1) {
		$systemExecution->runQuery("INSERT INTO web_reports (report_type, report_id, report_user, report_time) VALUES ('%s', '%s', '%s', '%s')", array($mReportType, $mReportId, $systemHandler->loadHandler("USER")->mUserId, time()));
		$a["isValid"] = true;
	} else $a["isValid"] = false;
	
	/* ### DO NOT CHANGE ANYTHING FROM HERE ### */
	header("Content-Type: application/json");
	echo json_encode($mPong);
?>