function cells($sid_str, $db, $current_col, &$current_row, $class, $snaps_table, $sample_time)
{
    #
    # Anything in the list?
    #
    if (strlen($sid_str) > 0) {
        $sid_list = explode(',', $sid_str);
        $active_sessions = count($sid_list);
        $display_cell = 1;
        #
        # put each sid in div
        #
        foreach ($sid_list as $sid) {
            #
            # Session detail drilldown link
            #
            $just_sid = current(explode('_', $sid));
            $link_str = "onclick=\"window.open('session_drilldown.php?db={$db}&sid={$just_sid}&all_secs=1&snaps_table={$snaps_table}');return false;\"";
            #
            # Detail popup
            #
            $div_id = "{$sample_time}_{$just_sid}";
            $show_hide = "showhide('{$div_id}'";
            $show_div_str = "onmouseover=\"{$show_hide},1);\" onmouseout=\"{$show_hide},0);\" ";
            #
            # Display?
            #
            if ($display_cell) {
                #
                # Where does this go?
                #
                $bottom = ($current_row - 1) * 20;
                $left = ($current_col - 1) * 20;
                $position_str = 'left:' . $left . 'px;bottom:' . $bottom . 'px;';
                $id_tail = str_replace(':', '_', $sample_time);
                $div_format = 'id="graph_' . $sid . '_' . $id_tail . '" style="' . $position_str . '" class="' . $class . '" ' . $show_div_str . ' ' . $link_str;
                #
                # too many?
                #
                if ($current_row > C_MAX_CELL_HEIGHT and u::request_val('trim', 1)) {
                    #
                    # Last cell for this class
                    #
                    $display_cell = 0;
                    #
                    # Just display the session count
                    #
                    u::tagged_item('div', $active_sessions, $div_format, 1);
                } else {
                    #
                    # Add cell to page
                    #
                    u::tagged_item('div', '', $div_format, 1);
                }
                $current_row++;
            }
        }
    }
}
Beispiel #2
0
 static function box($width, $color, $offset, $bg_image, $hover_txt, $text, $height, $container = false)
 {
     if ($color) {
         $color_str = 'background-color:' . $color . ';';
     } else {
         $color_str = '';
     }
     $styles = 'width:' . $width . 'px; height:' . $height . 'px; ' . $color_str . 'left:' . $offset . 'px; top:0px;';
     if ($container) {
         #
         # Wrapper div so just open tag
         #
         $styles = $styles . 'position:relative;';
         u::start_tag('div', 'style="' . $styles . '"', 1);
     } else {
         #
         # Graph element
         # - wrap in a lable and set background
         #
         $styles = $styles . "position:absolute;background-image:url('" . $bg_image . "')";
         u::tagged_item('a', '<div style="' . $styles . '">' . $text . '</div>', 'title="' . $hover_txt . '"', 1);
     }
 }
Beispiel #3
0
u::start_tag('table', 'id="data1"');
u::tr('<th>sql_id</th><th>% of ' . $sql_mins_hist . ' mins busy</th><th>Execs</th><th>Avg Disk Reads</th><th>Avg Secs</th><th>SQL Text</th>', '', 1);
$i = 0;
while ($rec = oci_fetch_object($cur)) {
    #
    # Row formatting
    #
    $class_str = u::odd_even_class_str($i++);
    u::start_tag('tr', $class_str);
    $highlight_graph_str = "onmouseover=\"highlight('{$rec->SQL_ID}');\" ";
    $sql_cell = "<div {$highlight_graph_str}>" . sql_details_link($rec->SQL_ID, $db) . "</div>";
    u::td($sql_cell, '', 1);
    #
    # Barchart
    #
    $values = array($rec->PERCENT_ON_CPU, $rec->PERCENT_USER_IO, $rec->PERCENT_SYSTEM_IO, $rec->PERCENT_BLOCKED, $rec->PERCENT_OTHER);
    u::start_tag('td', 'style="padding:0px 0px 0px 0px"');
    include 'bar_chart.php';
    u::end_tag('td');
    u::td($rec->EXECS, '', 1);
    u::td($rec->AVG_DISK_READS, '', 1);
    u::td($rec->AVG_SECS, '', 1);
    u::tagged_item('td', $rec->SQL_TEXT, 'style="border-right:0px;font-size:xx-small;font-family:Courier New;"', 1);
    u::end_tag('tr');
}
#
# Fill table up if needed
#
u::filler_rows($table_rows, $i, 6);
u::end_tag('table');
u::end_tag('div');