- Fixed memory exhaustion bug if DB query returned empty result set.
- Fixed POST/SESSION variable inconsistency with search form. - Cosmetics (removed whitespace at end of line).
This commit is contained in:
parent
e310e91542
commit
65322d9858
|
@ -194,6 +194,7 @@ class TSMMonitor {
|
||||||
|
|
||||||
if (($recordSet) || ($this->adodb->conn->ErrorNo() == 0)) {
|
if (($recordSet) || ($this->adodb->conn->ErrorNo() == 0)) {
|
||||||
$total_rows = $recordSet->RecordCount($recordSet);
|
$total_rows = $recordSet->RecordCount($recordSet);
|
||||||
|
if ($total_rows > 0 ) {
|
||||||
$this->max_pages = ceil($total_rows/$rows_per_page);
|
$this->max_pages = ceil($total_rows/$rows_per_page);
|
||||||
|
|
||||||
if($this->page > $this->max_pages || $this->page <= 0) {
|
if($this->page > $this->max_pages || $this->page <= 0) {
|
||||||
|
@ -208,6 +209,7 @@ class TSMMonitor {
|
||||||
$recordSet->MoveNext();
|
$recordSet->MoveNext();
|
||||||
}
|
}
|
||||||
$recordSet->close();
|
$recordSet->close();
|
||||||
|
}
|
||||||
return($recordArray);
|
return($recordArray);
|
||||||
} else {
|
} else {
|
||||||
echo "<p style='font-size: 16px; font-weight: bold; color: red;'>Database Error (".$this->conn->ErrorNo().")</p>\n<p>".$this->conn->ErrorMsg()."</p>";
|
echo "<p style='font-size: 16px; font-weight: bold; color: red;'>Database Error (".$this->conn->ErrorNo().")</p>\n<p>".$this->conn->ErrorMsg()."</p>";
|
||||||
|
@ -964,12 +966,21 @@ class TSMMonitor {
|
||||||
$arrval = "";
|
$arrval = "";
|
||||||
$arrop = "";
|
$arrop = "";
|
||||||
|
|
||||||
$operators = array ("<", "=", "<>", ">");
|
$operators = array ("<", "=", "<>", ">", "LIKE");
|
||||||
|
|
||||||
$searcharr = $_SESSION["search"][$this->GETVars['qq']];
|
$searcharr = $_SESSION["search"][$this->GETVars['qq']];
|
||||||
if (isset($searcharr)) {
|
if ($_POST["wcfield"] != "") {
|
||||||
|
$arrfield = $_POST["wcfield"];
|
||||||
|
} else if (isset($searcharr)){
|
||||||
$arrfield = $searcharr["field"];
|
$arrfield = $searcharr["field"];
|
||||||
|
}
|
||||||
|
if ($_POST["wcval"] != "") {
|
||||||
|
$arrval = $_POST["wcval"];
|
||||||
|
} else if (isset($searcharr)){
|
||||||
$arrval = $searcharr["val"];
|
$arrval = $searcharr["val"];
|
||||||
|
}
|
||||||
|
if ($_POST["wcop"] != "") {
|
||||||
|
$arrop = $_POST["wcop"];
|
||||||
|
} else if (isset($searcharr)){
|
||||||
$arrop = $searcharr["op"];
|
$arrop = $searcharr["op"];
|
||||||
}
|
}
|
||||||
$sql = "SHOW COLUMNS FROM res_".$this->configarray["queryarray"][$this->GETVars['qq']]["name"]."_".$this->GETVars['server'];
|
$sql = "SHOW COLUMNS FROM res_".$this->configarray["queryarray"][$this->GETVars['qq']]["name"]."_".$this->GETVars['server'];
|
||||||
|
@ -987,7 +998,7 @@ class TSMMonitor {
|
||||||
$fieldbox.= "</select>";
|
$fieldbox.= "</select>";
|
||||||
|
|
||||||
// Build Operator Combobox
|
// Build Operator Combobox
|
||||||
if ($arrop=="") $arrop="=";
|
if ($arrop == "") $arrop="=";
|
||||||
$opbox = "<select name='wcop' size=1 onChange='' class='button topnavbutton'>";
|
$opbox = "<select name='wcop' size=1 onChange='' class='button topnavbutton'>";
|
||||||
foreach ($operators as $op) {
|
foreach ($operators as $op) {
|
||||||
$opbox.= '<option value="'.$op.'"';
|
$opbox.= '<option value="'.$op.'"';
|
||||||
|
|
|
@ -156,8 +156,11 @@ include_once "includes/page_head.php";
|
||||||
$whereclause["field"] = $_POST["wcfield"];
|
$whereclause["field"] = $_POST["wcfield"];
|
||||||
$whereclause["val"] = $_POST["wcval"];
|
$whereclause["val"] = $_POST["wcval"];
|
||||||
$whereclause["op"] = $_POST["wcop"];
|
$whereclause["op"] = $_POST["wcop"];
|
||||||
//}
|
if ($whereclause["op"] == 'LIKE') {
|
||||||
if ($whereclause["field"]!="" && $whereclause["val"]!="") {
|
$whereclause["val"] = ereg_replace("\*","%",$whereclause["val"]);
|
||||||
|
$_POST["wcval"] = $whereclause["val"];
|
||||||
|
}
|
||||||
|
if ($whereclause["field"] != "" && $whereclause["val"] != "") {
|
||||||
if ($_POST["Clear"] == "Clear") {
|
if ($_POST["Clear"] == "Clear") {
|
||||||
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
|
$_SESSION["search"][$tsmmonitor->GETVars['qq']] = "";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue