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


PHP generate_lazy_graph_tag函数代码示例

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


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

示例1: round

}
//end if
if ($_SESSION['screen_width']) {
    if ($_SESSION['screen_width'] < 1024 && $_SESSION['screen_width'] > 700) {
        $graph_array['width'] = round(($_SESSION['screen_width'] - 90) / 2, 0);
    } else {
        if ($_SESSION['screen_width'] > 1024) {
            $graph_array['width'] = round(($_SESSION['screen_width'] - 90) / count($periods) + 1, 0);
        } else {
            $graph_array['width'] = $_SESSION['screen_width'] - 70;
        }
    }
}
$graph_array['height'] = round($graph_array['width'] / 2.15);
$graph_array['to'] = $config['time']['now'];
$graph_data = array();
foreach ($periods as $period) {
    $graph_array['from'] = $config['time'][$period];
    $graph_array_zoom = $graph_array;
    $graph_array_zoom['height'] = '150';
    $graph_array_zoom['width'] = '400';
    $link_array = $graph_array;
    $link_array['page'] = 'graphs';
    unset($link_array['height'], $link_array['width']);
    $link = generate_url($link_array);
    if ($return_data === true) {
        $graph_data[] = overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
    } else {
        echo overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
    }
}
开发者ID:sfromm,项目名称:librenms,代码行数:31,代码来源:print-graphrow.inc.php

示例2: unset

        $graph_array['height'] = 100;
        $graph_array['width'] = 210;
        $graph_array['to'] = $config['time']['now'];
        $graph_array['id'] = $port['port_id'];
        $graph_array['type'] = $graph_type;
        $graph_array['from'] = $config['time']['day'];
        $graph_array['legend'] = 'no';
        $link_array = $graph_array;
        $link_array['page'] = 'graphs';
        unset($link_array['height'], $link_array['width'], $link_array['legend']);
        $link = generate_url($link_array);
        $overlib_content = generate_overlib_content($graph_array, $port['hostname'] . ' - ' . $port['label']);
        $graph_array['title'] = 'yes';
        $graph_array['width'] = $width;
        $graph_array['height'] = 119;
        $graph = generate_lazy_graph_tag($graph_array);
        echo "<div style='display: block; padding: 1px; margin: 2px; min-width: " . $width_div . 'px; max-width:' . $width_div . "px; min-height:180px; max-height:180px; text-align: center; float: left; background-color: #f5f5f5;'>";
        echo overlib_link($link, $graph, $overlib_content);
        echo '</div>';
        // echo("<div style='display: block; padding: 1px; margin: 2px; min-width: 393px; max-width:393px; min-height:180px; max-height:180px; text-align: center; float: left; background-color: #f5f5f5;'>
        // <a href='".generate_port_url($port)."/' onmouseover=\"return overlib('\
        // <div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #e5e5e5;\'>".$device['hostname']." - ".$port['ifDescr']."</div>\
        // <img src=\'graph.php?type=$graph_type&amp;id=".$port['port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=450&amp;height=150&amp;title=yes\'>\
        // ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\"  >".
        // "<img src='graph.php?type=$graph_type&amp;id=".$port['port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=315&amp;height=110&amp;legend=no&amp;title=yes'>
        // </a>
        // </div>");
    }
    //end if
}
//end foreach
开发者ID:samyscoub,项目名称:librenms,代码行数:31,代码来源:graph.inc.php

