Now read values from file

Keep code for reading value by DB
This commit is contained in:
Rodolphe Quiedeville 2002-12-23 23:40:37 +00:00
parent a54555169e
commit da8a74468f

View File

@ -25,6 +25,38 @@ if (file_exists ($thermlib))
{ {
include($thermlib); include($thermlib);
if (1)
{
$dons_file = "/var/run/dolibarr.don.eucd";
/*
* Read Values
*/
if (file_exists ($dons_file))
{
$fp = fopen($dons_file, 'r' );
if ($fp)
{
$intentValue = fgets( $fp, 10 );
$pendingValue = fgets( $fp, 10 );
$actualValue = fgets( $fp, 10 );
fclose( $fp );
}
}
}
else
{
/* /*
* Read Values * Read Values
*/ */
@ -37,8 +69,16 @@ if (file_exists ($thermlib))
$pendingValue = $dontherm->sum_pending(); $pendingValue = $dontherm->sum_pending();
$intentValue = $dontherm->sum_intent(); $intentValue = $dontherm->sum_intent();
$dbt->close();
}
/*
* Graph thermometer
*/
print moneyMeter($actualValue, $pendingValue, $intentValue); print moneyMeter($actualValue, $pendingValue, $intentValue);
$dbt->close();
} }
?> ?>