2015-12-13 20:53:46 +01:00
|
|
|
<?php
|
|
|
|
|
2016-01-21 16:51:23 +01:00
|
|
|
$url = 'http://@concordia_host@:@concordia_port@';
|
|
|
|
$intervalsArray = array();
|
|
|
|
foreach ($_POST["intervals"] as $interval) {
|
|
|
|
array_push($intervalsArray, [intval($interval[0]), intval($interval[1])]);
|
|
|
|
}
|
|
|
|
$data = array("operation" => $_POST["operation"],"tmId" => intval($_POST["tmId"]),"pattern" => $_POST["pattern"],"intervals" => $intervalsArray);
|
2015-12-13 20:53:46 +01:00
|
|
|
|
|
|
|
// use key 'http' even if you send the request to https://...
|
|
|
|
$options = array(
|
|
|
|
'http' => array(
|
|
|
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
|
|
|
'method' => 'POST',
|
|
|
|
'content' => json_encode($data),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
$context = stream_context_create($options);
|
|
|
|
$result = file_get_contents($url, false, $context);
|
|
|
|
|
|
|
|
print $result;
|
|
|
|
|
|
|
|
?>
|