removed extra result tables for timetable results
added combobox for result view switching (normal table / timetable)
This commit is contained in:
parent
9d84e239e0
commit
f83ed97a42
|
@ -27,9 +27,8 @@
|
||||||
* @package tsmmonitor
|
* @package tsmmonitor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_POST["css"] != "") {
|
if ($_POST["css"] != "") $_SESSION['stylesheet'] = $_POST["css"];
|
||||||
$_SESSION['stylesheet'] = $_POST["css"];
|
if ($_POST["tabletype"] != "") $_SESSION["tabletype"] = $_POST["tabletype"];
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
|
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
|
||||||
|
|
|
@ -36,6 +36,20 @@
|
||||||
//if ($tsmmonitor->GETVars['qq'] != "admin" && !$_POST["edit"] == "edit") {
|
//if ($tsmmonitor->GETVars['qq'] != "admin" && !$_POST["edit"] == "edit") {
|
||||||
if ($tsmmonitor->GETVars['qq'] != "index" && $tsmmonitor->GETVars['qq'] != "overview" && $tsmmonitor->GETVars['qq'] != "serverlist") {
|
if ($tsmmonitor->GETVars['qq'] != "index" && $tsmmonitor->GETVars['qq'] != "overview" && $tsmmonitor->GETVars['qq'] != "serverlist") {
|
||||||
echo "<input type='button' value='PDF' onclick='genPDF()' class='button'>";
|
echo "<input type='button' value='PDF' onclick='genPDF()' class='button'>";
|
||||||
|
|
||||||
|
if ($tsmmonitor->configarray["queryarray"][$tsmmonitor->GETVars['qq']]["timetablefields"] != "") {
|
||||||
|
|
||||||
|
echo "<select name='tabletype' size=1 onChange='submit();' class='button'>";
|
||||||
|
$types = array('normal view', 'timetable');
|
||||||
|
foreach ($types as $type) {
|
||||||
|
echo '<option value="'.$type.'"';
|
||||||
|
if ($_SESSION['tabletype'] == $type){echo "SELECTED";}
|
||||||
|
echo '> '.$type.'</option>';
|
||||||
|
}
|
||||||
|
echo "</select>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($tsmmonitor->GETVars['qq'] != "polldstat" && $tsmmonitor->GETVars['qq'] != "serverlist") {
|
if ($tsmmonitor->GETVars['qq'] != "polldstat" && $tsmmonitor->GETVars['qq'] != "serverlist") {
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,8 @@ class TSMMonitor {
|
||||||
if ($this->GETVars['server'] == "") { $this->GETVars['server']=$this->configarray["defaultserver"]; }
|
if ($this->GETVars['server'] == "") { $this->GETVars['server']=$this->configarray["defaultserver"]; }
|
||||||
if ($this->GETVars['orderdir'] == "") { $this->GETVars['orderdir'] = "asc"; }
|
if ($this->GETVars['orderdir'] == "") { $this->GETVars['orderdir'] = "asc"; }
|
||||||
|
|
||||||
if ($_SESSION['timeshift'] == '' || !strstr($this->GETVars["qq"], 'dynamictimetable')) {
|
//if ($_SESSION['timeshift'] == '' || !strstr($this->GETVars["qq"], 'dynamictimetable')) {
|
||||||
|
if ($_SESSION['timeshift'] == '' || $this->configarray["queryarray"][$this->GETVars['qq']]["timetablefields"] == "") {
|
||||||
$_SESSION['timeshift'] = 0 ;
|
$_SESSION['timeshift'] = 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,12 +120,13 @@ class TSMMonitor {
|
||||||
|
|
||||||
$_SESSION["GETVars"] = $this->GETVars;
|
$_SESSION["GETVars"] = $this->GETVars;
|
||||||
|
|
||||||
|
//Cleanup
|
||||||
// BEGIN Timemachine
|
|
||||||
if ($_SESSION["from"] != $_GET['q']) {
|
if ($_SESSION["from"] != $_GET['q']) {
|
||||||
$_SESSION['timemachine'] = "";
|
$_SESSION['timemachine'] = "";
|
||||||
|
$_SESSION['tabletype'] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BEGIN Timemachine
|
||||||
if ($_POST['dateinput'] != "") $_SESSION['timemachine']['date'] = strtotime($_POST['dateinput']);
|
if ($_POST['dateinput'] != "") $_SESSION['timemachine']['date'] = strtotime($_POST['dateinput']);
|
||||||
if ($_POST['timestamps'] != "") $_SESSION['timemachine']['time'] = $_POST['timestamps'];
|
if ($_POST['timestamps'] != "") $_SESSION['timemachine']['time'] = $_POST['timestamps'];
|
||||||
|
|
||||||
|
@ -443,6 +445,42 @@ class TSMMonitor {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getStylesheetSwitcher - returns HTML Code for Stylesheetswitchdropdownbox ;)
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getStylesheetSwitcher() {
|
||||||
|
|
||||||
|
$ret = "";
|
||||||
|
$ret .= "<div class='sidebarinfo'>";
|
||||||
|
$ret .= "<b>Stylesheet Switcher</b><br><br>";
|
||||||
|
$ret .= "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']."&s=".$tsmmonitor->GETVars['server']." method='post'>\n";
|
||||||
|
$ret .= "<select name='css' size=1 onChange='submit();' class='button'>\n";
|
||||||
|
if ($handle = opendir('css')) {
|
||||||
|
while (false !== ($file = readdir($handle))) {
|
||||||
|
if ($file != '.' && $file != '..' && substr($file, 0, 6) == 'style_') {
|
||||||
|
$fileName = str_replace('.css', '', $file);
|
||||||
|
$fileName = str_replace('style_', '', $fileName);
|
||||||
|
$ret .= '<option value="' . $file . '"';
|
||||||
|
if ($_SESSION['stylesheet'] == $file){ $ret .= "SELECTED"; }
|
||||||
|
$ret .= '>' . $fileName . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
$ret .= "</select>\n";
|
||||||
|
$ret .= "</form>\n";
|
||||||
|
$ret .= "</div>";
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTableheader - generates and returns headers for query result HTML tables.
|
* getTableheader - generates and returns headers for query result HTML tables.
|
||||||
|
@ -781,7 +819,11 @@ class TSMMonitor {
|
||||||
$wc= " ";
|
$wc= " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$columnnames = $this->getTableFields("res_".$qtable."_".$server);
|
if ($type == "timetable") {
|
||||||
|
$columnnames = $this->configarray["queryarray"][$this->GETVars['qq']]["timetablefields"];
|
||||||
|
} else {
|
||||||
|
$columnnames = $this->getTableFields("res_".$qtable."_".$server);
|
||||||
|
}
|
||||||
|
|
||||||
if ($columnnames == "") $bContinue = FALSE;
|
if ($columnnames == "") $bContinue = FALSE;
|
||||||
|
|
||||||
|
@ -837,11 +879,11 @@ class TSMMonitor {
|
||||||
}
|
}
|
||||||
else if ($type == "timetable") {
|
else if ($type == "timetable") {
|
||||||
$sqlres = $this->adodb->fetchArrayDB($sql);
|
$sqlres = $this->adodb->fetchArrayDB($sql);
|
||||||
$outp = array();;
|
$outp = array();
|
||||||
foreach ($sqlres as $row) {
|
foreach ($sqlres as $row) {
|
||||||
$rowarray2 = array();
|
$rowarray2 = array();
|
||||||
while(list($keycell, $valcell) = each($row)) {
|
while(list($keycell, $valcell) = each($row)) {
|
||||||
if ($keycell == "Start Time" || $keycell == "End Time") {
|
if ($keycell == "Start Time" || $keycell == "Actual Start" || $keycell == "End Time") {
|
||||||
$date = $row[$keycell];
|
$date = $row[$keycell];
|
||||||
$rowarray2[] = mktime(substr($date,11,2),substr($date,14,2),substr($date,17,2),substr($date,5,2),substr($date,8,2),substr($date,0,4));
|
$rowarray2[] = mktime(substr($date,11,2),substr($date,14,2),substr($date,17,2),substr($date,5,2),substr($date,8,2),substr($date,0,4));
|
||||||
} else {
|
} else {
|
||||||
|
|
107
index.php
107
index.php
|
@ -76,27 +76,7 @@ include_once "includes/page_head.php";
|
||||||
-->
|
-->
|
||||||
<br>
|
<br>
|
||||||
<div class="menuelinks">
|
<div class="menuelinks">
|
||||||
<div class='sidebarinfo'>
|
<?php echo $tsmmonitor->getStylesheetSwitcher(); ?>
|
||||||
<b>Stylesheet Switcher</b><br><br>
|
|
||||||
<?php
|
|
||||||
echo "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']."&s=".$tsmmonitor->GETVars['server']." method='post'>\n";
|
|
||||||
echo "<select name='css' size=1 onChange='submit();' class='button'>\n";
|
|
||||||
if ($handle = opendir('css')) {
|
|
||||||
while (false !== ($file = readdir($handle))) {
|
|
||||||
if ($file != '.' && $file != '..' && substr($file, 0, 6) == 'style_') {
|
|
||||||
$fileName = str_replace('.css', '', $file);
|
|
||||||
$fileName = str_replace('style_', '', $fileName);
|
|
||||||
echo '<option value="' . $file . '"';
|
|
||||||
if ($_SESSION['stylesheet'] == $file){ echo "SELECTED"; }
|
|
||||||
echo '>' . $fileName . '</option>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
echo "</select>\n";
|
|
||||||
echo "</form>\n";
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<img src="/images/trans.gif" alt="" width="150" height="1" border="0"><br>
|
<img src="/images/trans.gif" alt="" width="150" height="1" border="0"><br>
|
||||||
</td>
|
</td>
|
||||||
|
@ -121,24 +101,6 @@ if (isset($_SESSION["logindata"]["user"]) && isset($_SESSION["logindata"]["pass"
|
||||||
} else if ( $tsmmonitor->GETVars['qq'] == "serverlist" ) {
|
} else if ( $tsmmonitor->GETVars['qq'] == "serverlist" ) {
|
||||||
echo $tsmmonitor->getServerlist();
|
echo $tsmmonitor->getServerlist();
|
||||||
|
|
||||||
// show graphical chart (timetable)
|
|
||||||
} else if ( strstr($tsmmonitor->GETVars['qq'], 'timetable')) {
|
|
||||||
|
|
||||||
if ($_POST["back"] != "") {
|
|
||||||
$_SESSION['timeshift'] += $_SESSION['selectedtimestep'];
|
|
||||||
}
|
|
||||||
if ($_POST["forward"] != "") {
|
|
||||||
$_SESSION['timeshift'] -= $_SESSION['selectedtimestep'];
|
|
||||||
}
|
|
||||||
if ($_SESSION['timeshift'] < 0) {
|
|
||||||
$_SESSION['timeshift'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$tablearray = $tsmmonitor->execute('timetable');
|
|
||||||
$headerarray = $queryarray[$tsmmonitor->GETVars['qq']]["header"]["column"];
|
|
||||||
echo $tsmmonitor->generateTimetable($tablearray, $headerarray[0]);
|
|
||||||
|
|
||||||
|
|
||||||
// "vertical" table
|
// "vertical" table
|
||||||
} else if ( strstr($tsmmonitor->GETVars['qq'], 'vertical')) {
|
} else if ( strstr($tsmmonitor->GETVars['qq'], 'vertical')) {
|
||||||
|
|
||||||
|
@ -157,7 +119,6 @@ if (isset($_SESSION["logindata"]["user"]) && isset($_SESSION["logindata"]["pass"
|
||||||
}
|
}
|
||||||
echo "<td><b>".$keycell."</b></td><td>".$valcell."</td></tr>";
|
echo "<td><b>".$keycell."</b></td><td>".$valcell."</td></tr>";
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
@ -165,36 +126,52 @@ if (isset($_SESSION["logindata"]["user"]) && isset($_SESSION["logindata"]["pass"
|
||||||
|
|
||||||
// show normal table layout
|
// show normal table layout
|
||||||
} else {
|
} else {
|
||||||
|
if ($_SESSION["tabletype"]!="" && $_SESSION["tabletype"] == "timetable") {
|
||||||
|
|
||||||
$whereclause = array();
|
if ($_POST["back"] != "") {
|
||||||
//if (!$_POST["Clear"] == "Clear") {
|
$_SESSION['timeshift'] += $_SESSION['selectedtimestep'];
|
||||||
$whereclause["field"] = $_POST["wcfield"];
|
}
|
||||||
$whereclause["val"] = $_POST["wcval"];
|
if ($_POST["forward"] != "") {
|
||||||
$whereclause["op"] = $_POST["wcop"];
|
$_SESSION['timeshift'] -= $_SESSION['selectedtimestep'];
|
||||||
//}
|
}
|
||||||
if ($whereclause["field"]!="" && $whereclause["val"]!="") {
|
if ($_SESSION['timeshift'] < 0) {
|
||||||
if ($_POST["Clear"] == "Clear") {
|
$_SESSION['timeshift'] = 0;
|
||||||
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
|
}
|
||||||
} else {
|
|
||||||
if (!isset($_SESSION["search"])){
|
$tablearray = $tsmmonitor->execute('timetable');
|
||||||
$temp = array();
|
$headerarray = $queryarray[$tsmmonitor->GETVars['qq']]["header"]["column"];
|
||||||
$temp[$tsmmonitor->GETVars['qq']] = $whereclause;
|
echo $tsmmonitor->generateTimetable($tablearray, $headerarray[0]);
|
||||||
$_SESSION["search"] = $temp;
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$whereclause = array();
|
||||||
|
$whereclause["field"] = $_POST["wcfield"];
|
||||||
|
$whereclause["val"] = $_POST["wcval"];
|
||||||
|
$whereclause["op"] = $_POST["wcop"];
|
||||||
|
//}
|
||||||
|
if ($whereclause["field"]!="" && $whereclause["val"]!="") {
|
||||||
|
if ($_POST["Clear"] == "Clear") {
|
||||||
|
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
|
||||||
} else {
|
} else {
|
||||||
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = $whereclause;
|
if (!isset($_SESSION["search"])){
|
||||||
|
$temp = array();
|
||||||
|
$temp[$tsmmonitor->GETVars['qq']] = $whereclause;
|
||||||
|
$_SESSION["search"] = $temp;
|
||||||
|
} else {
|
||||||
|
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = $whereclause;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "<table class='zebra'>";
|
||||||
|
echo $tsmmonitor->getTableheader();
|
||||||
|
echo $tsmmonitor->execute('table');
|
||||||
|
$nav = $tsmmonitor->showPageNavigation("40");
|
||||||
|
if ($nav!="") {
|
||||||
|
echo "<tr><td colspan='999' align='center' class='footer'><a class='navhead'>".$nav."</a></td></tr>";
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
}
|
}
|
||||||
echo "<table class='zebra'>";
|
|
||||||
//echo get_tableheader($queryarray[$tsmmonitor->GETVars['qq']]["header"]["column"]);
|
|
||||||
echo $tsmmonitor->getTableheader();
|
|
||||||
echo $tsmmonitor->execute('table');
|
|
||||||
$nav = $tsmmonitor->showPageNavigation("40");
|
|
||||||
if ($nav!="") {
|
|
||||||
echo "<tr><td colspan='999' align='center' class='footer'><a class='navhead'>".$nav."</a></td></tr>";
|
|
||||||
}
|
|
||||||
echo "</table>";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,33 +32,8 @@
|
||||||
* @package tsmmonitor
|
* @package tsmmonitor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ** Default database settings ** //
|
|
||||||
/**
|
|
||||||
$db_type = 'mysql';
|
|
||||||
$db_name = 'tsmmonitor';
|
|
||||||
$db_user = 'tsmmonitor';
|
|
||||||
$db_password = 'tsmmonitor';
|
|
||||||
$db_host = 'localhost';
|
|
||||||
$db_port = '3306';
|
|
||||||
$db_charset = 'utf8';
|
|
||||||
$db_collate = '';
|
|
||||||
*/
|
|
||||||
// ** Include user configureable definitions ** //
|
|
||||||
//include(dirname(__FILE__) . "/../includes/config.php");
|
|
||||||
|
|
||||||
// ** Global configuration array ** //
|
|
||||||
//$config = array();
|
|
||||||
|
|
||||||
// ** Display ALL PHP errors ** //
|
|
||||||
//error_reporting(E_ALL);
|
|
||||||
|
|
||||||
// ** Include generic code and external libraries ** //
|
|
||||||
//include ("../extlib/adodb5/adodb.inc.php");
|
|
||||||
//include_once("../includes/adodb.php");
|
|
||||||
include_once("../includes/global.php");
|
include_once("../includes/global.php");
|
||||||
|
|
||||||
// ** Connect to the database ** //
|
|
||||||
//$adodb = new ADOdb($db_host, $db_port, $db_user, $db_password, $db_name, $db_type, '' ,FALSE);
|
|
||||||
|
|
||||||
$tmonpolld = new PollD($adodb);
|
$tmonpolld = new PollD($adodb);
|
||||||
$tmonpolld->poll();
|
$tmonpolld->poll();
|
||||||
|
|
Loading…
Reference in New Issue