static function select_list($name, $values, $selected_val, $submit_on_change = 1) { if ($submit_on_change) { $submit_str = ' onchange="submit();"'; } else { $submit_str = ''; } u::start_tag('select', 'name="' . $name . '"' . $submit_str); foreach ($values as $value_pair) { if ($value_pair[0] == $selected_val) { $select_str = ' selected="selected"'; } else { $select_str = ''; } u::tagged_item('option', $value_pair[1], 'value="' . $value_pair[0] . '"' . $select_str, 1); } u::end_tag('select'); }
$end = date('o_m_d__17', $yest); $top_sql_report_url = "top_sql_report.php?start={$start}&end={$end}&order_by_id="; $values[] = array($top_sql_report_url . '1', 'Top SQL Report'); $values[] = array('db_size.php', 'Database Size'); $values[] = array('standby_details.php', 'Standby Details'); $values[] = array('db_checks_all_dbs.php?html=1', 'Checks all DB'); if (u::request_val('full', 0)) { $values[] = array('undo_monitor.php', 'Undo Monitor'); $values[] = array($top_sql_report_url . '2', 'AWR by disk reads'); $values[] = array($top_sql_report_url . '3', 'AWR by exec elapsed'); $values[] = array('run_sql.php[sql_file----longops]', 'Longops'); $values[] = array('db_sessions.php', 'Sessions'); $base_url = "system_load.php?hide=on&snaps_table={$snaps_table}&db={$db}&sql_mins_hist=2&mins_hist=2&table_styles=1&div_only=1" . "&width={$chart_width}&max_width={$chart_max_width}" . "&graph_icons=0&chart_icons=0&color_scheme=2&cell_style_param=3"; $values[] = array($base_url . "&active_sessions=on", 'Active Sessions'); $values[] = array($base_url . "&top_sql=on", 'Top SQL'); $values[] = array($base_url . "&top_sessions=on", 'Top Sessions'); $values[] = array('rman_progress.php', 'RMAN Progress'); $io_url = "io_monitor.php?db={$db}&wait_secs=10&top_n=10&order_by="; $values[] = array($io_url . "2", 'SQL IO Reads'); $values[] = array($io_url . "4", 'SQL IO Writes'); } u::select_list('page', $values, $db); u::end_tag('form'); u::tag('input', 'type="button" style="position:absolute;left:420;top:2;height:27px" value="Stop" id="btn" onclick="toggle_button(this.value);"'); u::end_tag('div'); # # Need a db to be selected for a page to make any sense # if (u::request_val('page') and !$db) { $_GET['page'] = ''; }
if ($value > 0) { # # Draw the box # $hover_txt = $label_lookup[$item] . ' ' . $value . '%'; $value = $value * $size_factor; if ($use_images) { $image = $bg_image_lookup[$item]; } else { $image = ''; } u::box($value, $color_lookup[$item], $offset, $image, $hover_txt, '', $bar_height); $offset = $offset + $value; } $item++; } # # Did we draw anything? # if ($offset) { # # Total percent label # $total_str = $offset / $size_factor . "%"; u::box($tail_size, '', $offset, '', $total_str, $total_str, $bar_height); } # # End the container div # u::end_tag('div', 1);