commit 1d7516406e77f406095f9ed55a8daef6a4f0e4aa
Author: Petr Lukašík <lukasik@rtsoft.cz>
Date:   Mon Jun 10 05:03:36 2019 +0200

    Re #7580 zkoušení hotovo, trochu předělány query

diff --git a/old/html/multidic/app/webroot/administration/add_author_of_source.php b/old/html/multidic/app/webroot/administration/add_author_of_source.php
index 5211be9..3e94358 100644
--- a/old/html/multidic/app/webroot/administration/add_author_of_source.php
+++ b/old/html/multidic/app/webroot/administration/add_author_of_source.php
@@ -23,8 +23,8 @@ function add_author_of_source($source_id, $author_id) {
                     VALUES ('$source_id', 
                             '$author_id')";  
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->connection->error);
     echo_zpet_do_zdroju();
     return false;
   }
diff --git a/old/html/multidic/app/webroot/administration/article.php b/old/html/multidic/app/webroot/administration/article.php
index 4e069d0..2a5dff2 100644
--- a/old/html/multidic/app/webroot/administration/article.php
+++ b/old/html/multidic/app/webroot/administration/article.php
@@ -7,7 +7,7 @@ function authorize_article($ID) {
   $dotaz = "UPDATE article SET autorized = true
                         WHERE \"IDarticle\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -261,7 +261,7 @@ function get_article($id) {
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Clanek se nepodařilo načíst.");
   }
 
@@ -273,7 +273,7 @@ function delete_article($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM article WHERE \"IDarticle\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -289,7 +289,7 @@ function update_article($id, $title, $body, $note, $lection) {
                             lection = '".AddSlashes($lection)."'
                             WHERE \"IDarticle\" = '".AddSlashes($id)."'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Slovo se nepodařilo upravit.");
   }
   print_hlasku("Slovo změněno.");
@@ -320,7 +320,7 @@ function insert_article($language,$source,$lection,$title,$body,$note,$user){
                             '$note',
                             '0')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
diff --git a/old/html/multidic/app/webroot/administration/author.php b/old/html/multidic/app/webroot/administration/author.php
index 28c3501..f1065b6 100644
--- a/old/html/multidic/app/webroot/administration/author.php
+++ b/old/html/multidic/app/webroot/administration/author.php
@@ -119,7 +119,7 @@ function insert_author($name, $surname) {
                     VALUES ('$name', 
                             '$surname')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, autora '$name $surname' se nepodařilo přidat.");
     return false;
   }
@@ -132,8 +132,8 @@ function possible_to_delete_author($author_id) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM author_of_source WHERE \"IDauthor\" = '$author_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->connection->error);
     return false;
   }
   //echo $spojeni->num_rows();
@@ -152,12 +152,12 @@ function delete_author($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM author WHERE \"IDauthor\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   $dotaz = "DELETE FROM author_of_source WHERE \"IDauthor\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -171,7 +171,7 @@ function update_author($name, $surname, $author_id) {
                               surname = '$surname'
                             WHERE \"IDauthor\" = $author_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Autora se nepodařilo upravit.");
   }
   print_hlasku("Autor změněn.");
diff --git a/old/html/multidic/app/webroot/administration/context.php b/old/html/multidic/app/webroot/administration/context.php
index 2867d24..37506e4 100644
--- a/old/html/multidic/app/webroot/administration/context.php
+++ b/old/html/multidic/app/webroot/administration/context.php
@@ -11,7 +11,7 @@ function link_context($context_id, $word_id) {
                         WHERE \"IDdict\" = '".AddSlashes($word_id)."'";
   $spojeni->query($dotaz);
   
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, vybraný kontext se nepodařilo připojit.");
     echo_zpet_do_slovniku();
     return false;
@@ -38,7 +38,7 @@ function insert_context($cz_context, $en_context, $org_context, $word_id, $sourc
                             '$source_id', 
                             '$pomoc')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, kontext '$cz_context - $en_context' se nepodařilo přidat.");
     echo_zpet_do_slovniku();
     return false;
@@ -66,7 +66,7 @@ function delete_context($context_id, $word_id) {
   
   /*$dotaz = "DELETE FROM context WHERE IDcontext LIKE $context_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }*/
   $dotaz = "UPDATE dict SET context = '0'
@@ -85,7 +85,7 @@ function update_context($cz_context, $en_context, $org_context, $context_id) {
                             orig_context = '".AddSlashes($org_context)."'
                             WHERE \"IDcontext\" = '".AddSlashes($context_id)."'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Kontext se nepodařilo upravit.");
   }
   print_hlasku("Kontext změněn.");
@@ -99,7 +99,7 @@ function get_context($context_id) {
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Kontext se nepodařilo načíst.");
   }
 
diff --git a/old/html/multidic/app/webroot/administration/delete_author_of_source.php b/old/html/multidic/app/webroot/administration/delete_author_of_source.php
index 9bfcf99..0b4f2aa 100644
--- a/old/html/multidic/app/webroot/administration/delete_author_of_source.php
+++ b/old/html/multidic/app/webroot/administration/delete_author_of_source.php
@@ -6,7 +6,7 @@
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $source_id AND \"IDauthor\" = $author_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Autora se nepodařilo odebrat");
   }
   print_hlasku("Autor odebrán");
diff --git a/old/html/multidic/app/webroot/administration/field.php b/old/html/multidic/app/webroot/administration/field.php
index 84b0d9f..ebca7f6 100644
--- a/old/html/multidic/app/webroot/administration/field.php
+++ b/old/html/multidic/app/webroot/administration/field.php
@@ -91,7 +91,7 @@ function insert_field($field, $en_field) {
   $dotaz = "INSERT INTO field (field, en_field) 
                     VALUES ('$field', '$en_field')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, obor '$field' - '$en_field' se nepodařilo přidat.");
     return false;
   }
@@ -127,7 +127,7 @@ function possible_to_delete_field($field_id) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM dict WHERE field LIKE '$field_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku($spojeni->$Error);
     return false;
   }
@@ -147,7 +147,7 @@ function delete_field($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM field WHERE \"IDfield\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     //print_hlasku("Bohužel, obor '$field' se nepodařilo smazat.");
     return false;
   }
@@ -163,7 +163,7 @@ function update_field($name, $en_field, $field_id) {
                             en_field = '$en_field'
                             WHERE \"IDfield\" = $field_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Obor se nepodařilo upravit.");
     echo_zpet_do_oboru();
     return false;
diff --git a/old/html/multidic/app/webroot/administration/list_article.php b/old/html/multidic/app/webroot/administration/list_article.php
index 79df4cc..d85efc2 100644
--- a/old/html/multidic/app/webroot/administration/list_article.php
+++ b/old/html/multidic/app/webroot/administration/list_article.php
@@ -11,11 +11,11 @@ if (Empty($language)) :
 ?>
   <p>Vyberte jazyk:</p>
   <p>
-    <a href="?nav_id=<?php echo $nav_id?>&language=1<?php echo $pomocna?>">arabský</a><br />
-    <a href="?nav_id=<?php echo $nav_id?>&language=2<?php echo $pomocna?>">hebrejský</a><br />
-    <a href="?nav_id=<?php echo $nav_id?>&language=3<?php echo $pomocna?>">akkadský</a><br /><br />
+    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=1<?php echo $pomocna?>">arabský</a><br />
+    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=2<?php echo $pomocna?>">hebrejský</a><br />
+    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=3<?php echo $pomocna?>">akkadský</a><br /><br />
 
