当前位置: 首页>>代码示例>>PHP>>正文


PHP bottom_footer函数代码示例

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


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

示例1: form_save

function form_save()
{
    global $export_types, $export_errors;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post('export_item_id'));
    /* ==================================================== */
    if (isset($_POST['save_component_export'])) {
        $export_errors = 0;
        $xml_data = get_item_xml($_POST['export_type'], $_POST['export_item_id'], (isset($_POST['include_deps']) ? $_POST['include_deps'] : '') == '' ? false : true);
        if ($_POST['output_format'] == '1') {
            top_header();
            print "<table width='100%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . '</pre></td></tr></table>';
            bottom_footer();
        } elseif ($_POST['output_format'] == '2') {
            header('Content-type: application/xml');
            if ($export_errors) {
                echo "WARNING: Export Errors Encountered.  Refresh Browser Window for Details!\n";
            }
            print $xml_data;
        } elseif ($_POST['output_format'] == '3') {
            if ($export_errors) {
                header('Location: templates_export.php');
            } else {
                header('Content-type: application/xml');
                header('Content-Disposition: attachment; filename=cacti_' . $_POST['export_type'] . '_' . strtolower(clean_up_file_name(db_fetch_cell(str_replace('|id|', $_POST['export_item_id'], $export_types[$_POST['export_type']]['title_sql'])))) . '.xml');
                print $xml_data;
            }
        }
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:30,代码来源:templates_export.php

示例2: ds_edit


//.........这里部分代码省略.........
        form_hidden_box('save_component_data', '1', '');
        html_end_box();
    }
    if ((isset($_REQUEST['id']) || isset($_REQUEST['new'])) && empty($data['data_template_id'])) {
        html_start_box('<strong>Data Source</strong>', '100%', '', '3', 'center', '');
        $form_array = array();
        while (list($field_name, $field_array) = each($struct_data_source)) {
            $form_array += array($field_name => $struct_data_source[$field_name]);
            if (!($use_data_template == false || !empty($data_template_data['t_' . $field_name]) || $field_array['flags'] == 'NOTEMPLATE')) {
                $form_array[$field_name]['description'] = '';
            }
            $form_array[$field_name]['value'] = isset($data[$field_name]) ? $data[$field_name] : '';
            $form_array[$field_name]['form_id'] = empty($data['id']) ? '0' : $data['id'];
            if (!($use_data_template == false || !empty($data_template_data['t_' . $field_name]) || $field_array['flags'] == 'NOTEMPLATE')) {
                $form_array[$field_name]['method'] = 'template_' . $form_array[$field_name]['method'];
            }
        }
        draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => inject_form_variables($form_array, isset($data) ? $data : array())));
        html_end_box();
        /* fetch ALL rrd's for this data source */
        if (!empty($_REQUEST['id'])) {
            $template_data_rrds = db_fetch_assoc_prepared('SELECT id, data_source_name FROM data_template_rrd WHERE local_data_id = ? ORDER BY data_source_name', array($_REQUEST['id']));
        }
        /* select the first "rrd" of this data source by default */
        if (empty($_REQUEST['view_rrd'])) {
            $_REQUEST['view_rrd'] = isset($template_data_rrds[0]['id']) ? $template_data_rrds[0]['id'] : '0';
        }
        /* get more information about the rrd we chose */
        if (!empty($_REQUEST['view_rrd'])) {
            $local_data_template_rrd_id = db_fetch_cell_prepared('SELECT local_data_template_rrd_id FROM data_template_rrd WHERE id = ?', array($_REQUEST['view_rrd']));
            $rrd = db_fetch_row_prepared('SELECT * FROM data_template_rrd WHERE id = ?', array($_REQUEST['view_rrd']));
            $rrd_template = db_fetch_row_prepared('SELECT * FROM data_template_rrd WHERE id = ?', array($local_data_template_rrd_id));
            $header_label = '[edit: ' . $rrd['data_source_name'] . ']';
        } else {
            $header_label = '';
        }
        $i = 0;
        if (isset($template_data_rrds)) {
            if (sizeof($template_data_rrds) > 1) {
                /* draw the data source tabs on the top of the page */
                print "\t<table class='tabs' width='100%' cellspacing='0' cellpadding='3' align='center'>\n\t\t\t\t\t<tr>\n";
                foreach ($template_data_rrds as $template_data_rrd) {
                    $i++;
                    print "\t<td " . ($template_data_rrd['id'] == $_REQUEST['view_rrd'] ? "class='even'" : "class='odd'") . " width='" . (strlen($template_data_rrd['data_source_name']) * 9 + 50) . "' align='center' class='tab'>\n\t\t\t\t\t\t\t\t<span class='textHeader'><a href='" . htmlspecialchars('data_sources.php?action=ds_edit&id=' . $_REQUEST['id'] . '&view_rrd=' . $template_data_rrd['id']) . "'>{$i}: " . htmlspecialchars($template_data_rrd['data_source_name']) . '</a>' . ($use_data_template == false ? " <a href='" . htmlspecialchars('data_sources.php?action=rrd_remove&id=' . $template_data_rrd['id'] . '&local_data_id=' . $_REQUEST['id']) . "'><img src='images/delete_icon.gif' border='0' alt='Delete'></a>" : '') . "</span>\n\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t<td width='1'></td>\n";
                }
                print "\n\t\t\t\t\t<td></td>\n\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n";
            } elseif (sizeof($template_data_rrds) == 1) {
                $_REQUEST['view_rrd'] = $template_data_rrds[0]['id'];
            }
        }
        html_start_box('', '100%', '', '3', 'center', '');
        print "\t<tr>\n\t\t\t\t<td class='textHeaderDark'>\n\t\t\t\t\t<strong>Data Source Item</strong> {$header_label}\n\t\t\t\t</td>\n\t\t\t\t<td class='textHeaderDark' align='right'>\n\t\t\t\t\t" . (!empty($_REQUEST['id']) && empty($data_template['id']) ? "<strong><a class='linkOverDark' href='" . htmlspecialchars('data_sources.php?action=rrd_add&id=' . $_REQUEST['id']) . "'>New</a>&nbsp;</strong>" : '') . "\n\t\t\t\t</td>\n\t\t\t</tr>\n";
        /* data input fields list */
        if (empty($data['data_input_id']) || db_fetch_cell_prepared('SELECT type_id FROM data_input WHERE id = ?', array($data['data_input_id'])) > '1') {
            unset($struct_data_source_item['data_input_field_id']);
        } else {
            $struct_data_source_item['data_input_field_id']['sql'] = "SELECT id,CONCAT(data_name,' - ',name) as name FROM data_input_fields WHERE data_input_id=" . $data['data_input_id'] . " and input_output='out' and update_rra='on' order by data_name,name";
        }
        $form_array = array();
        while (list($field_name, $field_array) = each($struct_data_source_item)) {
            $form_array += array($field_name => $struct_data_source_item[$field_name]);
            if (!($use_data_template == false || $rrd_template['t_' . $field_name] == 'on')) {
                $form_array[$field_name]['description'] = '';
            }
            $form_array[$field_name]['value'] = isset($rrd) ? $rrd[$field_name] : '';
            if (!($use_data_template == false || $rrd_template['t_' . $field_name] == 'on')) {
                $form_array[$field_name]['method'] = 'template_' . $form_array[$field_name]['method'];
            }
        }
        draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => array('data_template_rrd_id' => array('method' => 'hidden', 'value' => isset($rrd) ? $rrd['id'] : '0'), 'local_data_template_rrd_id' => array('method' => 'hidden', 'value' => isset($rrd) ? $rrd['local_data_template_rrd_id'] : '0')) + $form_array));
        html_end_box();
        /* data source data goes here */
        data_edit();
        form_hidden_box('current_rrd', $_REQUEST['view_rrd'], '0');
    }
    /* display the debug mode box if the user wants it */
    if (isset($_SESSION['ds_debug_mode']) && isset($_REQUEST['id'])) {
        ?>
		<table width='100%' align='center'>
			<tr>
				<td>
					<span class='textInfo'>Data Source Debug</span><br>
					<pre><?php 
        print @rrdtool_function_create($_REQUEST['id'], true);
        ?>
</pre>
				</td>
			</tr>
		</table>
		<?php 
    }
    if (isset($_REQUEST['id']) || isset($_REQUEST['new'])) {
        form_hidden_box('save_component_data_source', '1', '');
    } else {
        form_hidden_box('save_component_data_source_new', '1', '');
    }
    form_save_button('data_sources.php');
    api_plugin_hook('data_source_edit_bottom');
    bottom_footer();
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:data_sources.php

