• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP form_text_box函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中form_text_box函数的典型用法代码示例。如果您正苦于以下问题:PHP form_text_box函数的具体用法?PHP form_text_box怎么用?PHP form_text_box使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了form_text_box函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _data_template_field__template_name

function _data_template_field__template_name($field_name, $field_value = "", $field_id = 0) {
	require_once(CACTI_BASE_PATH . "/lib/sys/html_form.php");

	?>
	<tr bgcolor="#<?php echo field_get_row_color();?>">
		<td width="50%">
			<span class="textEditTitle"><?php echo _("Name");?></span><br>
			<?php echo _("The name given to this data template.");?>
		</td>
		<td>
			<?php form_text_box($field_name, $field_value, "", 150, 30, "text", $field_id);?>
		</td>
	</tr>
	<?php
}
开发者ID:songchin,项目名称:Cacti,代码行数:15,代码来源:data_template_form.php


示例2: _data_preset_color__hex

function _data_preset_color__hex($field_name, $field_value = "", $field_id = 0) {
	require_once(CACTI_BASE_PATH . "/lib/sys/html_form.php");

	?>
	<tr class="<?php echo field_get_row_style();?>">
		<td width="50%" class="field-row">
			<span class="textEditTitle"><?php echo _("Hex");?></span><br>
			<?php echo _("The hex value for this color; valid range: 000000-FFFFFF.");?>
		</td>
		<td class="field-row">
			<?php form_text_box($field_name, $field_value, "", 6, 20, "text", $field_id);?>
		</td>
		<td align="right" class="field-row">
			<span class="field-required">(required)</span>
		</td>
	</tr>
	<?php
}
开发者ID:songchin,项目名称:Cacti,代码行数:18,代码来源:data_preset_color_form.php


示例3: data_source_template_display_general

function data_source_template_display_general($data_template, $header_label) {
	global $colors;
	require_once(CACTI_BASE_PATH . "/lib/data_source/data_source_info.php");
	require_once(CACTI_BASE_PATH . "/lib/data_template/data_template_info.php");

	# fetch all settings for this graph template
	if (isset($data_template["id"])) {
		$template_data = db_fetch_row("SELECT * FROM data_template_data WHERE data_template_id=" . $data_template["id"] . " AND local_data_id=0");
	}else {
		$template_data = array();
	}

	print "<form method='post' action='" .  basename($_SERVER["PHP_SELF"]) . "' name='data_data_source_template_edit'>\n";

	# the template header
	html_start_box("<strong>" . __("Data Source Template") . "</strong> $header_label", "100", $colors["header"], 0, "center", "", true);
	$header_items = array(__("Field"), __("Value"));
	print "<tr><td>";
	html_header($header_items, 2, true, 'header_data_template');

	draw_edit_form(array(
		"config" => array("no_form_tag" => true),
		"fields" => inject_form_variables(data_template_form_list(), (isset($data_template) ? $data_template : array()), (isset($template_data) ? $template_data : array()))
		));

	print "</table></td></tr>";		/* end of html_header */
	html_end_box(false);
	form_hidden_box("data_template_id", $template_data["data_template_id"], "0");
	form_hidden_box("data_template_data_id", $template_data["id"], "0");
	form_hidden_box("current_rrd", (isset($_GET["current_rrd"]) ? $_GET["current_rrd"] : "0"), "0");
	form_hidden_box("save_component_template", 1, "");


	html_start_box("<strong>" . __("Data Source") . "</strong>", "100", $colors["header"], 0, "center", "", true);
	draw_template_edit_form('header_data_source', data_source_form_list(), $template_data, false);
	html_end_box();


	$i = 0;
	if (!empty($_GET["id"])) {
		/* get each INPUT field for this data input source */
		$fields = db_fetch_assoc("SELECT * FROM data_input_fields WHERE data_input_id=" . $template_data["data_input_id"] . " AND input_output='in' ORDER BY sequence");

		html_start_box("<strong>" . __("Custom Data") . "</strong> [data input: " . db_fetch_cell("SELECT name FROM data_input WHERE id=" . $template_data["data_input_id"]) . "]", "100", $colors["header"], 0, "center", "", true);
		$header_items = array(__("Field"), __("Value"));
		print "<tr><td>";
		html_header($header_items, 2, true, 'data_source_custom_data');

		/* loop through each field found */
		if (sizeof($fields) > 0) {
		foreach ($fields as $field) {
			$data_input_data = db_fetch_row("SELECT t_value,value FROM data_input_data WHERE data_template_data_id=" . $template_data["id"] . " AND data_input_field_id=" . $field["id"]);

			if (sizeof($data_input_data) > 0) {
				$old_value = $data_input_data["value"];
			}else{
				$old_value = "";
			}

			form_alternate_row_color("custom_data" . $field["id"]); ?>
				<td class='template_checkbox'>
					<strong><?php print $field["name"];?></strong><br>
					<?php form_checkbox("t_value_" . $field["data_name"], $data_input_data["t_value"], "<em>Use Per-Data Source Value (Ignore this Value)</em>", "", "", get_request_var("id"));?>
				</td>
				<td>
					<?php form_text_box("value_" . $field["data_name"],$old_value,"","");?>
					<?php if ((preg_match('/^' . VALID_HOST_FIELDS . '$/i', $field["type_code"])) && ($data_input_data["t_value"] == "")) { print "<br><em>Value will be derived from the device if this field is left empty.</em>\n"; } ?>
				</td>
			<?php
			form_end_row();
		}
		}else{
			print "<tr><td><em>" . __("No Input Fields for the Selected Data Input Source") . "</em></td></tr>";
		}

		print "</table></td></tr>";		/* end of html_header */
		html_end_box(false);
	}

	form_save_button_alt("url!data_templates.php");
}
开发者ID:songchin,项目名称:Cacti,代码行数:81,代码来源:data_templates.php