示例3: overlib_link

                $graph_array_new['type'] = $graph_type;
                $graph_array_new['device'] = $device['device_id'];
                $graph_array_new['height'] = '110';
                $graph_array_new['width'] = $width;
                $graph_array_new['legend'] = 'no';
                $graph_array_new['title'] = 'yes';
                $graph_array_new['from'] = $graph_array['from'];
                $graph_array_new['to'] = $graph_array['to'];
                $graph_array_zoom = $graph_array_new;
                $graph_array_zoom['height'] = '150';
                $graph_array_zoom['width'] = '400';
                $graph_array_zoom['legend'] = 'yes';
                $overlib_link = "device/device=" . $device['device_id'] . "/";
                echo '<div class="devices-overlib-box" style="min-width:' . ($width + 90) . '; max-width: ' . ($width + 90) . '">';
                echo '<div class="panel panel-default">';
                echo overlib_link($overlib_link, generate_lazy_graph_tag($graph_array_new), generate_graph_tag($graph_array_zoom), null);
                echo "</div></div>\n\n";
            }
        }
    }
} else {
    if (is_admin() === true || is_read() === true) {
        $os = "SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`";
        $ver = "SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`";
        $platform = "SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hardware` ORDER BY `hardware`";
        $features = "SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `features` ORDER BY `features`";
        $types = "SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER BY `type`";
    } else {
        $os = "SELECT `os` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `os` ORDER BY `os`";
        $ver = "SELECT `version` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `version` ORDER BY `version`";
        $platform = "SELECT `hardware` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `hardware` ORDER BY `hardware`";
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:devices.inc.php

示例4: unset

 $link_array['page'] = 'graphs';
 unset($link_array['height'], $link_array['width'], $link_array['legend']);
 $link_graph = generate_url($link_array);
 $link = generate_url(array('page' => 'device', 'device' => $sensor['device_id'], 'tab' => 'health', 'metric' => $sensor['sensor_class']));
 $overlib_content = '<div style="width: 580px;"><h2>' . $device['hostname'] . ' - ' . $sensor['sensor_descr'] . '</h1>';
 foreach (array('day', 'week', 'month', 'year') as $period) {
     $graph_array['from'] = $config['time'][$period];
     $overlib_content .= str_replace('"', "\\'", generate_graph_tag($graph_array));
 }
 $overlib_content .= '</div>';
 $graph_array['width'] = 80;
 $graph_array['height'] = 20;
 $graph_array['bg'] = 'ffffff00';
 // the 00 at the end makes the area transparent.
 $graph_array['from'] = $config['time']['day'];
 $sensor_minigraph = generate_lazy_graph_tag($graph_array);
 $sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 48, '');
 echo '<tr class="health">
       <td class=list-bold>' . generate_device_link($sensor) . '</td>
       <td>' . overlib_link($link, $sensor['sensor_descr'], $overlib_content) . '</td>
       <td >' . overlib_link($link_graph, $sensor_minigraph, $overlib_content) . '</td>
       <td >' . $alert . '</td>
       <td class="text-center"><strong>' . $sensor['sensor_current'] . $unit . '</strong></td>
       <td class="text-center">' . round($sensor['sensor_limit_low'], 2) . $unit . ' - ' . round($sensor['sensor_limit'], 2) . $unit . '</td>
       <td>' . (isset($sensor['sensor_notes']) ? $sensor['sensor_notes'] : '') . '</td>
     </tr>
  ';
 if ($vars['view'] == 'graphs') {
     echo "<tr></tr><tr class='health'><td colspan=7>";
     $daily_graph = 'graph.php?id=' . $sensor['sensor_id'] . '&amp;type=' . $graph_type . '&amp;from=' . $config['time']['day'] . '&amp;to=' . $config['time']['now'] . '&amp;width=211&amp;height=100';
     $daily_url = 'graph.php?id=' . $sensor['sensor_id'] . '&amp;type=' . $graph_type . '&amp;from=' . $config['time']['day'] . '&amp;to=' . $config['time']['now'] . '&amp;width=400&amp;height=150';
开发者ID:rkojedzinszky,项目名称:librenms,代码行数:31,代码来源:sensors.inc.php

示例5: str_replace

        if ($hrdevice['hrDeviceType'] == 'hrDeviceNetwork') {
            $int = str_replace('network interface ', '', $hrdevice['hrDeviceDescr']);
            $interface = dbFetchRow('SELECT * FROM ports WHERE device_id = ? AND ifDescr = ?', array($device['device_id'], $int));
            if ($interface['ifIndex']) {
                echo '<td>' . generate_port_link($interface) . '</td>';
                $graph_array['height'] = '20';
                $graph_array['width'] = '100';
                $graph_array['to'] = $config['time']['now'];
                $graph_array['id'] = $interface['port_id'];
                $graph_array['type'] = 'port_bits';
                $graph_array['from'] = $config['time']['day'];
                $graph_array_zoom = $graph_array;
                $graph_array_zoom['height'] = '150';
                $graph_array_zoom['width'] = '400';
                // FIXME click on graph should also link to port, but can't use generate_port_link here...
                $mini_graph = overlib_link(generate_port_url($interface), generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
                echo "<td>{$mini_graph}</td>";
            } else {
                echo '<td>' . stripslashes($hrdevice['hrDeviceDescr']) . '</td>';
                echo '<td></td>';
            }
        } else {
            echo '<td>' . stripslashes($hrdevice['hrDeviceDescr']) . '</td>';
            echo '<td></td>';
        }
    }
    //end if
    echo '<td>' . $hrdevice['hrDeviceType'] . '</td><td>' . $hrdevice['hrDeviceStatus'] . '</td>';
    echo '<td>' . $hrdevice['hrDeviceErrors'] . '</td><td>' . $hrdevice['hrProcessorLoad'] . '</td>';
    echo '</tr>';
}
开发者ID:samyscoub,项目名称:librenms,代码行数:31,代码来源:hrdevice.inc.php

示例6: foreach

foreach (dbFetchRows($sql, $param) as $mempool) {
    $perc = round($mempool['mempool_perc'], 0);
    $total = formatStorage($mempool['mempool_total']);
    $free = formatStorage($mempool['mempool_free']);
    $used = formatStorage($mempool['mempool_used']);
    $graph_array['type'] = $graph_type;
    $graph_array['id'] = $mempool['mempool_id'];
    $graph_array['from'] = $config['time']['day'];
    $graph_array['to'] = $config['time']['now'];
    $graph_array['height'] = '20';
    $graph_array['width'] = '80';
    $graph_array_zoom = $graph_array;
    $graph_array_zoom['height'] = '150';
    $graph_array_zoom['width'] = '400';
    $link = 'graphs/id=' . $graph_array['id'] . '/type=' . $graph_array['type'] . '/from=' . $graph_array['from'] . '/to=' . $graph_array['to'] . '/';
    $mini_graph = overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), null);
    $background = get_percentage_colours($perc);
    $bar_link = overlib_link($link, print_percentage_bar(400, 20, $perc, "{$used} / {$total}", 'ffffff', $background['left'], $free, 'ffffff', $background['right']), generate_graph_tag($graph_array_zoom), null);
    $response[] = array('hostname' => generate_device_link($mempool), 'mempool_descr' => $mempool['mempool_descr'], 'graph' => $mini_graph, 'mempool_used' => $bar_link, 'mempool_perc' => $perc . '%');
    if ($_POST['view'] == 'graphs') {
        $graph_array['height'] = '100';
        $graph_array['width'] = '216';
        $graph_array['to'] = $config['time']['now'];
        $graph_array['id'] = $mempool['mempool_id'];
        $graph_array['type'] = $graph_type;
        $return_data = true;
        include 'includes/print-graphrow.inc.php';
        unset($return_data);
        $response[] = array('hostname' => $graph_data[0], 'mempool_descr' => $graph_data[1], 'graph' => $graph_data[2], 'mempool_used' => $graph_data[3], 'mempool_perc' => '');
    }
    //end if
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:mempool.inc.php