示例3: host_remove

function host_remove()
{
    global $config;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the host <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT description FROM host WHERE id = ?', array($_REQUEST['id']))) . "'</strong>?", htmlspecialchars('host.php'), htmlspecialchars('host.php?action=remove&id=' . $_REQUEST['id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        api_device_remove($_REQUEST['id']);
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:16,代码来源:host.php

示例4: mactrack_site_remove

function mactrack_site_remove()
{
    global $config;
    /* ================= input validation ================= */
    get_filter_request_var('site_id');
    /* ==================================================== */
    if (read_config_option('remove_verification') == 'on' && !isset_request_var('confirm')) {
        top_header();
        form_confirm(__('Are You Sure?'), __("Are you sure you want to delete the site <strong>'%s'</strong>?", db_fetch_cell('SELECT description FROM host WHERE id=' . get_request_var('device_id'))), 'mactrack_sites.php', 'mactrack_sites.php?action=remove&site_id=' . get_request_var('site_id'));
        bottom_footer();
        exit;
    }
    if (read_config_option('remove_verification') == '' || isset_request_var('confirm')) {
        api_mactrack_site_remove(get_request_var('site_id'));
    }
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:16,代码来源:mactrack_sites.php

示例5: utilities_view_logfile


//.........这里部分代码省略.........
						<input id='filter' type="text" name="filter" size="75" value="<?php 
    print htmlspecialchars(get_request_var_request('filter'));
    ?>
">
					</td>
				</tr>
			</table>
			<input type='hidden' name='action' value='view_logfile'>
		</form>
		</td>
	</tr>
	<?php 
    html_end_box();
    /* read logfile into an array and display */
    $logcontents = tail_file($logfile, get_request_var_request('tail_lines'), get_request_var_request('message_type'), get_request_var_request('filter'));
    if (get_request_var_request('reverse') == 1) {
        $logcontents = array_reverse($logcontents);
    }
    if (get_request_var_request('message_type') > 0) {
        $start_string = '<strong>Log File</strong> [Total Lines: ' . sizeof($logcontents) . ' - Non-Matching Items Hidden]';
    } else {
        $start_string = '<strong>Log File</strong> [Total Lines: ' . sizeof($logcontents) . ' - All Items Shown]';
    }
    html_start_box($start_string, '100%', '', '3', 'center', '');
    $i = 0;
    $j = 0;
    $linecolor = false;
    foreach ($logcontents as $item) {
        $host_start = strpos($item, 'Device[');
        $ds_start = strpos($item, 'DS[');
        $new_item = '';
        if (!$host_start && !$ds_start) {
            $new_item = $item;
        } else {
            while ($host_start) {
                $host_end = strpos($item, ']', $host_start);
                $host_id = substr($item, $host_start + 5, $host_end - ($host_start + 5));
                $new_item = $new_item . substr($item, 0, $host_start + 5) . "<a href='" . htmlspecialchars('host.php?action=edit&id=' . $host_id) . "'>" . substr($item, $host_start + 5, $host_end - ($host_start + 5)) . '</a>';
                $item = substr($item, $host_end);
                $host_start = strpos($item, 'Device[');
            }
            $ds_start = strpos($item, 'DS[');
            while ($ds_start) {
                $ds_end = strpos($item, ']', $ds_start);
                $ds_id = substr($item, $ds_start + 3, $ds_end - ($ds_start + 3));
                $new_item = $new_item . substr($item, 0, $ds_start + 3) . "<a href='" . htmlspecialchars('data_sources.php?action=ds_edit&id=' . $ds_id) . "'>" . substr($item, $ds_start + 3, $ds_end - ($ds_start + 3)) . '</a>';
                $item = substr($item, $ds_end);
                $ds_start = strpos($item, 'DS[');
            }
            $new_item = $new_item . $item;
        }
        /* get the background color */
        if (substr_count($new_item, 'ERROR') || substr_count($new_item, 'FATAL')) {
            $bgcolor = 'FF3932';
        } elseif (substr_count($new_item, 'WARN')) {
            $bgcolor = 'EACC00';
        } elseif (substr_count($new_item, ' SQL ')) {
            $bgcolor = '6DC8FE';
        } elseif (substr_count($new_item, 'DEBUG')) {
            $bgcolor = 'C4FD3D';
        } elseif (substr_count($new_item, 'STATS')) {
            $bgcolor = '96E78A';
        } else {
            if ($linecolor) {
                $bgcolor = 'CCCCCC';
            } else {
                $bgcolor = 'FFFFFF';
            }
            $linecolor = !$linecolor;
        }
        ?>
		<tr bgcolor='#<?php 
        print $bgcolor;
        ?>
'>
			<td>
				<?php 
        print $new_item;
        ?>
			</td>
		</tr>
		<?php 
        $j++;
        $i++;
        if ($j > 1000) {
            ?>
			<tr bgcolor='#EACC00'>
				<td>
					<?php 
            print '>>>>  LINE LIMIT OF 1000 LINES REACHED!!  <<<<';
            ?>
				</td>
			</tr>
			<?php 
            break;
        }
    }
    html_end_box();
    bottom_footer();
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:utilities.php

示例6: thold_add_graphs_action_prepare

function thold_add_graphs_action_prepare()
{
    global $config;
    $local_graph_id = get_filter_request_var('local_graph_id');
    top_header();
    html_start_box(__('Create Threshold from Template'), '60%', '', '3', 'center', '');
    form_start('thold.php?action=add');
    /* get the valid thold templates
     * remove those hosts that do not have any valid templates
     */
    $templates = '';
    $found_list = '';
    $not_found = '';
    $data_template_id = db_fetch_cell("SELECT dtr.data_template_id\n\t\t FROM data_template_rrd AS dtr\n\t\t LEFT JOIN graph_templates_item AS gti\n\t\t ON gti.task_item_id=dtr.id\n\t\t LEFT JOIN graph_local AS gl\n\t\t ON gl.id=gti.local_graph_id\n\t\t WHERE gl.id={$local_graph_id}");
    if ($data_template_id != '') {
        if (sizeof(db_fetch_assoc("SELECT id FROM thold_template WHERE data_template_id={$data_template_id}"))) {
            $found_list .= '<li>' . get_graph_title($local_graph_id) . '</li>';
            if (strlen($templates)) {
                $templates .= ", {$data_template_id}";
            } else {
                $templates = "{$data_template_id}";
            }
        } else {
            $not_found .= '<li>' . get_graph_title($local_graph_id) . '</li>';
        }
    } else {
        $not_found .= '<li>' . get_graph_title($local_graph_id) . '</li>';
    }
    if (strlen($templates)) {
        $sql = 'SELECT id, name FROM thold_template WHERE data_template_id IN (' . $templates . ') ORDER BY name';
    } else {
        $sql = 'SELECT id, name FROM thold_template ORDER BY name';
    }
    print "<tr><td colspan='2' class='textArea'>\n";
    if (strlen($found_list)) {
        if (strlen($not_found)) {
            print '<p>' . __('The following Graph has no Threshold Templates associated with them.') . '</p>';
            print '<ul>' . $not_found . '</ul>';
        }
        print '<p>' . __('Are you sure you wish to create Thresholds for this Graph?') . '
			<ul>' . $found_list . "</ul>\n\t\t\t</td>\n\t\t</tr>\n";
        if (isset_request_var('tree_id')) {
            get_filter_request_var('tree_id');
        } else {
            set_request_var('tree_id', '');
        }
        if (isset_request_var('leaf_id')) {
            get_filter_request_var('leaf_id');
        } else {
            set_request_var('leaf_id', '');
        }
        $form_array = array('general_header' => array('friendly_name' => __('Available Threshold Templates'), 'method' => 'spacer'), 'thold_template_id' => array('method' => 'drop_sql', 'friendly_name' => __('Select a Threshold Template'), 'description' => '', 'none_value' => __('None'), 'value' => __('None'), 'sql' => $sql), 'usetemplate' => array('method' => 'hidden', 'value' => 1), 'local_graph_id' => array('method' => 'hidden', 'value' => $local_graph_id));
        draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => $form_array));
    } else {
        if (strlen($not_found)) {
            print '<p>' . __('There are no Threshold Templates associated with the following Graph.') . '</p>';
            print '<ul>' . $not_found . '</ul>';
        }
        $form_array = array('general_header' => array('friendly_name' => __('Please select an action'), 'method' => 'spacer'), 'doaction' => array('method' => 'drop_array', 'friendly_name' => __('Threshold Action'), 'description' => __('You may either create a new Threshold Template, or an non-templated Threshold from this screen.'), 'value' => 'None', 'array' => array(1 => __('Create a new Threshold'), 2 => __('Create a Threshold Template'))), 'usetemplate' => array('method' => 'hidden', 'value' => 1), 'local_graph_id' => array('method' => 'hidden', 'value' => $local_graph_id));
        draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => $form_array));
    }
    if (!strlen($not_found)) {
        $save_html = "<input type='submit' value='" . __('Continue') . "'>";
        print "<tr>\n\t\t\t<td colspan='2' class='saveRow'>\n\t\t\t\t<input type='hidden' id='action' value='actions'>\n\t\t\t\t<input type='button' onClick='cactiReturnTo()' value='" . __('Cancel') . "' title='" . __('Cancel') . "'>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n";
    } else {
        $save_html = "<input type='submit' value='" . __('Continue') . "'>";
        print "<tr>\n\t\t\t<td colspan='2' class='saveRow'>\n\t\t\t\t<input type='button' onClick='cactiReturnTo()' value='" . __('Cancel') . "' title='" . __('Cancel') . "'>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n";
    }
    html_end_box();
    print "<script type='text/javascript'>\$(function() { applySkin() ;});</script>";
    bottom_footer();
}
开发者ID:Cacti,项目名称:plugin_thold,代码行数:72,代码来源:thold_webapi.php

