- Fixed Bug #0000005: Search field/Clear search not working for timetable/timetable2.

- Fixed Bug #0000006: Navbar should always be visible.
- Added navbar to head of tables for easier navigation with large line numbers.
This commit is contained in:
Frank Fegert 2009-06-24 22:34:52 +00:00
parent c723a74a1b
commit 706a738ff1
2 changed files with 38 additions and 37 deletions

View File

@ -283,21 +283,20 @@ class TSMMonitor {
}
}
if ($end > 1) {
$lines = array ("20", "50", "100", "200", "500");
$linesel = $_SESSION["lines"][$this->GETVars['qq']];
if ($linesel == "") $linesel = "20";
$linebox = "<form action=".$_SERVER['PHP_SELF']."?q=".$this->GETVars['qq']."&m=".$this->GETVars['menu']."&s=".$this->GETVars['server']." method='post'><select name='lpp' size=1 onChange='submit();' class='button'>";
$lines = array ("20", "50", "100", "200", "500");
$linesel = $_SESSION["lines"][$this->GETVars['qq']];
if ($linesel == "") $linesel = "20";
$linebox = "<form action=".$_SERVER['PHP_SELF']."?q=".$this->GETVars['qq']."&m=".$this->GETVars['menu']."&s=".$this->GETVars['server']." method='post'><select name='lpp' size=1 onChange='submit();' class='button'>";
foreach ($lines as $line) {
$linebox .= '<option value="'.$line.'"';
if ($linesel == $line) {$linebox.= "SELECTED";}
$linebox .= '> '.$line.' </option>';
}
$linebox .= "</select></form>";
$navline = $fp.'&nbsp;'.$pp.'&nbsp;'.$numbers.'&nbsp;'.$np.'&nbsp;'.$lp;
foreach ($lines as $line) {
$linebox .= '<option value="'.$line.'"';
if ($linesel == $line) {$linebox.= "SELECTED";}
$linebox .= '> '.$line.' </option>';
}
$linebox .= "</select></form>";
$navline = $fp.'&nbsp;'.$pp.'&nbsp;'.$numbers.'&nbsp;'.$np.'&nbsp;'.$lp;
if ($navline != "") {
return '<div id="pagecountbox">'.$linebox.'</div>'.$navline.'';
} else {

View File

@ -133,6 +133,27 @@ include_once "includes/page_head.php";
// show normal table layout
} else {
$whereclause = array();
$whereclause["field"] = $_POST["wcfield"];
$whereclause["val"] = $_POST["wcval"];
$whereclause["op"] = $_POST["wcop"];
if ($whereclause["op"] == 'LIKE') {
$whereclause["val"] = ereg_replace("\*","%",$whereclause["val"]);
$_POST["wcval"] = $whereclause["val"];
}
if ($whereclause["field"] != "" && $whereclause["val"] != "") {
if ($_POST["Clear"] == "Clear") {
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
} else {
if (!isset($_SESSION["search"])){
$temp = array();
$temp[$tsmmonitor->GETVars['qq']] = $whereclause;
$_SESSION["search"] = $temp;
} else {
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = $whereclause;
}
}
}
if ($_SESSION["tabletype"] != "" && $_SESSION["tabletype"] == "timetable") {
if ($_POST["back"] != "") {
@ -166,28 +187,6 @@ include_once "includes/page_head.php";
echo $tsmmonitor->generateTimetable2($tablearray, $headerarray[0]);
} else {
$whereclause = array();
$whereclause["field"] = $_POST["wcfield"];
$whereclause["val"] = $_POST["wcval"];
$whereclause["op"] = $_POST["wcop"];
if ($whereclause["op"] == 'LIKE') {
$whereclause["val"] = ereg_replace("\*","%",$whereclause["val"]);
$_POST["wcval"] = $whereclause["val"];
}
if ($whereclause["field"] != "" && $whereclause["val"] != "") {
if ($_POST["Clear"] == "Clear") {
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
} else {
if (!isset($_SESSION["search"])){
$temp = array();
$temp[$tsmmonitor->GETVars['qq']] = $whereclause;
$_SESSION["search"] = $temp;
} else {
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = $whereclause;
}
}
}
$lines = $_POST["lpp"];
if ($lines != "") {
if (!isset($_SESSION["lines"])){
@ -200,14 +199,17 @@ include_once "includes/page_head.php";
}
echo "<table class='zebra'>";
$thead = $tsmmonitor->getTableheader();
echo $thead["header"];
$tbody = $tsmmonitor->execute('table');
$nav = $tsmmonitor->showPageNavigation("40");
if ($nav != "") {
echo "<tr><td colspan='".$thead["numfields"]."' align='center' class='footer'><a>".$nav."</a></td></tr>";
}
echo $thead["header"];
if ($tbody != "") {
echo $tbody;
} else {
echo "<tr class='d0'><td colspan='".$thead["numfields"]."' align='center'>No entries found in database.</td></tr>";
}
$nav = $tsmmonitor->showPageNavigation("40");
if ($nav != "") {
echo "<tr><td colspan='".$thead["numfields"]."' align='center' class='footer'><a>".$nav."</a></td></tr>";
}