-    <a href="?nav_id=<?php echo $nav_id?>&language=all&contrains_source=all&contrains_lection=all">všechny</a>
+    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=all&contrains_source=all&contrains_lection=all">všechny</a>
   </p>
 <?php
 
@@ -29,7 +29,7 @@ echo get_source_chooser($language, "contrains_source");
 ?>
      <input type="submit" value="Dál" />
      </form>
-   <br /> <a href="?nav_id=<?php echo $nav_id?>&language=<?php echo $language?>&contrains_source=all&contrains_lection=all">všechny</a>
+   <br /> <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=<?php echo $language?>&contrains_source=all&contrains_lection=all">všechny</a>
   </p>
 <?php
 elseif ($language != "all" && $contrains_source != "all" && Empty($contrains_lection)):
@@ -43,7 +43,7 @@ echo get_lection_chooser_article($contrains_source, 1, "contrains_lection");
      <input type="submit" value="Dál" />
      <input type="hidden" name="contrains_source" value="<?php echo $contrains_source?>" title="Dál" />
      </form>
-   <br /> <a href="?nav_id=<?php echo $nav_id?>&language=<?php echo $language?>&contrains_source=<?php echo $contrains_source?>&contrains_lection=all">všechny</a>
+   <br /> <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=<?php echo $language?>&contrains_source=<?php echo $contrains_source?>&contrains_lection=all">všechny</a>
   </p>
 <?php
 else :
@@ -79,7 +79,7 @@ if (!Empty($nav_id) && $nav_id == "autorize_article") {
     print_hlasku("Bohužel, článek se nepodařilo autorizovat.");
 }
 
-if ($nav_id == "list_artile") $pomocna = false;
+if ($nav_id == "list_article") $pomocna = false;
 else if ($nav_id == "list_nonauthorized_article") $pomocna = true;
 else  $pomocna = ($nonauthorized == true);
 //pr($nav_id);
diff --git a/old/html/multidic/app/webroot/administration/not_found.php b/old/html/multidic/app/webroot/administration/not_found.php
index 546672e..b401fed 100644
--- a/old/html/multidic/app/webroot/administration/not_found.php
+++ b/old/html/multidic/app/webroot/administration/not_found.php
@@ -141,7 +141,7 @@ function delete_not_found($table, $ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM $table WHERE \"ID$table\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
diff --git a/old/html/multidic/app/webroot/administration/report.php b/old/html/multidic/app/webroot/administration/report.php
index a2e9e37..608417b 100644
--- a/old/html/multidic/app/webroot/administration/report.php
+++ b/old/html/multidic/app/webroot/administration/report.php
@@ -69,7 +69,7 @@ function update_report($czech, $english, $ratio) {
                             english = '".pg_escape_string($english)."'
                             WHERE \"ratio\" = $ratio";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Zprávu se nepodařilo upravit.");
     echo_zpet_do_zprav();
     return false;
diff --git a/old/html/multidic/app/webroot/administration/source.php b/old/html/multidic/app/webroot/administration/source.php
index ccfeee5..1ab8745 100644
--- a/old/html/multidic/app/webroot/administration/source.php
+++ b/old/html/multidic/app/webroot/administration/source.php
@@ -166,7 +166,7 @@ function insert_source($title,$subtitle,$place,$publication,$publication_no,$fro
                                '$language',
                               '$year')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, zdroj '$title' se nepodařilo přidat.");
     return false;
   }
@@ -182,8 +182,8 @@ function possible_to_delete_source($source_id) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM author_of_source WHERE \"IDsource\" = '$source_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->Error);
     return false;
   }
   if ($spojeni->num_rows() == 0)
@@ -191,8 +191,8 @@ function possible_to_delete_source($source_id) {
     
   $dotaz = "SELECT * FROM dict WHERE source = '$source_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->Error);
     return false;
   }
   if ($spojeni->num_rows() == 0)
@@ -210,12 +210,12 @@ function delete_source($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM source WHERE \"IDsource\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -237,7 +237,7 @@ function update_source($title, $subtitle, $place, $publication, $publication_no,
                             year = '$year'
                             WHERE \"IDsource\" = $source_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Zdroj se nepodařilo upravit.");
     echo_zpet_do_zdroju();
     return false;
diff --git a/old/html/multidic/app/webroot/administration/test.php b/old/html/multidic/app/webroot/administration/test.php
index 981165f..9b3673a 100644
--- a/old/html/multidic/app/webroot/administration/test.php
+++ b/old/html/multidic/app/webroot/administration/test.php
@@ -8,7 +8,7 @@ function authorize_test($ID) {
   $dotaz = "UPDATE test SET autorized = true
                         WHERE \"IDtest\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -260,7 +260,7 @@ function get_test($id) {
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Test se nepodařilo načíst.");
   }
 
@@ -272,7 +272,7 @@ function delete_test($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM test WHERE \"IDtest\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -289,7 +289,7 @@ function update_test($id, $title, $body, $note, $lection, $test_category) {
                             test_category_id = '".AddSlashes($test_category)."'
                             WHERE \"IDtest\" = '".AddSlashes($id)."'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Test se nepodařilo upravit.");
   }
   print_hlasku("Test změněn.");
@@ -320,7 +320,7 @@ function insert_test($language,$source,$lection,$title,$body,$note,$user,$test_c
                             '". AddSlashes($note)."',
                             '". AddSlashes($test_category)."')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
diff --git a/old/html/multidic/app/webroot/administration/test_category.php b/old/html/multidic/app/webroot/administration/test_category.php
index 8f1cc49..812d1c4 100644
--- a/old/html/multidic/app/webroot/administration/test_category.php
+++ b/old/html/multidic/app/webroot/administration/test_category.php
@@ -92,7 +92,7 @@ function insert_test_category($name, $parent_id) {
   $dotaz = "INSERT INTO test_category (name, parent_id) 
                     VALUES ('$name', '$parent_id')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Bohužel, kategorii '$name' - '$parent_id' se nepodařilo přidat.");
     return false;
   }
@@ -128,8 +128,8 @@ function possible_to_delete_test_category($test_category_id) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM test WHERE test_category_id LIKE '$test_category_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->connection->error);
     return false;
   }
   //echo $spojeni->num_rows();
@@ -148,7 +148,7 @@ function delete_test_category($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM test_category WHERE \"id\" = $ID";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     //print_hlasku("Bohužel, obor '$field' se nepodařilo smazat.");
     return false;
   }
