| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- Lib::loadClass('Api_WfsNs');
- class Route_RefGraph extends RouteBase {
- function defaultAction() {
- UI::layout([$this, 'defaultView']);
- }
- function defaultView() {
- $namespace = V::get('namespace', '', $_GET);
- if (!$namespace) throw new Exception("Missing namespace");
- $primaryKey = V::get('primaryKey', '', $_GET);
- if (!$primaryKey) throw new Exception("Missing primaryKey");
- $show_flow_diagram = (V::get('FLOW', 0, $_GET, 'int') > 0); // TODO: BUG dla pracownika 9
- echo UI::h('div', [ 'id' => "ref_graph_node", 'style' => "width:98%; height:500px; border:1px solid silver; margin:8px auto; padding:0" ], [
- "Pobieranie danych..."
- ]);
- if ($show_flow_diagram) { // $_GET['FLOW'] = 1
- echo UI::h('svg', [ 'width' => "200%", 'height' => "500", 'id' => "d3-sankey-test" ]);
- echo UI::h('script', [ 'src' => "https://d3js.org/d3.v4.js" ]);
- echo UI::h('script', [ 'src' => "https://unpkg.com/d3-sankey@0.7.1" ]);
- }
- echo UI::h('script', [ 'src' => "static/visjs/vis.min.js" ]);
- echo UI::h('style', [ 'type' => "text/css", 'src' => "static/visjs/vis.min.css" ]);
- UI::inlineJS(__FILE__ . '.view.js', [
- // 'FUNCTION_FETCH_CHILDRENS' => 'refGraphFetchChildrens',
- // 'FUNCTION_FETCH_PARENTS' => 'refGraphFetchParents',
- 'HTML_ID_REF_GRAPH' => 'ref_graph_node',
- 'TYPENAME' => Api_WfsNs::typeName($namespace),
- 'PRIMARY_KEY' => $primaryKey,
- // 'WFS_URL' => Router::getRoute('Test_WfsApi')->getLink(),
- // 'WFS_URL' => "https://biuro.biall-net.pl/dev-pl/se-master/wfs-data.php/default_db/",
- // 'JS_CHANNEL_UPDATE_NAME' => $jsFunction['JS_CHANNEL_UPDATE_NAME'],
- 'DBG' => (V::get('DBG', 0, $_GET, 'int') > 0),
- 'SHOW_FLOW_DIAGRAM' => $show_flow_diagram,
- ]);
- }
- }
|