Exemplo n.º 1
0
            $bar_width = round((1 - intval($master_array[$i][3]) / intval($master_array[$i][1])) * 148);
            $free_percent = $master_array[$i][3] / $master_array[$i][1] * 100;
            $used_percent = 100 - $free_percent;
            $bar_width = 1.48 * $used_percent;
            if ($used_percent > 90) {
                echo '<span style="display:block; height:11px; width:' . $bar_width . 'px; background-color:#DA2626"></span>';
                // Red bar
            } else {
                echo '<span style="display:block; height:11px; width:' . $bar_width . 'px; background-color:#26A0DA"></span>';
                // Blue bar
            }
        }
        // linux resutls are in kbyte blocks
        if (php_uname('s') != 'Windows NT') {
            $master_array[$i][3] = $master_array[$i][3] * 1024;
            $master_array[$i][1] = $master_array[$i][1] * 1024;
        }
        echo '</span><span style="color:#808080">' . sprintf($string['freespace'], format_space($master_array[$i][3]), format_space($master_array[$i][1])) . '</span></td></tr>';
    }
}
echo '</table></td></tr>';
echo "</table>\n<br />\n";
$mysqli->close();
?>
</td></tr>
</table>
</div>
</div>
</body>
</html>
Exemplo n.º 2
0
function format_list($string)
{
    $string = str_replace(";", "&nbsp;&nbsp;&nbsp;&nbsp;", $string);
    return format_space($string);
}