summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/forms.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-03 15:10:07 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-03 15:10:07 +0000
commitcc3aafd58689e4391c75a4d54531cc26bca06c44 (patch)
treee2217ade7edc9ff081e946e2965a168b0867a9f5 /frontends/php/include/forms.inc.php
parenta4bb707afc71f1060abd3f27f7b9a4f12c4bfff6 (diff)
downloadzabbix-cc3aafd58689e4391c75a4d54531cc26bca06c44.tar.gz
zabbix-cc3aafd58689e4391c75a4d54531cc26bca06c44.tar.xz
zabbix-cc3aafd58689e4391c75a4d54531cc26bca06c44.zip
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@2089 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/forms.inc.php')
-rw-r--r--frontends/php/include/forms.inc.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 46fe70bb..e398c8a8 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -1418,4 +1418,73 @@
show_table2_header_end();
}
+
+ # Insert autoregistration form
+ function insert_autoregistration_form($id)
+ {
+ if(isset($id))
+ {
+ $result=DBselect("select * from autoreg where id=$id");
+
+ $row=DBfetch($result);
+
+ $pattern=$row["pattern"];
+ $priority=$row["priority"];
+ $hopstid=$row["hostid"];
+ }
+ else
+ {
+ $pattern="*";
+ $priority=10;
+ $hostid=0;
+ }
+
+ $col=0;
+
+ show_form_begin("autoregistration");
+ echo S_AUTOREGISTRATION;
+
+ show_table2_v_delimiter($col++);
+ echo "<form method=\"get\" action=\"config.php\">";
+ echo "<input class=\"biginput\" name=\"config\" type=\"hidden\" value=\"".$_GET["config"]."\" size=8>";
+ if(isset($id))
+ {
+ echo "<input class=\"biginput\" name=\"id\" type=\"hidden\" value=\"$id\" size=8>";
+ }
+
+ echo S_PATTERN;
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"pattern\" size=64 value=\"$pattern\">";
+
+ show_table2_v_delimiter($col++);
+ echo S_PRIORITY;
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"priority\" size=4 value=\"$priority\">";
+
+ show_table2_v_delimiter($col++);
+ echo S_HOST;
+ show_table2_h_delimiter();
+
+ echo "<select class=\"biginput\" name=\"hostid\">";
+ echo form_select("hostid",0,S_SELECT_HOST_DOT_DOT_DOT);
+
+ $sql="select h.hostid,h.host from hosts h where h.status<>".HOST_STATUS_DELETED." group by h.hostid,h.host order by h.host";
+
+ $result=DBselect($sql);
+ while($row=DBfetch($result))
+ {
+ echo form_select("hostid",$row["hostid"],$row["host"]);
+ }
+ echo "</select>";
+
+ show_table2_v_delimiter2($col++);
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add autoregistration\">";
+ if(isset($id))
+ {
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update autoregistration\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete autoregistration\" onClick=\"return Confirm('Delete selected autoregistration rule?');\">";
+ }
+
+ show_table2_header_end();
+ }
?>