Changeset 51 for branches/old
- Timestamp:
- Feb 20, 2015, 9:21:01 AM (10 years ago)
- Location:
- branches/old
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/old/add.php
r49 r51 1 <? 1 <?php 2 2 3 include('global.php'); 3 4 … … 10 11 { 11 12 AddValue($Measure, $Value); 12 echo('Hodnota '.$Value.' ulo ena');13 } else echo('Nemáte oprávnění k aktualizaci zadané veličiny!<br>Va e adresa: '.gethostbyaddr($_SERVER['REMOTE_ADDR']).'('.$_SERVER['REMOTE_ADDR'].')');13 echo('Hodnota '.$Value.' uložena'); 14 } else echo('Nemáte oprávnění k aktualizaci zadané veličiny!<br>Vaše adresa: '.gethostbyaddr($_SERVER['REMOTE_ADDR']).'('.$_SERVER['REMOTE_ADDR'].')'); 14 15 } else echo('Nebyly zadány potřebné parametry'); -
branches/old/admin.php
r28 r51 65 65 echo('Dokončeno<br>'); 66 66 } 67 68 ?> -
branches/old/classes.php
r28 r51 16 16 ), 17 17 ); 18 19 ?> -
branches/old/code.php
r3 r51 559 559 return $string; 560 560 } 561 ?> -
branches/old/config.sample.php
r50 r51 28 28 'ImageHeight' => 200, 29 29 'ValueToImageHeigthCoefficient' => 0.9, 30 'FontFileName' => ' arial.ttf',30 'FontFileName' => './arial.ttf', 31 31 'FontSize' => 10, 32 32 'DefaultVariables' => array( -
branches/old/create_groups.php
r1 r51 1 <? 1 <?php 2 2 3 3 include('error.php'); … … 16 16 for($Level=) 17 17 } 18 ?> -
branches/old/database.php
r50 r51 69 69 $this->query('SET CHARACTER SET '.$Charset); 70 70 } 71 72 71 } -
branches/old/error.php
r28 r51 64 64 65 65 set_error_handler('obsluha_chyb'); // Aktivuj novou obsluhu chyb 66 67 ?> -
branches/old/graph.php
r28 r51 1 1 <?php 2 2 3 include('global.php'); 3 4 4 5 if(array_key_exists('Debug', $_GET)) $Debug = $_GET['Debug']; 5 6 else $Debug = 0; 6 7 7 8 if(!array_key_exists('From',$_GET)) die('Musíte zadat čas počátku'); 8 9 $StartTime = addslashes($_GET['From']); … … 28 29 if($Level < 0) $Level = 0; 29 30 if($Level > $MaxLevel) $Level = $MaxLevel; 30 //$Level = 0;31 32 31 33 32 $Points = GetValues($Measure, $StartTime, $EndTime, $Level); … … 54 53 //$MinValue = round($MinValue * $Measure['Divider']) / $Measure['Divider']; 55 54 //$MaxValue = round($MaxValue * $Measure['Divider']) / $Measure['Divider']; 56 $AvgValue = $AvgValue / count($Points); //round( 55 $AvgValue = $AvgValue / count($Points); //round(* $Measure['Divider']) / $Measure['Divider']; 57 56 58 57 // Generate polygon and recalculate y values to fit graph height … … 61 60 $PointsMax = array(0, $Height-1); 62 61 if(($MaxValue - $MinValue) == 0) $MaxValue = $MinValue + 1; 63 { 62 { 64 63 foreach($Points as $Index => $Item) 65 64 { … … 73 72 } 74 73 } 75 $PointsMin[] = $Width -1;76 $PointsMin[] = $Height -1;77 $PointsAvg[] = $Width -1;78 $PointsAvg[] = $Height -1;79 $PointsMax[] = $Width -1;80 $PointsMax[] = $Height -1;81 $PointsMin[] = $Width -1;82 $PointsMin[] = $Height -1;83 $PointsAvg[] = $Width -1;84 $PointsAvg[] = $Height -1;85 $PointsMax[] = $Width -1;86 $PointsMax[] = $Height -1;74 $PointsMin[] = $Width - 1; 75 $PointsMin[] = $Height - 1; 76 $PointsAvg[] = $Width - 1; 77 $PointsAvg[] = $Height - 1; 78 $PointsMax[] = $Width - 1; 79 $PointsMax[] = $Height - 1; 80 $PointsMin[] = $Width - 1; 81 $PointsMin[] = $Height - 1; 82 $PointsAvg[] = $Width - 1; 83 $PointsAvg[] = $Height - 1; 84 $PointsMax[] = $Width - 1; 85 $PointsMax[] = $Height - 1; 87 86 88 87 … … 95 94 96 95 // Generate image 97 if(!$Debug) 96 if(!$Debug) 98 97 { 99 98 header("Content-type: image/png"); … … 115 114 imagefilledpolygon($Image, $PointsAvg, count($PointsAvg) / 2, $LightGreen); 116 115 imagefilledpolygon($Image, $PointsMin, count($PointsMin) / 2, $LightBlue); 117 116 118 117 $TimeMarks = array(1, 60, 60*60, 60*60*24, 60*60*24*7, 60*60*24*30, 60*60*24*365, 60*60*24*365*10); 119 118 120 119 $TimeRange = $EndTime - $StartTime; 121 120 $TimeMarksIndex = 0; … … 124 123 $MajorTimeMarks = $TimeMarks[$TimeMarksIndex - 1]; 125 124 $MinorTimeMarks = $TimeMarks[$TimeMarksIndex - 2]; 126 125 127 126 $TimeShift = AlignTime($StartTime, $MajorTimeMarks) - $StartTime; 128 127 //imagestring($Image, 10, 40, 50, $TimeShift, $Black); 129 128 130 129 // Zobraz měřítko Y 131 130 $VerticalLinesDistance = $Height / $VerticalLinesCount; … … 138 137 139 138 $TimeShift = AlignTime($StartTime, $MinorTimeMarks) - $StartTime; 140 139 141 140 // Zobraz měřítko X 142 141 $LastTextEnd = 0; … … 155 154 } 156 155 else for($Y=0; $Y < $Height; $Y = $Y + 3) imagesetpixel($Image, $X, $Y, $Gray); 157 } 158 156 } 157 159 158 // Popisky osy Y 160 for($I =1; $I<=$VerticalLinesCount; $I++)159 for($I = 1; $I <= $VerticalLinesCount; $I++) 161 160 { 162 161 $Y = $Height - 1 - ($VerticalLinesDistance * $I); … … 166 165 if(($Y - ($BoundBox[5] - $BoundBox[1]) / 2) > 10) 167 166 imagettftext($Image, $FontSize, 0, 2, $Y - ($BoundBox[5] - $BoundBox[1]) / 2, $Black, $FontFile, $Text); 168 } 167 } 169 168 $GenerationTime = floor((GetMicrotime() - $StopWatchStart) * 1000 ) / 1000; 170 169 … … 175 174 imagettftext($Image, $FontSize, 0, $Left, 14, $Red, $FontFile, $Text); 176 175 177 $Text = " Avg. ".AddPrefixMultipliers($AvgValue, $Measure['Unit'] );176 $Text = " Avg. ".AddPrefixMultipliers($AvgValue, $Measure['Unit'], 4); 178 177 $BoundingBox = imagettfbbox($FontSize, 0, $FontFile, $Text); 179 178 $Left -= ($BoundingBox[2] - $BoundingBox[0]); … … 192 191 imagedestroy($Image); 193 192 } 194 195 ?> -
branches/old/index.php
r50 r51 156 156 } 157 157 $Output .= '<br>'; 158 159 $Result = $Database->select('measure', 'id', '(Enabled=1) AND ((PermissionView="all") OR (PermissionView="'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'")) WHERE Id='.$_SESSION['Measure']); 160 if($Result->num_rows == 0) $_SESSION['Measure'] = $Config['DefaultVariables']['Measure']; 158 161 159 162 $Output .= '<strong>Graf:</strong><br>'; -
branches/old/rebuild.php
r17 r51 7 7 8 8 //RebuildAllMeasuresCache(); 9 10 ?> -
branches/old/sql/23_data.sql
r24 r51 8 8 `level` tinyint(4) NOT NULL default '0', 9 9 KEY `time` (`time`) 10 ) ENGINE=MyISAM DEFAULT CHARSET= latin2;10 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -
branches/old/stat_functions.php
r49 r51 24 24 function TruncateDigits($Value, $Digits = 4) 25 25 { 26 for($II = 2; $II > - 1; $II--)26 for($II = 2; $II > -6; $II--) 27 27 { 28 28 if($Value >= pow(10, $II)) 29 29 { 30 if($Digits < ($II + 1)) $RealDigits = $II + 1; else $RealDigits = $Digits; 30 if($Digits < ($II + 1)) $RealDigits = $II + 1; 31 else $RealDigits = $Digits; 31 32 $Value = round($Value / pow(10, $II - $RealDigits + 1)) * pow(10, $II - $RealDigits + 1); 32 33 break; -
branches/old/types.php
r4 r51 12 12 ), 13 13 ); 14 15 ?>
Note:
See TracChangeset
for help on using the changeset viewer.