summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 10:27:05 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 10:27:05 +0000
commit8aee7a4bf11b6a36d74892f56d8937219cba0be0 (patch)
tree8cb0ef378685a801cc14e2228ca4bf7fe46238ff /frontends/php/include
parent4eeeb02ee16f99f6b2d692f7e863ebfca66c1c63 (diff)
downloadzabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.tar.gz
zabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.tar.xz
zabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.zip
Cleanup of PHP code.
git-svn-id: svn://svn.zabbix.com/trunk@2357 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/actions.inc.php15
-rw-r--r--frontends/php/include/config.inc.php16
-rw-r--r--frontends/php/include/maps.inc.php15
-rw-r--r--frontends/php/include/media.inc.php36
4 files changed, 67 insertions, 15 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 1e07f988..6d3ea372 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -19,6 +19,21 @@
**/
?>
<?php
+ function get_action_by_actionid($actionid)
+ {
+ $sql="select * from actions where actionid=$actionid";
+ $result=DBselect($sql);
+ if(DBnum_rows($result) == 1)
+ {
+ return DBfetch($result);
+ }
+ else
+ {
+ error("No action with actionid=[$actionid]");
+ }
+ return $result;
+ }
+
# Update Action
function update_action( $actionid, $triggerid, $userid, $good, $delay, $subject, $message, $scope, $severity, $recipient, $usrgrpid, $maxrepeats, $repeatdelay)
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 25e5582e..cf3fa45d 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -43,6 +43,7 @@
include_once "include/profiles.inc.php";
include_once "include/services.inc.php";
include_once "include/maps.inc.php";
+ include_once "include/media.inc.php";
function info($msg)
{
@@ -628,21 +629,6 @@
return $result;
}
- function get_action_by_actionid($actionid)
- {
- $sql="select * from actions where actionid=$actionid";
- $result=DBselect($sql);
- if(DBnum_rows($result) == 1)
- {
- return DBfetch($result);
- }
- else
- {
- error("No action with actionid=[$actionid]");
- }
- return $result;
- }
-
function get_usergroup_by_usrgrpid($usrgrpid)
{
$result=DBselect("select usrgrpid,name from usrgrp where usrgrpid=$usrgrpid");
diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
index 08fdc2c8..9845240f 100644
--- a/frontends/php/include/maps.inc.php
+++ b/frontends/php/include/maps.inc.php
@@ -34,6 +34,21 @@
return $result;
}
+ function get_sysmaps_hosts_by_shostid($shostid)
+ {
+ $sql="select * from sysmaps_hosts where shostid=$shostid";
+ $result=DBselect($sql);
+ if(DBnum_rows($result) == 1)
+ {
+ return DBfetch($result);
+ }
+ else
+ {
+ error("No sysmap host with shostid=[$shostid]");
+ }
+ return $result;
+ }
+
# Delete System Map
function delete_sysmap( $sysmapid )
diff --git a/frontends/php/include/media.inc.php b/frontends/php/include/media.inc.php
new file mode 100644
index 00000000..7e56732c
--- /dev/null
+++ b/frontends/php/include/media.inc.php
@@ -0,0 +1,36 @@
+<?php
+/*
+** ZABBIX
+** Copyright (C) 2000-2005 SIA Zabbix
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**/
+?>
+<?php
+ function get_media_by_mediaid($mediaid)
+ {
+ $sql="select * from media where mediaid=$mediaid";
+ $result=DBselect($sql);
+ if(DBnum_rows($result) == 1)
+ {
+ return DBfetch($result);
+ }
+ else
+ {
+ error("No media with mediaid=[$mediaid]");
+ }
+ return $result;
+ }
+?>