Beispiel #1
0
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";
}
Beispiel #2
0
        $selected_shards[] = $arr["shard"];
    }
    echo "<option value='" . $arr["shard"] . "'" . ($selected ? " selected" : "") . ">" . $arr["shard"];
}
echo "</select>\n";
echo "</td>\n";
echo "<td width=30>&nbsp;</td>\n";
echo "<td>\n";
echo "<table border=0>\n";
echo "<tr><th align=left>Player/Character name</th></tr>\n";
echo "<tr><td><input name=char_name value='" . stripslashes($char_name) . "' size=50 maxlength=20480></td>\n";
echo "<td><input type=submit value='Locate'></td></tr>\n";
echo "</form></table>\n";
if (isset($char_name)) {
    $addr = (count($selected_shards) > 0 ? "[" . join(",", $selected_shards) . "]" : "*") . ".*.EGS.playerInfo {$char_name}";
    $qstate = nel_query($addr, $commandResult);
}
if ($commandResult) {
    $res_array = explode("\n", $commandResult);
    $parse_start = 0;
    /*
    		echo "<pre>";
    		print_r($res_array);
    		echo "</pre>\n";
    */
    echo "<br><br>\n";
    $num_player = 0;
    echo "<script><!--\n";
    echo "var player_eid = new Array(30000);\n";
    echo "var player_select = new Array(30000);\n";
    echo "var player_bgcolor = new Array(30000);\n";
Beispiel #3
0
{
    global $_POST, $_GET;
    if (isset($_POST[$var])) {
        $GLOBALS[$var] = $_POST[$var];
    } else {
        if (isset($_GET[$var])) {
            $GLOBALS[$var] = $_GET[$var];
        } else {
            unset($GLOBALS[$var]);
        }
    }
}
htmlProlog($_SERVER['PHP_SELF'], "Log Analysis");
// look for LAS
$las_query = "*.*.LAS.State";
$qstate = nel_query($las_query, $result);
unset($availableLAS);
if ($qstate) {
    $arr = explode(' ', $result);
    $numRes = count($arr);
    $numRows = current($arr);
    $numLines = ($numRes - $numRows - 2) / $numRows;
    next($arr);
    for ($i = 0; $i < $numRows; ++$i) {
        $vars[] = current($arr);
        next($arr);
    }
    unset($shards);
    for ($i = 0; $i < $numLines; ++$i) {
        unset($l);
        foreach ($vars as $var) {
Beispiel #4
0
        $executeQuery = $query;
        $bef = microtime();
        logUser($uid, "UPDATE=" . $executeQuery);
        $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";
    }
} 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) {
Beispiel #5
0
    } else {
        $dispServ = "<a href='" . $_SERVER['PHP_SELF'] . "?preselServ={$addr}'>{$service}</a>";
    }
    echo "<tr><td {$dcolor}>{$dshard}</td><td {$dcolor}>{$dserver}</td><td {$dcolor}>{$dispServ}</td></tr></a>\n";
    $pshard = $shard;
    $pserver = $server;
}
echo "</table>\n";
echo "</td>\n";
echo "<td width=30>&nbsp;</td>\n";
echo "<td>\n";
echo "<table border=0><form method=post action='" . $_SERVER['PHP_SELF'] . "' name='cmdform'>\n";
echo "<tr><th align=left>Service Path</th><th align=left>Command (exact service syntax)</th></tr>\n";
echo "<tr><td><input name=preselServ value='{$preselServ}' size=32 maxlength=256></td>\n";
echo "<td><input name=execCommand value='" . stripslashes($execCommand) . "' size=50 maxlength=20480></td>\n";
echo "<td><input type=submit value=Execute></td></tr>\n";
echo "</form></table>\n";
if (isset($preselServ) && $preselServ != "" && isset($execCommand) && $execCommand != "") {
    $fullCmd = $preselServ . "." . stripslashes($execCommand);
    logUser($uid, "SYS_COMMAND=" . $fullCmd);
    $qstate = nel_query($preselServ . "." . stripslashes($execCommand), $commandResult);
}
if ($commandResult) {
    echo "<textarea rows=60 cols=300 readOnly style='font-family: Terminal, Courier; font-size: 10pt;'>" . stripslashes($commandResult) . "</textarea>\n";
}
echo "</td>\n";
echo "</tr></table>\n";
echo "<script type='text/javascript'><!--\n";
echo "if (document.cmdform) { document.cmdform.execCommand.focus(); }\n";
echo "// --></script>\n";
htmlEpilog();