示例4: _data_preset_rra_item__hw_window_length

function _data_preset_rra_item__hw_window_length($field_name, $field_value = "", $field_id = 0) {
	require_once(CACTI_BASE_PATH . "/lib/sys/html_form.php");

	?>
	<tr class="<?php echo field_get_row_style();?>" id="row_field_hw_window_length_<?php echo $field_id;?>">
		<td width="50%" class="field-row">
			<span class="textEditTitle"><?php echo _("Window Length (Holt-Winters)");?></span><br>
			<?php echo _("The number of points contained within a window. Must be greater than or equal to the threshold and less than 28.");?>
		</td>
		<td class="field-row">
			<?php form_text_box($field_name, $field_value, "9", 6, 10, "text", $field_id);?>
		</td>
		<td align="right" class="field-row">
			<span class="field-required">(required)</span>
		</td>
	</tr>
	<?php
}
开发者ID:songchin,项目名称:Cacti,代码行数:18,代码来源:data_preset_rra_form.php


示例5: form_actions

function form_actions()
{
    global $host_actions;
    /* ================= input validation ================= */
    input_validate_input_regex(get_request_var_post('drp_action'), '^([a-zA-Z0-9_]+)$');
    /* ==================================================== */
    /* if we are to save this form, instead of display it */
    if (isset($_POST['selected_items'])) {
        $selected_items = unserialize(stripslashes($_POST['selected_items']));
        if ($_POST['drp_action'] == '1') {
            /* delete */
            db_execute('DELETE FROM host_template WHERE ' . array_to_sql_or($selected_items, 'id'));
            db_execute('DELETE FROM host_template_snmp_query WHERE ' . array_to_sql_or($selected_items, 'host_template_id'));
            db_execute('DELETE FROM host_template_graph WHERE ' . array_to_sql_or($selected_items, 'host_template_id'));
            /* "undo" any device that is currently using this template */
            db_execute('UPDATE host SET host_template_id=0 WHERE ' . array_to_sql_or($selected_items, 'host_template_id'));
        } elseif ($_POST['drp_action'] == '2') {
            /* duplicate */
            for ($i = 0; $i < count($selected_items); $i++) {
                /* ================= input validation ================= */
                input_validate_input_number($selected_items[$i]);
                /* ==================================================== */
                duplicate_host_template($selected_items[$i], $_POST['title_format']);
            }
        }
        header('Location: host_templates.php');
        exit;
    }
    /* setup some variables */
    $host_list = '';
    $i = 0;
    /* loop through each of the host templates selected on the previous page and get more info about them */
    while (list($var, $val) = each($_POST)) {
        if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) {
            /* ================= input validation ================= */
            input_validate_input_number($matches[1]);
            /* ==================================================== */
            $host_list .= '<li>' . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM host_template WHERE id = ?'), array($matches[1])) . '<br>';
            $host_array[$i] = $matches[1];
            $i++;
        }
    }
    top_header();
    html_start_box('<strong>' . $host_actions[$_POST['drp_action']] . '</strong>', '60%', '', '3', 'center', '');
    print "<form action='host_templates.php' autocomplete='off' method='post'>\n";
    if (isset($host_array) && sizeof($host_array)) {
        if ($_POST['drp_action'] == '1') {
            /* delete */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea'>\n\t\t\t\t\t\t<p>Are you sure you want to delete the following Device Template(s)? All Devices currently associated\n\t\t\t\t\t\twith these Device Template(s) will lose that assocation.</p>\n\t\t\t\t\t\t<p><ul>{$host_list}</ul></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Delete Device Template(s)'>";
        } elseif ($_POST['drp_action'] == '2') {
            /* duplicate */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea'>\n\t\t\t\t\t\t<p>When you click \"Continue\", the following Device Template(s) will be duplicated. You can\n\t\t\t\t\t\toptionally change the title format for the new Device Template(s).</p>\n\t\t\t\t\t\t<p><ul>{$host_list}</ul></p>\n\t\t\t\t\t\t<p><strong>Title Format:</strong><br>";
            form_text_box('title_format', '<template_title> (1)', '', '255', '30', 'text');
            print "</p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Duplicate Device Template(s)'>";
        }
    } else {
        print "<tr><td class='even'><span class='textError'>You must select at least one host template.</span></td></tr>\n";
        $save_html = "<input type='button' value='Return' onClick='window.history.back()'>";
    }
    print "\t<tr>\n\t\t\t<td align='right' class='saveRow'>\n\t\t\t\t<input type='hidden' name='action' value='actions'>\n\t\t\t\t<input type='hidden' name='selected_items' value='" . (isset($host_array) ? serialize($host_array) : '') . "'>\n\t\t\t\t<input type='hidden' name='drp_action' value='" . $_POST['drp_action'] . "'>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
    html_end_box();
    bottom_footer();
}
开发者ID:MrWnn,项目名称:cacti,代码行数:65,代码来源:host_templates.php


