Changeset 56


Ignore:
Timestamp:
Feb 21, 2015, 12:17:01 AM (9 years ago)
Author:
chronos
Message:
  • Added: Version information.
  • Modified: Used newest Database class.
  • Modified: Generated HTML code should be now compain with HTML5 standard.
Location:
branches/old
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/old/Packages/Common/Package.php

    r55 r56  
    44  'Name' => 'Common',
    55  'Version' => 1,
    6 };
    7  
     6);
     7
     8include_once(dirname(__FILE__).'/PrefixMultiplier.php');
     9include_once(dirname(__FILE__).'/Database.php');
     10include_once(dirname(__FILE__).'/Image.php');
     11include_once(dirname(__FILE__).'/Mail.php');
     12include_once(dirname(__FILE__).'/UTF8.php');
     13include_once(dirname(__FILE__).'/NetworkAddress.php');
     14include_once(dirname(__FILE__).'/VarDumper.php');
     15include_once(dirname(__FILE__).'/RSS.php');
  • branches/old/Packages/Common/RSS.php

    r55 r56  
    11<?php
    22
    3 class RSS 
     3class RSS
    44{
    55  var $Charset;
     
    99  var $WebmasterEmail;
    1010  var $Items;
    11  
     11
    1212  function __construct()
    1313  {
  • branches/old/config.sample.php

    r51 r56  
    22
    33// Toto je ukázkový konfigurační soubor. Zkopírujte si jej jako config.php do stejné složky a upravte podle potřeby.
     4
     5$IsDeveloper = in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'));
    46
    57$Config = array(
     
    1921    'AdminEmail' => 'admin@domain',
    2022    'ShowError' => 0,
    21     'ErrorLogFile' => 'php_script_error.log',   
     23    'ShowSQLError' => $IsDeveloper,
     24    'ShowSQLQuery' => $IsDeveloper,
     25    'ErrorLogFile' => 'php_script_error.log',
    2226  ),
    2327  'DivisionCount' => 500,
  • branches/old/custom/convert_data.php

    r6 r56  
    33include('../global.php');
    44
    5 $Database->select_db('measure');
    65$Result = $Database->select('measure', '*', 'DataTable != "data"');
    76while($Measure = $Result->fetch_array())
     
    3433  }
    3534}
    36 
    37 ?>
  • branches/old/global.php

    r54 r56  
    88}
    99include_once('config.php');
    10 include_once('database.php');
    11 include_once('code.php');
     10include_once('Version.php');
    1211include_once('types.php');
    1312include_once('classes.php');
    14 include_once('Common/PrefixMultiplier.php');
     13include_once('Packages/Common/Package.php');
    1514$PrefixMultiplier = new PrefixMultiplier();
    1615include_once('stat_functions.php');
    17 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    18 if ($Database->connect_error) {
    19   die('Connect Error (' . $Database->connect_errno . ') '.$Database->connect_error);
    20 }
    21 
     16$Database = new Database();
     17$Database->Connect($Config['Database']['Host'], $Config['Database']['User'],
     18  $Config['Database']['Password'], $Config['Database']['Database']);
    2219$Database->Prefix = $Config['Database']['Prefix'];
    2320$Database->charset($Config['Database']['Charset']);
     21$Database->ShowSQLError = $Config['Web']['ShowSQLError'];
     22$Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
    2423
    2524// SQL injection hack protection
     
    2726foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
    2827
     28function HumanDate($Time)
     29{
     30  return(date('j.n.Y', $Time));
     31}
     32
    2933function ShowPage($Content)
    3034{
    31   global $Config;
    32   $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n". // <? 
    33 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    34 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    35 <head>
    36   <meta http-equiv="Content-Language" content="cs"/>
    37   <meta http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'"/>
    38   <title>'.$Config['Web']['Title'].'</title>
    39   <link rel="StyleSheet" href="style/style.css" type="text/css" media="all"/>
    40   </head><body>';
    41   $Output .= $Content.'</body></html>';
     35  global $Config, $ReleaseTime, $Revision;
     36
     37  $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n".
     38  '<!DOCTYPE html>'.
     39  '<html>'.
     40  '<head>'.
     41  '<meta http-equiv="Content-Language" content="cs"/>'.
     42  '<meta http-equiv="content-type" content="text/html; charset='.$Config['Web']['Charset'].'" />'.
     43  '<meta name="robots" content="all" />'.
     44  '<title>'.$Config['Web']['Title'].'</title>'.
     45  '<link rel="StyleSheet" href="style/style.css" type="text/css" media="all"/>'.
     46  '</head><body>';
     47  $Output .= $Content;
     48  $Output .= '<br/><div style="text-align: center; font-size: small;">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'.
     49    ' &nbsp; <a href="http://svn.zdechov.net/trac/statistic/browser/trunk">Zdrojový kód</a> &nbsp; '.
     50    '<a href="http://svn.zdechov.net/trac/statistic/log/trunk?verbose=on">Historie změn</a></div>';
     51  $Output .= '</body></html>';
    4252  echo($Output);
    4353}
  • branches/old/graph.php

    r52 r56  
    9696if(!$Debug)
    9797{
    98   header("Content-type: image/png");
    99   header("Cache-Control: no-cache");    // Dynamic graph - no cache
     98  Header("Content-type: image/png");
     99  Header("Cache-Control: no-cache");    // Dynamic graph - no cache
    100100  $Image = @imagecreate($Width, $Height);
    101101  $BackgroundColor = imagecolorallocate($Image, 255, 255, 255);
  • branches/old/index.php

    r54 r56  
    173173if(array_key_exists('Debug', $_GET)) $Output .= '<th>Počet položek</th><th>Čas vykonání</th>';
    174174$Output .= '</tr>';
    175 $Database->select_db('measure');
    176175$Result = $Database->select('measure', '*', '(Enabled=1) AND ((PermissionView="all") OR (PermissionView="'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'")) ORDER BY Description');
    177176while($Measure = $Result->fetch_array())
     
    202201}
    203202$Output .= '</table>';
    204 $Output .= '<br><a href="http://svn.zdechov.net/trac/statistic/">Sekce vývoje systému</a>';
    205 $Output .= '</div></body></html>';
     203$Output .= '</div>';
    206204
    207205ShowPage($Output);
  • branches/old/stat_functions.php

    r52 r56  
    77    list($Usec, $Sec) = explode(" ",microtime());
    88    return ((float)$Usec + (float)$Sec);
    9 }
    10 
    11 function MysqlDateTimeToTime($Time)
    12 {
    13   $Parts = explode(' ', $Time);
    14   $DateParts = explode('-', $Parts[0]);
    15   $TimeParts = explode(':', $Parts[1]);
    16   $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]);
    17   return($Result);
    18 }
    19 
    20 function TimeToMysqlDateTime($Time)
    21 {
    22   return(date('Y-m-d H:i:s', $Time));
    239}
    2410
Note: See TracChangeset for help on using the changeset viewer.