@@ -164,7 +164,7 @@ function update_test_category($name, $parent_id, $id) {
                             parent_id = '$parent_id'
                             WHERE id = $id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Kategorii se nepodařilo upravit.");
     echo_zpet_do_kategorii();
     return false;
diff --git a/old/html/multidic/app/webroot/administration/translation.php b/old/html/multidic/app/webroot/administration/translation.php
index f9376dd..6617784 100644
--- a/old/html/multidic/app/webroot/administration/translation.php
+++ b/old/html/multidic/app/webroot/administration/translation.php
@@ -128,7 +128,7 @@ function update_translation($translation, $translation_id) {
   $dotaz = "UPDATE translation SET translation = '$translation'
                             WHERE \"IDtranslation\" = $translation_id";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Položku se nepodařilo upravit.");
     echo_zpet_do_translation();
     return false;
diff --git a/old/html/multidic/app/webroot/administration/translation_lang.php b/old/html/multidic/app/webroot/administration/translation_lang.php
index 60d0f39..5434ccb 100644
--- a/old/html/multidic/app/webroot/administration/translation_lang.php
+++ b/old/html/multidic/app/webroot/administration/translation_lang.php
@@ -142,7 +142,7 @@ function insert_translation_lang($name, $surname, $city, $email, $nationality, $
                             '$nick',
                             '$password')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     if (vypisovat) print_hlasku("Bohužel, uživatele '$name $surname' se nepodařilo přidat.");
     return false;
   }
@@ -156,7 +156,7 @@ function delete_user($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM \"translation_lang\" WHERE \"IDtranslation_lang\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -178,7 +178,7 @@ function update_translation_lang($name, $surname, $city, $email, $nationality, $
   $dotaz .= " WHERE \"IDuser\" = '$user_id'";
   
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Uživatel se nepodařilo upravit.");
   }
   print_hlasku("Uživatel změněn.");
diff --git a/old/html/multidic/app/webroot/administration/user.php b/old/html/multidic/app/webroot/administration/user.php
index ec3c993..0c04e11 100644
--- a/old/html/multidic/app/webroot/administration/user.php
+++ b/old/html/multidic/app/webroot/administration/user.php
@@ -127,8 +127,8 @@ function nick_exists($nick) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM \"user\" WHERE nick LIKE '$nick'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->Error);
     return true;
   }
   //echo $nick." / ".$spojeni->num_rows();
@@ -164,7 +164,7 @@ function insert_user($name, $surname, $city, $email, $nationality, $privileges,
                             '$nick',
                             '$password')";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     if ($vypisovat) print_hlasku("Bohužel, uživatele '$name $surname' se nepodařilo přidat.");
     return false;
   }
@@ -177,8 +177,8 @@ function possible_to_delete_user($user_id) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM dict WHERE usr LIKE '$user_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
-    print_hlasku($spojeni->$Error);
+  if ($spojeni->connection->errno != 0) {
+    print_hlasku($spojeni->connection->error);
     return false;
   }
   //echo $spojeni->num_rows();
@@ -197,7 +197,7 @@ function delete_user($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM \"user\" WHERE \"IDuser\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -219,7 +219,7 @@ function update_user($name, $surname, $city, $email, $nationality, $privileges,
   $dotaz .= " WHERE \"IDuser\" = '$user_id'";
   
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Uživatel se nepodařilo upravit.");
   }
   print_hlasku("Uživatel změněn.");
diff --git a/old/html/multidic/app/webroot/administration/voice.php b/old/html/multidic/app/webroot/administration/voice.php
index f561db4..c273176 100644
--- a/old/html/multidic/app/webroot/administration/voice.php
+++ b/old/html/multidic/app/webroot/administration/voice.php
@@ -26,7 +26,7 @@ function save_article_voice($file,$id) {
   $dotaz = "UPDATE article SET article_voice = 1 WHERE \"IDarticle\" = $id ";
   $spojeni->query($dotaz);
   
-  if ($spojeni->Errno != 0) return false;
+  if ($spojeni->connection->errno != 0) return false;
   return true;
 }
 
@@ -67,7 +67,7 @@ function save_word_voice($file,$word_id) {
   $dotaz = "UPDATE dict SET word_voice = 1 WHERE \"IDdict\" = $word_id ";
   $spojeni->query($dotaz);
   
-  if ($spojeni->Errno != 0) return false;
+  if ($spojeni->connection->errno != 0) return false;
   return true;
 }
 
diff --git a/old/html/multidic/app/webroot/administration/word.php b/old/html/multidic/app/webroot/administration/word.php
index 8feaa01..5f2caa0 100644
--- a/old/html/multidic/app/webroot/administration/word.php
+++ b/old/html/multidic/app/webroot/administration/word.php
@@ -327,7 +327,7 @@ function authorize_word($ID) {
   $dotaz = "UPDATE dict SET autorized = 1
                         WHERE \"IDdict\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -338,7 +338,7 @@ function delete_word($ID) {
   $spojeni = new DB_Sql();
   $dotaz = "DELETE FROM dict WHERE \"IDdict\" = '$ID'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -391,7 +391,7 @@ function update_word($czech,$english,$word_category,$verbal_class,
                             
                             WHERE \"IDdict\" = '".AddSlashes($word_id)."'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Slovo se nepodařilo upravit.");
   }
   print_hlasku("Slovo změněno.");
@@ -400,15 +400,15 @@ function update_word($czech,$english,$word_category,$verbal_class,
 function get_word($word_id) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM dict WHERE \"IDdict\" LIKE '$word_id'";
+  $dotaz = "SELECT * FROM dict WHERE IDdict LIKE '$word_id'";
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Slovo se nepodařilo načíst.");
   }
 
