<?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 ### */

	$mParam = $p["readParam"];
	$mUserId = $systemHandler->loadHandler("USER")->mUserId;
	
	switch($mParam) {
		case 0: // messages
			$systemExecution->runQuery("UPDATE web_messages SET message_seen_user = '1' WHERE user_two = '%s' AND message_seen_user = '0'", array($mUserId, $mUserId));
		break;
		
		case 1: // global
			$systemExecution->runQuery("UPDATE web_notifications SET has_seen = '1' WHERE user_id = '%s'", $mUserId);
		break;
	}
	
	/* ### DO NOT CHANGE ANYTHING FROM HERE ### */
	header("Content-Type: application/json");
	echo json_encode($mPong);
?>