示例7: field_remove

function field_remove()
{
    global $registered_cacti_names;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('data_input_id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the field <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM data_input_fields WHERE id = ?', array(get_request_var_request('id'))), ENT_QUOTES) . "'</strong>?", htmlspecialchars('data_input.php?action=edit&id=' . $_REQUEST['data_input_id']), htmlspecialchars('data_input.php?action=field_remove&id=' . $_REQUEST['id'] . '&data_input_id=' . $_REQUEST['data_input_id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        /* get information about the field we're going to delete so we can re-order the seqs */
        $field = db_fetch_row_prepared('SELECT input_output,data_input_id FROM data_input_fields WHERE id = ?', array(get_request_var_request('id')));
        db_execute_prepared('DELETE FROM data_input_fields WHERE id = ?', array(get_request_var_request('id')));
        db_execute_prepared('DELETE FROM data_input_data WHERE data_input_field_id = ?', array(get_request_var_request('id')));
        /* when a field is deleted; we need to re-order the field sequences */
        if ($field['input_output'] == 'in' && preg_match_all('/<([_a-zA-Z0-9]+)>/', db_fetch_cell_prepared('SELECT input_string FROM data_input WHERE id = ?', array($field['data_input_id'])), $matches)) {
            $j = 0;
            for ($i = 0; $i < count($matches[1]); $i++) {
                if (in_array($matches[1][$i], $registered_cacti_names) == false) {
                    $j++;
                    db_execute_prepared("UPDATE data_input_fields SET sequence = ? WHERE data_input_id = ? AND input_output = 'in' AND data_name = ?", array($j, $field['data_input_id'], $matches[1][$i]));
                }
            }
        }
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:30,代码来源:data_input.php

示例8: form_actions

function form_actions()
{
    global $colors, $user_actions, $fields_user_edit;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post('drp_action'));
    /* ==================================================== */
    /* 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 */
            if (!isset($_POST['delete_type'])) {
                $_POST['delete_type'] = 2;
            }
            $data_sources_to_act_on = array();
            $graphs_to_act_on = array();
            $devices_to_act_on = array();
            for ($i = 0; $i < count($selected_items); $i++) {
                /* ================= input validation ================= */
                $selected_items[$i] = sanitize_search_string($selected_items[$i]);
                /* ==================================================== */
                $data_sources = db_fetch_assoc('SELECT
					data_local.id AS local_data_id
					FROM data_local
					WHERE ' . array_to_sql_or($selected_items, 'data_local.snmp_index') . "\n\t\t\t\t\tAND snmp_query_id='" . mikrotik_data_query_by_hash('ce63249e6cc3d52bc69659a3f32194fe') . "'");
                if (sizeof($data_sources) > 0) {
                    foreach ($data_sources as $data_source) {
                        $data_sources_to_act_on[] = $data_source['local_data_id'];
                    }
                }
                $graphs = db_fetch_assoc('SELECT
					graph_local.id AS local_graph_id
					FROM graph_local
					WHERE ' . array_to_sql_or($selected_items, 'graph_local.snmp_index') . "\n\t\t\t\t\tAND snmp_query_id='" . mikrotik_data_query_by_hash('ce63249e6cc3d52bc69659a3f32194fe') . "'");
                if (sizeof($graphs) > 0) {
                    foreach ($graphs as $graph) {
                        $graphs_to_act_on[] = $graph['local_graph_id'];
                    }
                }
                $devices_to_act_on[] = $selected_items[$i];
            }
            api_data_source_remove_multi($data_sources_to_act_on);
            api_graph_remove_multi($graphs_to_act_on);
            db_execute("DELETE FROM plugin_mikrotik_users WHERE name IN ('" . implode("','", $devices_to_act_on) . "')");
        }
        header('Location: mikrotik_users.php&header=false');
        exit;
    }
    /* setup some variables */
    $user_list = '';
    /* loop through each of the user templates selected on the previous page and get more info about them */
    while (list($var, $val) = each($_POST)) {
        if (preg_match('/^chk_([A-Z0-9]+)$/', $var, $matches)) {
            /* ================= input validation ================= */
            $matches[1] = sanitize_search_string($matches[1]);
            /* ==================================================== */
            $user_list .= '<li>' . $matches[1] . '</li>';
            $user_array[] = $matches[1];
        }
    }
    top_header();
    html_start_box('<strong>' . $user_actions[$_POST['drp_action']] . '</strong>', '60%', '', '3', 'center', '');
    print "<form action='mikrotik_users.php' autocomplete='off' method='post'>\n";
    if (isset($user_array) && sizeof($user_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>When you click \"Continue\" the following Users(s) and their Graph(s) will be deleted.</p>\n\t\t\t\t\t\t<ul>" . $user_list . "</ul>";
            print "</td></tr>\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='cactiReturnTo()'>&nbsp;<input type='submit' value='Continue' title='Delete Device(s)'>";
        }
    } else {
        print "<tr><td><span class='textError'>You must select at least one User.</span></td></tr>\n";
        $save_html = "<input type='button' value='Return' onClick='cactiReturnTo()'>";
    }
    print "<tr class='saveRow'>\n\t\t<td colspan='2' align='right' bgcolor='#eaeaea'>\n\t\t\t<input type='hidden' name='action' value='actions'>\n\t\t\t<input type='hidden' name='selected_items' value='" . (isset($user_array) ? serialize($user_array) : '') . "'>\n\t\t\t<input type='hidden' name='drp_action' value='" . $_POST["drp_action"] . "'>\n\t\t\t{$save_html}\n\t\t</td>\n\t</tr>\n";
    html_end_box();
    bottom_footer();
}
开发者ID:TFyre,项目名称:plugin_mikrotik_new,代码行数:78,代码来源:mikrotik_users.php

示例9: flowview_display_report


//.........这里部分代码省略.........
		if (!$('#packets').is(':checked')) {
			$('#wrapperpackets').hide();
			$.get('flowview.php?action=updatesess&type=packets&value=');
		}else{
			$('#wrapperpackets').show();
		}
	});

	$('#flows').click(function() {
		if (!$('#flows').is(':checked')) {
			$('#wrapperflows').hide();
			$.get('flowview.php?action=updatesess&type=flows&value=');
		}else{
			$('#wrapperflows').show();
		}
	});

	$('#table').click(function() {
		if (!$('#table').is(':checked')) {
			$('#flowcontent').hide();
			$.get('flowview.php?action=updatesess&type=table&value=');
		}else{
			$.get('flowview.php?action=updatesess&type=table&value=on');
			$('#flowcontent').show();
		}
	});

	$('#clear').click(function() {
		loadPageNoHeader('flowview.php?header=false&action=view&clear=true&tab='+$('#tab').val());
	});

	$('#exclude').change(function() {
		loadPageNoHeader('flowview.php?header=false&action=view&exclude='+$('#exclude').val()+'&tab='+$('#tab').val());
	});
			
	if ($('#table').is(':checked') || <?php 
    print isset_request_var('stat_report') ? get_nfilter_request_var('stat_report') == 99 ? 'true' : 'false' : 'true';
    ?>
) {
		$('#flowcontent').show();
	}else{
		$('#flowcontent').hide();
	}

	if ($('#bytes').is(':checked')) {
		$('#wrapperbytes').show();
	}

	if ($('#packets').is(':checked')) {
		$('#wrapperpackets').show();
	}

	if ($('#flows').is(':checked')) {
		$('#wrapperflows').show();
	}

    $.tablesorter.addParser({ 
        id: 'bytes', 
        is: function(s) { 
            return false; 
        }, 
        format: function(s) { 
			if (s.indexOf('MB') > 0) {
				loc=s.indexOf('MB');
				return s.substring(0,loc) * 1024 * 1024;
			}else if (s.indexOf('KB') > 0) {
				loc=s.indexOf('KB');
				return s.substring(0,loc) * 1024;
			}else if (s.indexOf('Bytes') > 0) {
				loc=s.indexOf('Bytes');
				return s.substring(0,loc);
			}else if (s.indexOf('GB') > 0) {
				loc=s.indexOf('GB');
				return s.substring(0,loc) * 1024 * 1024 * 1024;
			}else if (s.indexOf('TB') > 0) {
				loc=s.indexOf('TB');
				return s.substring(0,loc) * 1024 * 1024 * 1024 * 1024;
			}else{
				return s;
			}
        }, 
        type: 'numeric' 
    }); 

	$(function() {
		$('#sorttable').tablesorter({
			widgets: ['zebra'],
			widgetZebra: { css: ['even', 'odd'] },
			headerTemplate: '<div class="textSubHeaderDark">{content} {icon}</div>',
			cssIconAsc: 'fa-sort-asc',
			cssIconDesc: 'fa-sort-desc',
			cssIconNone: 'fa-sort',
			cssIcon: 'fa'
		});
		$('#sorttable').resizable();
	});
	</script>
	<?php 
    bottom_footer();
}
开发者ID:Cacti,项目名称:plugin_flowview,代码行数:101,代码来源:functions.php