示例6: draw_custom_data_row

function draw_custom_data_row($field_name, $data_input_field_id, $data_template_data_id, $current_value) {
	$field = db_fetch_row("select data_name,type_code from data_input_fields where id=$data_input_field_id");

	if (($field["type_code"] == "index_type") && (db_fetch_cell("select local_data_id from data_template_data where id=$data_template_data_id") > 0)) {
		$index_type = db_fetch_assoc("select
			host_snmp_cache.field_name
			from data_template_data,data_local,host_snmp_cache
			where data_template_data.local_data_id=data_local.id
			and data_local.snmp_query_id=host_snmp_cache.snmp_query_id
			and data_template_data.id=$data_template_data_id
			group by host_snmp_cache.field_name");

		if (sizeof($index_type) == 0) {
			print "<em>Data query data sources must be created through <a href='graphs_new.php'>New Graphs</a>.</em>\n";
		}else{
			form_dropdown($field_name, $index_type, "field_name", "field_name", $current_value, "", "", "");
		}
	}elseif (($field["type_code"] == "output_type") && (db_fetch_cell("select local_data_id from data_template_data where id=$data_template_data_id") > 0)) {
		$output_type = db_fetch_assoc("select
			snmp_query_graph.id,
			snmp_query_graph.name
			from data_template_data,data_local,snmp_query_graph
			where data_template_data.local_data_id=data_local.id
			and data_local.snmp_query_id=snmp_query_graph.snmp_query_id
			and data_template_data.id=$data_template_data_id
			group by snmp_query_graph.id");

		if (sizeof($output_type) == 0) {
			print "<em>Data query data sources must be created through <a href='graphs_new.php'>New Graphs</a>.</em>\n";
		}else{
			form_dropdown($field_name, $output_type, "name", "id", $current_value, "", "", "");
		}
	}else{
		form_text_box($field_name, $current_value, "", "");
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:36,代码来源:html_form_template.php


示例7: template_edit


//.........这里部分代码省略.........
    _data_source_field__polling_interval("polling_interval", true, isset($data_template["polling_interval"]) ? $data_template["polling_interval"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_polling_interval", isset($data_template["t_polling_interval"]) ? $data_template["t_polling_interval"] : "");
    _data_source_field__active("active", true, isset($data_template["active"]) ? $data_template["active"] : "", empty($_GET["id"]) ? 0 : $_GET["id"], "t_active", isset($data_template["t_active"]) ? $data_template["t_active"] : "");
    html_end_box();
    /* ==================== Box: Data Source Item ==================== */
    html_start_box("<strong>" . _("Data Source Item") . "</strong>", empty($_GET["id"]) ? "" : "javascript:document.forms[0].action.value='item_add';submit_redirect(0, '" . htmlspecialchars("data_templates.php?action=item_add&id=" . $_GET["id"]) . "', '')");
    /* the user clicked the "add item" link. we need to make sure they get redirected back to
     * this page if an error occurs */
    if ($_GET["action"] == "item_add") {
        form_hidden_box("redirect_item_add", "x", "");
    }
    /* this allows a "blank" data template item to be displayed when the user wants to create
     * a new one */
    if (!isset($data_template_items) || sizeof($data_template_items) == 0 || $_GET["action"] == "item_add") {
        if (isset($data_template_items)) {
            $next_index = sizeof($data_template_items);
        } else {
            $next_index = 0;
        }
        $data_template_items[$next_index] = array();
    }
    if (sizeof($data_template_items) > 0) {
        if ($_data_input_type == DATA_INPUT_TYPE_SCRIPT) {
            $script_output_fields = db_fetch_assoc("select * from data_input_fields where data_input_id = {$_script_id} and input_output='out' order by name");
            $field_input_description = _("Script Output Field");
        } else {
            if ($_data_input_type == DATA_INPUT_TYPE_DATA_QUERY) {
                $field_list = api_data_query_field_list($_data_query_id, DATA_QUERY_FIELD_TYPE_OUTPUT);
                $data_query_output_fields = array();
                if (sizeof($field_list) > 0) {
                    foreach ($field_list as $field) {
                        $data_query_output_fields[$field["name"]] = $field["name"] . " (" . $field["name_desc"] . ")";
                    }
                }
                $field_input_description = _("Data Query Output Field");
            } else {
                if ($_data_input_type == DATA_INPUT_TYPE_SNMP) {
                    $field_input_description = _("SNMP OID");
                }
            }
        }
        foreach ($data_template_items as $item) {
            if ($_data_input_type != DATA_INPUT_TYPE_NONE) {
                ?>
				<tr bgcolor="<?php 
                print $colors["header_panel_background"];
                ?>
">
					<td class='textSubHeaderDark' colspan="2">
						<?php 
                print isset($item["data_source_name"]) ? $item["data_source_name"] : "(" . _("New Data Template Item") . ")";
                ?>
					</td>
					<td class='textSubHeaderDark' align='right'>
						<?php 
                if (isset($item["id"]) && sizeof($data_template_items) > 1) {
                    print "[<a href='data_templates.php?action=item_remove&id=" . $item["id"] . "&data_template_id=" . $item["data_template_id"] . "' class='linkOverDark'>remove</a>]\n";
                }
                ?>
					</td>
				</tr>
				<tr bgcolor="#e1e1e1">
					<td width="50%" style="border-bottom: 1px solid #a1a1a1;">
						<font class='textEditTitle'>Field Input: <?php 
                print $field_input_description;
                ?>
</font><br>
					</td>
					<td style="border-bottom: 1px solid #a1a1a1;" colspan="2">
						<?php 
                if ($_data_input_type == DATA_INPUT_TYPE_SCRIPT) {
                    form_dropdown("dsi|field_input_value|" . (isset($item["id"]) ? $item["id"] : "0"), $script_output_fields, "name", "data_name", isset($item["field_input_value"]) ? $item["field_input_value"] : "", "", "");
                } else {
                    if ($_data_input_type == DATA_INPUT_TYPE_DATA_QUERY) {
                        form_dropdown("dsi|field_input_value|" . (isset($item["id"]) ? $item["id"] : "0"), $data_query_output_fields, "", "", isset($item["field_input_value"]) ? $item["field_input_value"] : "", "", "");
                    } else {
                        if ($_data_input_type == DATA_INPUT_TYPE_SNMP) {
                            form_text_box("dsi|field_input_value|" . (isset($item["id"]) ? $item["id"] : "0"), isset($item["field_input_value"]) ? $item["field_input_value"] : "", "", "100", 40, "text", 0);
                        }
                    }
                }
                ?>
					</td>
				</tr>
				<?php 
            }
            $_field_id = isset($item["id"]) ? $item["id"] : 0;
            field_reset_row_color();
            field_increment_row_color();
            _data_source_item_field__data_source_name("dsi|data_source_name|{$_field_id}", true, isset($item["data_source_name"]) ? $item["data_source_name"] : "", $_field_id);
            _data_source_item_field__rrd_minimum("dsi|rrd_minimum|{$_field_id}", true, isset($item["rrd_minimum"]) ? $item["rrd_minimum"] : "", $_field_id, "dsi|t_rrd_minimum|{$_field_id}", isset($item["t_rrd_minimum"]) ? $item["t_rrd_minimum"] : "");
            _data_source_item_field__rrd_maximum("dsi|rrd_maximum|{$_field_id}", true, isset($item["rrd_maximum"]) ? $item["rrd_maximum"] : "", $_field_id, "dsi|t_rrd_maximum|{$_field_id}", isset($item["t_rrd_maximum"]) ? $item["t_rrd_maximum"] : "");
            _data_source_item_field__data_source_type("dsi|data_source_type|{$_field_id}", true, isset($item["data_source_type"]) ? $item["data_source_type"] : "", $_field_id, "dsi|t_data_source_type|{$_field_id}", isset($item["t_data_source_type"]) ? $item["t_data_source_type"] : "");
            _data_source_item_field__rrd_heartbeat("dsi|rrd_heartbeat|{$_field_id}", true, isset($item["rrd_heartbeat"]) ? $item["rrd_heartbeat"] : "", $_field_id, "dsi|t_rrd_heartbeat|{$_field_id}", isset($item["t_rrd_heartbeat"]) ? $item["t_rrd_heartbeat"] : "");
        }
    }
    html_end_box();
    form_hidden_box("data_template_id", empty($_GET["id"]) ? 0 : $_GET["id"], "");
    form_hidden_box("action_post", "data_template_edit");
    form_save_button("data_templates.php");
}
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:data_templates.php


示例8: form_actions

function form_actions()
{
    global $colors, $graph_actions;
    /* if we are to save this form, instead of display it */
    if (isset($_POST["selected_items"])) {
        $selected_items = unserialize(stripslashes($_POST["selected_items"]));
        if ($_POST["drp_action"] == "1") {
            /* delete */
            db_execute("delete from graph_templates where " . array_to_sql_or($selected_items, "id"));
            $graph_template_input = db_fetch_assoc("select id from graph_template_input where " . array_to_sql_or($selected_items, "graph_template_id"));
            if (sizeof($graph_template_input) > 0) {
                foreach ($graph_template_input as $item) {
                    db_execute("delete from graph_template_input_defs where graph_template_input_id=" . $item["id"]);
                }
            }
            db_execute("delete from graph_template_input where " . array_to_sql_or($selected_items, "graph_template_id"));
            db_execute("delete from graph_templates_graph where " . array_to_sql_or($selected_items, "graph_template_id") . " and local_graph_id=0");
            db_execute("delete from graph_templates_item where " . array_to_sql_or($selected_items, "graph_template_id") . " and local_graph_id=0");
            db_execute("delete from host_template_graph where " . array_to_sql_or($selected_items, "graph_template_id"));
            /* "undo" any graph that is currently using this template */
            db_execute("update graph_templates_graph set local_graph_template_graph_id=0,graph_template_id=0 where " . array_to_sql_or($selected_items, "graph_template_id"));
            db_execute("update graph_templates_item set local_graph_template_item_id=0,graph_template_id=0 where " . array_to_sql_or($selected_items, "graph_template_id"));
            db_execute("update graph_local set graph_template_id=0 where " . array_to_sql_or($selected_items, "graph_template_id"));
        } elseif ($_POST["drp_action"] == "2") {
            /* duplicate */
            for ($i = 0; $i < count($selected_items); $i++) {
                /* ================= input validation ================= */
                input_validate_input_number($selected_items[$i]);
                /* ==================================================== */
                duplicate_graph(0, $selected_items[$i], $_POST["title_format"]);
            }
        }
        header("Location: graph_templates.php");
        exit;
    }
    /* setup some variables */
    $graph_list = "";
    $i = 0;
    /* loop through each of the graphs selected on the previous page and get more info about them */
    while (list($var, $val) = each($_POST)) {
        if (ereg("^chk_([0-9]+)\$", $var, $matches)) {
            /* ================= input validation ================= */
            input_validate_input_number($matches[1]);
            /* ==================================================== */
            $graph_list .= "<li>" . db_fetch_cell("select name from graph_templates where id=" . $matches[1]) . "<br>";
            $graph_array[$i] = $matches[1];
        }
        $i++;
    }
    include_once "./include/top_header.php";
    html_start_box("<strong>" . $graph_actions[$_POST["drp_action"]] . "</strong>", "60%", $colors["header_panel"], "3", "center", "");
    print "<form action='graph_templates.php' method='post'>\n";
    if ($_POST["drp_action"] == "1") {
        /* delete */
        print "\t<tr>\n\t\t\t\t<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>\n\t\t\t\t\t<p>Are you sure you want to delete the following graph templates? Any graphs attached\n\t\t\t\t\tto these templates will become individual graphs.</p>\n\t\t\t\t\t<p>{$graph_list}</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t";
    } elseif ($_POST["drp_action"] == "2") {
        /* duplicate */
        print "\t<tr>\n\t\t\t\t<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>\n\t\t\t\t\t<p>When you click save, the following graph templates will be duplicated. You can\n\t\t\t\t\toptionally change the title format for the new graph templates.</p>\n\t\t\t\t\t<p>{$graph_list}</p>\n\t\t\t\t\t<p><strong>Title Format:</strong><br>";
        form_text_box("title_format", "<template_title> (1)", "", "255", "30", "text");
        print "</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t";
    }
    if (!isset($graph_array)) {
        print "<tr><td bgcolor='#" . $colors["form_alternate1"] . "'><span class='textError'>You must select at least one graph template.</span></td></tr>\n";
        $save_html = "";
    } else {
        $save_html = "<input type='image' src='images/button_yes.gif' alt='Save' align='absmiddle'>";
    }
    print "\t<tr>\n\t\t\t<td align='right' bgcolor='#eaeaea'>\n\t\t\t\t<input type='hidden' name='action' value='actions'>\n\t\t\t\t<input type='hidden' name='selected_items' value='" . (isset($graph_array) ? serialize($graph_array) : '') . "'>\n\t\t\t\t<input type='hidden' name='drp_action' value='" . $_POST["drp_action"] . "'>\n\t\t\t\t<a href='graph_templates.php'><img src='images/button_no.gif' alt='Cancel' align='absmiddle' border='0'></a>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
    html_end_box();
    include_once "./include/bottom_footer.php";
}
开发者ID:songchin,项目名称:Cacti,代码行数:71,代码来源:graph_templates.php


示例9:

								}

								/* draw the acual header and textbox on the form */
								print "<p><strong>" . $form_check_string . $array["friendly_name"] . "</strong>";

								if (!empty($array["friendly_name"])) {
									print ": " . $array["description"];
								}else{
									print "<strong>" . $array["description"] . "</strong>";
								}

								print "<br>";

								switch ($array["method"]) {
								case 'textbox':
									form_text_box($name, $current_value, "", "", "40", "text");
									break;
								case 'filepath':
									form_filepath_box($name, $current_value, "", "", "40", "text");
									break;
								case 'drop_array':
									form_dropdown($name, $array["array"], "", "", $current_value, "", "");
									break;
								}

								print "<br></p>";
							}

							$i++;
						}?>
开发者ID:songchin,项目名称:Cacti,代码行数:30,代码来源:index.php


示例10: form_actions

function form_actions()
{
    global $host_actions;
    /* ================= input validation ================= */
    input_validate_input_regex(get_request_var_post('drp_action'), "^([a-zA-Z0-9_]+)\$");
    /* ==================================================== */
    /* if we are to save this form, instead of display it */
    if (isset($_POST["selected_items"])) {
        $selected_items = sanitize_unserialize_selected_items($_POST['selected_items']);
        if ($selected_items != false) {
            if ($_POST["drp_action"] == "1") {
                /* delete */
                db_execute("delete from host_template where " . array_to_sql_or($selected_items, "id"));
                db_execute("delete from host_template_snmp_query where " . array_to_sql_or($selected_items, "host_template_id"));
                db_execute("delete from host_template_graph where " . array_to_sql_or($selected_items, "host_template_id"));
                /* "undo" any device that is currently using this template */
                db_execute("update host set host_template_id=0 where " . array_to_sql_or($selected_items, "host_template_id"));
            } elseif ($_POST["drp_action"] == "2") {
                /* duplicate */
                for ($i = 0; $i < count($selected_items); $i++) {
                    duplicate_host_template($selected_items[$i], $_POST["title_format"]);
                }
            }
        }
        header("Location: host_templates.php");
        exit;
    }
    /* setup some variables */
    $host_list = "";
    $i = 0;
    /* loop through each of the host templates selected on the previous page and get more info about them */
    while (list($var, $val) = each($_POST)) {
        if (preg_match("/^chk_([0-9]+)\$/", $var, $matches)) {
            /* ================= input validation ================= */
            input_validate_input_number($matches[1]);
            /* ==================================================== */
            $host_list .= "<li>" . htmlspecialchars(db_fetch_cell("select name from host_template where id=" . $matches[1])) . "</li>";
            $host_array[$i] = $matches[1];
            $i++;
        }
    }
    include_once "./include/top_header.php";
    html_start_box("<strong>" . $host_actions[$_POST["drp_action"]] . "</strong>", "60%", "", "3", "center", "");
    print "<form action='host_templates.php' autocomplete='off' method='post'>\n";
    if (isset($host_array) && sizeof($host_array)) {
        if ($_POST["drp_action"] == "1") {
            /* delete */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea'>\n\t\t\t\t\t\t<p>Are you sure you want to delete the following Host Template(s)? All Devices currently associated\n\t\t\t\t\t\twith these Host Template(s) will lose that assocation.</p>\n\t\t\t\t\t\t<p><ul>{$host_list}</ul></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Delete Host Template(s)'>";
        } elseif ($_POST["drp_action"] == "2") {
            /* duplicate */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea'>\n\t\t\t\t\t\t<p>When you click \"Continue\", the following Host Template(s) will be duplicated. You can\n\t\t\t\t\t\toptionally change the title format for the new Host Template(s).</p>\n\t\t\t\t\t\t<p><ul>{$host_list}</ul></p>\n\t\t\t\t\t\t<p><strong>Title Format:</strong><br>";
            form_text_box("title_format", "<template_title> (1)", "", "255", "30", "text");
            print "</p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Duplicate Host Template(s)'>";
        }
    } else {
        print "<tr><td class='even'><span class='textError'>You must select at least one host template.</span></td></tr>\n";
        $save_html = "<input type='button' value='Return' onClick='window.history.back()'>";
    }
    print "\t<tr>\n\t\t\t<td align='right' class='saveRow'>\n\t\t\t\t<input type='hidden' name='action' value='actions'>\n\t\t\t\t<input type='hidden' name='selected_items' value='" . (isset($host_array) ? serialize($host_array) : '') . "'>\n\t\t\t\t<input type='hidden' name='drp_action' value='" . $_POST["drp_action"] . "'>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
    html_end_box();
    include_once "./include/bottom_footer.php";
}
开发者ID:teddywen,项目名称:cacti,代码行数:64,代码来源:host_templates.php


示例11: data_source_form_actions


//.........这里部分代码省略.........
						<p><ul>$ds_list</ul></p>
						";
						if (sizeof($graphs) > 0) {
							form_alternate_row_color();

							print "<td class='textArea'><p class='textArea'>" . __("The following graphs are using these data sources:") . "</p>\n";

							foreach ($graphs as $graph) {
								print "<strong>" . $graph["title_cache"] . "</strong><br>\n";
							}

							print "<br>";
							form_radio_button("delete_type", "3", "1", __("Leave the graphs untouched."), "1"); print "<br>";
							form_radio_button("delete_type", "3", "2", __("Delete all <strong>graph items</strong> that reference these data sources."), "1"); print "<br>";
							form_radio_button("delete_type", "3", "3", __("Delete all <strong>graphs</strong> that reference these data sources."), "1"); print "<br>";
							print "</td></tr>";
						}
					print "
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_CHANGE_TEMPLATE) { /* change graph template */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("Choose a data template and click save to change the data template for the following data souces. Be aware that all warnings will be suppressed during the conversion, so graph data loss is possible.") . "</p>
						<p><ul>$ds_list</ul></p>
						<p><strong>". __("New Data Source Template:") . "</strong><br>"; form_dropdown("data_template_id",db_fetch_assoc("select data_template.id,data_template.name from data_template order by data_template.name"),"name","id","","","0"); print "</p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_CHANGE_HOST) { /* change device */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("Choose a new device for these data sources.") . "</p>
						<p><ul>$ds_list</ul></p>
						<p><strong>" . __("New Host:") . "</strong><br>"; form_dropdown("device_id",db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from device order by description,hostname"),"name","id","","","0"); print "</p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_DUPLICATE) { /* duplicate */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("When you click save, the following data sources will be duplicated. You can optionally change the title format for the new data sources.") . "</p>
						<p><ul>$ds_list</ul></p>
						<p><strong>" . __("Title Format:") . "</strong><br>"; form_text_box("title_format", "<ds_title> (1)", "", "255", "30", "text"); print "</p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_CONVERT_TO_TEMPLATE) { /* data source -> data template */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("When you click save, the following data sources will be converted into data templates.  You can optionally change the title format for the new data templates.") . "</p>
						<p><ul>$ds_list</ul></p>
						<p><strong>" . __("Title Format:") . "</strong><br>"; form_text_box("title_format", "<ds_title> Template", "", "255", "30", "text"); print "</p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_ENABLE) { /* data source enable */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("When you click yes, the following data sources will be enabled.") . "</p>
						<p><ul>$ds_list</ul></p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_DISABLE) { /* data source disable */
			print "	<tr>
					<td class='textArea'>
						<p>" . __("When you click yes, the following data sources will be disabled.") . "</p>
						<p><ul>$ds_list</ul></p>
					</td>
				</tr>\n
				";
		}elseif (get_request_var_post("drp_action") === DS_ACTION_REAPPLY_SUGGESTED_NAMES) { /* reapply suggested data source naming */
			print "	<tr>
					<td class='textArea' bgcolor='#" . $colors["form_alternate1"]. "'>
						<p>" . __("When you click yes, the following data sources will will have their suggested naming conventions recalculated.") . "</p>
						<p><ul>$ds_list</ul></p>
					</td>
				</tr>\n
				";
			}
	} else {
		print "	<tr>
				<td class='textArea'>
					<p>" . __("You must first select a Data Source.  Please select 'Return' to return to the previous menu.") . "</p>
				</td>
			</tr>\n";
	}

	if (!sizeof($ds_array) || get_request_var_post("drp_action") === ACTION_NONE) {
		form_return_button_alt();
	}else{
		form_yesno_button_alt(serialize($ds_array), get_request_var_post("drp_action"));
	}

	html_end_box();

	include_once(CACTI_BASE_PATH . "/include/bottom_footer.php");
}
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:data_source_form.php


