Legend:
- Unmodified
- Added
- Removed
-
index.php
r3 r6 98 98 ); 99 99 100 $Variables = array( 101 'TimeStart' => time() - 3600*24, 102 'TimeEnd' => time(), 103 'Measure' => 1, 104 'Period' => 'day', 105 'TimeSpecify' => 0, 106 ); 107 108 foreach($Variables as $Index => $Variable) 100 foreach($Config['DefaultVariables'] as $Index => $Variable) 109 101 { 110 102 if(!array_key_exists($Index, $_SESSION)) $_SESSION[$Index] = $Variable; … … 182 174 183 175 $Output .= '<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;">'; 184 $Output .= '<tr><th>Mìøená velièina</th><th>Èas posledního mìøení</th><th>Poslední hodnota</th><th>Interpolace</th><th>Poznámky</th></tr>'; 176 $Output .= '<tr><th>Mìøená velièina</th><th>Èas posledního mìøení</th><th>Poslední hodnota</th><th>Interpolace</th><th>Poznámky</th>'; 177 if(array_key_exists('Debug', $_GET)) $Output .= '<th>Poèet polo¾ek</th><th>Èas vykonání</th>'; 178 $Output .= '</tr>'; 185 179 $Database->select_db('measure'); 186 180 $Result = $Database->select('measure', '*', 'Enabled=1 AND PermissionView="all" OR PermissionView="'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'" ORDER BY Description'); … … 190 184 { 191 185 $StopWatchStart = GetMicrotime(); 192 // DB_Select('stat_data', 'COUNT(*)', 'measure='.$Measure['id']); 193 // $RowCount = DB_Row(); 194 // $RowCount = $RowCount[0]; 195 // $RowCount = 0; 196 $Result2 = $Database->select('stat_data', 'time, avg', 'measure='.$Measure['id'].' ORDER BY time DESC LIMIT 1'); 186 if(array_key_exists('Debug', $_GET)) 187 { 188 $DbResult = $Database->select($Measure['DataTable'], 'COUNT(*)', 'measure='.$Measure['Id']); 189 $RowCount = $DbResult->fetch_array(); 190 $RowCount = $RowCount[0]; 191 } 192 $Result2 = $Database->select($Measure['DataTable'], 'time, avg', 'measure='.$Measure['Id'].' ORDER BY time DESC LIMIT 1'); 197 193 if($Result2->num_rows > 0) 198 194 { 199 195 $Row = $Result2->fetch_array(); 200 196 $LastMeasureTime = date('j.n.Y G:i:s', MysqlDateTimeToTime($Row['time'])); 201 $LastMeasureValue = round($Row['avg'] / $Measure[' display_divider']);197 $LastMeasureValue = round($Row['avg'] / $Measure['Divider']); 202 198 } else { 203 199 $LastMeasureTime = ' '; 204 200 $LastMeasureValue = ' '; 205 201 } 206 if($Measure[' continuity'] == 1) $Interpolate = 'Ano'; else $Interpolate = 'Ne';207 if($Measure[' info'] == '') $Measure['info'] = ' ';202 if($Measure['Continuity'] == 1) $Interpolate = 'Ano'; else $Interpolate = 'Ne'; 203 if($Measure['Info'] == '') $Measure['Info'] = ' '; 208 204 $GenerationTime = floor((GetMicrotime() - $StopWatchStart) * 1000 ) / 1000; 209 $Output .= '<tr><td><a href="?Measure='.$Measure[' id'].'">'.$Measure['description'].'</a></td><td align="center">'.$LastMeasureValue.' '.$Measure['display_unit'].'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['info'].'</td>';210 //<td>'.$RowCount.'</td><td>'.$GenerationTime.'</td></tr>');211 flush();205 $Output .= '<tr><td><a href="?Measure='.$Measure['Id'].'">'.$Measure['Description'].'</a></td><td align="center">'.$LastMeasureValue.' '.$Measure['Unit'].'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['Info'].'</td>'; 206 if(array_key_exists('Debug', $_GET)) $Output .= '<td>'.$RowCount.'</td><td>'.$GenerationTime.'</td>'; 207 $Output .= '</tr>'; 212 208 } 213 209 $Output .= '</table>';
Note:
See TracChangeset
for help on using the changeset viewer.