Index: /trunk/Application/Core.php
===================================================================
--- /trunk/Application/Core.php	(revision 77)
+++ /trunk/Application/Core.php	(revision 78)
@@ -38,11 +38,15 @@
     $ErrorHandler->Start();
 
-    $this->Database = new Database();
-    $this->Database->Connect($Config['Database']['Host'], $Config['Database']['User'],
-      $Config['Database']['Password'], $Config['Database']['Database']);
-    $this->Database->Prefix = $Config['Database']['Prefix'];
-    $this->Database->charset($Config['Database']['Charset']);
-    $this->Database->ShowSQLError = $Config['Web']['ShowSQLError'];
-    $this->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
+    try {
+      $this->Database = new Database();
+      $this->Database->Connect($Config['Database']['Host'], $Config['Database']['User'],
+        $Config['Database']['Password'], $Config['Database']['Database']);
+      $this->Database->Prefix = $Config['Database']['Prefix'];
+      $this->Database->charset($Config['Database']['Charset']);
+      $this->Database->ShowSQLError = $Config['Web']['ShowSQLError'];
+      $this->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
+    } catch (Exception $E) {
+
+    }
 
     // SQL injection hack protection
Index: /trunk/Application/DefaultConfig.php
===================================================================
--- /trunk/Application/DefaultConfig.php	(revision 77)
+++ /trunk/Application/DefaultConfig.php	(revision 78)
@@ -10,7 +10,7 @@
         array('Name' => 'SystemPassword', 'Type' => 'PasswordEncoded', 'Default' => '', 'Title' => 'Systémové heslo'),
         array('Name' => 'Database/Host', 'Type' => 'String', 'Default' => 'localhost', 'Title' => 'Server'),
-        array('Name' => 'Database/User', 'Type' => 'String', 'Default' => 'root', 'Title' => 'Uživatel'),
+        array('Name' => 'Database/User', 'Type' => 'String', 'Default' => 'estetistic', 'Title' => 'Uživatel'),
         array('Name' => 'Database/Password', 'Type' => 'Password', 'Default' => '', 'Title' => 'Heslo'),
-        array('Name' => 'Database/Database', 'Type' => 'String', 'Default' => 'centrala', 'Title' => 'Databáze'),
+        array('Name' => 'Database/Database', 'Type' => 'String', 'Default' => 'estetistic', 'Title' => 'Databáze'),
         array('Name' => 'Database/Prefix', 'Type' => 'String', 'Default' => '', 'Title' => 'Prefix'),
         array('Name' => 'Database/Charset', 'Type' => 'String', 'Default' => 'utf8', 'Title' => 'Znaková sada'),
@@ -21,5 +21,5 @@
         array('Name' => 'Web/Host', 'Type' => 'String', 'Default' => 'localhost', 'Title' => 'Doménové jméno'),
         array('Name' => 'Web/Title', 'Type' => 'String', 'Default' => 'Síť', 'Title' => 'Titulek'),
-        array('Name' => 'Web/Description', 'Type' => 'String', 'Default' => 'Komunitní počítačová síť', 'Title' => 'Popis'),
+        array('Name' => 'Web/Description', 'Type' => 'String', 'Default' => 'Web measure statistics', 'Title' => 'Popis'),
         array('Name' => 'Web/Admin', 'Type' => 'String', 'Default' => 'Admin', 'Title' => 'Jméno správce'),
         array('Name' => 'Web/AdminEmail', 'Type' => 'String', 'Default' => 'admin@localhost', 'Title' => 'E-mail správce'),
Index: /trunk/Application/Version.php
===================================================================
--- /trunk/Application/Version.php	(revision 77)
+++ /trunk/Application/Version.php	(revision 78)
@@ -6,5 +6,5 @@
 // and system will need database update.
 
-$Revision = 76;
+$Revision = 77;
 $DatabaseRevision = 67;