示例12: form_actions


//.........这里部分代码省略.........

	include_once("./include/top_header.php");

	html_start_box("<strong>" . $user_actions[get_request_var_post("drp_action")] . "</strong>", "60%", $colors["header_panel"], "3", "center", "");

	print "<form action='user_admin.php' method='post'>\n";

	if ((get_request_var_post("drp_action") == "1") && (sizeof($user_array))) { /* delete */
		print "
			<tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					<p>Are you sure you want to delete the following users?</p>
					<p>$user_list</p>
				</td>
			</tr>\n";
	}
	$user_id = "";
	if ((get_request_var_post("drp_action") == "2") && (sizeof($user_array))) { /* copy */
		$user_id = $user_array[0];
		$user_realm = db_fetch_cell("SELECT realm FROM user_auth WHERE id = " . $user_id);

		print "
			<tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					Would you like to copy this user?<br><br>
				</td>
			</tr><tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					Template Username: <i>" . db_fetch_cell("SELECT username FROM user_auth WHERE id=" . $user_id) . "</i>
				</td>
			</tr><tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
				New Username: ";
		print form_text_box("new_username", "", "", 25);
		print "				</td>
			</tr><tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					New Full Name: ";
		print form_text_box("new_fullname", "", "", 35);
		print "				</td>
			</tr><tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					New Realm: \n";
		print form_dropdown("new_realm", $auth_realms, "", "", $user_realm, "", 0);
		print "				</td>

			</tr>\n";
	}

	if ((get_request_var_post("drp_action") == "3") && (sizeof($user_array))) { /* enable */
		print "
			<tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					<p>Are you sure you want to enable the following users?</p>
					<p>$user_list</p>
				</td>
			</tr>\n";
	}

	if ((get_request_var_post("drp_action") == "4") && (sizeof($user_array))) { /* disable */
		print "
			<tr>
				<td class='textArea' bgcolor='#" . $colors["form_alternate1"] . "'>
					<p>Are you sure you want to disable the following users?</p>
					<p>$user_list</p>
				</td>
开发者ID:songchin,项目名称:Cacti,代码行数:67,代码来源:user_admin.php


示例13: _script_field_field__regexp_match

function _script_field_field__regexp_match($field_name, $field_value = "", $field_id = 0) {
	require_once(CACTI_BASE_PATH . "/lib/sys/html_form.php");

	?>
	<tr class="<?php echo field_get_row_style();?>">
		<td class="field-row" width="50%">
			<span class="textEditTitle"><?php echo _("Regular Expression Match");?></span><br>
			<?php echo _("If you want to require a certain regular expression to be matched againt input data, enter it here (ereg format).");?>
		</td>
		<td class="field-row" colspan="2">
			<?php form_text_box($field_name, $field_value, "", 100, 30, "text", $field_id);?>
		</td>
	</tr>
	<?php
}
开发者ID:songchin,项目名称:Cacti,代码行数:15,代码来源:script_form.php


示例14: _graph_item_field__legend_format


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP form_text_input函数代码示例发布时间:2022-05-15
下一篇:
PHP form_text函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap