(Values marked with '*' are cached results)";
// show admin page
} else if ( $GETVars['qq'] == "admin" ) {
echo "nothing to see here";
// show serverlist
} else if ( $GETVars['qq'] == "serverlist" ) {
echo getServerlist();
// show graphical chart
} else if ( strstr($GETVars['qq'], 'timetable')) {
if ($_POST["edit"] == "edit") {
echo showEdit();
}else {
$timesteps = array("1 hour" => "1", "6 hours" => "6", "12 hours" => "12", "24 hours" => "24");
echo "";
}
// "vertical" table
} else if ( strstr($GETVars['qq'], 'vertical')) {
if ($_POST["edit"] == "edit") {
echo showEdit();
}else {
$i = 0;
$headerarray = $queryarray[$GETVars['qq']]["header"]["column"];
$tablearray = execute($query, 'no', 'verticaltable');
echo "";
for ( $co = 0; $co <= count($headerarray); $co++) {
if ($i == 0) {
echo "";
$i = 1;
} else {
echo " ";
$i = 0;
}
echo "".$headerarray[$co]['label']." | ".$tablearray[$co]." | ";
}
echo " ";
}
// show normal table layout
} else {
if ($_POST["Edit"] == "Edit") {
echo showEdit();
}else {
if ($_POST["Save"] == "Save") {
saveQuery();
}
if ($_POST["Refresh"] == "Refresh") {
$_SESSION["cachedqueries"][$GETVars['server']][$query]["timestamp"] = '';
}
$cache = $queryarray[$GETVars['qq']]["cache"];
$searchfieldxml = $queryarray[$GETVars['qq']]["searchfield"];
if (isset($searchfieldxml) && $searchfieldxml != "") {
echo getSearchfield();
}
$searchfield = $_POST["searchfield"];
if ($searchfield == "" && $_GET['sf']!=""){
$searchfield = $_GET['sf'];
}
if ( $searchfieldxml == "" || $searchfield != "") {
echo "";
echo get_tableheader($queryarray[$GETVars['qq']]["header"]["column"]);
echo execute($query, 'no', 'table', $cache);
echo " ";
}
}
}
}
} else {
if (!$bLoginOK){
$errormsg = "Login failed!";
}else{
$errormsg = "Login";
}
session_unset();
$_SESSION=array();
include_once "includes/login.php";
}
$_SESSION['from'] = $GETVars['qq'];
session_write_close(void);
?>
|