Changeset 47 for trunk/Application/Model


Ignore:
Timestamp:
Jul 27, 2014, 9:14:56 PM (10 years ago)
Author:
chronos
Message:
  • Odstraněno: Zbytečná PHP ukončovací značka "?>" z konce všech souborů.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 
        21config.php
         2.project
  • trunk/Application/Model/Measure.php

    r46 r47  
    467467  }
    468468}
    469 
    470 ?>
  • trunk/Application/Model/Measurement/MeasureClient.php

    r44 r47  
    2626      } else echo('Třída '.$MeasureMethod['MeasureClass'].' neexistuje.');
    2727    }
    28   } 
     28  }
    2929}
    30 
    31 ?>
  • trunk/Application/Model/Measurement/Measurement.php

    r43 r47  
    66{
    77}
    8 
    9 ?>
  • trunk/Application/Model/Measurement/System.php

    r44 r47  
    2424
    2525  function Ping($Host = 'nix.cz')
    26   { 
     26  {
     27    $Row = array();
    2728    exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row);
    2829    // W - timeout in seconds
     
    5556    $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName));
    5657    //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev;
    57  
     58
    5859    // get processor usage seconds for pct stats ###
    5960    $File = fopen('/proc/stat', 'r');
     
    6970    $CpuUsageDiffTotal = (($CpuUsageDiff['User'] + $CpuUsageDiff['System']) + $CpuUsageDiff['Idle']);
    7071    if ($CpuUsageDiffTotal > 0)
    71     { 
     72    {
    7273      $CpuUsagePercent['User'] = ($CpuUsageDiff['User'] / $CpuUsageDiffTotal) * 100;
    7374      $CpuUsagePercent['System'] = ($CpuUsageDiff['System'] / $CpuUsageDiffTotal) * 100;
     
    9394    array_shift($Output); // Skip header
    9495    foreach($Output as $Item)
    95     { 
     96    {
    9697      while(strpos($Item, '  ') !== false) $Item = str_replace('  ', ' ', $Item);  // Rrmove multiple spaces
    9798      $Item = explode(':', $Item);
     
    108109        $NetworkState[$Interface]['DownAverage'] = 0;
    109110        $NetworkState[$Interface]['UpAverage'] = 0;
    110       } 
     111      }
    111112      if($NetworkState[$Interface]['DownAverage'] < 0) $NetworkState[$Interface]['DownAverage'] = 0;
    112113      if($NetworkState[$Interface]['UpAverage'] < 0) $NetworkState[$Interface]['UpAverage'] = 0;
     
    121122    return($NetworkState['Interface']['DownAverage']);
    122123  }
    123  
     124
    124125  function NetworkSpeedUpload($Interface)
    125126  {
     
    177178  }
    178179}
    179 
    180 ?>
  • trunk/Application/Model/Permission.php

    r40 r47  
    1111      if($DbRow['SubGroup'] > 0) $Result = array_merge($Result, $this->LoadForGroup($DbRow['SubGroup']));
    1212      if($DbRow['Operation'] > 0)
    13       { 
     13      {
    1414        $DbResult2 = $this->Database->query('SELECT `PermissionOperation`.*, `Module`.`Name` FROM `PermissionOperation` JOIN `Module` ON `Module`.`Id` = `PermissionOperation`.`Module` WHERE `PermissionOperation`.`Id`='.$DbRow['Operation']);
    1515        $DbRow2 = $DbResult2->fetch_assoc();
     
    1919    $this->Data = $Result;
    2020  }
    21    
     21
    2222  function LoadForGroup($Group)
    2323  {
     
    2828      if($DbRow['SubGroup'] > 0) $Result = array_merge($Result, $this->LoadForGroup($DbRow['SubGroup']));
    2929      if($DbRow['Operation'] > 0)
    30       { 
     30      {
    3131        $DbResult2 = $this->Database->query('SELECT `PermissionOperation`.*, `Module`.`Name` FROM `PermissionOperation` JOIN `Module` ON `Module`.`Id` = `PermissionOperation`.`Module` WHERE `PermissionOperation`.`Id`='.$DbRow['Operation']);
    3232        $DbRow2 = $DbResult2->fetch_assoc();
     
    3636    return($Result);
    3737  }
    38  
     38
    3939  function Check($Module, $Action, $Item = 0)
    4040  {
     
    4444  }
    4545}
    46 
    47 ?>
  • trunk/Application/Model/User.php

    r46 r47  
    267267  }
    268268}
    269 
    270 ?>
  • trunk/Application/Model/stat_functions.php

    r43 r47  
    4343  if($Unit == '') return(TruncateDigits($Value, $Digits));
    4444  $I = 8;
    45   if($Value > 0) $II = 1; 
     45  if($Value > 0) $II = 1;
    4646  else if($Value < 0) $II = -1;
    4747  else $II = 0;
     
    9999  $Result = $Database->select($Measure['DataTable'], '*', 'measure='.$Measure['Id'].' AND level='.$Level.' ORDER BY time DESC LIMIT 2');
    100100  //echo($Database->LastQuery."\n");
    101   if($Result->num_rows == 0) 
    102   {
    103      $Database->insert($Measure['DataTable'], array('min' => $Value['min'], 'avg' => $Value['avg'], 'max' => $Value['max'], 'level' => $Level, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), 'continuity' => 0)); 
     101  if($Result->num_rows == 0)
     102  {
     103     $Database->insert($Measure['DataTable'], array('min' => $Value['min'], 'avg' => $Value['avg'], 'max' => $Value['max'], 'level' => $Level, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), 'continuity' => 0));
    104104     //echo($Database->LastQuery."\n");
    105105  } else if($Result->num_rows == 1)
     
    237237        }
    238238      }
    239       else if($ValueType == 'min') 
    240       {
    241         //echo($Values[$I+1]['continuity'].'=='.$Measure['ContinuityEnabled'].'<br>'); 
     239      else if($ValueType == 'min')
     240      {
     241        //echo($Values[$I+1]['continuity'].'=='.$Measure['ContinuityEnabled'].'<br>');
    242242        if($Values[$I + 1]['continuity'] == $Measure['ContinuityEnabled'])
    243243        {
     
    258258    $NewValue[$ValueType] = $NewValue[$ValueType];
    259259  }
    260   //if(($RightTime - $LeftTime) > 0) 
    261   if($Measure['Cumulative'] == 0) 
     260  //if(($RightTime - $LeftTime) > 0)
     261  if($Measure['Cumulative'] == 0)
    262262  {
    263263    $NewValue['avg'] = $NewValue['avg'] / ($RightTime - $LeftTime);
     
    273273
    274274  // Get first and last time
    275   //echo($Measure['Id'].','.$Level.','.StatTableName($Level)."\n"); 
     275  //echo($Measure['Id'].','.$Level.','.StatTableName($Level)."\n");
    276276  $Result = $Database->select($Measure['DataTable'], '*', 'measure='.$Measure['Id'].' AND level='.$Level.' ORDER BY time LIMIT 1');
    277277  if($Result->num_rows > 0)
     
    288288  } else $AbsoluteRightTime = 0;
    289289
    290   if($Debug) 
     290  if($Debug)
    291291  {
    292292    echo('AbsoluteLeftTime: '.$AbsoluteLeftTime.'('.TimeToMysqlDateTime($AbsoluteLeftTime).')<br>');
     
    297297
    298298function LoadRightSideValue($Level, $Measure, $Time)
    299 { 
     299{
    300300  global $Debug, $Database;
    301301  $Result = array();
     
    362362  //$AbsoluteTime = GetTimeRange($MeasureId);
    363363
    364 //  if(($TimeFrom > $AbsoluteLeftTime) and ($TimeStart < $AbsoluteRightTime) and 
     364//  if(($TimeFrom > $AbsoluteLeftTime) and ($TimeStart < $AbsoluteRightTime) and
    365365//    ($TimeTo > $AbsoluteLeftTime) and ($TimeTo < $AbsoluteRightTime))
    366366//  {
     
    480480      // Load values in time range
    481481      //array_pop($NextValues);
    482     } 
     482    }
    483483    echo("Uroven dokoncena<br>\n");
    484484    $DbResult = $Database->select($Measure['DataTable'], 'COUNT(*)', 'level='.$Level.' AND measure='.$Measure['Id']);
     
    525525) ENGINE = MYISAM ;');
    526526}
    527 
    528 ?>
Note: See TracChangeset for help on using the changeset viewer.