diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-03 08:58:45 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-03 08:58:45 +0000 |
| commit | 1f829e896d022a4ed202d443d127346d26cbf7f2 (patch) | |
| tree | f94630ee96cae994e22450e96848a5d61193a018 /frontends/php/include/forms.inc.php | |
| parent | 9d8c5c8048b648f6b92c51ac96cd3001f55c6253 (diff) | |
| download | zabbix-1f829e896d022a4ed202d443d127346d26cbf7f2.tar.gz zabbix-1f829e896d022a4ed202d443d127346d26cbf7f2.tar.xz zabbix-1f829e896d022a4ed202d443d127346d26cbf7f2.zip | |
- Frontend improvements (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2602 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/forms.inc.php')
| -rw-r--r-- | frontends/php/include/forms.inc.php | 101 |
1 files changed, 30 insertions, 71 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 878b8861..4c2d755a 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -1884,89 +1884,48 @@ $frmHostG->Show(); } -/* - # Insert host profile form - function insert_host_profile_form($hostid,$readonly=0) + # Insert host profile ReadOnly form + function insert_host_profile_form() { - $selected=0; - - if(isset($hostid)) - { - $result=DBselect("select * from hosts_profiles where hostid=$hostid"); - - if(DBnum_rows($result)==1) - { - $row=DBfetch($result); - - $selected=1; - $devicetype=$row["devicetype"]; - $name=$row["name"]; - $os=$row["os"]; - $serialno=$row["serialno"]; - $tag=$row["tag"]; - $macaddress=$row["macaddress"]; - $hardware=$row["hardware"]; - $software=$row["software"]; - $contact=$row["contact"]; - $location=$row["location"]; - $notes=$row["notes"]; - } - } - if($selected==0) - { - $devicetype=""; - $name=""; - $os=""; - $serialno=""; - $tag=""; - $macaddress=""; - $hardware=""; - $software=""; - $contact=""; - $location=""; - $notes=""; - } - $frmHostP = new CFormTable(S_HOST_PROFILE,"hosts.php"); $frmHostP->SetHelp("web.host_profile.php"); - if(isset($_REQUEST["config"])) - { - $frmHostP->AddVar("config",$_REQUEST["config"]); - } - $frmHostP->AddVar("hostid",$hostid); + $result=DBselect("select * from hosts_profiles where hostid=".$_REQUEST["hostid"]); - $frmHostP->AddRow(S_DEVICE_TYPE,new CTextBox("devicetype",$devicetype,61)); - $frmHostP->AddRow(S_NAME,new CTextBox("name",$name,61)); - $frmHostP->AddRow(S_OS,new CTextBox("os",$os,61)); - $frmHostP->AddRow(S_SERIALNO,new CTextBox("serialno",$serialno,61)); - $frmHostP->AddRow(S_TAG,new CTextBox("tag",$tag,61)); - $frmHostP->AddRow(S_MACADDRESS,new CTextBox("macaddress",$macaddress,61)); - $frmHostP->AddRow(S_HARDWARE,new CTextArea("hardware",$hardware,60,4)); - $frmHostP->AddRow(S_SOFTWARE,new CTextArea("software",$software,60,4)); - $frmHostP->AddRow(S_CONTACT,new CTextArea("contact",$contact,60,4)); - $frmHostP->AddRow(S_LOCATION,new CTextArea("location",$location,60,4)); - $frmHostP->AddRow(S_NOTES,new CTextArea("notes",$notes,60,4)); - - if($readonly==0) + if(DBnum_rows($result)==1) { - $frmHostP->AddItemToBottomRow(new CButton("register","add profile")); - if(isset($hostid)) - { - $frmHostP->AddItemToBottomRow(SPACE); - $frmHostP->AddItemToBottomRow(new CButton("register","update profile")); - $frmHostP->AddItemToBottomRow(SPACE); - $frmHostP->AddItemToBottomRow(new CButton("register","delete profile", - "return Confirm('Delete selected profile?');")); - } + $row=DBfetch($result); + + $devicetype=$row["devicetype"]; + $name=$row["name"]; + $os=$row["os"]; + $serialno=$row["serialno"]; + $tag=$row["tag"]; + $macaddress=$row["macaddress"]; + $hardware=$row["hardware"]; + $software=$row["software"]; + $contact=$row["contact"]; + $location=$row["location"]; + $notes=$row["notes"]; + + $frmHostP->AddRow(S_DEVICE_TYPE,new CTextBox("devicetype",$devicetype,61,NULL,'yes')); + $frmHostP->AddRow(S_NAME,new CTextBox("name",$name,61,NULL,'yes')); + $frmHostP->AddRow(S_OS,new CTextBox("os",$os,61,NULL,'yes')); + $frmHostP->AddRow(S_SERIALNO,new CTextBox("serialno",$serialno,61,NULL,'yes')); + $frmHostP->AddRow(S_TAG,new CTextBox("tag",$tag,61,NULL,'yes')); + $frmHostP->AddRow(S_MACADDRESS,new CTextBox("macaddress",$macaddress,61,NULL,'yes')); + $frmHostP->AddRow(S_HARDWARE,new CTextArea("hardware",$hardware,60,4,NULL,'yes')); + $frmHostP->AddRow(S_SOFTWARE,new CTextArea("software",$software,60,4,NULL,'yes')); + $frmHostP->AddRow(S_CONTACT,new CTextArea("contact",$contact,60,4,NULL,'yes')); + $frmHostP->AddRow(S_LOCATION,new CTextArea("location",$location,60,4,NULL,'yes')); + $frmHostP->AddRow(S_NOTES,new CTextArea("notes",$notes,60,4,NULL,'yes')); } else { - $frmHostP->AddItemToBottomRow(SPACE); + $frmHostP->AddSpanRow("Profile for this host is missing","form_row_c"); } $frmHostP->Show(); } -*/ function insert_map_form() { |