示例7: foreach

    $graph_type = 'atmvp_bits';
}
echo '<table cellspacing="0" cellpadding="5" border="0">';
foreach (dbFetchRows('SELECT * FROM juniAtmVp WHERE port_id = ?', array($interface['port_id'])) as $vp) {
    if (is_integer($row / 2)) {
        $row_colour = $list_colour_a;
    } else {
        $row_colour = $list_colour_b;
    }
    echo '<tr bgcolor="' . $row_colour . '">';
    echo '<td><span class=list-bold>' . $row . '. VP' . $vp['vp_id'] . ' ' . $vp['vp_descr'] . '</span></td>';
    echo '</tr>';
    $graph_array['height'] = '100';
    $graph_array['width'] = '214';
    $graph_array['to'] = $config['time']['now'];
    $graph_array['id'] = $vp['juniAtmVp_id'];
    $graph_array['type'] = $graph_type;
    $periods = array('day', 'week', 'month', 'year');
    echo '<tr bgcolor="' . $row_colour . '"><td>';
    foreach ($periods as $period) {
        $graph_array['from'] = ${$period};
        $graph_array_zoom = $graph_array;
        $graph_array_zoom['height'] = '150';
        $graph_array_zoom['width'] = '400';
        echo overlib_link('#', generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), null);
    }
    echo '</td></tr>';
    $row++;
}
//end foreach
echo '</table>';
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:junose-atm-vp.inc.php


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