示例10: mactrack_device_remove

function mactrack_device_remove()
{
    global $config;
    /* ================= input validation ================= */
    get_filter_request_var('device_id');
    get_filter_request_var('type_id');
    /* ==================================================== */
    if (read_config_option('remove_verification') == 'on' && !isset_request_var('confirm')) {
        top_header();
        form_confirm(__('Are You Sure?'), __('Are you sure you want to delete the host %s', db_fetch_cell_prepared('SELECT device_name FROM host WHERE id = ?', array(get_request_var('device_id')))), 'mactrack_devices.php', 'mactrack_devices.php?action=remove&id=' . get_request_var('device_id'));
        bottom_footer();
        exit;
    }
    if (read_config_option('remove_verification') == '' || isset_request_var('confirm')) {
        api_mactrack_device_remove(get_request_var('device_id'));
    }
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:17,代码来源:mactrack_devices.php

示例11: hmib_view_graphs

function hmib_view_graphs()
{
    global $current_user, $colors, $config, $host_template_hashes, $graph_template_hashes;
    include './lib/timespan_settings.php';
    include './lib/html_graph.php';
    html_graph_validate_preview_request_vars();
    if (!isset($_SESSION['sess_hmib_gt'])) {
        $_SESSION['sess_hmib_gt'] = implode(',', array_rekey(db_fetch_assoc('SELECT DISTINCT gl.graph_template_id 
			FROM graph_local AS gl 
			WHERE gl.host_id IN(
				SELECT host_id 
				FROM plugin_hmib_hrSystem
			)'), 'graph_template_id', 'graph_template_id'));
    }
    $gt = $_SESSION['sess_hmib_gt'];
    if (!isset($_SESSION['sess_hmib_hosts'])) {
        $_SESSION['sess_hmib_hosts'] = implode(',', array_rekey(db_fetch_assoc('SELECT h.id 
			FROM host AS h 
			WHERE h.id IN (
				SELECT host_id 
				FROM plugin_hmib_hrSystem
			) 
			UNION 
			SELECT h.id 
			FROM host AS h
			INNER JOIN host_template AS ht
			ON h.host_template_id=ht.id
			WHERE hash="7c13344910097cc599f0d0485305361d" ORDER BY id DESC'), 'id', 'id'));
    }
    $hosts = $_SESSION['sess_hmib_hosts'];
    /* include graph view filter selector */
    html_start_box(__('Graph Preview Filters') . (isset_request_var('style') && strlen(get_request_var('style')) ? ' [ ' . __('Custom Graph List Applied - Filtering from List') . ' ]' : ''), '100%', '', '3', 'center', '');
    html_graph_preview_filter('hmib.php', 'graphs', "h.id IN ({$hosts})", "gt.id IN ({$gt})");
    html_end_box();
    /* the user select a bunch of graphs of the 'list' view and wants them displayed here */
    $sql_or = '';
    if (isset_request_var('style')) {
        if (get_request_var('style') == 'selective') {
            /* process selected graphs */
            if (!isempty_request_var('graph_list')) {
                foreach (explode(',', get_request_var('graph_list')) as $item) {
                    $graph_list[$item] = 1;
                }
            } else {
                $graph_list = array();
            }
            if (!isempty_request_var('graph_add')) {
                foreach (explode(',', get_request_var('graph_add')) as $item) {
                    $graph_list[$item] = 1;
                }
            }
            /* remove items */
            if (!isempty_request_var('graph_remove')) {
                foreach (explode(',', get_request_var('graph_remove')) as $item) {
                    unset($graph_list[$item]);
                }
            }
            $graph_array = array_keys($graph_list);
            if (sizeof($graph_array)) {
                $sql_or = array_to_sql_or($graph_array, 'gl.id');
            }
        }
    }
    $total_graphs = 0;
    // Filter sql_where
    $sql_where = strlen(get_request_var('filter')) ? "gtg.title_cache LIKE '%" . get_request_var('filter') . "%'" : '';
    $sql_where .= (strlen($sql_or) && strlen($sql_where) ? ' AND ' : '') . $sql_or;
    // Host Id sql_where
    if (get_request_var('host_id') > 0) {
        $sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.host_id=' . get_request_var('host_id');
    }
    // Graph Template Id sql_where
    if (get_request_var('graph_template_id') > 0) {
        $sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.graph_template_id=' . get_request_var('graph_template_id');
    }
    $limit = get_request_var('graphs') * (get_request_var('page') - 1) . ',' . get_request_var('graphs');
    $order = 'gtg.title_cache';
    $graphs = get_allowed_graphs($sql_where, $order, $limit, $total_graphs);
    /* do some fancy navigation url construction so we don't have to try and rebuild the url string */
    if (preg_match('/page=[0-9]+/', basename($_SERVER['QUERY_STRING']))) {
        $nav_url = str_replace('&page=' . get_request_var('page'), '', get_browser_query_string());
    } else {
        $nav_url = get_browser_query_string() . '&host_id=' . get_request_var('host_id');
    }
    $nav_url = preg_replace('/((\\?|&)host_id=[0-9]+|(\\?|&)filter=[a-zA-Z0-9]*)/', '', $nav_url);
    $nav = html_nav_bar($nav_url, MAX_DISPLAY_PAGES, get_request_var('page'), get_request_var('graphs'), $total_graphs, get_request_var('columns'), 'Graphs', 'page', 'main');
    print $nav;
    html_start_box('', '100%', '', '3', 'center', '');
    if (get_request_var('thumbnails') == 'true') {
        html_graph_thumbnail_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var('columns'));
    } else {
        html_graph_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var('columns'));
    }
    html_end_box();
    if ($total_graphs > 0) {
        print $nav;
    }
    bottom_footer();
}
开发者ID:Cacti,项目名称:plugin_hmib,代码行数:99,代码来源:hmib.php

示例12: tree_remove

function tree_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the tree <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM graph_tree WHERE id = ?', array($_REQUEST['id'])), ENT_QUOTES) . "'</strong>?", htmlspecialchars('tree.php'), htmlspecialchars('tree.php?action=remove&id=' . $_REQUEST['id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        db_execute_prepared('DELETE FROM graph_tree WHERE id = ?', array($_REQUEST['id']));
        db_execute_prepared('DELETE FROM graph_tree_items WHERE graph_tree_id = ?', array($_REQUEST['id']));
    }
    /* clear graph tree cache on save - affects current user only, other users should see changes in <5 minutes */
    if (isset($_SESSION['dhtml_tree'])) {
        unset($_SESSION['dhtml_tree']);
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:20,代码来源:tree.php

示例13: form_actions

function form_actions()
{
    global $rra_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 rra WHERE ' . array_to_sql_or($selected_items, 'id'));
            db_execute('DELETE FROM rra_cf WHERE ' . array_to_sql_or($selected_items, 'rra_id'));
        }
        header('Location: rra.php');
        exit;
    }
    /* setup some variables */
    $rra_list = '';
    $i = 0;
    /* loop through each of the rra 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]);
            /* ==================================================== */
            $rra_list .= '<li>' . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM rra WHERE id = ?', array($matches[1]))) . '</li>';
            $rra_array[$i] = $matches[1];
            $i++;
        }
    }
    top_header();
    print "<form action='rra.php' method='post'>\n";
    html_start_box('<strong>' . $rra_actions[$_POST['drp_action']] . '</strong>', '60%', '', '3', 'center', '');
    if (isset($rra_array) && sizeof($rra_array)) {
        if ($_POST['drp_action'] == '1') {
            /* delete */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea' class='odd'>\n\t\t\t\t\t\t<p>When you click \"Continue\", the folling Round Robin Archive definition(s) will be deleted.</p>\n\t\t\t\t\t\t<ul>{$rra_list}</ul>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Delete Round Robin Archive definition(s)'>";
        }
    } else {
        print "<tr><td class='odd'><span class='textError'>You must select at least one Round Robin Archive definition.</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($rra_array) ? serialize($rra_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";
    html_end_box();
    bottom_footer();
}
开发者ID:MrWnn,项目名称:cacti,代码行数:48,代码来源:rra.php

示例14: settings

function settings()
{
    global $tabs_graphs, $settings_graphs, $current_user, $graph_views, $current_user;
    $current_user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', array($_SESSION['sess_user_id']));
    /* you cannot have per-user graph settings if cacti's user management is not turned on */
    if (read_config_option('auth_method') == 0) {
        raise_message(6);
        display_output_messages();
        return;
    }
    /* Find out whether this user has right here */
    if (!is_view_allowed('graph_settings')) {
        print "<strong><font class='txtErrorTextBox'>YOU DO NOT HAVE RIGHTS TO CHANGE GRAPH SETTINGS</font></strong>";
        bottom_footer();
        exit;
    }
    if (read_config_option('auth_method') != 0) {
        $settings_graphs['tree']['default_tree_id']['sql'] = get_graph_tree_array(true);
    }
    print "<form method='post' action='graph_settings.php'>\n";
    html_start_box('<strong>Graph Settings</strong>', '100%', '', '3', 'center', '');
    while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
        $collapsible = true;
        print "<tr class='spacer tableHeader" . ($collapsible ? ' collapsible' : '') . "' id='row_{$tab_short_name}'><td colspan='2' style='cursor:pointer;' class='tableSubHeaderColumn'>" . $tabs_graphs[$tab_short_name] . ($collapsible ? "<div style='float:right;padding-right:4px;'><i class='fa fa-angle-double-up'></i></div>" : "") . "</td></tr>\n";
        $form_array = array();
        while (list($field_name, $field_array) = each($tab_fields)) {
            $form_array += array($field_name => $tab_fields[$field_name]);
            if (isset($field_array['items']) && is_array($field_array['items'])) {
                while (list($sub_field_name, $sub_field_array) = each($field_array['items'])) {
                    if (graph_config_value_exists($sub_field_name, $_SESSION['sess_user_id'])) {
                        $form_array[$field_name]['items'][$sub_field_name]['form_id'] = 1;
                    }
                    $form_array[$field_name]['items'][$sub_field_name]['value'] = db_fetch_cell_prepared('SELECT value FROM settings_graphs WHERE name = ? AND user_id = ?', array($sub_field_name, $_SESSION['sess_user_id']));
                }
            } else {
                if (graph_config_value_exists($field_name, $_SESSION['sess_user_id'])) {
                    $form_array[$field_name]['form_id'] = 1;
                }
                $form_array[$field_name]['value'] = db_fetch_cell_prepared('SELECT value FROM settings_graphs WHERE name = ? AND user_id = ?', array($field_name, $_SESSION['sess_user_id']));
            }
        }
        draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => $form_array));
    }
    html_end_box();
    ?>
	<script type="text/javascript">
	<!--
	var themeFonts=<?php 
    print read_config_option('font_method');
    ?>
