예제 #1
0
<?php

require_once SERVER_ROOT . '/module/query_create/module.php';
require_once SERVER_ROOT . '/module/query_run/module.php';
require_once SERVER_ROOT . '/module/parse_data/module.php';
$m_axes = json_decode($_POST["m_axes"]);
$query = queryCreate($m_axes);
$query_results = queryRun($query);
// $round_count_min = $m_axes->x_axis->round_count_min;
$round_count = $m_axes->x_axis->round_count;
$data = parseData($query_results, $round_count);
$output = new stdClass();
$output->query = $query;
$output->data_heat = $data->data_heat;
$output->data_round = $data->data_round;
$output->x_datatype = 'linear';
echo json_encode($output);
예제 #2
0
파일: query.php 프로젝트: shupa/SDMX
<?php

//echo "method=" . $_GET["method"] . '<br>';
//foreach ($_GET as $key => $value) {
//    $querystring = $key . "=" . $value;
//    echo $querystring . '<br>';
//}
if (isset($_GET['method'])) {
    if ($_GET['method'] == 'create' && isset($_GET['name']) && isset($_GET['query0'])) {
        queryCreate();
    } elseif ($_GET['method'] == 'save' && isset($_GET['name']) && isset($_GET['options']) && isset($_GET['filename'])) {
        //querySave($_GET['filename']);
    } elseif ($_GET['method'] == 'list') {
        queryList();
    } elseif ($_GET['method'] == 'shorten' && isset($_GET['uri'])) {
        queryShorten($_GET['uri']);
    } elseif ($_GET['method'] == 'download') {
        queryDownload($_GET['filetype']);
    } elseif ($_GET['method'] == 'get' && isset($_GET['filename'])) {
        queryGet($_GET['filename']);
    } elseif ($_GET['method'] == 'delete' && isset($_GET['filename'])) {
        queryDelete($_GET['filename']);
    } else {
        sendResponse(400, 'method parameters not valid');
    }
} else {
    //echo 'Function not Found';
    sendResponse(400, 'Function not Found');
}
// Helper method to get a string description for an HTTP status code
// From http://www.gen-x-design.com/archives/create-a-rest-api-with-php/