commit b8dc69e25106cd59d586b2e40e476644e5935dab
Author: Filip Jani <jsem@filek.cz>
Date:   Mon Jun 10 16:18:54 2019 +0200

    Re #7580 překlady prostředí

diff --git a/old/html/multidic/app/webroot/administration/edit_translation.php b/old/html/multidic/app/webroot/administration/edit_translation.php
index a387c8b..e6b075c 100644
--- a/old/html/multidic/app/webroot/administration/edit_translation.php
+++ b/old/html/multidic/app/webroot/administration/edit_translation.php
@@ -3,19 +3,19 @@
 
 $vypis_edit = true;
 
-if (!Empty($action) && $action == "edit_translation") {
+if (!Empty($_POST)) {
 
-  if (Empty($translation)) {
+  if (Empty($_POST['translation'])) {
     print_hlasku("Položku musíte vyplnit");
   }
   else {
-    update_translation($translation, $translation_id);
+    update_translation($_POST['translation'], $_POST['translation_id']);
     $vypis_edit = false;
   }
 }
 if($vypis_edit){
 
-  $Record      = get_translation($translation_id);
+  $Record      = get_translation($_REQUEST['translation_id']);
   $translation = $Record["translation"];
   $idf         = $Record["idf"];
 ?>
diff --git a/old/html/multidic/app/webroot/administration/list_translation.php b/old/html/multidic/app/webroot/administration/list_translation.php
index 1678630..82d0ea5 100644
--- a/old/html/multidic/app/webroot/administration/list_translation.php
+++ b/old/html/multidic/app/webroot/administration/list_translation.php
@@ -2,18 +2,18 @@
 
 require_once("./administration/translation.php");
 
-if (!IsSet($translation_lang_id)) {
+if (!IsSet($_REQUEST['translation_lang_id'])) {
   echo "<p>Vyberte jazyk:</p>\n  <p>";
   echo "<form method=\"post\">";
   echo get_translation_chooser();
   echo "<input type=\"submit\" value=\"Dál\" />\n     </form>";
 }
 else {
-  if (!Empty($serad)) {
-    print_table_of_translation($translation_lang_id, $order, $od, $limit);
+  if (!Empty($_REQUEST['serad'])) {
+    print_table_of_translation($_REQUEST['translation_lang_id'], $_REQUEST['order'], $_REQUEST['od'], $_REQUEST['limit']);
   }
   else {
-    print_table_of_translation($translation_lang_id);
+    print_table_of_translation($_REQUEST['translation_lang_id']);
   }
 }
 ?>
diff --git a/old/html/multidic/app/webroot/administration/list_translation_lang.php b/old/html/multidic/app/webroot/administration/list_translation_lang.php
index 418fdcc..0fa54b4 100644
--- a/old/html/multidic/app/webroot/administration/list_translation_lang.php
+++ b/old/html/multidic/app/webroot/administration/list_translation_lang.php
@@ -2,14 +2,12 @@
 
 require_once("./administration/translation_lang.php");
 
-if (!Empty($action) && $action == "delete_translation_lang") {
-
-
+if (!Empty($_POST) && $_REQUEST['action'] == 'delete_translation_lang') {
   $coun_true = 0;
   $coun_false = 0;
-  if (Is_Array($smaz)) {
-    for (Reset($smaz); Current($smaz); Next($smaz)) {
-      if (delete_translation_lang(Key($smaz))) $coun_true++;
+  if (Is_Array($_POST['smaz'])) {
+    for (Reset($_POST['smaz']); Current($_POST['smaz']); Next($_POST['smaz'])) {
+      if (delete_translation_lang(Key($_POST['smaz']))) $coun_true++;
       else $coun_false++;
     }
   }
@@ -19,8 +17,8 @@ if (!Empty($action) && $action == "delete_translation_lang") {
     print_hlasku("Bohužel,$coun_false jazyků se nepodařilo smazat ($coun_true se podařilo smazat)");
 }
 
-if (!Empty($serad)) {
-    print_table_of_translation_lang($order, $od, $limit);
+if (!Empty($_REQUEST['serad'])) {
+    print_table_of_translation_lang($_REQUEST['order'], $_REQUEST['od'], $_REQUEST['limit']);
 }
 else {
   print_table_of_translation_lang();
diff --git a/old/html/multidic/app/webroot/administration/translation.php b/old/html/multidic/app/webroot/administration/translation.php
index 6617784..6389f97 100644
--- a/old/html/multidic/app/webroot/administration/translation.php
+++ b/old/html/multidic/app/webroot/administration/translation.php
@@ -106,15 +106,16 @@ function print_table_of_translation($translation_lang_id, $order = "IDtranslatio
   $spojeni = new DB_Sql();
   $dotaz = "SELECT * FROM translation 
               WHERE language = '$translation_lang_id' 
-              ORDER BY \"$order\" 
-              OFFSET $od LIMIT $limit";
-  $radky = $spojeni->query($dotaz);
+              ORDER BY $order 
+              LIMIT $limit OFFSET $od";
+  $result = $spojeni->query($dotaz);
   $navrat = "<h3 class=\"nadpis2\">Výpis překladu prostředí jazyk - $translation_lang_id</h3>";
   $navrat .= get_razeni($translation_lang_id, $order, $od, $limit);
   $navrat .= "<table>";
   $navrat .= get_header_of_table();
-  while ($spojeni->next_record()) {
-    $navrat .= get_row_of_table($spojeni->Record, $translation_lang_id);
+
+  foreach ($result as $radka) {
+    $navrat .= get_row_of_table($radka, $translation_lang_id);
   }
   $navrat .= get_foot_of_table();
   $navrat .= "</table>";
@@ -142,11 +143,9 @@ function update_translation($translation, $translation_id) {
 function get_translation($translation_id) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM translation WHERE \"IDtranslation\" LIKE '$translation_id'";
+  $dotaz = "SELECT * FROM translation WHERE IDtranslation LIKE '$translation_id'";
   $radky = $spojeni->query($dotaz);
 
-  $spojeni->next_record();
-  
-  return $spojeni->Record;
+  return mysqli_fetch_assoc($radky);
 }
 ?>
diff --git a/old/html/multidic/app/webroot/administration/translation_lang.php b/old/html/multidic/app/webroot/administration/translation_lang.php
index 5434ccb..fb8e81b 100644
--- a/old/html/multidic/app/webroot/administration/translation_lang.php
+++ b/old/html/multidic/app/webroot/administration/translation_lang.php
@@ -10,7 +10,7 @@ require_once("./functions/dictionary.php");
 function get_row_of_table($Record, $od = 1, $do = 2) {
   $navrat .= "<tr class=\"akt\">\n     ";
   $navrat .= '<td>';
-  if ($Record["code"] != "cz" && $Record["code"] != "en") {
+  if ($Record[1] != "cz" && $Record[1] != "en") {
     $navrat .= '<input type="checkbox" name="smaz['.$Record[0].']" /></td>'.
                '<td><a href="?nav_id=edit_translation_lang&translation_lang_id='.$Record[0].'">uprav</a>';
   }
@@ -98,14 +98,15 @@ function get_foot_of_table() {
 function print_table_of_translation_lang($order = "IDtranslation_lang", $od = 0, $limit = 30) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM \"translation_lang\" ORDER BY \"$order\" OFFSET $od LIMIT $limit";
-  $radky = $spojeni->query($dotaz);
+  $dotaz = "SELECT * FROM translation_lang ORDER BY $order LIMIT $limit OFFSET $od";
+  $result = $spojeni->query($dotaz);
   $navrat .= "<h3 class=\"nadpis2\">Výpis jazyků</h3>";
   $navrat .= get_razeni($order, $od, $limit);
   $navrat .= "<table><form action=\"\" method=\"post\">";
   $navrat .= get_header_of_table();
-  while ($spojeni->next_record()) {
-    $navrat .= get_row_of_table($spojeni->Record, 1, 4);
+  $radky = mysqli_fetch_all($result);
+  foreach ($radky as $radka) {
+    $navrat .= get_row_of_table($radka, 1, 4);
   }
   $navrat .= get_foot_of_table();
   $navrat .= '<input type="hidden" name="action" value="delete_translation_lang">';
diff --git a/old/html/multidic/app/webroot/functions/dictionary.php b/old/html/multidic/app/webroot/functions/dictionary.php
index 0d8c4d0..22ca9a8 100644
--- a/old/html/multidic/app/webroot/functions/dictionary.php
+++ b/old/html/multidic/app/webroot/functions/dictionary.php
@@ -281,10 +281,10 @@ function get_translation_chooser()
     require_once("./classes/db.php");
     $spojeni = new DB_Sql();
     $dotaz = "SELECT * FROM translation_lang";
-    $spojeni->query($dotaz);
-    $navrat = "<select name=\"translation_lang_id\" size=\"4\">";
-    while ($spojeni->next_record()) {
-        $navrat .= "  <option value=\"" . $spojeni->Record["code"] . "\">  " . $spojeni->Record["name"] . "  </option>";
+    $result = $spojeni->query($dotaz);
+    $navrat .= '<select name="translation_lang_id" size="4">';
+    foreach ($result as $radka) {
+        $navrat .= "  <option value=\"" . $radka["code"] . "\">  " . $radka["name"] . "  </option>";
     }
     $navrat .= '</select>';
     return $navrat;
