function displayViewTable($uid, $gid, $tid, $selection) { global $keep_shard, $keep_server, $keep_service, $display_view; // 1. create views tree buildVariableEnv($uid, $gid, $tid, $vardisp, $bounds, $privilege, $tree, $condensed, $autoDisplay); if ($autoDisplay || $display_view) { // 2. select branches if (count($selection) > 0) { foreach ($selection as $sel) { if ($sel != "") { $selarray = expandQuery($sel); foreach ($selarray as $sel) { $address = explode(".", $sel); //echo "select address ".$sel."<br>\n"; addToSelectNode($tree, $address, 0); } } } } // 3. remove unselected branches clearupNode($tree); // 4. build and factorize query $query = factorizeQuery(buildQuery($tree)); if ($numsteps == 5) { echo "Unsupported entity request now<br>\n"; return; } $bef = microtime(); $qstate = nel_query($query, $result); $aft = microtime(); list($usec, $sec) = explode(" ", $bef); $bef = (double) $sec + (double) $usec; list($usec, $sec) = explode(" ", $aft); $aft = (double) $sec + (double) $usec; $tm = (int) (($aft - $bef) * 1000.0); if (!$qstate) { echo "<b>{$result}</b>\n"; } } displayResult($result, $vardisp, $bounds, $privilege, $condensed, $autoDisplay); return "Executed query '{$query}'<br>{$tm} milliseconds computation time<br>\n"; }
} } else { if (isset($executeQuery)) { $bef = microtime(); $qstate = nel_query($executeQuery, $updateResult); $aft = microtime(); list($usec, $sec) = explode(" ", $bef); $bef = (double) $sec + (double) $usec; list($usec, $sec) = explode(" ", $aft); $aft = (double) $sec + (double) $usec; $tm = (int) (($aft - $bef) * 1000.0); $queryResult = "Executed {$executeQuery}<br>{$tm} milliseconds computation time<br>\n"; } } if ($updateResult) { buildVariableEnv($uid, $gid, $tid, $vardisp, $bounds, $privilege, $tree, $condensed, $autoDisplay); displayResult($updateResult, $vardisp, $bounds, $privilege); } else { // send select request if (count($sel) > 0) { $sel = array_unique($sel); } if (count($sel) == 1 && $sel[0] == "") { unset($sel); } $queryResult = displayViewTable($uid, $gid, $tid, $sel); } echo "<input type=hidden name='current_tid' value='{$tid}'>\n"; $i = 0; if (count($sel) > 0) { foreach ($sel as $selec) {