-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreset_list.php
More file actions
35 lines (27 loc) · 1007 Bytes
/
preset_list.php
File metadata and controls
35 lines (27 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once( __DIR__ . '/classes/HttpTool.php' );
require_once( __DIR__ . '/classes/Config.php' );
$item = $_REQUEST[ 'item' ];
$parameters = array( 'type' => $item );
HttpTool::setFilterParameters( $parameters );
unset( $parameters[ $item ] );
unset( $parameters[ $item . '_s' ] );
$data = http_build_query( $parameters );
$options = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded'
)
);
$url = Config::$SPARQLIST_URL . 'stat_chart_filtering';
$url2 = $url . '?' . $data;
$result = file_get_contents( $url2, false, stream_context_create( $options ) );
$result = json_decode( $result );
$array = array();
foreach( $result->data as $element ) {
$item = $element->onclick_list[ 0 ];
array_push( $array, $item );
}
header( 'content-type: application/json; charset=utf-8' );
echo json_encode( $array );
?>