\n"; echo "\n"; exit(); } /* if (!$objectid) $objectid = "_NewBss"; */ if (!$tablename) $tablename = "OMCR_BSSTABLE"; include("display_type.inc"); include("login_parm.inc"); // // Translate the value to string // e.g. AdminState=2 --> AdminState=Unlocked // function translate($input,$data) { $found=0; if ($data) { $items=split("[,=]",$data); $no_of_items=count($items); for ($i=1;$i<$no_of_items;$i+=2) { if ( $data == $items[$i] ) { $found=$i; break; } } return($items[$found]); } else return($input); } $db = mysql_connect($hostname, $username, $password); mysql_select_db($dbname,$db); if (!isset($language)) $language = "eng"; $sqlstring = "select Object_Name,Attribute_Name,Attribute_Type,Display_Type," . "${language}Display_Name, ${language}Lookup, ${language}Help_Text" . " from OMCR_Meta_Table " . "where Display_Type<>0 AND Object_Name='" . substr($tablename,5) . "'"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); while ( $row = mysqli_fetch_row($result) ) { if ($row[3] == PUSH_BUTTON) //For action item in NMI list($act_object_name[], $act_attribute_name[], $act_attribute_type[], $act_display_type[], $act_display_name[], $act_lookup[], $act_help_text[]) = $row; else list($object_name[],$attribute_name[],$attribute_type[],$display_type[], $display_name[],$lookup[],$help_text[]) = $row; } $no_of_parms = count($attribute_name); if ($no_of_parms == 0) return; $sqlstring = "select " . join(",",$attribute_name) . " from $tablename where bssid=$bssid"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); $no_of_instance = mysqli_num_rows($result); while ( $row = mysqli_fetch_row($result) ) { echo "
"; echo "\n"; $no_of_fields = count($row); for($i=0;$i<$no_of_fields;$i++) { if(!strcasecmp(mysql_field_name($result,$i),"objectid")) { printf("=) %s\n", $row[$i]); break; } } for ($i=0; $i<$no_of_parms; $i++) { //printf("%s%s %s\n",$display_type[$i],$attribute_name[$i],$lookup[$i]); switch($display_type[$i]) { case DO_NOT_DISPLAY: //do not display $widget=""; continue; case PULLDOWN_MENU: //pulldown menu $widget=""; break; case TEXTBOX: //text box $widget=""; break; case LABEL: //label $widget=translate($row[$i],$lookup[$i]); break; case RADIO_BUTTON: //radio button $widget="" . $row[$i] . "\n"; break; case CHECKBOX: //check box $widget=""; break; case TEXTAREA: //text area $widget=""; break; } printf(" \n", $help_text[$i], $display_name[$i], $widget); } echo "
%s%s
\n
\n"; echo "\n"; echo "\n"; $no_of_actions = count($act_attribute_name); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; } ?>