本文整理汇总了PHP中html_create_list函数的典型用法代码示例。如果您正苦于以下问题:PHP html_create_list函数的具体用法?PHP html_create_list怎么用?PHP html_create_list使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_create_list函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: graphs
//.........这里部分代码省略.........
}
$sql_query .= ' FROM host_snmp_cache
WHERE host_id=' . $host['id'] . '
AND snmp_query_id=' . $snmp_query['id'] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index\n\t\t\t\t\t\t{$sql_order}\n\t\t\t\t\t\tLIMIT " . $row_limit * ($page - 1) . ',' . $row_limit;
$rows_query = 'SELECT host_id, snmp_query_id, snmp_index
FROM host_snmp_cache
WHERE host_id=' . $host['id'] . '
AND snmp_query_id=' . $snmp_query['id'] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index";
$snmp_query_indexes = db_fetch_assoc($sql_query);
$total_rows = sizeof(db_fetch_assoc($rows_query));
if (($page - 1) * $row_limit > $total_rows) {
$page = 1;
$_REQUEST['page' . $query['id']] = $page;
load_current_session_value('page' . $query['id'], 'sess_graphs_new_page' . $query['id'], '1');
}
$nav = html_nav_bar('graphs_new.php', MAX_DISPLAY_PAGES, $page, $row_limit, $total_rows, 15, 'Items', 'page' . $snmp_query['id']);
print $nav;
while (list($field_name, $field_array) = each($xml_array['fields'])) {
if ($field_array['direction'] == 'input' && sizeof($field_names)) {
foreach ($field_names as $row) {
if ($row['field_name'] == $field_name) {
$html_dq_header .= "<td class='tableSubHeaderColumn'>" . $field_array['name'] . "</td>\n";
break;
}
}
}
}
if (!sizeof($snmp_query_indexes)) {
print "<tr class='odd'><td>This Data Query returned 0 rows, perhaps there was a problem executing this\n\t\t\t\t\t\t\tData Query. You can <a href='" . htmlspecialchars('host.php?action=query_verbose&id=' . $snmp_query['id'] . '&host_id=' . $host['id']) . "'>run this Data Query in debug mode</a> to get more information.</td></tr>\n";
} else {
print "<tr class='tableHeader'>\n\t\t\t\t\t\t\t\t{$html_dq_header}\n\t\t\t\t\t\t\t\t<td width='1%' align='center' class='tableSubHeaderCheckbox' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_" . $snmp_query['id'] . "' title='Select All' onClick='SelectAll(\"sg_" . $snmp_query['id'] . "\",this.checked)'></td>\n\n\t\t\t\t\t\t\t</tr>\n";
}
$row_counter = 0;
$column_counter = 0;
$fields = array_rekey($field_names, 'field_name', 'field_name');
if (sizeof($snmp_query_indexes) > 0) {
foreach ($snmp_query_indexes as $row) {
$query_row = $snmp_query['id'] . '_' . encode_data_query_index($row['snmp_index']);
print "<tr id='line{$query_row}' class='selectable " . ($row_counter % 2 == 0 ? 'odd' : 'even') . "'>";
$i++;
$column_counter = 0;
reset($xml_array['fields']);
while (list($field_name, $field_array) = each($xml_array['fields'])) {
if ($field_array['direction'] == 'input') {
if (in_array($field_name, $fields)) {
if (isset($row[$field_name])) {
print "<td><span id='text{$query_row}" . '_' . $column_counter . "'>" . (strlen($_REQUEST['filter']) ? preg_replace('/(' . preg_quote($_REQUEST['filter']) . ')/i', "<span class='filteredValue'>\\1</span>", $row[$field_name]) : $row[$field_name]) . '</span></td>';
} else {
print "<td><span id='text{$query_row}" . '_' . $column_counter . "'></span></td>";
}
$column_counter++;
}
}
}
print "<td class='checkbox' align='right'>";
print "<input type='checkbox' name='sg_{$query_row}' id='sg_{$query_row}'>";
print '</td>';
print "</tr>\n";
$row_counter++;
}
}
if ($total_rows > $row_limit) {
print $nav;
}
} else {
print "<tr class='odd'><td class='textError'>Search Returned no Rows.</td></tr>\n";
}
} else {
print "<tr class='odd'><td class='textError'>Error in data query.</td></tr>\n";
}
print '</table>';
/* draw the graph template drop down here */
$data_query_graphs = db_fetch_assoc_prepared('SELECT snmp_query_graph.id, snmp_query_graph.name FROM snmp_query_graph WHERE snmp_query_graph.snmp_query_id = ? ORDER BY snmp_query_graph.name', array($snmp_query['id']));
if (sizeof($data_query_graphs) == 1) {
echo "<input type='hidden' id='sgg_" . $snmp_query['id'] . "' name='sgg_" . $snmp_query['id'] . "' value='" . $data_query_graphs[0]['id'] . "'>\n";
} elseif (sizeof($data_query_graphs) > 1) {
print "\t<table align='center' width='100%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='100%' valign='middle'>\n\t\t\t\t\t\t\t\t<img src='images/arrow.gif' align='absmiddle' alt=''>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style='white-space:nowrap;font-style: italic;'' align='right'>\n\t\t\t\t\t\t\t\tSelect a Graph Type to Create\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\t\t\t<select name='sgg_" . $snmp_query['id'] . "' id='sgg_" . $snmp_query['id'] . "' onChange='dqUpdateDeps(" . $snmp_query['id'] . ',' . (isset($column_counter) ? $column_counter : '') . ");'>\n\t\t\t\t\t\t\t\t\t";
html_create_list($data_query_graphs, 'name', 'id', '0');
print "\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n";
}
print '<br>';
$script .= 'dqUpdateDeps(' . $snmp_query['id'] . ',' . $num_visible_fields . ");\n";
}
}
}
if (strlen($script)) {
$script .= "</script>\n";
print $script;
}
form_hidden_box('save_component_graph', '1', '');
if (!empty($_REQUEST['host_id'])) {
form_hidden_box('host_id', $host['id'], '0');
form_hidden_box('host_template_id', $host['host_template_id'], '0');
}
if (isset($_SERVER['HTTP_REFERER']) && !substr_count($_SERVER['HTTP_REFERER'], 'graphs_new')) {
$_REQUEST['returnto'] = basename($_SERVER['HTTP_REFERER']);
}
load_current_session_value('returnto', 'sess_graphs_new_returnto', '');
form_save_button($_REQUEST['returnto']);
}
示例2: graphs
//.........这里部分代码省略.........
usort($data_query_indexes, "usort_numeric");
}
}
}
?>
<table width='98%' style='background-color: #<?php
echo $colors["form_alternate2"];
?>
; border: 1px solid #<?php
echo $colors["header_background"];
?>
;' align='center' cellpadding='3' cellspacing='0'>
<tr>
<td bgcolor='#<?php
echo $colors["header_background"];
?>
' colspan='<?php
echo sizeof($data_query_field_names) + 1;
?>
'>
<table cellspacing='0' cellpadding='0' width='100%' >
<tr>
<td class='textHeaderDark'>
<strong><?php
echo _("Data Query");
?>
</strong> [<?php
echo $data_query["name"];
?>
]
</td>
<td align='right' nowrap>
<a href='graphs_new.php?action=query_reload&id=<?php
echo $data_query["id"];
?>
&host_id=<?php
echo $host["id"];
?>
'><img src='<?php
echo html_get_theme_images_path("reload_icon_small.gif");
?>
' alt='<?php
echo _("Reload Associated Query");
?>
' border='0' align='absmiddle'></a>
</td>
</tr>
</table>
</td>
</tr>
<?php
if (sizeof($attached_graph_templates) == 0) {
echo "<tr bgcolor='#" . $colors["form_alternate1"] . "'><td>" . _("This data query is not being used by any graph templates. You must create at least one graph template that references to a data template using this data query.") . "</td></tr>\n";
} else {
if (sizeof($data_query_field_names) == 0) {
echo "<tr bgcolor='#" . $colors["form_alternate1"] . "'><td>" . _("This data query returned 0 rows, perhaps there was a problem executing this data query. You can") . " <a href='devices.php?action=query_verbose&id=" . $data_query["id"] . "&host_id=" . $host["id"] . "'>" . _("run this data query in debug mode</a> to get more information.") . "</td></tr>\n";
} else {
echo "<tr bgcolor='#" . $colors["header_panel_background"] . "'>\n";
foreach ($data_query_field_names as $field_name) {
echo "<td height='1'><strong><font color='#" . $colors["header_text"] . "'>" . $data_query_field_desc[$field_name] . "</font></strong></td>\n";
}
echo "<td width='1%' align='center' bgcolor='#" . $colors["header_panel_background"] . "' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_" . $data_query["id"] . "' title='Select All' onClick='" . _("SelectAll") . "(\"sg_" . $data_query["id"] . "\",this.checked);" . ($use_javascript == true ? "dq_update_selection_indicators();" : "") . "'></td>\n</tr>\n";
}
}
$row_counter = 0;
foreach ($data_query_indexes as $index_value) {
$query_row = $data_query["id"] . "_" . encode_data_query_index($index_value);
echo "<tr id='line{$query_row}' bgcolor='#" . ($row_counter % 2 == 0 ? $colors["form_alternate1"] : $colors["form_alternate2"]) . "'>";
$i++;
$column_counter = 0;
foreach ($data_query_field_names as $field_name) {
echo "<td " . ($use_javascript == true ? "onClick='dq_select_line(" . $data_query["id"] . ",\"" . encode_data_query_index($index_value) . "\");'" : "") . "><span id='text{$query_row}" . "_" . $column_counter . "'>" . (isset($data_query_data[$index_value][$field_name]) ? $data_query_data[$index_value][$field_name] : "") . "</span></td>";
$column_counter++;
}
echo "<td align='right'>";
echo "<input type='checkbox' name='sg_{$query_row}' id='sg_{$query_row}' " . ($use_javascript == true ? "onClick='dq_update_selection_indicators();'" : "") . ">";
echo "</td>";
echo "</tr>\n";
$row_counter++;
}
echo "</table>";
if (sizeof($attached_graph_templates) == 1) {
form_hidden_box("sgg_" . $data_query["id"] . "' id='sgg_" . $data_query["id"], $attached_graph_templates[0]["id"], "");
} elseif (sizeof($attached_graph_templates) > 1) {
print "\t<table align='center' width='98%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='1' valign='top'>\n\t\t\t\t\t\t\t\t<img src='" . html_get_theme_images_path("arrow.gif") . "' alt='' align='absmiddle'> \n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\t\t\t<span style='font-size: 12px; font-style: italic;'>" . _("Select a graph type:") . "</span> \n\t\t\t\t\t\t\t\t<select name='sgg_" . $data_query["id"] . "' id='sgg_" . $data_query["id"] . "' " . ($use_javascript == true ? "onChange='dq_update_deps(" . $data_query["id"] . "," . $num_visible_columns . ");'" : "") . ">\n\t\t\t\t\t\t\t\t\t";
html_create_list($attached_graph_templates, "template_name", "id", "0");
print "\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>";
}
print "<br>";
if ($use_javascript == true) {
print "<script type='text/javascript'>dq_update_deps(" . $data_query["id"] . "," . $num_visible_columns . ");</script>\n";
}
}
}
form_hidden_box("save_component_graph", "1", "");
form_hidden_box("host_id", $host["id"], "0");
form_save_button("graphs_new.php");
print "<script type='text/javascript'>dq_update_selection_indicators();</script>\n";
print "<script type='text/javascript'>gt_update_selection_indicators();</script>\n";
}
示例3: form_dropdown
function form_dropdown($form_name, $form_data, $column_display, $column_id, $form_previous_value, $form_none_entry, $form_default_value, $class = "", $on_change = "")
{
if ($form_previous_value == "") {
$form_previous_value = $form_default_value;
}
if (isset($_SESSION["sess_error_fields"])) {
if (!empty($_SESSION["sess_error_fields"][$form_name])) {
$class .= (strlen($class) ? " " : "") . "txtErrorTextBox";
unset($_SESSION["sess_error_fields"][$form_name]);
}
}
if (isset($_SESSION["sess_field_values"])) {
if (!empty($_SESSION["sess_field_values"][$form_name])) {
$form_previous_value = $_SESSION["sess_field_values"][$form_name];
}
}
if (strlen($class)) {
$class = " class='{$class}' ";
}
if (strlen($on_change)) {
$on_change = " onChange='{$on_change}' ";
}
print "<select id='" . htmlspecialchars($form_name) . "' name='" . htmlspecialchars($form_name) . "'" . $class . $on_change . ">";
if (!empty($form_none_entry)) {
print "<option value='0'" . (empty($form_previous_value) ? " selected" : "") . ">{$form_none_entry}</option>\n";
}
html_create_list($form_data, $column_display, $column_id, htmlspecialchars($form_previous_value, ENT_QUOTES));
print "</select>\n";
}
示例4: graphs
//.........这里部分代码省略.........
foreach ($field_names as $column) {
$field_name = $column["field_name"];
$sql_query .= ", MAX(CASE WHEN field_name='{$field_name}' THEN field_value ELSE NULL END) AS '{$field_name}'";
$i++;
}
}
$sql_query .= " FROM host_snmp_cache\n\t\t\t\t\t\tWHERE host_id=" . $host["id"] . "\n\t\t\t\t\t\tAND snmp_query_id=" . $snmp_query["id"] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index\n\t\t\t\t\t\t{$sql_order}\n\t\t\t\t\t\tLIMIT " . $row_limit * ($page - 1) . "," . $row_limit;
$rows_query = "SELECT host_id, snmp_query_id, snmp_index\n\t\t\t\t\t\tFROM host_snmp_cache\n\t\t\t\t\t\tWHERE host_id=" . $host["id"] . "\n\t\t\t\t\t\tAND snmp_query_id=" . $snmp_query["id"] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index";
$snmp_query_indexes = db_fetch_assoc($sql_query);
$total_rows = sizeof(db_fetch_assoc($rows_query));
if (($page - 1) * $row_limit > $total_rows) {
$page = 1;
$_REQUEST["page" . $query["id"]] = $page;
load_current_session_value("page" . $query["id"], "sess_graphs_new_page" . $query["id"], "1");
}
$nav = html_nav_bar("graphs_new.php", MAX_DISPLAY_PAGES, $page, $row_limit, $total_rows, 15, "Items", "page" . $snmp_query["id"]);
print $nav;
while (list($field_name, $field_array) = each($xml_array["fields"])) {
if ($field_array["direction"] == "input") {
foreach ($field_names as $row) {
if ($row["field_name"] == $field_name) {
$html_dq_header .= "<td class='tableSubHeaderColumn'>" . $field_array["name"] . "</td>\n";
break;
}
}
}
}
if (!sizeof($snmp_query_indexes)) {
print "<tr class='odd'><td>This data query returned 0 rows, perhaps there was a problem executing this\n\t\t\t\t\t\t\tdata query. You can <a href='" . htmlspecialchars("host.php?action=query_verbose&id=" . $snmp_query["id"] . "&host_id=" . $host["id"]) . "'>run this data\n\t\t\t\t\t\t\tquery in debug mode</a> to get more information.</td></tr>\n";
} else {
print "<tr class='tableHeader'>\n\t\t\t\t\t\t\t\t{$html_dq_header}\n\t\t\t\t\t\t\t\t<td width='1%' align='center' class='tableSubHeaderCheckbox' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_" . $snmp_query["id"] . "' title='Select All' onClick='SelectAll(\"sg_" . $snmp_query["id"] . "\",this.checked);dq_update_selection_indicators();'></td>\n\n\t\t\t\t\t\t\t</tr>\n";
}
$row_counter = 0;
$column_counter = 0;
$fields = array_rekey($field_names, "field_name", "field_name");
if (sizeof($snmp_query_indexes) > 0) {
foreach ($snmp_query_indexes as $row) {
$query_row = $snmp_query["id"] . "_" . encode_data_query_index($row["snmp_index"]);
print "<tr id='line{$query_row}' class='" . ($row_counter % 2 == 0 ? "odd" : "even") . "'>";
$i++;
$column_counter = 0;
reset($xml_array["fields"]);
while (list($field_name, $field_array) = each($xml_array["fields"])) {
if ($field_array["direction"] == "input") {
if (in_array($field_name, $fields)) {
if (isset($row[$field_name])) {
print "<td onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($row["snmp_index"]) . "\");'><span id='text{$query_row}" . "_" . $column_counter . "'>" . (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $row[$field_name]) : $row[$field_name]) . "</span></td>";
} else {
print "<td onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($row["snmp_index"]) . "\");'><span id='text{$query_row}" . "_" . $column_counter . "'></span></td>";
}
$column_counter++;
}
}
}
print "<td align='right'>";
print "<input type='checkbox' name='sg_{$query_row}' id='sg_{$query_row}' onClick='dq_update_selection_indicators();'>";
print "</td>";
print "</tr>\n";
$row_counter++;
}
}
if ($total_rows > $row_limit) {
print $nav;
}
} else {
print "<tr class='odd'><td colspan='2' style='color: red; font-size: 12px; font-weight: bold;'>Search Returned no Rows.</td></tr>\n";
}
} else {
print "<tr class='odd'><td colspan='2' style='color: red; font-size: 12px; font-weight: bold;'>Error in data query.</td></tr>\n";
}
print "</table>";
/* draw the graph template drop down here */
$data_query_graphs = db_fetch_assoc("select snmp_query_graph.id,snmp_query_graph.name from snmp_query_graph where snmp_query_graph.snmp_query_id=" . $snmp_query["id"] . " order by snmp_query_graph.name");
if (sizeof($data_query_graphs) == 1) {
echo "<input type='hidden' id='sgg_" . $snmp_query["id"] . "' name='sgg_" . $snmp_query["id"] . "' value='" . $data_query_graphs[0]["id"] . "'>\n";
} elseif (sizeof($data_query_graphs) > 1) {
print "\t<table align='center' width='100%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='1' valign='top'>\n\t\t\t\t\t\t\t\t<img src='images/arrow.gif' alt=''> \n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\t\t\t<span style='font-size: 12px; font-style: italic;'>Select a graph type:</span> \n\t\t\t\t\t\t\t\t<select name='sgg_" . $snmp_query["id"] . "' id='sgg_" . $snmp_query["id"] . "' onChange='dq_update_deps(" . $snmp_query["id"] . "," . (isset($column_counter) ? $column_counter : "") . ");'>\n\t\t\t\t\t\t\t\t\t";
html_create_list($data_query_graphs, "name", "id", "0");
print "\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>";
}
print "<br>";
$script .= "dq_update_deps(" . $snmp_query["id"] . "," . $num_visible_fields . ");\n";
}
}
}
if (strlen($script)) {
$script .= "</script>\n";
print $script;
}
form_hidden_box("save_component_graph", "1", "");
form_hidden_box("host_id", $host["id"], "0");
form_hidden_box("host_template_id", $host["host_template_id"], "0");
if (isset($_SERVER["HTTP_REFERER"]) && !substr_count($_SERVER["HTTP_REFERER"], "graphs_new")) {
$_REQUEST["returnto"] = basename($_SERVER["HTTP_REFERER"]);
}
load_current_session_value("returnto", "sess_graphs_new_returnto", "");
form_save_button($_REQUEST["returnto"]);
print "<script type='text/javascript'>dq_update_selection_indicators();</script>\n";
print "<script type='text/javascript'>gt_update_selection_indicators();</script>\n";
}
示例5: graphs
//.........这里部分代码省略.........
unset($xml_array["fields"][$field_name]);
}
}
}
/* if the user specified a prefered sort order; sort the list of indexes before displaying them */
if (isset($xml_array["index_order_type"])) {
if ($xml_array["index_order_type"] == "numeric") {
usort($snmp_query_indexes, "usort_numeric");
}else if ($xml_array["index_order_type"] == "alphabetic") {
usort($snmp_query_indexes, "usort_alphabetic");
}else if ($xml_array["index_order_type"] == "natural") {
usort($snmp_query_indexes, "usort_natural");
}
}
if ($num_visible_fields == 0) {
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'><td>This data query returned 0 rows, perhaps there was a problem executing this
data query. You can <a href='host.php?action=query_verbose&id=" . $snmp_query["id"] . "&host_id=" . $host["id"] . "'>run this data
query in debug mode</a> to get more information.</td></tr>\n";
}else{
print " <tr bgcolor='#" . $colors["header_panel"] . "'>
$html_dq_header
<td width='1%' align='center' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_" . $snmp_query["id"] . "' title='Select All' onClick='SelectAll(\"sg_" . $snmp_query["id"] . "\",this.checked);" . (($use_javascript == true) ? "dq_update_selection_indicators();" : "") . "'></td>\n
</tr>\n";
}
$row_counter = 0;
if (sizeof($snmp_query_indexes) > 0) {
while (list($id, $snmp_index) = each($snmp_query_indexes)) {
$query_row = $snmp_query["id"] . "_" . encode_data_query_index($snmp_index);
print "<tr id='line$query_row' bgcolor='#" . (($row_counter % 2 == 0) ? "ffffff" : $colors["light"]) . "'>"; $i++;
$column_counter = 0;
reset($xml_array["fields"]);
while (list($field_name, $field_array) = each($xml_array["fields"])) {
if ($field_array["direction"] == "input") {
if (isset($snmp_query_data[$field_name][$snmp_index])) {
print "<td " . (($use_javascript == true) ? "onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($snmp_index) . "\");'" : "") ."><span id='text$query_row" . "_" . $column_counter . "'>" . $snmp_query_data[$field_name][$snmp_index] . "</span></td>";
}else{
print "<td " . (($use_javascript == true) ? "onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($snmp_index) . "\");'" : "") . "><span id='text$query_row" . "_" . $column_counter . "'></span></td>";
}
$column_counter++;
}
}
print "<td align='right'>";
print "<input type='checkbox' name='sg_$query_row' id='sg_$query_row' " . (($use_javascript == true) ? "onClick='dq_update_selection_indicators();'" : "") . ">";
print "</td>";
print "</tr>\n";
$row_counter++;
}
}
}else{
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'><td colspan='2' style='color: red; font-size: 12px; font-weight: bold;'>Error in data query.</td></tr>\n";
}
print "</table>";
/* draw the graph template drop down here */
$data_query_graphs = db_fetch_assoc("select snmp_query_graph.id,snmp_query_graph.name from snmp_query_graph where snmp_query_graph.snmp_query_id=" . $snmp_query["id"] . " order by snmp_query_graph.name");
if (sizeof($data_query_graphs) == 1) {
form_hidden_box("sgg_" . $snmp_query["id"] . "' id='sgg_" . $snmp_query["id"], $data_query_graphs[0]["id"], "");
}elseif (sizeof($data_query_graphs) > 1) {
print " <table align='center' width='98%'>
<tr>
<td width='1' valign='top'>
<img src='images/arrow.gif' alt='' align='absmiddle'>
</td>
<td align='right'>
<span style='font-size: 12px; font-style: italic;'>Select a graph type:</span>
<select name='sgg_" . $snmp_query["id"] . "' id='sgg_" . $snmp_query["id"] . "' " . (($use_javascript == true) ? "onChange='dq_update_deps(" . $snmp_query["id"] . "," . $num_visible_fields . ");'" : "") . ">
"; html_create_list($data_query_graphs,"name","id","0"); print "
</select>
</td>
</tr>
</table>";
}
print "<br>";
if ($use_javascript == true) {
print "<script type='text/javascript'>dq_update_deps(" . $snmp_query["id"] . "," . ($num_visible_fields) . ");</script>\n";
}
}
}
form_hidden_box("save_component_graph", "1", "");
form_hidden_box("host_id", $host["id"], "0");
form_hidden_box("host_template_id", $host["host_template_id"], "0");
form_save_button((isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
print "<script type='text/javascript'>dq_update_selection_indicators();</script>\n";
print "<script type='text/javascript'>gt_update_selection_indicators();</script>\n";
}
示例6: form_callback
function form_callback($form_name, $classic_sql, $column_display, $column_id, $callback, $previous_id, $previous_value, $none_entry, $default_value, $class = "", $on_change = "")
{
if ($previous_value == "") {
$previous_value = $default_value;
}
if (isset($_SESSION["sess_error_fields"])) {
if (!empty($_SESSION["sess_error_fields"][$form_name])) {
$class .= (strlen($class) ? " " : "") . "txtErrorTextBox";
unset($_SESSION["sess_error_fields"][$form_name]);
}
}
if (isset($_SESSION["sess_field_values"])) {
if (!empty($_SESSION["sess_field_values"][$form_name])) {
$previous_value = $_SESSION["sess_field_values"][$form_name];
}
}
if (strlen($class)) {
$class = " class='{$class}' ";
}
if (strlen($on_change)) {
$on_change = " onChange='{$on_change}' ";
}
$theme = read_config_option('selected_theme');
if ($theme == 'classic') {
print "<select id='" . htmlspecialchars($form_name) . "' name='" . htmlspecialchars($form_name) . "'" . $class . $on_change . ">";
if (!empty($none_entry)) {
print "<option value='0'" . (empty($previous_value) ? " selected" : "") . ">{$none_entry}</option>\n";
}
$form_data = db_fetch_assoc($classic_sql);
html_create_list($form_data, $column_display, $column_id, htmlspecialchars($previous_value, ENT_QUOTES));
print "</select>\n";
} else {
$form_prefix = htmlspecialchars($form_name);
print "<span id='{$form_prefix}" . "_wrap' style='width:200px;' class='ui-selectmenu-button ui-widget ui-state-default ui-corner-all'>\n";
print "<span id='{$form_prefix}" . "_click' style='z-index:4' class='ui-icon ui-icon-triangle-1-s'></span>\n";
print "<input id='{$form_prefix}" . "_input' class='ui-selectmenu-text ui-state-default' value='" . htmlspecialchars($previous_value) . "'>\n";
print "</span>\n";
print "<input type='hidden' id='" . $form_prefix . "' name='" . $form_prefix . "' value='" . $previous_id . "'>\n";
?>
<script type='text/javascript'>
var prefix = '<?php
print $form_name;
?>
';
var <?php
print $form_name;
?>
Timer;
var <?php
print $form_name;
?>
ClickTimer;
var <?php
print $form_name;
?>
Open = false;
$(function() {
$('#'+prefix+'_input').autocomplete({
source: '<?php
print $_SERVER['PHP_SELF'];
?>
?action=<?php
print $callback;
?>
',
autoFocus: true,
minLength: 0,
select: function(event,ui) {
$('#'+prefix).val(ui.item.id);
<?php
print $on_change;
?>
;
}
}).css('border', 'none').css('background-color', 'transparent');
$('#'+prefix+'_wrap').dblclick(function() {
<?php
print $form_name;
?>
Open = false;
clearTimeout(<?php
print $form_name;
?>
Timer);
clearTimeout(<?php
print $form_name;
?>
ClickTimer);
$('#'+prefix+'_input').autocomplete('close');
}).click(function() {
if (<?php
print $form_name;
?>
Open) {
$('#'+prefix+'_input').autocomplete('close');
clearTimeout(<?php
print $form_name;
?>
//.........这里部分代码省略.........
示例7: form_dropdown
function form_dropdown($form_name, $form_data, $column_display, $column_id, $form_previous_value, $form_none_entry, $form_default_value, $css_style = "") {
if ($form_previous_value == "") {
$form_previous_value = $form_default_value;
}
if (isset($_SESSION["sess_field_values"])) {
if (!empty($_SESSION["sess_field_values"][$form_name])) {
$form_previous_value = $_SESSION["sess_field_values"][$form_name];
}
}
print "<select name='$form_name' style='$css_style'>";
if (!empty($form_none_entry)) {
print "<option value='0'" . (empty($form_previous_value) ? " selected" : "") . ">$form_none_entry</option>\n";
}
html_create_list($form_data, $column_display, $column_id, htmlspecialchars($form_previous_value, ENT_QUOTES));
print "</select>\n";
}
示例8: form_dropdown
function form_dropdown($field_name, $form_data, $column_display, $column_id, $form_previous_value, $form_none_entry, $form_default_value, $css_style = "", $trim_display_length = 0, $js_onchange = "") {
if ($form_previous_value == "") {
$form_previous_value = $form_default_value;
}
/* always use the cached value if it's available */
if (isset_post_cache_field($field_name)) {
$form_previous_value = get_post_cache_field($field_name);
}
print "<select name='$field_name' id='$field_name' style='$css_style'" . ($js_onchange == "" ? "" : " onChange='$js_onchange'") . ">";
if (!empty($form_none_entry)) {
print "<option value='0'" . (empty($form_previous_value) ? " selected" : "") . ">$form_none_entry</option>\n";
}
html_create_list($form_data, $column_display, $column_id, $form_previous_value, $trim_display_length);
print "</select>\n";
}
示例9: graphs_new
//.........这里部分代码省略.........
</tr>\n";
}
$row_counter = 0;
$column_counter = 0;
$fields = array_rekey($field_names, "field_name", "field_name");
if (sizeof($snmp_query_indexes) > 0) {
foreach($snmp_query_indexes as $row) {
$query_row = $snmp_query["id"] . "_" . encode_data_query_index($row["snmp_index"]);
form_alternate_row_color("line" . $query_row, true);
$column_counter = 0;
reset($xml_array["fields"]);
while (list($field_name, $field_array) = each($xml_array["fields"])) {
if ($field_array["direction"] == "input") {
if (in_array($field_name, $fields)) {
if (isset($row[$field_name])) {
print "<td style='line-height: 1.5em;padding:0px 5px 0px 5px;' onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($row["snmp_index"]) . "\");'><span id='text$query_row" . "_" . $column_counter . "'>" . (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $row[$field_name]) : $row[$field_name]) . "</span></td>";
}else{
print "<td style='line-height: 1.5em;padding:0px 5px 0px 5px;' onClick='dq_select_line(" . $snmp_query["id"] . ",\"" . encode_data_query_index($row["snmp_index"]) . "\");'><span id='text$query_row" . "_" . $column_counter . "'></span></td>";
}
$column_counter++;
}
}
}
print "<td style='padding-right: 4px;' align='right'>";
print "<input type='checkbox' name='sg_$query_row' id='sg_$query_row' onClick='dq_update_selection_indicators();'>";
print "</td>";
print "</tr>\n";
$row_counter++;
}
}
if ($total_rows > $row_limit) {
print $nav;
}
}else{
print "<tr class='rowAlternate1'><td colspan='2' style='color: red; font-size: 12px; font-weight: bold;'>" . __("Search Returned no Rows.") . "</td></tr>\n";
}
}else{
print "<tr class='rowAlternate1'><td colspan='2' style='color: red; font-size: 12px; font-weight: bold;'>" . __("Error in data query.") . "</td></tr>\n";
}
/* draw the graph template drop down here */
$data_query_graphs = db_fetch_assoc("select snmp_query_graph.id,snmp_query_graph.name from snmp_query_graph where snmp_query_graph.snmp_query_id=" . $snmp_query["id"] . " order by snmp_query_graph.name");
if (sizeof($data_query_graphs) == 1) {
html_end_box();
form_hidden_box("sgg_" . $snmp_query["id"], $data_query_graphs[0]["id"], "");
}elseif (sizeof($data_query_graphs) > 1) {
html_end_box(FALSE);
print "<table align='center' width='100%'>
<tr>
<td width='1' valign='top'>
<img src='images/arrow.gif' alt='' align='middle'>
</td>
<td align='right'>
<span class=\"italic\">" . __("Select a graph type:") . "</span>
<select name='sgg_" . $snmp_query["id"] . "' id='sgg_" . $snmp_query["id"] . "' onChange='dq_update_deps(" . $snmp_query["id"] . "," . $column_counter . ");'>
"; html_create_list($data_query_graphs,"name","id","0"); print "
</select>
</td>
</tr>
</table>";
}
print "<script type='text/javascript'>dq_update_deps(" . $snmp_query["id"] . "," . ($num_visible_fields) . ");</script>\n";
}
}
}
form_hidden_box("save_component_graph", "1", "");
form_hidden_box("device_id", $device["id"], "0");
form_hidden_box("device_template_id", $device["device_template_id"], "0");
form_save_button_alt("url!" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : ""));
if (!empty($debug_log)) {
debug_log_clear("new_graphs");
?>
<table class='topBoxAlt'>
<tr>
<td class='mono'>
<?php print $debug_log;?>
</td>
</tr>
</table>
<br>
<?php
}
print "<script type='text/javascript'>dq_update_selection_indicators();</script>\n";
print "<script type='text/javascript'>gt_update_selection_indicators();</script>\n";
}