;

	function graphSettings() {
		if (themeFonts == 1) {
				$('#row_fonts').hide();
				$('#row_custom_fonts').hide();
				$('#row_title_size').hide();
				$('#row_title_font').hide();
				$('#row_legend_size').hide();
				$('#row_legend_font').hide();
				$('#row_axis_size').hide();
				$('#row_axis_font').hide();
				$('#row_unit_size').hide();
				$('#row_unit_font').hide();
		}else{
			var custom_fonts = $('#custom_fonts').is(':checked');

			switch(custom_fonts) {
			case true:
				$('#row_fonts').show();
				$('#row_title_size').show();
				$('#row_title_font').show();
				$('#row_legend_size').show();
				$('#row_legend_font').show();
				$('#row_axis_size').show();
				$('#row_axis_font').show();
				$('#row_unit_size').show();
				$('#row_unit_font').show();
				break;
			case false:
				$('#row_fonts').show();
				$('#row_title_size').hide();
				$('#row_title_font').hide();
				$('#row_legend_size').hide();
				$('#row_legend_font').hide();
				$('#row_axis_size').hide();
				$('#row_axis_font').hide();
				$('#row_unit_size').hide();
				$('#row_unit_font').hide();
				break;
			}
		}

		if ($('#timespan_sel').is(':checked')) {
			$('#row_default_rra_id').hide();
			$('#row_default_timespan').show();
			$('#row_default_timeshift').show();
			$('#row_allow_graph_dates_in_future').show();
			$('#row_first_weekdayid').show();
			$('#row_day_shift_start').show();
//.........这里部分代码省略.........
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:graph_settings.php

示例15: mactrack_view

function mactrack_view()
{
    global $title, $mactrack_rows, $config;
    mactrack_interfaces_request_validation();
    general_header();
    $sql_where = '';
    if (get_request_var('rows') == -1) {
        $row_limit = read_config_option('num_rows_table');
    } elseif (get_request_var('rows') == -2) {
        $row_limit = 99999999;
    } else {
        $row_limit = get_request_var('rows');
    }
    $stats = mactrack_get_records($sql_where, TRUE, $row_limit);
    mactrack_tabs();
    html_start_box($title, '100%', '', '3', 'center', '');
    mactrack_filter_table();
    html_end_box();
    $rows_query_string = "SELECT COUNT(*)\n\t\tFROM mac_track_interfaces\n\t\tINNER JOIN mac_track_devices\n\t\tON mac_track_interfaces.device_id=mac_track_devices.device_id\n\t\tINNER JOIN mac_track_device_types\n\t\tON mac_track_device_types.device_type_id=mac_track_devices.device_type_id\n\t\t{$sql_where}";
    $total_rows = db_fetch_cell($rows_query_string);
    $nav = html_nav_bar('mactrack_view_interfaces.php?report=interfaces', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 22, __('Interfaces'));
    print $nav;
    html_start_box('', '100%', '', '3', 'center', '');
    $display_text = mactrack_display_array();
    html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
    $i = 0;
    if (sizeof($stats)) {
        foreach ($stats as $stat) {
            /* find the background color and enclose it */
            $class = mactrack_int_row_class($stat);
            if ($bgc) {
                print "<tr id='row_" . $stat['device_id'] . '_' . $stat['ifName'] . "' class='{$class}'>\n";
                $i++;
            } else {
                if ($i % 2 == 1) {
                    $class = 'odd';
                } else {
                    $class = 'even';
                }
                print "<tr id='row_" . $stat['device_id'] . "' class='{$class}'>\n";
                $i++;
            }
            print mactrack_format_interface_row($stat);
        }
    } else {
        print '<tr><td colspan="7"><em>' . __('No MacTrack Interfaces Found') . '</em></td></tr>';
    }
    html_end_box(false);
    if (sizeof($stats)) {
        print $nav;
    }
    print '<div class="center" style="position:fixed;left:0;bottom:0;display:table;margin-left:auto;margin-right:auto;width:100%;">';
    html_start_box('', '100%', '', '3', 'center', '');
    print '<tr>';
    mactrack_legend_row('int_up', 'Interface Up');
    mactrack_legend_row('int_up_wo_alias', 'No Alias');
    mactrack_legend_row('int_errors', 'Errors Present');
    mactrack_legend_row('int_discards', 'Discards Present');
    mactrack_legend_row('int_no_graph', 'No Graphs');
    mactrack_legend_row('int_down', 'Interface Down');
    print '</tr>';
    html_end_box(false);
    print '</div>';
    if (sizeof($stats)) {
        mactrack_display_stats();
    }
    print '<div id="response"></div>';
    bottom_footer();
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:69,代码来源:mactrack_view_interfaces.php


注:本文中的bottom_footer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。