fixed paged result table problems

fixed problems with multiple servers and timemachine
This commit is contained in:
Michael Clemens 2009-05-11 09:23:34 +00:00
parent 228d07c602
commit 14fb779ea1
2 changed files with 22 additions and 20 deletions

View File

@ -127,7 +127,7 @@ function initialize() {
}
if (($_POST['Poll'] == "Poll Now!" || $_SESSION['timemachine']['date'] == "") && $queryarray[$GETVars['qq']]["polltype"]=="snapshot") {
if (($_POST['Poll'] == "Poll Now!" || $_SESSION['timemachine']['date'] == "") && $queryarray[$GETVars['qq']]["polltype"]=="snapshot" || $_POST['s'] != "") {
$qtable = $configarray["queryarray"][$GETVars['qq']]["name"];
$sql = "SELECT MAX(TimeStamp) FROM res_".$qtable."_".$GETVars["server"];
$res = fetchArrayDB($sql, $conn);
@ -166,6 +166,7 @@ function showPageNavigation($links_per_page = "1") {
global $GETVars;
$page = intval($_GET['page']);
if ($page == "") $page = 1;
$so = $_GET['so'];
$sortcol = $_GET['sort'];
@ -267,7 +268,7 @@ function GetTimemachine() {
if ($queryarray[$GETVars['qq']]["polltype"]=="snapshot") {
$ret .= "<div class='sidebarinfo'><b>Time Machine</b><br><br><div id='datechooser'>";
$ret .= "<form name='calform' action='".$_SERVER['PHP_SELF']."?q=".$GETVars['qq']."&m=".$GETVars['menu']."' method='post'>";
$ret .= "<form name='calform' action='".$_SERVER['PHP_SELF']."?q=".$GETVars['qq']."&m=".$GETVars['menu']."&s=".$GETVars['server']."' method='post'>";
$ret .= "<input id='dateinput' class='textfield' name='dateinput' type='text' style='width: 100px' value='".strftime("%Y/%m/%d", $_SESSION['timemachine']['date'])."'>";
$ret .= "<br>";
$ret .= "<select name='timestamps' class='button' size=1 style='width: 103px' onchange='submit()'>";
@ -751,7 +752,8 @@ function execute($type = 'table') {
$polltype = $configarray["queryarray"][$GETVars['qq']]["polltype"];
if ($polltype == "snapshot") {
if ($_SESSION['timemachine']['time'] == date) {
//if ($_SESSION['timemachine']['time'] == date) {
if ($_SESSION['timemachine']['time'] == $_SESSION['timemachine']['date']) {
$timestampquery = " WHERE timestamp=(SELECT MAX(TimeStamp) FROM res_".$qtable."_".$server.")";
} else {
$timestampquery = " WHERE timestamp = '".$_SESSION['timemachine']['time']."'";

View File

@ -31,7 +31,7 @@
?>
<form action="<?php echo $_SERVER['PHP_SELF']."?q=".$GETVars['qq']."&m=".$GETVars['menu']; ?>" method="post">
<form action="<?php echo $_SERVER['PHP_SELF']."?q=".$GETVars['qq']."&m=".$GETVars['menu']."&s=".$GETVars['server']; ?>" method="post">
<?php
if ($GETVars['qq'] != "admin" && !$_POST["edit"] == "edit") {
if ($GETVars['qq'] != "index" && $GETVars['qq'] != "overview") {