2013-02-28 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_reporting.php: fixed php warning message when
	calculate the server healty without servers.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7739 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-28 10:04:58 +00:00
parent 5c05258961
commit a9ae04d72d
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-02-28 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: fixed php warning message when
calculate the server healty without servers.
2013-02-28 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php: added code to set the config options

View File

@ -1195,7 +1195,12 @@ function reporting_get_stats_indicators($data, $width = 280, $height = 20) {
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver');
$servers["up"] = (int) servers_check_status ();
$servers["down"] = $servers["all"] - $servers["up"];
$servers["health"] = $servers["up"] / ($servers["all"] / 100);
if ($servers["all"] == 0) {
$servers["health"] = 0;
}
else {
$servers["health"] = $servers["up"] / ($servers["all"] / 100);
}
$tdata[0] = '<fieldset class="databox" style="width:97%;">
<legend style="text-align:left; color: #666;">' .