- Timestamp:
- Sep 1, 2010, 5:23:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/network/dostupnost.php
r271 r284 9 9 var $PeriodCount = 12; 10 10 var $Period = array( 11 array('Column' => 'Hour', 'Title' => 'Hodina', 'Period' => 1 ),12 array('Column' => 'Day', 'Title' => 'Den', 'Period' => 24 ),13 array('Column' => 'Week', 'Title' => 'Týden', 'Period' => 168 ), // 24 * 714 array('Column' => 'Month', 'Title' => 'Měsíc', 'Period' => 720 ), // 24 * 3015 array('Column' => 'Year', 'Title' => 'Rok', 'Period' => 8760 ), // 365 * 2411 array('Column' => 'Hour', 'Title' => 'Hodina', 'Period' => 1, 'MinPercent' => 100), 12 array('Column' => 'Day', 'Title' => 'Den', 'Period' => 24, 'MinPercent' => 98), 13 array('Column' => 'Week', 'Title' => 'Týden', 'Period' => 168, 'MinPercent' => 96), // 24 * 7 14 array('Column' => 'Month', 'Title' => 'Měsíc', 'Period' => 720, 'MinPercent' => 93), // 24 * 30 15 array('Column' => 'Year', 'Title' => 'Rok', 'Period' => 8760, 'MinPercent' => 92), // 365 * 24 16 16 //array('Column' => 'TenYear', 'Title' => 'Desetiletí', 'Period' => 87600), // 365 * 24 * 10 17 17 ); … … 67 67 $Output .= '</tr>'; 68 68 69 $DbResult2 = $this->Database->query('SELECT NetworkInterface.Name'.$Columns.', NetworkDevice.Name AS DeviceName FROM NetworkInterface '.$Join.' JOIN NetworkDevice ON NetworkInterface.Device = NetworkDevice.Id WHERE NetworkDevice.Used = 1 AND NetworkDevice. Type IN (1, 4, 5)ORDER BY DeviceName, Name');69 $DbResult2 = $this->Database->query('SELECT NetworkInterface.Name'.$Columns.', NetworkDevice.Name AS DeviceName FROM NetworkInterface '.$Join.' JOIN NetworkDevice ON NetworkInterface.Device = NetworkDevice.Id WHERE NetworkDevice.Used = 1 AND NetworkDevice.PermanentOnline=1 ORDER BY DeviceName, Name'); 70 70 while($Interface = $DbResult2->fetch_assoc()) 71 71 { … … 76 76 { 77 77 foreach($this->Period as $Period) 78 $Output .= '<td style="text-align: right;">'.sprintf('%01.2f', $Interface[$Period['Column']]).'</td>'; 78 { 79 if($Interface[$Period['Column']] >= $Period['MinPercent']) $Color = ' color: green;'; 80 else $Color = 'color: red'; 81 $Output .= '<td style="text-align: right;'.$Color.'">'.sprintf('%01.2f', $Interface[$Period['Column']]).'</td>'; 82 } 79 83 } else 80 84 { … … 83 87 for($I = 0; $I < $this->PeriodCount; $I++) 84 88 { 85 $Output .= '<td style="text-align: center;">'.sprintf('%01.2f', $Interface['Period'.$I.'Column']).'</td>'; 89 if($Interface['Period'.$I.'Column'] >= $Period['MinPercent']) $Color = ' color: green;'; 90 else $Color = 'color: red'; 91 $Output .= '<td style="text-align: center;'.$Color.'">'.sprintf('%01.2f', $Interface['Period'.$I.'Column']).'</td>'; 86 92 } 87 93 } else die('Neznámé id');
Note:
See TracChangeset
for help on using the changeset viewer.