-$ReleaseTime = strtotime('2016-13-31');
+$ReleaseTime = strtotime('2016-12-31');
Index: /trunk/Modules/Admin/Admin.php
===================================================================
--- /trunk/Modules/Admin/Admin.php	(revision 78)
+++ /trunk/Modules/Admin/Admin.php	(revision 78)
@@ -0,0 +1,103 @@
+<?php
+
+class ModuleAdmin extends AppModule
+{
+  function __construct($System)
+  {
+    parent::__construct($System);
+    $this->Name = 'Admin';
+    $this->Version = '1.0';
+    $this->Creator = 'Chronos';
+    $this->License = 'GNU/GPL';
+    $this->Description = 'Admin interface';
+    $this->Dependencies = array();
+  }
+
+  function DoStart()
+  {
+    $this->System->RegisterPage('admin', 'PageAdmin');
+  }
+
+  function DoInstall()
+  {
+   }
+
+  function DoUninstall()
+  {
+  }
+
+  function DoUpgrade()
+  {
+  }
+}
+
+class PageAdmin extends Page
+{
+  function __construct(System $System)
+  {
+    parent::__construct($System);
+  }
+
+  function Show()
+  {
+    if(array_key_exists('Operation', $_GET)) $Operation = $_GET['Operation']; else $Operation = '';
+    switch($Operation)
+    {
+      case 'Add':
+        $Output = $this->ShowAdd();
+        break;
+      case 'Delete':
+        $Output = $this->ShowDelete();
+        break;
+      case 'Edit':
+        $Output = $this->ShowEdit();
+        break;
+      case 'RebuildCache':
+        $Output = $this->ShowRebuildCache();
+        break;
+      default:
+        $Output = $this->ShowNone();
+    }
+    return($Output);
+  }
+
+  function ShowNone()
+  {
+    $Table = array(
+      'Header' => array('Název veličiny', 'Operace'),
+      'Rows' => array(),
+    );
+
+    $Result = $this->Database->select('Measure', '*', '1 ORDER BY Description');
+    while($Measure = $Result->fetch_array())
+    {
+      array_push($Table['Rows'], array($Measure['Description'], MakeLink('?Operation=Edit&amp;MeasureId='.$Measure['Id'], 'Editovat').' '.MakeLink('?Operation=Delete&amp;MeasureId='.$Measure['Id'], 'Odstranit').' '.MakeLink('?Operation=RebuildCache&amp;MeasureId='.$Measure['Id'], 'Přestavět cache')));
+    }
+    $Output = '<h3>Seznam měření</h3>'.Table($Table).MakeLink('?Operation=Add', 'Přidat');
+    return($Output);
+  }
+
+  function ShowEdit()
+  {
+    $DbResult = $this->Database->select('Measure', '*', 'Id='.addslashes($_GET['MeasureId']));
+    $Values = array();
+    $Values = $DbResult->fetch_array();
+    return(ShowEditTable('Measure', $Values));
+  }
+
+  function ShowAdd()
+  {
+    $Values = array();
+    return(ShowEditTable('Measure', $Values));
+  }
+
+  function ShowRebuildCache()
+  {
+    echo("Vytvařím novou cache...<br>");
+    $DbResult = $this->Database->select('Measure', '*', 'Id='.addslashes($_GET['MeasureId']));
+    $Measure = $DbResult->fetch_array();
+
+    $Measure->RebuildMeasureCache();
+    echo('Dokončeno<br>');
+  }
+}
Index: unk/admin.php
===================================================================
--- /trunk/admin.php	(revision 77)
+++ 	(revision )
@@ -1,76 +1,0 @@
-<?php
-include('Global.php');
-
-$Application = new Application();
-$Application->Start();
-
-class AdminPage
-{
-  function __construct($Database)
-  {
-    $this->Database = &$Database;
-  }
-
-  function Show()
-  {
-    if(array_key_exists('Operation', $_GET)) $Operation = $_GET['Operation']; else $Operation = '';
-    switch($Operation)
-    {
-      case 'Add':
-        $Output = $this->ShowAdd();
-        break;
-      case 'Delete':
-        $Output = $this->ShowDelete();
-        break;
-      case 'Edit':
-        $Output = $this->ShowEdit();
-        break;
-      case 'RebuildCache':
-        $Output = $this->ShowRebuildCache();
-        break;
-      default:
-        $Output = $this->ShowNone();
-    }
-    ShowPage($Output);
-  }
-
-  function ShowNone()
-  {
-    $Table = array(
-      'Header' => array('Název veličiny', 'Operace'),
-      'Rows' => array(),
-    );
-
-    $Result = $this->Database->select('measure', '*', '1 ORDER BY Description');
-    while($Measure = $Result->fetch_array())
-    {
-      array_push($Table['Rows'], array($Measure['Description'], MakeLink('?Operation=Edit&amp;MeasureId='.$Measure['Id'], 'Editovat').' '.MakeLink('?Operation=Delete&amp;MeasureId='.$Measure['Id'], 'Odstranit').' '.MakeLink('?Operation=RebuildCache&amp;MeasureId='.$Measure['Id'], 'Přestavět cache')));
-    }
-    $Output = '<h3>Seznam měření</h3>'.Table($Table).MakeLink('?Operation=Add', 'Přidat');
-    return($Output);
-  }
-
-  function ShowEdit()
-  {
-    $DbResult = $this->Database->select('measure', '*', 'Id='.addslashes($_GET['MeasureId']));
-    $Values = array();
-    $Values = $DbResult->fetch_array();
-    return($this->ShowEditTable('Measure', $Values));
-  }
-
-  function ShowAdd()
-  {
-    $Values = array();
-    return($this->ShowEditTable('Measure', $Values));
-  }
-
-  function ShowRebuildCache()
-  {
-    echo("Vytvařím novou cache...<br>");
-    $DbResult = $this->Database->select('measure', '*', 'Id='.addslashes($_GET['MeasureId']));
-    $Measure = $DbResult->fetch_array();
-
-    $Measure->RebuildMeasureCache();
-    echo('Dokončeno<br>');
-  }
-}
