summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
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
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')
-rw-r--r--frontends/php/include/config.inc.php72
-rw-r--r--frontends/php/include/db.inc.php12
-rw-r--r--frontends/php/include/locales/en_gb.inc.php2
3 files changed, 41 insertions, 45 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;
}
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index d115a66e..d3fd55a2 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -22,13 +22,13 @@
// DATABASE CONFIGURATION
-// $DB_TYPE ="ORACLE";
+ $DB_TYPE ="ORACLE";
// $DB_TYPE ="POSTGRESQL";
- $DB_TYPE ="MYSQL";
+// $DB_TYPE ="MYSQL";
$DB_SERVER ="localhost";
- $DB_DATABASE ="osmiy";
- $DB_USER ="root";
- $DB_PASSWORD ="";
+// $DB_DATABASE ="osmiy";
+ $DB_USER ="scott";
+ $DB_PASSWORD ="tiger";
// END OF DATABASE CONFIGURATION
global $USER_DETAILS;
@@ -182,7 +182,7 @@ COpt::savesqlrequest($query);
if($DB_TYPE == "ORACLE")
{
// echo "DBfetch<br>";
- if(!ocifetchinto($cursor,$row,OCI_ASSOC+OCI_RETURN_NULLS))
+ if(!ocifetchinto($cursor, $row, OCI_ASSOC+OCI_NUM+OCI_RETURN_NULLS))
{
return FALSE;
}
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 1142a08e..7508deac 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -280,7 +280,7 @@
"S_COMPARE"=> "Compare",
// Footer
- "S_ZABBIX_VER"=> "ZABBIX 1.1",
+ "S_ZABBIX_VER"=> "ZABBIX 1.1patch1",
"S_COPYRIGHT_BY"=> "Copyright 2001-2006 by ",
"S_CONNECTED_AS"=> "Connected as",
"S_SIA_ZABBIX"=> "SIA Zabbix",