Changeset 9


Ignore:
Timestamp:
Oct 16, 2007, 10:30:50 PM (17 years ago)
Author:
george
Message:

Oprava funkce přidání nové položky

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stat_functions.php

    r6 r9  
    6262
    6363  $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),
    6565    'continuity' => 0));
    6666  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),
     
    6969    $LastValue = $Result->fetch_array();
    7070    $NextToLastValue = DB_Row();
    71     if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 0.75 * $Measure['period'])
     71    if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 0.75 * $Measure['Period'])
    7272    {
    7373    }
    7474    else
    7575    {
    76       if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 1.25 * $Measure['period']) $Continuity = 1;
     76      if(($Time - MysqlDateTimeToTime($LastValue['time'])) < 1.25 * $Measure['Period']) $Continuity = 1;
    7777        else $Continuity = 0;
    7878      if(($LastValue['avg'] == $NextToLastValue['avg']) and ($LastValue['avg'] == $Value) and
Note: See TracChangeset for help on using the changeset viewer.