summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-06-27 07:29:32 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-06-27 07:29:32 +0000
commita840c40a485076ed3b5f43e79ddb4bec59afb862 (patch)
treeb44fd2b467200f0ea3f72329a5650a0d83a4f095 /frontends/php/include/config.inc.php
parente2a49f81092e445f549e3cac4c0d57a2b14df7fb (diff)
- changed type of lastlogsize to long in structure METRIC (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2980 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php72
1 files changed, 34 insertions, 38 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 53a653c6..3dd12d49 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1070,57 +1070,53 @@ COpt::profiling_start("page");
# Show screen cell containing plain text values
function& get_screen_plaintext($itemid,$elements)
{
+ global $DB_TYPE;
+
$item=get_item_by_itemid($itemid);
- if($item["value_type"]==ITEM_VALUE_TYPE_FLOAT)
- {
- $sql="select clock,value from history where itemid=$itemid".
- " order by clock desc";
- }
- else if($item["value_type"]==ITEM_VALUE_TYPE_UINT64)
- {
- $sql="select clock,value from history_uint where itemid=$itemid".
- " order by clock desc";
- }
- else if($item["value_type"]==ITEM_VALUE_TYPE_TEXT)
+ switch($item["value_type"])
{
- $sql="select clock,value from history_text where itemid=$itemid".
- " order by clock desc";
- }
- else
- {
- $sql="select clock,value from history_str where itemid=$itemid".
- " order by clock desc";
+ case ITEM_VALUE_TYPE_FLOAT: $history_table = "history"; break;
+ case ITEM_VALUE_TYPE_UINT64: $history_table = "history_uint"; break;
+ case ITEM_VALUE_TYPE_TEXT: $history_table = "history_text"; break;
+ default: $history_table = "history_str"; break;
}
+
+ $sql="select h.clock,h.value,i.valuemapid from ".$history_table." h, items i where".
+ " h.itemid=i.itemid and i.itemid=$itemid order by clock desc";
+
$result=DBselect($sql,$elements);
$table = new CTableInfo();
$table->SetHeader(array(S_TIMESTAMP,item_description($item["description"],$item["key_"])));
while($row=DBfetch($result))
{
- if($item["value_type"]==ITEM_VALUE_TYPE_TEXT)
+ switch($item["value_type"])
{
- $value = nbsp(htmlspecialchars($row["value"]));
- }
- else if($item["value_type"]==ITEM_VALUE_TYPE_STRING)
- {
- $value = nbsp(htmlspecialchars($row["value"]));
- }
- else
- {
- if($DB_TYPE == "ORACLE" && $item["value_type"]==ITEM_VALUE_TYPE_TEXT)
- {
- if(isset($row["value"]))
+ case ITEM_VALUE_TYPE_TEXT:
+ if($DB_TYPE == "ORACLE")
{
- $value = $row["value"]->load();
+ if(isset($row["value"]))
+ {
+ $row["value"] = $row["value"]->load();
+ }
+ else
+ {
+ $row["value"] = "";
+ }
}
- else
- {
- $value = "";
- }
- } else {
+ /* do not use break */
+ case ITEM_VALUE_TYPE_STR:
+ $value = nbsp(htmlspecialchars($row["value"]));
+ break;
+
+ default:
$value = $row["value"];
- }
+ break;
}
+
+ if($row["valuemapid"] > 0)
+ $value = replace_value_by_map($value, $row["valuemapid"]);
+
$table->AddRow(array(date(S_DATE_FORMAT_YMDHMS,$row["clock"]), $value));
}
return $table;
@@ -2640,7 +2636,7 @@ COpt::profiling_stop("script");
$row = DBfetch($result);
if($row)
{
- return $row["newvalue"].SPACE."($value)";
+ return $row["newvalue"]." "."($value)";
}
return $value;
}