concordia gate

This commit is contained in:
Rafał Jaworski 2015-12-13 20:53:46 +01:00
parent 7307c4612b
commit 7b38c59e92
3 changed files with 22 additions and 2 deletions

19
cat/concordia_gate.php Normal file
View File

@ -0,0 +1,19 @@
<?php
$url = 'http://concordia.vm.wmi.amu.edu.pl:8800';
$data = array("operation" => $_POST["operation"],"tmId" => intval($_POST["tmId"]),"pattern" => $_POST["pattern"]);
// 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;
?>

View File

@ -6,13 +6,13 @@ function searchHandle(tmid) {
} }
$.ajax({ $.ajax({
url: concordiaUrl, url: '/concordia_gate.php',
type: 'post', type: 'post',
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
$('#result').html(renderResult(data)); $('#result').html(renderResult(data));
}, },
data: JSON.stringify(concordiaRequest) data: concordiaRequest
}); });
} }

View File

@ -21,6 +21,7 @@ shutil.copytree('js', root_dir+'/js')
shutil.copytree('css', root_dir+'/css') shutil.copytree('css', root_dir+'/css')
shutil.copytree('images', root_dir+'/images') shutil.copytree('images', root_dir+'/images')
shutil.copy('favicon.ico', root_dir+'/favicon.ico') shutil.copy('favicon.ico', root_dir+'/favicon.ico')
shutil.copy('concordia_gate.php', root_dir+'/concordia_gate.php')
versions_dir = 'versions' versions_dir = 'versions'