diff options
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/alarms.php | 4 | ||||
-rw-r--r-- | frontends/php/audit.php | 2 | ||||
-rw-r--r-- | frontends/php/bulkloader.php | 4 | ||||
-rw-r--r-- | frontends/php/chart2.php | 4 | ||||
-rw-r--r-- | frontends/php/config.php | 67 | ||||
-rw-r--r-- | frontends/php/graphs.php | 4 | ||||
-rw-r--r-- | frontends/php/hosts.php | 8 | ||||
-rw-r--r-- | frontends/php/include/db.inc.php | 4 | ||||
-rw-r--r-- | frontends/php/index.php | 4 | ||||
-rw-r--r-- | frontends/php/items.php | 2 | ||||
-rw-r--r-- | frontends/php/map.php | 4 | ||||
-rw-r--r-- | frontends/php/triggers.php | 4 |
12 files changed, 25 insertions, 86 deletions
diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php index 1aa3a45c..084613ed 100644 --- a/frontends/php/alarms.php +++ b/frontends/php/alarms.php @@ -162,9 +162,11 @@ if($row["value"] == 1 && $row["acknowledged"] == 1) { $db_acks = get_acknowledges_by_alarmid($row["alarmid"]); + $rows=0; + while($a=DBfetch($db_acks)) $rows++; $ack=array( new CSpan(S_YES,"off"), - SPACE."(".DBnum_rows($db_acks).SPACE, + SPACE."(".$rows.SPACE, new CLink(S_SHOW, "acknow.php?alarmid=".$row["alarmid"],"action"), ")" diff --git a/frontends/php/audit.php b/frontends/php/audit.php index 742087eb..805c6d16 100644 --- a/frontends/php/audit.php +++ b/frontends/php/audit.php @@ -70,7 +70,7 @@ $sql="select max(auditid) as max from audit"; $result=DBselect($sql); $row=DBfetch($result); - $maxauditid=@iif(DBnum_rows($result)>0,$row["max"],0); + $maxauditid=@iif($row,$row["max"],0); if(!isset($_REQUEST["start"])) { diff --git a/frontends/php/bulkloader.php b/frontends/php/bulkloader.php index 9ad52d78..07bd1be3 100644 --- a/frontends/php/bulkloader.php +++ b/frontends/php/bulkloader.php @@ -88,9 +88,9 @@ // Determine which template, if any this host is linked to $sqlResult=DBselect("select distinct(hostid) from hosts where status=". HOST_STATUS_TEMPLATE . " and host=".zbx_dbstr($tmpHostTemplate)); - if(DBnum_rows($sqlResult)==1) + $row=DBfetch($sqlResult); + if($row) { - $row=DBfetch($sqlResult); $hostTemplate=$row["hostid"]; } else diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index 1a4342c2..36574112 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -45,9 +45,9 @@ $db_hosts = get_hosts_by_graphid($_REQUEST["graphid"]); $name=$row["name"]; - if(DBnum_rows($db_hosts)==1) + $db_host = DBfetch($db_hosts); + if($db_host) { - $db_host = DBfetch($db_hosts); $name = $db_host["host"].":".$name; } if(isset($_REQUEST["width"])&&$_REQUEST["width"]>0) diff --git a/frontends/php/config.php b/frontends/php/config.php index 856c086a..dd83c084 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -419,73 +419,6 @@ $table->show(); } } -/* -// Disabled - elseif($_REQUEST["config"]==2) - { - echo "<br>"; - show_table_header(S_ESCALATION_RULES_BIG); - - table_begin(); - table_header(array(S_ID,S_DESCRIPTION_SMALL,S_DEFAULT,S_ACTIONS)); - - $result=DBselect("select * from escalations order by name"); - $col=0; - while($row=DBfetch($result)) - { - $yes=iif($row["dflt"]==1,array("value"=>S_YES,"class"=>"on"),array("value"=>S_NO,"class"=>"off")); - - $actions="<a href=\"config.php?config=2®ister=change&escalationid=".$row["escalationid"]."\">".S_CHANGE."</a>"; - table_row(array( - $row["escalationid"], - $row["name"], - $yes, - $actions),$col++); - } - if(DBnum_rows($result)==0) - { - echo "<TR BGCOLOR=#EEEEEE>"; - echo "<TD COLSPAN=4 ALIGN=CENTER>".S_NO_ESCALATION_RULES_DEFINED."</TD>"; - echo "<TR>"; - } - table_end(); - - insert_escalation_form($_REQUEST["escalationid"]); - - if(isset($_REQUEST["escalationid"])) - { - echo "<br>"; - show_table_header(S_ESCALATION_RULES); - - table_begin(); - table_header(array(S_LEVEL,S_PERIOD,S_DELAY_BEFORE_ACTION,S_DO,S_ACTIONS)); - - $result=DBselect("select * from escalation_rules order by level"); - $col=0; - while($row=DBfetch($result)) - { - $actions="<a href=\"config.php?config=2®ister=change&escalationid=".$_REQUEST["escalationid"]."&escalationruleid=".$row["escalationruleid"]."\">".S_CHANGE."</a>"; - $actiontypes=array("Do nothing","Execute action","Increase severity","Increase administrative hierarcy"); - - table_row(array( - $row["level"], - $row["period"], - $row["delay"], - $actiontypes[$row["actiontype"]], - $actions),$col++); - } - if(DBnum_rows($result)==0) - { - echo "<TR BGCOLOR=#EEEEEE>"; - echo "<TD COLSPAN=5 ALIGN=CENTER>".S_NO_ESCALATION_DETAILS."</TD>"; - echo "<TR>"; - } - table_end(); - - insert_escalation_rule_form($_REQUEST["escalationid"],$_REQUEST["escalationruleid"]); - } - } -*/ elseif($_REQUEST["config"]==3) { if(isset($_REQUEST["form"])) diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index f281ba7c..133ddb9a 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -238,9 +238,9 @@ "graph.php?graphid=".$row["graphid"]); } else { $real_hosts = get_realhosts_by_graphid($row["templateid"]); - if(DBnum_rows($real_hosts) == 1) + $real_host = DBfetch($real_hosts); + if($real_host) { - $real_host = DBfetch($real_hosts); $name = array( new CLink($real_host["host"],"graphs.php?". "hostid=".$real_host["hostid"], diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 5f3a3a43..0695a0b9 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -668,7 +668,6 @@ $hosts = DBSelect("select * from hosts where templateid=".$template["hostid"]. " and status in (".HOST_STATUS_MONITORED.",".HOST_STATUS_NOT_MONITORED.")". " order by host"); -// if(DBnum_rows($hosts) <= 0) continue; $host_list = array(); while($host = DBfetch($hosts)) { @@ -799,13 +798,18 @@ $db_app["name"] ); } + $items=get_items_by_applicationid($db_app["applicationid"]); + $rows=0; + while(DBfetch($items)) $rows++; + + $table->AddRow(array( array(new CCheckBox("applications[]",NULL,NULL,NULL,$db_app["applicationid"]), SPACE, $db_app["applicationid"]), $name, array(new CLink(S_ITEMS,"items.php?hostid=".$db_app["hostid"],"action"), - SPACE."(".DBnum_rows(get_items_by_applicationid($db_app["applicationid"])).")") + SPACE."($rows)") )); } $footerButtons = array(); diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index fb60305b..bc84a16d 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -202,7 +202,7 @@ } } - function DBnum_rows($result) +/* function DBnum_rows($result) { global $DB_TYPE; @@ -221,7 +221,7 @@ $result=FALSE; } return 0; - } + }*/ function DBinsert_id($result,$table,$field) { diff --git a/frontends/php/index.php b/frontends/php/index.php index 83d794af..a314630e 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -61,9 +61,9 @@ $result=DBselect("select u.userid,u.alias,u.name,u.surname,u.url,u.refresh from users u where". " u.alias=".zbx_dbstr($name)." and u.passwd=".zbx_dbstr($password)); - if(DBnum_rows($result)==1) + $row=DBfetch($result); + if($row) { - $row=DBfetch($result); $USER_DETAILS["userid"] = $row["userid"]; $USER_DETAILS["alias"] = $row["alias"]; $USER_DETAILS["name"] = $row["name"]; diff --git a/frontends/php/items.php b/frontends/php/items.php index 73735bc8..c6b27944 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -302,7 +302,7 @@ echo BR; $db_hosts=DBselect("select hostid from hosts"); - if(isset($_REQUEST["form"])&&isset($_REQUEST["hostid"])&&DBnum_rows($db_hosts)>0) + if(isset($_REQUEST["form"])&&isset($_REQUEST["hostid"])&&DBfetch($db_hosts)) { // FORM insert_item_form(); diff --git a/frontends/php/map.php b/frontends/php/map.php index 62eb9858..56f74d69 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -89,9 +89,9 @@ $db_images = DBselect("select image from images". " where imagetype=2 and name=".zbx_dbstr($background)); - if(DBnum_rows($db_images)==1) + $db_image = DBfetch($db_images); + if($db_image) { - $db_image = DBfetch($db_images); $back = ImageCreateFromString($db_image["image"]); ImageCopy($im,$back,0,0,0,0,imagesx($back),imagesy($back)); } diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 5b60fd6c..aa9724ec 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -311,9 +311,9 @@ ); } else { $real_hosts = get_realhosts_by_triggerid($row["triggerid"]); - if(DBnum_rows($real_hosts) == 1) + $real_host = DBfetch($real_hosts); + if($real_host) { - $real_host = DBfetch($real_hosts); array_push($description, new CLink($real_host["host"], "triggers.php?&hostid=".$real_host["hostid"], 'action'), |