summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/db.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-26 13:07:57 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-26 13:07:57 +0000
commit3ad9ec2c7d4be13068a49fb19a1fb8f3781dd485 (patch)
treeaa2576f5266f28ddd94a7a22b15270802e1d8339 /frontends/php/include/db.inc.php
parent20dfeb5d1966879f9d76e69cab4872831119ba9f (diff)
- [DEV-57] added better "hosts info" selection in screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4920 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/db.inc.php')
-rw-r--r--frontends/php/include/db.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index c931b01f..ad6bb8b1 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -593,4 +593,18 @@ if(isset($DB_TYPE) && $DB_TYPE == "ORACLE") {
return $ret2;
}
+
+ function create_id_by_nodeid($id,$nodeid=0){
+
+ global $ZBX_LOCALNODEID;
+ $nodeid = ($nodeid == 0)?get_current_nodeid(false):$nodeid;
+
+ $id=remove_nodes_from_id($id);
+ $id=bcadd($id,bcadd(bcmul($nodeid,'100000000000000'),bcmul($ZBX_LOCALNODEID,'100000000000')));
+ return $id;
+ }
+
+ function remove_nodes_from_id($id){
+ return bcmod($id,'100000000000');
+ }
?>