Changeset 61


Ignore:
Timestamp:
Dec 31, 2015, 11:02:23 PM (9 years ago)
Author:
chronos
Message:
  • Added: Used ErrorHandler class Common package.
  • Removed: Unused files.
Location:
trunk
Files:
2 added
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/RSS.php

    r56 r61  
    11<?php
    22
    3 class RSS
     3class RSS 
    44{
    55  var $Charset;
     
    99  var $WebmasterEmail;
    1010  var $Items;
    11 
     11 
    1212  function __construct()
    1313  {
  • trunk/create_groups.php

    r51 r61  
    11<?php
    22
    3 include('error.php');
    43include('stat_functions.php');
    54include('db.php');
  • trunk/global.php

    r56 r61  
    33session_start();
    44$FileName = dirname(__FILE__).'/config.php';
    5 if(file_exists($FileName)) include($FileName);
     5if(file_exists($FileName)) include_once($FileName);
    66else {
    77  die('Configuration file "'.$FileName.'" not found.');
    88}
    9 include_once('config.php');
    109include_once('Version.php');
    1110include_once('types.php');
    1211include_once('classes.php');
    13 include_once('Packages/Common/Package.php');
     12include_once('Packages/Common/Common.php');
    1413$PrefixMultiplier = new PrefixMultiplier();
     14$ErrorHandler = new ErrorHandler();
     15$ErrorHandler->Start();
     16$ErrorHandler->ShowError = $Config['Web']['ShowError'];
    1517include_once('stat_functions.php');
    1618$Database = new Database();
     
    5557function MakeLink($Target, $Title)
    5658{
    57   return('<a href="'.$Target.'">'.$Title.'</a>'); 
     59  return('<a href="'.$Target.'">'.$Title.'</a>');
    5860}
    5961
     
    8789  foreach($Class as $Index => $Item)
    8890  {
    89     if(!array_key_exists($Index, $Values)) $Values[$Index] = $Item['Default']; 
     91    if(!array_key_exists($Index, $Values)) $Values[$Index] = $Item['Default'];
    9092    switch($Item['Type'])
    9193    {
  • trunk/graph.php

    r56 r61  
    33include('global.php');
    44
    5 if(array_key_exists('Debug', $_GET)) $Debug = $_GET['Debug']; 
     5if(array_key_exists('Debug', $_GET)) $Debug = $_GET['Debug'];
    66  else $Debug = 0;
    77
     
    1414if(!array_key_exists('Measure',$_GET)) die('Musíte zadat měřenou veličinu');
    1515$MeasureId = addslashes($_GET['Measure']);
    16 if(!array_key_exists('Width', $_GET)) $Width = $DefaultWidth; 
     16if(!array_key_exists('Width', $_GET)) $Width = $DefaultWidth;
    1717else $Width = addslashes($_GET['Width']);
    1818if(!array_key_exists('Height', $_GET)) $Height = $DefaultHeight;
     
    3232$Points = GetValues($Measure, $StartTime, $EndTime, $Level);
    3333
    34 if($Debug) echo('Points count: '.count($Points).'<br>'); 
    35 //if($Debug) foreach($Points as $Index => $Item) 
     34if($Debug) echo('Points count: '.count($Points).'<br>');
     35//if($Debug) foreach($Points as $Index => $Item)
    3636//  echo($Index.': '.$Item['min'].'<br>');
    3737
     
    5555$AvgValue = $AvgValue / count($Points); //round(* $Measure['Divider']) / $Measure['Divider'];
    5656
    57 // Generate polygon and recalculate y values to fit graph height 
     57// Generate polygon and recalculate y values to fit graph height
    5858$PointsMin = array(0, $Height-1);
    5959$PointsAvg = array(0, $Height-1);
     
    9797{
    9898  Header("Content-type: image/png");
    99   Header("Cache-Control: no-cache");    // Dynamic graph - no cache 
     99  Header("Cache-Control: no-cache");    // Dynamic graph - no cache
    100100  $Image = @imagecreate($Width, $Height);
    101101  $BackgroundColor = imagecolorallocate($Image, 255, 255, 255);
     
    122122  if($TimeMarksIndex < 2) $TimeMarksIndex = 2;
    123123  $MajorTimeMarks = $TimeMarks[$TimeMarksIndex - 1];
    124   $MinorTimeMarks = $TimeMarks[$TimeMarksIndex - 2]; 
     124  $MinorTimeMarks = $TimeMarks[$TimeMarksIndex - 2];
    125125
    126   $TimeShift = AlignTime($StartTime, $MajorTimeMarks) - $StartTime; 
     126  $TimeShift = AlignTime($StartTime, $MajorTimeMarks) - $StartTime;
    127127  //imagestring($Image, 10, 40, 50, $TimeShift, $Black);
    128128
     
    134134    for($X=1; $X < $Width; $X = $X + 3) imagesetpixel($Image, $X, $Y, $Gray);
    135135    //imageline($Image, 30, $Y, $Width-1, $Y, IMG_COLOR_STYLED);
    136   } 
     136  }
    137137
    138   $TimeShift = AlignTime($StartTime, $MinorTimeMarks) - $StartTime; 
     138  $TimeShift = AlignTime($StartTime, $MinorTimeMarks) - $StartTime;
    139139
    140140  // Zobraz měřítko X
     
    142142  for($Time = $StartTime; $Time < $EndTime; $Time += $MajorTimeMarks)
    143143  {
    144     $X = round(($Time - $StartTime + $TimeShift) / $TimeRange * $Width) % $Width; 
     144    $X = round(($Time - $StartTime + $TimeShift) / $TimeRange * $Width) % $Width;
    145145    //imageline($Image, 30, $Y, $Width-1, $Y, IMG_COLOR_STYLED);
    146146    if(($MajorTimeMarks > 60*60*24)) $Text = date('j.n.Y', $Time + $TimeShift);
Note: See TracChangeset for help on using the changeset viewer.