Changeset 9 for stat_functions.php
- Timestamp:
- Oct 16, 2007, 10:30:50 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stat_functions.php
r6 r9 62 62 63 63 $Result = $Databse->select($Measure['DataTable'], '*', 'measure='.$Measure['Id'].' AND level=0 ORDER BY time DESC LIMIT 2'); 64 if($Result->num_rows == 0) $Database->insert( 'stat_data', array('min' => $Value, 'avg' => $Value, 'max' => $Value, 'level' => 0, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time),64 if($Result->num_rows == 0) $Database->insert($Measure['DataTable'], array('min' => $Value, 'avg' => $Value, 'max' => $Value, 'level' => 0, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), 65 65 'continuity' => 0)); 66 66 else if($Result->num_rows == 1) $Database->insert($Measure['DataTable'], array('min' => $Value, 'avg' => $Value, 'max' => $Value, 'level' => 0, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), … … 69 69 $LastValue = $Result->fetch_array(); 70 70 $NextToLastValue = DB_Row(); 71 if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 0.75 * $Measure[' period'])71 if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 0.75 * $Measure['Period']) 72 72 { 73 73 } 74 74 else 75 75 { 76 if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 1.25 * $Measure[' period']) $Continuity = 1;76 if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 1.25 * $Measure['Period']) $Continuity = 1; 77 77 else $Continuity = 0; 78 78 if(($LastValue['avg'] == $NextToLastValue['avg']) and ($LastValue['avg'] == $Value) and
Note:
See TracChangeset
for help on using the changeset viewer.