<?php

$accessControl = array("Admin" => true);
require_once '../../AccessControl.php';

if(!empty($_REQUEST["sumbitDefaultFormat"])){
	$dateFormat = array(
		"format1" => $_REQUEST["format1"]
		,"seperator1" => $_REQUEST["seperator1"]
		,"format2" => $_REQUEST["format2"]
		,"seperator2" => $_REQUEST["seperator2"]
		,"format3" => $_REQUEST["format3"]
		,"seperator3" => $_REQUEST["seperator3"]
		,"format4" => $_REQUEST["format4"]
	);
	setGlobalSetting("profileDateFormat",json_encode($dateFormat));
	$pretty = array();
	foreach($dateFormat as $val) {
		$pretty[] = $val;
	}
	$pretty = implode("",$pretty);

	echo '{ "Status": "Success", "Message": "Saved Format: '.$pretty.'" }';
}

?>