-  return $spojeni->Record;
+  return $spojeni->row;
 }
 
 function sort_word($word_id, $direction) {
@@ -421,7 +421,7 @@ function sort_word($word_id, $direction) {
   else   $hodnota++;
   $dotaz = "UPDATE dict SET sorting_no = $hodnota WHERE \"IDdict\" LIKE '$word_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
@@ -432,7 +432,7 @@ function set_sorting_value($word_id, $sorting_no) {
   $spojeni = new DB_Sql();
   $dotaz = "UPDATE dict SET sorting_no = $sorting_no WHERE \"IDdict\" LIKE '$word_id'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     return false;
   }
   return true;
diff --git a/old/html/multidic/app/webroot/classes/db.php b/old/html/multidic/app/webroot/classes/db.php
index 0bf4a90..ad088f2 100644
--- a/old/html/multidic/app/webroot/classes/db.php
+++ b/old/html/multidic/app/webroot/classes/db.php
@@ -8,153 +8,165 @@
  *
  */
 
-class DB_Sql {
-  var $Host     = "Filek.cz";
-  var $Database = "aswi-dictionary";
-  var $User     = "dbowner";
-  var $Password = "";
+class DB_Sql
+{
+    var $Host = "Filek.cz";
+    var $Database = "aswi-dictionary";
+    var $User = "dbowner";
+    var $Password = "db486ex12";
 
-  /** @var mysqli_result  */
-  var $result = null;
+    /** @var mysqli_result */
+    var $result = null;
 
-  var $row = null;
+    var $row = null;
 
-  /** @var mysqli */
-  var $connection = null;
-  var $Debug = 0;
+    /** @var mysqli */
+    var $connection = null;
+    var $Debug = 0;
 
-  /* public: constructor */
-  function __construct($query = "") {
-      $this->query($query);
-  }
+    /* public: constructor */
+    function __construct($query = "")
+    {
+        $this->query($query);
+    }
 
-  function connect() {
-    $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
-    $this->connection->set_charset("utf8");
+    function connect()
+    {
+        $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
+        $this->connection->set_charset("utf8");
 
-    if ($this->connection->connect_error) {
-      $this->halt("Connection failed: " . $this->connection->connect_error);
+        if ($this->connection->connect_error) {
+            $this->halt("Connection failed: " . $this->connection->connect_error);
+        }
     }
-  }
 
     function escape_string($string)
     {
-        if ($this->connection == null)
-        {
+        if ($this->connection == null) {
             $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
             $this->connection->set_charset("utf8");
         }
         return $this->connection->real_escape_string($string);
     }
 
-  function query(string $Query_String) {
-    /* No empty queries, please, since PHP4 chokes on them. */
-    if ($Query_String == "")
-      /* The empty query string is passed on from the constructor,
-       * when calling the class without a query, e.g. in situations
-       * like these: '$db = new DB_Sql_Subclass;'
-       */
-      return 0;
+    function query(string $Query_String)
+    {
+        /* No empty queries, please, since PHP4 chokes on them. */
+        if ($Query_String == "")
+            /* The empty query string is passed on from the constructor,
+             * when calling the class without a query, e.g. in situations
+             * like these: '$db = new DB_Sql_Subclass;'
+             */
+            return 0;
 
-    $this->connect();
+        $this->connect();
 
-    if ($this->Debug)
-      printf("<br>Debug: query = %s<br>\n", $Query_String);
+        if ($this->Debug)
+            printf("<br>Debug: query = %s<br>\n", $Query_String);
 
-    $this->result = $this->connection->query($Query_String);
+        $this->result = $this->connection->query($Query_String);
 
 //    if ($this->result) {
 //      $this->halt("Invalid SQL: ".$Query_String);
 //    }
 
-    return $this->result;
-  }
-
-  function next_record() {
-    $this->row = mysqli_fetch_row($this->result);
-    return $this->row;
-  }
-
-  function metadata($table="") {
-    $count = 0;
-    $id    = 0;
-    $res   = array();
-
-    if (!empty($table)) {
-       $this->connect();
-       $id = pg_exec($this->Link_ID, "select * from $table");
-       if ($id < 0) {
-          $this->Error = pg_ErrorMessage($id);
-          $this->Errno = 1;
-          $this->halt("Metadata query failed.");
-       }
-    } else {
-      $id = $this->Query_ID;
-      if (!$id) {
-        $this->halt("No query specified.");
-      }
+        return $this->result;
     }
 
-    $count = pg_NumFields($id);
-
-    for ($i=0; $i<$count; $i++) {
-      $res[$i]["table"] = $table;
-      $res[$i]["name"]  = pg_FieldName  ($id, $i);
-      $res[$i]["type"]  = pg_FieldType  ($id, $i);
-      $res[$i]["len"]   = pg_FieldSize  ($id, $i);
-      $res[$i]["flags"] = "";
+    function next_record()
+    {
+        if ($this->result==null) return false;
+        $this->row = mysqli_fetch_array($this->result);
+        return $this->row;
     }
 
-    if ($table) {
-      pg_FreeResult($id);
-    }
+    function metadata($table = "")
+    {
+        $count = 0;
+        $id = 0;
+        $res = array();
+
+        if (!empty($table)) {
+            $this->connect();
+            $id = pg_exec($this->Link_ID, "select * from $table");
+            if ($id < 0) {
+                $this->Error = pg_ErrorMessage($id);
+                $this->Errno = 1;
+                $this->halt("Metadata query failed.");
+            }
+        } else {
+            $id = $this->Query_ID;
+            if (!$id) {
+                $this->halt("No query specified.");
+            }
+        }
 
-    return $res;
-  }
+        $count = pg_NumFields($id);
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i]["table"] = $table;
+            $res[$i]["name"] = pg_FieldName($id, $i);
+            $res[$i]["type"] = pg_FieldType($id, $i);
+            $res[$i]["len"] = pg_FieldSize($id, $i);
+            $res[$i]["flags"] = "";
+        }
 
-  function affected_rows() {
-    return $this->connection->affected_rows;
-  }
+        if ($table) {
+            pg_FreeResult($id);
+        }
 
-  function num_rows() {
-    if ($this->result) {
-      return $this->result->num_rows;
-    }else{
-      return 0;
+        return $res;
     }
-  }
 
-  function num_fields() {
-    if ($this->result) {
-      return $this->result->field_count;
-    }else{
-      return 0;
+    function affected_rows()
+    {
+        return $this->connection->affected_rows;
     }
-  }
 
-  function f($Name) {
-    return $this->result[$Name];
-  }
+    function num_rows()
+    {
+        if ($this->result) {
+            return $this->result->num_rows;
+        } else {
+            return 0;
+        }
+    }
+
+    function num_fields()
+    {
+        if ($this->result) {
+            return $this->result->field_count;
+        } else {
+            return 0;
+        }
+    }
+
+    function f($Name)
+    {
+        return $this->result[$Name];
+    }
 
-  function halt($msg) {
-    printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
-    printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
-      $this->connection->errno,
-      $this->connection->error);
+    function halt($msg)
+    {
+        printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
+        printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
+            $this->connection->errno,
+            $this->connection->error);
 //    die("Session halted."); // potřebuju vidět errory v logu
-  }
-
-  function table_names() {
-    $this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
-    $i=0;
-    while ($this->next_record())
-     {
-      $return[$i]["table_name"]= $this->f(0);
-      $return[$i]["tablespace_name"]=$this->Database;
-      $return[$i]["database"]=$this->Database;
-      $i++;
-     }
-    return $return;
-  }
+    }
+
+    function table_names()
+    {
+        $this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
+        $i = 0;
+        while ($this->next_record()) {
+            $return[$i]["table_name"] = $this->f(0);
+            $return[$i]["tablespace_name"] = $this->Database;
+            $return[$i]["database"] = $this->Database;
+            $i++;
+        }
+        return $return;
+    }
 }
+
 ?>
diff --git a/old/html/multidic/app/webroot/examination.php b/old/html/multidic/app/webroot/examination.php
index ea2a9f2..a4195a3 100644
--- a/old/html/multidic/app/webroot/examination.php
+++ b/old/html/multidic/app/webroot/examination.php
@@ -1,12 +1,12 @@
 <?php
-session_start();
+@session_start();
 require_once("./functions/dictionary.php");
 
 //pr($_SESSION);flush(1);
 
 if (!kontrola_pristupu(1)) {
   //echo "odhlas";
-  Header("Location: ./?hlaska=".lang('Došlo k odhlášení')."&n=".$_SESSION["ses_nick"]);
+  Header("Location: .?hlaska=".lang('Došlo k odhlášení')."&n=".$_SESSION["ses_nick"]);
 }
 
 ?>
@@ -66,18 +66,21 @@ if (!kontrola_pristupu(1)) {
 <div id="content">
  <div class="content_home">
     <?php
-  if ($poprve == "ano") print_hlasku(lang("Gratulujeme. <br />
+  if (@$_GET['poprve'] == "ano"){
+      print_hlasku(lang("Gratulujeme. <br />
             Vítejte v registrované zóně. Díky ní si budete moci při příštím zkoušení ověřit,
             zda již znáte slovíčka, která jste minule neuměli."));
+      $_SESSION['poprve'] = 'ne';
+  }
 
   $cesta = "./examination/";
 
   //dulezite - urcuje zda jde o learning nebo examination
-  $learning = (strstr($nav_id, 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
+  $learning = (strstr(@$_REQUEST['nav_id'], 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
 
    //echo $nav_id;
 
-  switch($_REQUEST['nav_id']) {
+  switch(@$_REQUEST['nav_id']) {
     case("new_learning") :
     case("new_exam") :
       require_once($cesta."new_exam.php");
diff --git a/old/html/multidic/app/webroot/examination/article.php b/old/html/multidic/app/webroot/examination/article.php
index 0f530b9..0acd0a9 100644
--- a/old/html/multidic/app/webroot/examination/article.php
+++ b/old/html/multidic/app/webroot/examination/article.php
@@ -236,7 +236,7 @@ function get_article($id) {
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Slovo se nepodařilo načíst.");
   }
 
diff --git a/old/html/multidic/app/webroot/examination/do_exam.php b/old/html/multidic/app/webroot/examination/do_exam.php
index 98fb03a..e929b82 100644
--- a/old/html/multidic/app/webroot/examination/do_exam.php
+++ b/old/html/multidic/app/webroot/examination/do_exam.php
@@ -4,15 +4,15 @@
 <?php
 require_once("./examination/exam.php");
 
-if (!Empty($action) && $action == "do_exam") {
+if (!Empty(@$_REQUEST['action']) && @$_REQUEST['action'] == "do_exam") {
   //zavolat funkci, ktera otestuje zda je to dobre
   //podle toho nastavi priznakove bity
 
-  $navrat = exam_word($IDdict, $IDexam, $type, $to);
+  $navrat = exam_word(@$_REQUEST['IDdict'], @$_REQUEST['IDexam'], @$_REQUEST['type'], @$_REQUEST['to']);
 
   if ($navrat != NULL) {
 
-    print_hlasku(sprintf(lang("Je mi líto, ale vaše odpověď '%s' není správná."), $to ));
+    print_hlasku(sprintf(lang("Je mi líto, ale vaše odpověď '%s' není správná."), @$_REQUEST['to'] ));
     print_hlasku(lang("Slovo bylo:"));
 
     echo __get_word_in_card_format($navrat);
@@ -21,25 +21,25 @@ if (!Empty($action) && $action == "do_exam") {
     print_hlasku(lang("Správně"));
   }
 }
-else if (!Empty($action) && $action == "do_learning") {
+else if (!Empty(@$_REQUEST['action']) && @$_REQUEST['action'] == "do_learning") {
   if (!Empty( $sub_button ) && $sub_button == lang("Uměl")) {
-    set_exam_status($IDexam, 1);
+    set_exam_status(@$_REQUEST['IDexam'], 1);
     //echo "1";
   }
   else {
-    set_exam_status($IDexam, 0);
+    set_exam_status(@$_REQUEST['IDexam'], 0);
     //echo "0";
   }
 }
-$slovicko = get_exam_word($examing, $step);
+$slovicko = get_exam_word(@$_REQUEST['examing'], @$_REQUEST['step']);
 
 if ($slovicko == NULL) {
   //ukoncit zkouseni
   //tj. uklidit spravne zodpovezene polozky nastavit rating.
   //vypsat hlasku...
 
-  $pocet_slov = get_pocet_slov_ve_zkouseni($examing);
-  $pocet_spatnych_slov = get_pocet_spatnych_slov($examing);
+  $pocet_slov = get_pocet_slov_ve_zkouseni(@$_REQUEST['examing']);
+  $pocet_spatnych_slov = get_pocet_spatnych_slov(@$_REQUEST['examing']);
   $pocet_spravnych_slov = $pocet_slov - $pocet_spatnych_slov;
   $rating = ($pocet_spravnych_slov / $pocet_slov) * 100;
 
@@ -48,7 +48,7 @@ if ($slovicko == NULL) {
                        $pocet_slov, $rating));
 
   print_hlasku(get_vyslednou_hlasku($rating));
-  uklid($examing, $rating);
+  uklid(@$_REQUEST['examing'], $rating);
   exit;
 }
 
@@ -97,7 +97,7 @@ $language = $slovicko["language"];
   </script>
 <?php } //end if ?>
 
-<?php if ($type == "to_cz" || $type == "to_en") :?>
+<?php if (@$_REQUEST['type'] == "to_cz" || @$_REQUEST['type'] == "to_en") :?>
 
   <table>
     <thead align="center"> <h3 class="nadpis2"><?php echo lang("Přeložte:") ?></h3> </thead>
@@ -130,8 +130,8 @@ $language = $slovicko["language"];
         <td>
           <input type="hidden" name="IDdict" value="<?php echo $slovicko["IDdict"] ?>">
           <input type="hidden" name="IDexam" value="<?php echo $slovicko["IDexam"] ?>">
-          <input type="hidden" name="examing" value="<?php echo $examing ?>">
-          <input type="hidden" name="type" value="<?php echo $type ?>">
+          <input type="hidden" name="examing" value="<?php echo @$_REQUEST['examing'] ?>">
+          <input type="hidden" name="type" value="<?php echo @$_REQUEST['type'] ?>">
         <?php if ($learning != 'TRUE') { ?>
           <input type="hidden" name="action" value="do_exam">
           <input type="submit" value="<?php echo lang("Dál") ?>">
@@ -162,7 +162,7 @@ $language = $slovicko["language"];
     <form action="" method="POST" name="do_exam_form">
       <tr class="akt">
         <td><?php echo lang("Originál:") ?></td>
-        <td><?php echo (($type == "from_cz") ? $slovicko["czech"]:$slovicko["english"]) ?></td>
+        <td><?php echo ((@$_REQUEST['type'] == "from_cz") ? $slovicko["czech"]:$slovicko["english"]) ?></td>
       </tr>
       <tr class="akt">
         <td><?php echo lang("Překlad:") ?></td>
@@ -186,8 +186,8 @@ $language = $slovicko["language"];
         <td>
           <input type="hidden" name="IDdict" value="<?php echo $slovicko["IDdict"] ?>">
           <input type="hidden" name="IDexam" value="<?php echo $slovicko["IDexam"] ?>">
-          <input type="hidden" name="examing" value="<?php echo $examing ?>">
-          <input type="hidden" name="type" value="<?php echo $type ?>">
+          <input type="hidden" name="examing" value="<?php echo @$_REQUEST['examing'] ?>">
+          <input type="hidden" name="type" value="<?php echo @$_REQUEST['type'] ?>">
           <?php if ($learning != 'TRUE') { ?>
           <input type="hidden" name="action" value="do_exam">
           <input type="submit" value="<?php echo lang("Dál") ?>">
diff --git a/old/html/multidic/app/webroot/examination/exam.php b/old/html/multidic/app/webroot/examination/exam.php
index 6483fae..9a9cbf9 100644
--- a/old/html/multidic/app/webroot/examination/exam.php
+++ b/old/html/multidic/app/webroot/examination/exam.php
@@ -6,10 +6,10 @@ function get_pocet_slov_ve_zkouseni($examing) {
   $spojeni = new DB_Sql();
   //vybereme exam
   $dotaz = "SELECT count FROM examing
-              WHERE \"IDexaming\" = '$examing'";
+              WHERE IDexaming = '$examing'";
   $spojeni->query($dotaz);
   $spojeni->next_record();
-  return $spojeni->Record["count"];
+  return $spojeni->row["count"];
 }
 
 function get_pocet_spatnych_slov($examing) {
@@ -27,22 +27,15 @@ function insert_new_examing($user, $source, $lection, $count, $type, $learning)
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
 
-  $dotaz = "INSERT INTO examing (\"user\", date, rating, source, count, type, lection, learning)
+  $dotaz = "INSERT INTO examing (user, date, rating, source, count, type, lection, learning)
             VALUES ('$user', 'NOW', -1, '$source', '$count', '$type', '$lection', '$learning')";
-  $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  $result = $spojeni->query($dotaz);
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při vytváření zkoušení."));
     return NULL;
   }
-  $dotaz = "SELECT currval('examing_id_seq')";
-  $spojeni->query($dotaz);
 
-  if ($spojeni->Errno != 0) {
-    print_hlasku(lang("Chyba při vytváření zkoušení."));
-    return NULL;
-  }
-  $spojeni->next_record();
-  return $spojeni->Record["currval"];
+  return $spojeni->connection->insert_id;
 }
 
 function words_to_repeat($source, $lection, $user) {
@@ -50,13 +43,14 @@ function words_to_repeat($source, $lection, $user) {
   $spojeni = new DB_Sql();
   $dotaz = "SELECT *
             FROM exam e, examing ex
-            WHERE e.examing = ex.\"IDexaming\"
+            WHERE e.examing = ex.IDexaming
               AND ex.source = '$source'
-              AND ex.\"user\" = '$user'
+              AND ex.user = '$user'
               AND ex.lection = '$lection'
               AND e.status = 0";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při vytváření zkoušení."));
     return NULL;
   }
@@ -78,7 +72,7 @@ function create_examing($user, $source, $lection, $count, $type, $learning) {
       $dotaz = "UPDATE exam
                 SET examing = $new_examing,
                     status = NULL
-                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
+                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
       $spojeni->query($dotaz);
     }
   }
@@ -88,12 +82,12 @@ function create_examing($user, $source, $lection, $count, $type, $learning) {
       $dotaz = "UPDATE exam
                 SET examing = $new_examing,
                     status = NULL
-                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
+                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
       $spojeni->query($dotaz);
     }
     while ($spojeni_k_opakovani->next_record()) {
       $dotaz = "DELETE FROM exam
-                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
+                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
       $spojeni->query($dotaz);
     }
   }
@@ -103,20 +97,21 @@ function create_examing($user, $source, $lection, $count, $type, $learning) {
       $dotaz = "UPDATE exam
                 SET examing = $new_examing,
                     status = NULL
-                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
+                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
       $spojeni->query($dotaz);
       //tohle se pouzije az dale
-      $pomoc .= " AND NOT \"IDdict\" = ".$spojeni_k_opakovani->Record["dict"];
+      $pomoc .= " AND NOT IDdict = ".$spojeni_k_opakovani->row["dict"];
     }
     $dotaz = "SELECT *
               FROM dict
               WHERE source = '$source' AND
                     lection = '$lection'";
     $dotaz .= $pomoc;
-    $dotaz .= " ORDER BY random()
+    $dotaz .= " ORDER BY RAND()
                 LIMIT ".($count-$pocet_k_opakovani);
     $spojeni->query($dotaz);
-    if ($spojeni->Errno != 0) {
+
+    if ($spojeni->connection->errno != 0) {
       print_hlasku(lang("Chyba při vytváření zkoušení."));
       return NULL;
     }
@@ -125,9 +120,9 @@ function create_examing($user, $source, $lection, $count, $type, $learning) {
     while ($spojeni->next_record()) {
       //echo($spojeni->Record["czech"] . "<br />\n");
       $dotaz = "INSERT INTO exam (examing, status, dict)
-                       VALUES ('$new_examing', NULL, ".$spojeni->Record["IDdict"].")";
+                       VALUES ('$new_examing', NULL, ".$spojeni->row["IDdict"].")";
       $spojeni_na_vkladani->query($dotaz);
-      if ($spojeni_na_vkladani->Errno != 0) {
+      if ($spojeni_na_vkladani->connection->errno != 0) {
         print_hlasku(lang("Chyba při vytváření zkoušení."));
         return NULL;
       }
@@ -140,14 +135,14 @@ function get_exam_word($examing, $step) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
   //vybereme exam
-  $dotaz = "SELECT e.\"IDexam\", d.* FROM exam e, dict d
+  $dotaz = "SELECT e.IDexam, d.* FROM exam e, dict d
               WHERE e.examing = '$examing'
               	AND e.status is NULL
-              	AND e.dict = d.\"IDdict\"
-              ORDER BY random()
+              	AND e.dict = d.IDdict
+              ORDER BY RAND()
               LIMIT 1";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při zkoušení."));
     return NULL;
   }
@@ -156,7 +151,7 @@ function get_exam_word($examing, $step) {
   }
 
   $spojeni->next_record();
-  return $spojeni->Record;
+  return $spojeni->row;
 }
 
 function exam_word($IDdict, $IDexam, $type, $to) {
@@ -166,7 +161,7 @@ function exam_word($IDdict, $IDexam, $type, $to) {
   
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM dict
-            WHERE \"IDdict\" = '$IDdict'";
+            WHERE IDdict = '$IDdict'";
 
   if(empty($to)) {
     $dotaz .= " AND 1 = 0 ";
@@ -174,18 +169,15 @@ function exam_word($IDdict, $IDexam, $type, $to) {
   switch ($type) {
     case ("to_cz"):
     	$word = mb_strtolower($to, "UTF-8");
-        $word = get_token_regexp($word); 
-      $dotaz .= " AND lower(czech) ~ ('$word')";
+      $dotaz .= " AND lower(czech) = ('$word')";
     break;
     case("to_en"):
     	$word = mb_strtolower($to, "UTF-8");
-        $word = get_token_regexp($word);
       $dotaz .= " AND lower(english) = ('$word')";
     break;
     case("from_cz"):
     case("from_en"):
       $to = hebrew_add_vowel($to);
-      $to = get_token_regexp($to);
       /*
       SELECT * FROM dict
             WHERE language = $language AND
@@ -193,9 +185,9 @@ function exam_word($IDdict, $IDexam, $type, $to) {
                    (past    ~ ('$word')) OR
                    (valence ~ ('$word')))
                    */
-      $dotaz .= " AND ((present ~ ('$to')) OR
-                   (past    ~ ('$to')) OR
-                   (valence ~ ('$to')))";
+      $dotaz .= " AND ((present = ('$to')) OR
+                   (past    = ('$to')) OR
+                   (valence = ('$to')))";
     break;
     default:
       echo lang("Chyba");
@@ -221,9 +213,9 @@ function set_exam_status($IDexam, $status) {
 
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "UPDATE exam SET status = $status WHERE \"IDexam\" = '$IDexam'";
+  $dotaz = "UPDATE exam SET status = $status WHERE IDexam = '$IDexam'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při zkoušení."));
   }
 }
@@ -234,19 +226,19 @@ function uklid($examing, $rating) {
   $dotaz = "DELETE FROM exam WHERE examing = '$examing'
                              AND status = 1";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při zkoušení."));
   }
-  $dotaz = "UPDATE examing SET rating = $rating WHERE \"IDexaming\" = '$examing'";
+  $dotaz = "UPDATE examing SET rating = $rating WHERE IDexaming = '$examing'";
   $spojeni->query($dotaz);
 }
 
 function delete_exam($IDexam) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "DELETE FROM exam WHERE \"IDexam\" = '$IDexam'";
+  $dotaz = "DELETE FROM exam WHERE IDexam = '$IDexam'";
   $spojeni->query($dotaz);
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku(lang("Chyba při zkoušení."));
   }
 }
@@ -277,6 +269,7 @@ function get_typ($identifikator) {
  *  @return do tabulky zformatovany zaznam
  */
 function get_row_of_table_examing($learning, $Record) {
+  $navrat = "";
   $navrat .= "<tr class=\"akt\">\n     ";
   $navrat .= '<td>'.$Record["date"].'</td>';
   $pomoc = ($learning == 'TRUE')? 'learning' : 'exam';
@@ -368,20 +361,22 @@ function get_foot_of_table_examing() {
 
 
 function print_table_of_examing($learning, $order = "IDexaming", $od = 0, $limit = 30) {
-  global $ses_IDuser;
+
+  $ses_IDuser = $_SESSION['ses_IDuser'];
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
   $dotaz = "SELECT s.title, e.* FROM examing e";
-  $dotaz .= " LEFT OUTER JOIN source s ON (e.source = s.\"IDsource\")";
-  $dotaz .= " WHERE e.\"user\" = $ses_IDuser AND e.learning = $learning";
-  $dotaz .= " ORDER BY \"$order\" OFFSET $od LIMIT $limit";
+  $dotaz .= " LEFT OUTER JOIN source s ON (e.source = s.IDsource)";
+  $dotaz .= " WHERE e.user = $ses_IDuser AND e.learning = $learning";
+  $dotaz .= " ORDER BY $order LIMIT $limit OFFSET $od";
   $spojeni->query($dotaz);
   $navrat = "<h3 class=\"nadpis2\">".lang("Výpis zkoušení")."</h3>";
   $navrat .= get_razeni_of_table_examing($order, $od, $limit);
   $navrat .= "<table><form action=\"\" method=\"post\">";
   $navrat .= get_header_of_table_examing();
+
   while ($spojeni->next_record()) {
-    $navrat .= get_row_of_table_examing($learning, $spojeni->Record);
+    $navrat .= get_row_of_table_examing($learning, $spojeni->row);
   }
   $navrat .= get_foot_of_table_examing();
   $navrat .= '';
@@ -402,7 +397,7 @@ function get_vyslednou_hlasku($rating) {
   //echo $dotaz;
   $spojeni->query($dotaz);
   $spojeni->next_record();
-  return $spojeni->Record[0];
+  return $spojeni->row[0];
 }
  /*
 
diff --git a/old/html/multidic/app/webroot/examination/list_exam.php b/old/html/multidic/app/webroot/examination/list_exam.php
index 786f281..2e779ac 100644
--- a/old/html/multidic/app/webroot/examination/list_exam.php
+++ b/old/html/multidic/app/webroot/examination/list_exam.php
@@ -20,10 +20,10 @@ if (!Empty($action) && $action == "delete_user") {
 }
 */
 
-$learning = (strstr($nav_id, 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
+$learning = (strstr(@$_REQUEST['nav_id'], 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
 
-if (!Empty($serad)) {
-  print_table_of_examing($learning, $order, $od, $limit);
+if (!Empty(@$_REQUEST['serad'])) {
+  print_table_of_examing($learning, @$_REQUEST['order'], @$_REQUEST['od'], @$_REQUEST['limit']);
 }
 else {
   print_table_of_examing($learning);
diff --git a/old/html/multidic/app/webroot/examination/new_exam.php b/old/html/multidic/app/webroot/examination/new_exam.php
index e591b1a..4e43651 100644
--- a/old/html/multidic/app/webroot/examination/new_exam.php
+++ b/old/html/multidic/app/webroot/examination/new_exam.php
@@ -1,13 +1,13 @@
 <?php
 require_once("./examination/exam.php");
 
-if (Empty($source) || $source == "") {
+if (empty(@$_REQUEST['source']) || @$_REQUEST['source'] == "") {
   $krok = 0;
 }
-else if (Empty($lection) || $lection == "") {
+else if (Empty(@$_REQUEST['lection']) || @$_REQUEST['lection'] == "") {
   $krok = 1;
 }
-else if (Empty($count) || $count == "" || Empty($type)) {
+else if (Empty(@$_REQUEST['count']) || @$_REQUEST['count'] == "" || Empty(@$_REQUEST['type'])) {
   $krok = 2;
 }
 else {
@@ -16,8 +16,9 @@ else {
 //echo $krok;
 
 switch ($krok) {
-  case (0):  
+  case (0):
 ?>
+
   <table>
     <thead align="center"> <h3 class="nadpis2"><?php printf(lang("Vyberte zdroj ze kterého chcete zkoušet (krok %d ze 3)"), $krok+1) ?></h3> </thead>
     <tbody>
@@ -36,10 +37,10 @@ switch ($krok) {
     </tbody>
   </table>
   <script language="javascript">
-				<!--
-					var chooser = document.choose_source_form.source;
-  				chooser.focus();
-				-->
+
+					// var chooser = document.choose_source_form.source;
+  				// chooser.focus();
+
   </script>
 
 <?php
@@ -52,13 +53,13 @@ switch ($krok) {
     <table border="0">
     <form action="" method="POST" name="choose_lection_form">
       <tr class="akt">
-        <td><?php echo $language;
-        echo(get_lection_chooser($source, 10))?></td>
+        <td><?php
+        echo(get_lection_chooser(@$_REQUEST['source'], 10))?></td>
       </tr>
       <tr class="nadpis_sekce">
         <td>
           <input type="hidden" name="action" value="select_lection">
-          <input type="hidden" name="source" value="<?php echo $source ?>">
+          <input type="hidden" name="source" value="<?php echo @$_REQUEST['source'] ?>">
           <input type="submit" value="<?php echo lang("Dál") ?>">
         </td>
       </tr>
@@ -76,7 +77,7 @@ switch ($krok) {
     <table border="0">
     <form action="" method="POST" name="choose_count_form">
       <tr class="">
-        <td><?php echo(get_count_chooser($source, $lection))?></td>
+        <td><?php echo(get_count_chooser(@$_REQUEST['source'], @$_REQUEST['lection']))?></td>
       </tr>
       <tr class="">
         <td>
@@ -96,8 +97,8 @@ switch ($krok) {
       <tr class="nadpis_sekce">
         <td>
           <input type="hidden" name="action" value="select_count">
-          <input type="hidden" name="lection" value="<?php echo $lection ?>">
-          <input type="hidden" name="source" value="<?php echo $source ?>">
+          <input type="hidden" name="lection" value="<?php echo @$_REQUEST['lection'] ?>">
+          <input type="hidden" name="source" value="<?php echo @$_REQUEST['source'] ?>">
           <input type="submit" value="<?php echo lang("Dál") ?>">
         </td>
       </tr>
@@ -108,9 +109,9 @@ switch ($krok) {
 <?php
   break;
   case (3):
-  $IDexaming = create_examing($ses_IDuser, $source, $lection, $count, $type, $learning);
+  $IDexaming = create_examing($_SESSION['ses_IDuser'], @$_REQUEST['source'], @$_REQUEST['lection'], @$_REQUEST['count'], @$_REQUEST['type'], @$_REQUEST['learning']);
   
-  $pomoc = ($learning == 'TRUE')? 'learning' : 'exam';
+  $pomoc = (@$_REQUEST['learning'] == 'TRUE')? 'learning' : 'exam';
 ?>
 <h3 class="nadpis2"><?php echo lang("Zkoušení vytvořeno") ?></h3>
 <a href="?nav_id=do_<?php 
@@ -118,7 +119,7 @@ switch ($krok) {
                  ?>&examing=<?php 
                  echo $IDexaming
                  ?>&type=<?php 
-                 echo $type?>"
+                 echo @$_REQUEST['type']?>"
    class="velkybutton"><?php echo lang("Začít")?></a>
 <?php
 }
diff --git a/old/html/multidic/app/webroot/functions/dictionary.php b/old/html/multidic/app/webroot/functions/dictionary.php
index 1e7f18d..c5d50c5 100644
--- a/old/html/multidic/app/webroot/functions/dictionary.php
+++ b/old/html/multidic/app/webroot/functions/dictionary.php
@@ -1,6 +1,6 @@
 <?php
 mb_internal_encoding('UTF-8');
-session_start();
+@session_start();
 
 require_once("./classes/db.php");
 require_once "./functions/new_hebrew_format.php";
@@ -54,17 +54,20 @@ function prihlasit($jmeno, $heslo)
             "and pass = '" . $DB->escape_string($heslo) . "'");//, array($jmeno, $heslo) );
         if ($DB->num_rows() != 1)
             return false;
-        session_regenerate_id();
-        $_SESSION['ses_nick'] = $DB->Record['nick'];
-        $_SESSION['ses_IDuser'] = $DB->Record['IDuser'];
+
+        $result = $result->fetch_assoc();
+        $_SESSION = array();
+        $_SESSION['ses_nick'] = $result['nick'];
+        $_SESSION['ses_IDuser'] = $result['IDuser'];
         $_SESSION['ses_date_last_visit'] = time();
-        $_SESSION['ses_level'] = $DB->Record['privileges'];
-        $_SESSION['ses_name'] = $DB->Record['name'];
-        $_SESSION['ses_surname'] = $DB->Record['surname'];
+        $_SESSION['ses_level'] = $result['privileges'];
+        $_SESSION['ses_name'] = $result['name'];
+        $_SESSION['ses_surname'] = $result['surname'];
+        $_SESSION['poprve'] = 'ano';
 
         pr($_SESSION);
 
-        $number_of_usage = $DB->Record["number_of_usage"];
+        $number_of_usage = $result["number_of_usage"];
         $number_of_usage++;
 
         $dotaz = "UPDATE \"user\" SET date_last_visit = now(),
@@ -80,7 +83,6 @@ function prihlasit($jmeno, $heslo)
 
 function kontrola_pristupu($level = 0)
 {
-    global $_SESSION;
     //pr($_SESSION);
     if (Empty($_SESSION['ses_nick'])) return false;
     if (Empty($_SESSION['ses_date_last_visit'])) return false;
@@ -92,8 +94,7 @@ function kontrola_pristupu($level = 0)
 
 function odhlasit()
 {
-    global $_SESSION;
-    session_regenerate_id();
+    $_SESSION = array();
     //p_g($_SESSION);
 }
 
@@ -135,7 +136,7 @@ function lang($idf)
         $dotaz = "SELECT idf, translation FROM translation WHERE language = '$LaId'";
         $spojeni->query($dotaz);
         while ($spojeni->next_record()) {
-            $translations[$spojeni->row[0]] = $spojeni->row[1];
+            $translations[$spojeni->row['idf']] = $spojeni->row['translation'];
         }
     }
     return (isset($translations[$idf]) ? $translations[$idf] : $idf);
@@ -387,11 +388,12 @@ function get_source_chooser($language, $nazev = "source")
     $spojeni = new DB_Sql();
     $dotaz = "SELECT * FROM source";
     if (!Empty($language))
-        $dotaz .= " WHERE \"language\" = '$language'";
+        $dotaz .= " WHERE language = '$language'";
     $radky = $spojeni->query($dotaz);
+
     $navrat = "<select name=\"$nazev\" size=\"1\">";
     while ($spojeni->next_record()) {
-        $navrat .= "  <option value=\"" . $spojeni->Record[0] . "\">  " . $spojeni->Record[1] . " - " . $spojeni->Record[2] . "  </option>";
+        $navrat .= "  <option value=\"" . $spojeni->row['IDsource'] . "\">  " . $spojeni->row['title'] . " - " . $spojeni->row['subtitle'] . "  </option>";
     }
     $navrat .= '</select>';
     return $navrat;
@@ -406,8 +408,8 @@ function get_lection_chooser($source, $size = 1, $nazev = "lection")
     $navrat = "<select name=\"$nazev\" size=\"$size\">";
     $i = 0;
     while ($spojeni->next_record()) {
-        $cisla[$i] = 0 + ($spojeni->Record["lection"]);
-        $hodnoty[$i] = $spojeni->Record["lection"];
+        $cisla[$i] = 0 + ($spojeni->row["lection"]);
+        $hodnoty[$i] = $spojeni->row["lection"];
         $i++;
     }
     if (count($cisla) <= 0) {
@@ -500,7 +502,7 @@ function is_in_dictionary_past($past, $source, $lection)
     $spojeni = new DB_Sql();
     $dotaz = "SELECT past FROM dict WHERE past LIKE '$past' AND source = $source AND lection LIKE '$lection'";
     $spojeni->query($dotaz);
-    if ($spojeni->Errno != 0) {
+    if ($spojeni->connection->errno != 0) {
         print_hlasku($spojeni->Error);
         return false;
     }
@@ -622,8 +624,8 @@ function insert_word($czech, $english, $word_category, $verbal_class, $present,
 			    '" . AddSlashes($vocalized_alternative) . "'
 )";
     $spojeni->query($dotaz);
-    if ($spojeni->Errno != 0) {
-        print_hlasku($spojeni->$Error);
+    if ($spojeni->connection->errno != 0) {
+        print_hlasku($spojeni->connection->error);
         return false;
     }
     return true;
@@ -979,8 +981,8 @@ function dump_csv_file($file)
             0,//source
             2);//lection
         $spojeni->query($dotaz);
-        if ($spojeni->Errno != 0) {
-            echo $spojeni->$Error;
+        if ($spojeni->connection->errno != 0) {
+            echo $spojeni->connection->error;
         } else $pocitadlo++;
     }
 
diff --git a/old/html/multidic/app/webroot/index-hebrew.php b/old/html/multidic/app/webroot/index-hebrew.php
index 1b476e1..5711545 100644
--- a/old/html/multidic/app/webroot/index-hebrew.php
+++ b/old/html/multidic/app/webroot/index-hebrew.php
@@ -15,6 +15,7 @@ if (!Empty($_POST['n']) && !Empty($_POST['p'])) {
             Header("Location: examination.php?nav_id=new_exam&action=select_lection&source=" . urlencode($_REQUEST['source']) . "&lection=" . urlencode($_REQUEST['lection']));
         else
             //p_g($_SESSION);
+            $poprve = $_SESSION['poprve'];
             Header("Location: examination.php?poprve=$poprve");
         exit;
     } else {
diff --git a/old/html/utf/autor/multidic/administration/word.php b/old/html/utf/autor/multidic/administration/word.php
index 1a437db..2f8874c 100644
--- a/old/html/utf/autor/multidic/administration/word.php
+++ b/old/html/utf/autor/multidic/administration/word.php
@@ -262,11 +262,11 @@ function update_word($czech,$english,$word_category,$verbal_class,
 function get_word($word_id) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM dict WHERE \"IDdict\" LIKE '$word_id'";
+  $dotaz = "SELECT * FROM dict WHERE IDdict LIKE '$word_id'";
   $radky = $spojeni->query($dotaz);
   $spojeni->next_record();
 
-  if ($spojeni->Errno != 0) {
+  if ($spojeni->connection->errno != 0) {
     print_hlasku("Slovo se nepodařilo načíst.");
   }
 
diff --git a/old/html/utf/autor/multidic/functions/dictionary.php b/old/html/utf/autor/multidic/functions/dictionary.php
index 6983a9f..635f55c 100644
--- a/old/html/utf/autor/multidic/functions/dictionary.php
+++ b/old/html/utf/autor/multidic/functions/dictionary.php
@@ -94,7 +94,7 @@ function get_lection_chooser($source, $size = 1) {
   $radky = $spojeni->query($dotaz);
   $navrat = "<select name=\"lection\" size=\"$size\">";
   while ($spojeni->next_record()) {
-    $navrat .= "  <option value=\"".$spojeni->Record["lection"]."\"> lekce ".$spojeni->Record["lection"]."  </option>";
+    $navrat .= "  <option value=\"".$spojeni->row[0]."\"> lekce ".$spojeni->row[0]."  </option>";
   }
   $navrat .= '</select>';
   return $navrat;
