Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1d751640

Přidáno uživatelem Petr Lukašík před téměř 6 roky(ů)

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

Zobrazit rozdíly:

old/html/multidic/app/webroot/administration/add_author_of_source.php
23 23
                    VALUES ('$source_id', 
24 24
                            '$author_id')";  
25 25
  $spojeni->query($dotaz);
26
  if ($spojeni->Errno != 0) {
27
    print_hlasku($spojeni->$Error);
26
  if ($spojeni->connection->errno != 0) {
27
    print_hlasku($spojeni->connection->error);
28 28
    echo_zpet_do_zdroju();
29 29
    return false;
30 30
  }
old/html/multidic/app/webroot/administration/article.php
7 7
  $dotaz = "UPDATE article SET autorized = true
8 8
                        WHERE \"IDarticle\" = '$ID'";
9 9
  $spojeni->query($dotaz);
10
  if ($spojeni->Errno != 0) {
10
  if ($spojeni->connection->errno != 0) {
11 11
    return false;
12 12
  }
13 13
  return true;
......
261 261
  $radky = $spojeni->query($dotaz);
262 262
  $spojeni->next_record();
263 263

  
264
  if ($spojeni->Errno != 0) {
264
  if ($spojeni->connection->errno != 0) {
265 265
    print_hlasku("Clanek se nepodařilo načíst.");
266 266
  }
267 267

  
......
273 273
  $spojeni = new DB_Sql();
274 274
  $dotaz = "DELETE FROM article WHERE \"IDarticle\" = '$ID'";
275 275
  $spojeni->query($dotaz);
276
  if ($spojeni->Errno != 0) {
276
  if ($spojeni->connection->errno != 0) {
277 277
    return false;
278 278
  }
279 279
  return true;
......
289 289
                            lection = '".AddSlashes($lection)."'
290 290
                            WHERE \"IDarticle\" = '".AddSlashes($id)."'";
291 291
  $spojeni->query($dotaz);
292
  if ($spojeni->Errno != 0) {
292
  if ($spojeni->connection->errno != 0) {
293 293
    print_hlasku("Slovo se nepodařilo upravit.");
294 294
  }
295 295
  print_hlasku("Slovo změněno.");
......
320 320
                            '$note',
321 321
                            '0')";
322 322
  $spojeni->query($dotaz);
323
  if ($spojeni->Errno != 0) {
323
  if ($spojeni->connection->errno != 0) {
324 324
    return false;
325 325
  }
326 326
  return true;
old/html/multidic/app/webroot/administration/author.php
119 119
                    VALUES ('$name', 
120 120
                            '$surname')";
121 121
  $spojeni->query($dotaz);
122
  if ($spojeni->Errno != 0) {
122
  if ($spojeni->connection->errno != 0) {
123 123
    print_hlasku("Bohužel, autora '$name $surname' se nepodařilo přidat.");
124 124
    return false;
125 125
  }
......
132 132
  $spojeni = new DB_Sql();
133 133
  $dotaz = "SELECT * FROM author_of_source WHERE \"IDauthor\" = '$author_id'";
134 134
  $spojeni->query($dotaz);
135
  if ($spojeni->Errno != 0) {
136
    print_hlasku($spojeni->$Error);
135
  if ($spojeni->connection->errno != 0) {
136
    print_hlasku($spojeni->connection->error);
137 137
    return false;
138 138
  }
139 139
  //echo $spojeni->num_rows();
......
152 152
  $spojeni = new DB_Sql();
153 153
  $dotaz = "DELETE FROM author WHERE \"IDauthor\" = $ID";
154 154
  $spojeni->query($dotaz);
155
  if ($spojeni->Errno != 0) {
155
  if ($spojeni->connection->errno != 0) {
156 156
    return false;
157 157
  }
158 158
  $dotaz = "DELETE FROM author_of_source WHERE \"IDauthor\" = $ID";
159 159
  $spojeni->query($dotaz);
160
  if ($spojeni->Errno != 0) {
160
  if ($spojeni->connection->errno != 0) {
161 161
    return false;
162 162
  }
163 163
  return true;
......
171 171
                              surname = '$surname'
172 172
                            WHERE \"IDauthor\" = $author_id";
173 173
  $spojeni->query($dotaz);
174
  if ($spojeni->Errno != 0) {
174
  if ($spojeni->connection->errno != 0) {
175 175
    print_hlasku("Autora se nepodařilo upravit.");
176 176
  }
177 177
  print_hlasku("Autor změněn.");
old/html/multidic/app/webroot/administration/context.php
11 11
                        WHERE \"IDdict\" = '".AddSlashes($word_id)."'";
12 12
  $spojeni->query($dotaz);
13 13
  
14
  if ($spojeni->Errno != 0) {
14
  if ($spojeni->connection->errno != 0) {
15 15
    print_hlasku("Bohužel, vybraný kontext se nepodařilo připojit.");
16 16
    echo_zpet_do_slovniku();
17 17
    return false;
......
38 38
                            '$source_id', 
39 39
                            '$pomoc')";
40 40
  $spojeni->query($dotaz);
41
  if ($spojeni->Errno != 0) {
41
  if ($spojeni->connection->errno != 0) {
42 42
    print_hlasku("Bohužel, kontext '$cz_context - $en_context' se nepodařilo přidat.");
43 43
    echo_zpet_do_slovniku();
44 44
    return false;
......
66 66
  
67 67
  /*$dotaz = "DELETE FROM context WHERE IDcontext LIKE $context_id";
68 68
  $spojeni->query($dotaz);
69
  if ($spojeni->Errno != 0) {
69
  if ($spojeni->connection->errno != 0) {
70 70
    return false;
71 71
  }*/
72 72
  $dotaz = "UPDATE dict SET context = '0'
......
85 85
                            orig_context = '".AddSlashes($org_context)."'
86 86
                            WHERE \"IDcontext\" = '".AddSlashes($context_id)."'";
87 87
  $spojeni->query($dotaz);
88
  if ($spojeni->Errno != 0) {
88
  if ($spojeni->connection->errno != 0) {
89 89
    print_hlasku("Kontext se nepodařilo upravit.");
90 90
  }
91 91
  print_hlasku("Kontext změněn.");
......
99 99
  $radky = $spojeni->query($dotaz);
100 100
  $spojeni->next_record();
101 101

  
102
  if ($spojeni->Errno != 0) {
102
  if ($spojeni->connection->errno != 0) {
103 103
    print_hlasku("Kontext se nepodařilo načíst.");
104 104
  }
105 105

  
old/html/multidic/app/webroot/administration/delete_author_of_source.php
6 6
  $spojeni = new DB_Sql();
7 7
  $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $source_id AND \"IDauthor\" = $author_id";
8 8
  $spojeni->query($dotaz);
9
  if ($spojeni->Errno != 0) {
9
  if ($spojeni->connection->errno != 0) {
10 10
    print_hlasku("Autora se nepodařilo odebrat");
11 11
  }
12 12
  print_hlasku("Autor odebrán");
old/html/multidic/app/webroot/administration/field.php
91 91
  $dotaz = "INSERT INTO field (field, en_field) 
92 92
                    VALUES ('$field', '$en_field')";
93 93
  $spojeni->query($dotaz);
94
  if ($spojeni->Errno != 0) {
94
  if ($spojeni->connection->errno != 0) {
95 95
    print_hlasku("Bohužel, obor '$field' - '$en_field' se nepodařilo přidat.");
96 96
    return false;
97 97
  }
......
127 127
  $spojeni = new DB_Sql();
128 128
  $dotaz = "SELECT * FROM dict WHERE field LIKE '$field_id'";
129 129
  $spojeni->query($dotaz);
130
  if ($spojeni->Errno != 0) {
130
  if ($spojeni->connection->errno != 0) {
131 131
    print_hlasku($spojeni->$Error);
132 132
    return false;
133 133
  }
......
147 147
  $spojeni = new DB_Sql();
148 148
  $dotaz = "DELETE FROM field WHERE \"IDfield\" = $ID";
149 149
  $spojeni->query($dotaz);
150
  if ($spojeni->Errno != 0) {
150
  if ($spojeni->connection->errno != 0) {
151 151
    //print_hlasku("Bohužel, obor '$field' se nepodařilo smazat.");
152 152
    return false;
153 153
  }
......
163 163
                            en_field = '$en_field'
164 164
                            WHERE \"IDfield\" = $field_id";
165 165
  $spojeni->query($dotaz);
166
  if ($spojeni->Errno != 0) {
166
  if ($spojeni->connection->errno != 0) {
167 167
    print_hlasku("Obor se nepodařilo upravit.");
168 168
    echo_zpet_do_oboru();
169 169
    return false;
old/html/multidic/app/webroot/administration/list_article.php
11 11
?>
12 12
  <p>Vyberte jazyk:</p>
13 13
  <p>
14
    <a href="?nav_id=<?php echo $nav_id?>&language=1<?php echo $pomocna?>">arabský</a><br />
15
    <a href="?nav_id=<?php echo $nav_id?>&language=2<?php echo $pomocna?>">hebrejský</a><br />
16
    <a href="?nav_id=<?php echo $nav_id?>&language=3<?php echo $pomocna?>">akkadský</a><br /><br />
14
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=1<?php echo $pomocna?>">arabský</a><br />
15
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=2<?php echo $pomocna?>">hebrejský</a><br />
16
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=3<?php echo $pomocna?>">akkadský</a><br /><br />
17 17

  
18
    <a href="?nav_id=<?php echo $nav_id?>&language=all&contrains_source=all&contrains_lection=all">všechny</a>
18
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=all&contrains_source=all&contrains_lection=all">všechny</a>
19 19
  </p>
20 20
<?php
21 21

  
......
29 29
?>
30 30
     <input type="submit" value="Dál" />
31 31
     </form>
32
   <br /> <a href="?nav_id=<?php echo $nav_id?>&language=<?php echo $language?>&contrains_source=all&contrains_lection=all">všechny</a>
32
   <br /> <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=<?php echo $language?>&contrains_source=all&contrains_lection=all">všechny</a>
33 33
  </p>
34 34
<?php
35 35
elseif ($language != "all" && $contrains_source != "all" && Empty($contrains_lection)):
......
43 43
     <input type="submit" value="Dál" />
44 44
     <input type="hidden" name="contrains_source" value="<?php echo $contrains_source?>" title="Dál" />
45 45
     </form>
46
   <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>
46
   <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>
47 47
  </p>
48 48
<?php
49 49
else :
......
79 79
    print_hlasku("Bohužel, článek se nepodařilo autorizovat.");
80 80
}
81 81

  
82
if ($nav_id == "list_artile") $pomocna = false;
82
if ($nav_id == "list_article") $pomocna = false;
83 83
else if ($nav_id == "list_nonauthorized_article") $pomocna = true;
84 84
else  $pomocna = ($nonauthorized == true);
85 85
//pr($nav_id);
old/html/multidic/app/webroot/administration/not_found.php
141 141
  $spojeni = new DB_Sql();
142 142
  $dotaz = "DELETE FROM $table WHERE \"ID$table\" = $ID";
143 143
  $spojeni->query($dotaz);
144
  if ($spojeni->Errno != 0) {
144
  if ($spojeni->connection->errno != 0) {
145 145
    return false;
146 146
  }
147 147
  return true;
old/html/multidic/app/webroot/administration/report.php
69 69
                            english = '".pg_escape_string($english)."'
70 70
                            WHERE \"ratio\" = $ratio";
71 71
  $spojeni->query($dotaz);
72
  if ($spojeni->Errno != 0) {
72
  if ($spojeni->connection->errno != 0) {
73 73
    print_hlasku("Zprávu se nepodařilo upravit.");
74 74
    echo_zpet_do_zprav();
75 75
    return false;
old/html/multidic/app/webroot/administration/source.php
166 166
                               '$language',
167 167
                              '$year')";
168 168
  $spojeni->query($dotaz);
169
  if ($spojeni->Errno != 0) {
169
  if ($spojeni->connection->errno != 0) {
170 170
    print_hlasku("Bohužel, zdroj '$title' se nepodařilo přidat.");
171 171
    return false;
172 172
  }
......
182 182
  $spojeni = new DB_Sql();
183 183
  $dotaz = "SELECT * FROM author_of_source WHERE \"IDsource\" = '$source_id'";
184 184
  $spojeni->query($dotaz);
185
  if ($spojeni->Errno != 0) {
186
    print_hlasku($spojeni->$Error);
185
  if ($spojeni->connection->errno != 0) {
186
    print_hlasku($spojeni->Error);
187 187
    return false;
188 188
  }
189 189
  if ($spojeni->num_rows() == 0)
......
191 191
    
192 192
  $dotaz = "SELECT * FROM dict WHERE source = '$source_id'";
193 193
  $spojeni->query($dotaz);
194
  if ($spojeni->Errno != 0) {
195
    print_hlasku($spojeni->$Error);
194
  if ($spojeni->connection->errno != 0) {
195
    print_hlasku($spojeni->Error);
196 196
    return false;
197 197
  }
198 198
  if ($spojeni->num_rows() == 0)
......
210 210
  $spojeni = new DB_Sql();
211 211
  $dotaz = "DELETE FROM source WHERE \"IDsource\" = $ID";
212 212
  $spojeni->query($dotaz);
213
  if ($spojeni->Errno != 0) {
213
  if ($spojeni->connection->errno != 0) {
214 214
    return false;
215 215
  }
216 216
  $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $ID";
217 217
  $spojeni->query($dotaz);
218
  if ($spojeni->Errno != 0) {
218
  if ($spojeni->connection->errno != 0) {
219 219
    return false;
220 220
  }
221 221
  return true;
......
237 237
                            year = '$year'
238 238
                            WHERE \"IDsource\" = $source_id";
239 239
  $spojeni->query($dotaz);
240
  if ($spojeni->Errno != 0) {
240
  if ($spojeni->connection->errno != 0) {
241 241
    print_hlasku("Zdroj se nepodařilo upravit.");
242 242
    echo_zpet_do_zdroju();
243 243
    return false;
old/html/multidic/app/webroot/administration/test.php
8 8
  $dotaz = "UPDATE test SET autorized = true
9 9
                        WHERE \"IDtest\" = '$ID'";
10 10
  $spojeni->query($dotaz);
11
  if ($spojeni->Errno != 0) {
11
  if ($spojeni->connection->errno != 0) {
12 12
    return false;
13 13
  }
14 14
  return true;
......
260 260
  $radky = $spojeni->query($dotaz);
261 261
  $spojeni->next_record();
262 262

  
263
  if ($spojeni->Errno != 0) {
263
  if ($spojeni->connection->errno != 0) {
264 264
    print_hlasku("Test se nepodařilo načíst.");
265 265
  }
266 266

  
......
272 272
  $spojeni = new DB_Sql();
273 273
  $dotaz = "DELETE FROM test WHERE \"IDtest\" = '$ID'";
274 274
  $spojeni->query($dotaz);
275
  if ($spojeni->Errno != 0) {
275
  if ($spojeni->connection->errno != 0) {
276 276
    return false;
277 277
  }
278 278
  return true;
......
289 289
                            test_category_id = '".AddSlashes($test_category)."'
290 290
                            WHERE \"IDtest\" = '".AddSlashes($id)."'";
291 291
  $spojeni->query($dotaz);
292
  if ($spojeni->Errno != 0) {
292
  if ($spojeni->connection->errno != 0) {
293 293
    print_hlasku("Test se nepodařilo upravit.");
294 294
  }
295 295
  print_hlasku("Test změněn.");
......
320 320
                            '". AddSlashes($note)."',
321 321
                            '". AddSlashes($test_category)."')";
322 322
  $spojeni->query($dotaz);
323
  if ($spojeni->Errno != 0) {
323
  if ($spojeni->connection->errno != 0) {
324 324
    return false;
325 325
  }
326 326
  return true;
old/html/multidic/app/webroot/administration/test_category.php
92 92
  $dotaz = "INSERT INTO test_category (name, parent_id) 
93 93
                    VALUES ('$name', '$parent_id')";
94 94
  $spojeni->query($dotaz);
95
  if ($spojeni->Errno != 0) {
95
  if ($spojeni->connection->errno != 0) {
96 96
    print_hlasku("Bohužel, kategorii '$name' - '$parent_id' se nepodařilo přidat.");
97 97
    return false;
98 98
  }
......
128 128
  $spojeni = new DB_Sql();
129 129
  $dotaz = "SELECT * FROM test WHERE test_category_id LIKE '$test_category_id'";
130 130
  $spojeni->query($dotaz);
131
  if ($spojeni->Errno != 0) {
132
    print_hlasku($spojeni->$Error);
131
  if ($spojeni->connection->errno != 0) {
132
    print_hlasku($spojeni->connection->error);
133 133
    return false;
134 134
  }
135 135
  //echo $spojeni->num_rows();
......
148 148
  $spojeni = new DB_Sql();
149 149
  $dotaz = "DELETE FROM test_category WHERE \"id\" = $ID";
150 150
  $spojeni->query($dotaz);
151
  if ($spojeni->Errno != 0) {
151
  if ($spojeni->connection->errno != 0) {
152 152
    //print_hlasku("Bohužel, obor '$field' se nepodařilo smazat.");
153 153
    return false;
154 154
  }
......
164 164
                            parent_id = '$parent_id'
165 165
                            WHERE id = $id";
166 166
  $spojeni->query($dotaz);
167
  if ($spojeni->Errno != 0) {
167
  if ($spojeni->connection->errno != 0) {
168 168
    print_hlasku("Kategorii se nepodařilo upravit.");
169 169
    echo_zpet_do_kategorii();
170 170
    return false;
old/html/multidic/app/webroot/administration/translation.php
128 128
  $dotaz = "UPDATE translation SET translation = '$translation'
129 129
                            WHERE \"IDtranslation\" = $translation_id";
130 130
  $spojeni->query($dotaz);
131
  if ($spojeni->Errno != 0) {
131
  if ($spojeni->connection->errno != 0) {
132 132
    print_hlasku("Položku se nepodařilo upravit.");
133 133
    echo_zpet_do_translation();
134 134
    return false;
old/html/multidic/app/webroot/administration/translation_lang.php
142 142
                            '$nick',
143 143
                            '$password')";
144 144
  $spojeni->query($dotaz);
145
  if ($spojeni->Errno != 0) {
145
  if ($spojeni->connection->errno != 0) {
146 146
    if (vypisovat) print_hlasku("Bohužel, uživatele '$name $surname' se nepodařilo přidat.");
147 147
    return false;
148 148
  }
......
156 156
  $spojeni = new DB_Sql();
157 157
  $dotaz = "DELETE FROM \"translation_lang\" WHERE \"IDtranslation_lang\" = '$ID'";
158 158
  $spojeni->query($dotaz);
159
  if ($spojeni->Errno != 0) {
159
  if ($spojeni->connection->errno != 0) {
160 160
    return false;
161 161
  }
162 162
  return true;
......
178 178
  $dotaz .= " WHERE \"IDuser\" = '$user_id'";
179 179
  
180 180
  $spojeni->query($dotaz);
181
  if ($spojeni->Errno != 0) {
181
  if ($spojeni->connection->errno != 0) {
182 182
    print_hlasku("Uživatel se nepodařilo upravit.");
183 183
  }
184 184
  print_hlasku("Uživatel změněn.");
old/html/multidic/app/webroot/administration/user.php
127 127
  $spojeni = new DB_Sql();
128 128
  $dotaz = "SELECT * FROM \"user\" WHERE nick LIKE '$nick'";
129 129
  $spojeni->query($dotaz);
130
  if ($spojeni->Errno != 0) {
131
    print_hlasku($spojeni->$Error);
130
  if ($spojeni->connection->errno != 0) {
131
    print_hlasku($spojeni->Error);
132 132
    return true;
133 133
  }
134 134
  //echo $nick." / ".$spojeni->num_rows();
......
164 164
                            '$nick',
165 165
                            '$password')";
166 166
  $spojeni->query($dotaz);
167
  if ($spojeni->Errno != 0) {
167
  if ($spojeni->connection->errno != 0) {
168 168
    if ($vypisovat) print_hlasku("Bohužel, uživatele '$name $surname' se nepodařilo přidat.");
169 169
    return false;
170 170
  }
......
177 177
  $spojeni = new DB_Sql();
178 178
  $dotaz = "SELECT * FROM dict WHERE usr LIKE '$user_id'";
179 179
  $spojeni->query($dotaz);
180
  if ($spojeni->Errno != 0) {
181
    print_hlasku($spojeni->$Error);
180
  if ($spojeni->connection->errno != 0) {
181
    print_hlasku($spojeni->connection->error);
182 182
    return false;
183 183
  }
184 184
  //echo $spojeni->num_rows();
......
197 197
  $spojeni = new DB_Sql();
198 198
  $dotaz = "DELETE FROM \"user\" WHERE \"IDuser\" = '$ID'";
199 199
  $spojeni->query($dotaz);
200
  if ($spojeni->Errno != 0) {
200
  if ($spojeni->connection->errno != 0) {
201 201
    return false;
202 202
  }
203 203
  return true;
......
219 219
  $dotaz .= " WHERE \"IDuser\" = '$user_id'";
220 220
  
221 221
  $spojeni->query($dotaz);
222
  if ($spojeni->Errno != 0) {
222
  if ($spojeni->connection->errno != 0) {
223 223
    print_hlasku("Uživatel se nepodařilo upravit.");
224 224
  }
225 225
  print_hlasku("Uživatel změněn.");
old/html/multidic/app/webroot/administration/voice.php
26 26
  $dotaz = "UPDATE article SET article_voice = 1 WHERE \"IDarticle\" = $id ";
27 27
  $spojeni->query($dotaz);
28 28
  
29
  if ($spojeni->Errno != 0) return false;
29
  if ($spojeni->connection->errno != 0) return false;
30 30
  return true;
31 31
}
32 32

  
......
67 67
  $dotaz = "UPDATE dict SET word_voice = 1 WHERE \"IDdict\" = $word_id ";
68 68
  $spojeni->query($dotaz);
69 69
  
70
  if ($spojeni->Errno != 0) return false;
70
  if ($spojeni->connection->errno != 0) return false;
71 71
  return true;
72 72
}
73 73

  
old/html/multidic/app/webroot/administration/word.php
327 327
  $dotaz = "UPDATE dict SET autorized = 1
328 328
                        WHERE \"IDdict\" = '$ID'";
329 329
  $spojeni->query($dotaz);
330
  if ($spojeni->Errno != 0) {
330
  if ($spojeni->connection->errno != 0) {
331 331
    return false;
332 332
  }
333 333
  return true;
......
338 338
  $spojeni = new DB_Sql();
339 339
  $dotaz = "DELETE FROM dict WHERE \"IDdict\" = '$ID'";
340 340
  $spojeni->query($dotaz);
341
  if ($spojeni->Errno != 0) {
341
  if ($spojeni->connection->errno != 0) {
342 342
    return false;
343 343
  }
344 344
  return true;
......
391 391
                            
392 392
                            WHERE \"IDdict\" = '".AddSlashes($word_id)."'";
393 393
  $spojeni->query($dotaz);
394
  if ($spojeni->Errno != 0) {
394
  if ($spojeni->connection->errno != 0) {
395 395
    print_hlasku("Slovo se nepodařilo upravit.");
396 396
  }
397 397
  print_hlasku("Slovo změněno.");
......
400 400
function get_word($word_id) {
401 401
  require_once("./classes/db.php");
402 402
  $spojeni = new DB_Sql();
403
  $dotaz = "SELECT * FROM dict WHERE \"IDdict\" LIKE '$word_id'";
403
  $dotaz = "SELECT * FROM dict WHERE IDdict LIKE '$word_id'";
404 404
  $radky = $spojeni->query($dotaz);
405 405
  $spojeni->next_record();
406 406

  
407
  if ($spojeni->Errno != 0) {
407
  if ($spojeni->connection->errno != 0) {
408 408
    print_hlasku("Slovo se nepodařilo načíst.");
409 409
  }
410 410

  
411
  return $spojeni->Record;
411
  return $spojeni->row;
412 412
}
413 413

  
414 414
function sort_word($word_id, $direction) {
......
421 421
  else   $hodnota++;
422 422
  $dotaz = "UPDATE dict SET sorting_no = $hodnota WHERE \"IDdict\" LIKE '$word_id'";
423 423
  $spojeni->query($dotaz);
424
  if ($spojeni->Errno != 0) {
424
  if ($spojeni->connection->errno != 0) {
425 425
    return false;
426 426
  }
427 427
  return true;
......
432 432
  $spojeni = new DB_Sql();
433 433
  $dotaz = "UPDATE dict SET sorting_no = $sorting_no WHERE \"IDdict\" LIKE '$word_id'";
434 434
  $spojeni->query($dotaz);
435
  if ($spojeni->Errno != 0) {
435
  if ($spojeni->connection->errno != 0) {
436 436
    return false;
437 437
  }
438 438
  return true;
old/html/multidic/app/webroot/classes/db.php
8 8
 *
9 9
 */
10 10

  
11
class DB_Sql {
12
  var $Host     = "Filek.cz";
13
  var $Database = "aswi-dictionary";
14
  var $User     = "dbowner";
15
  var $Password = "";
11
class DB_Sql
12
{
13
    var $Host = "Filek.cz";
14
    var $Database = "aswi-dictionary";
15
    var $User = "dbowner";
16
    var $Password = "db486ex12";
16 17

  
17
  /** @var mysqli_result  */
18
  var $result = null;
18
    /** @var mysqli_result */
19
    var $result = null;
19 20

  
20
  var $row = null;
21
    var $row = null;
21 22

  
22
  /** @var mysqli */
23
  var $connection = null;
24
  var $Debug = 0;
23
    /** @var mysqli */
24
    var $connection = null;
25
    var $Debug = 0;
25 26

  
26
  /* public: constructor */
27
  function __construct($query = "") {
28
      $this->query($query);
29
  }
27
    /* public: constructor */
28
    function __construct($query = "")
29
    {
30
        $this->query($query);
31
    }
30 32

  
31
  function connect() {
32
    $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
33
    $this->connection->set_charset("utf8");
33
    function connect()
34
    {
35
        $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
36
        $this->connection->set_charset("utf8");
34 37

  
35
    if ($this->connection->connect_error) {
36
      $this->halt("Connection failed: " . $this->connection->connect_error);
38
        if ($this->connection->connect_error) {
39
            $this->halt("Connection failed: " . $this->connection->connect_error);
40
        }
37 41
    }
38
  }
39 42

  
40 43
    function escape_string($string)
41 44
    {
42
        if ($this->connection == null)
43
        {
45
        if ($this->connection == null) {
44 46
            $this->connection = new mysqli($this->Host, $this->User, $this->Password, $this->Database);
45 47
            $this->connection->set_charset("utf8");
46 48
        }
47 49
        return $this->connection->real_escape_string($string);
48 50
    }
49 51

  
50
  function query(string $Query_String) {
51
    /* No empty queries, please, since PHP4 chokes on them. */
52
    if ($Query_String == "")
53
      /* The empty query string is passed on from the constructor,
54
       * when calling the class without a query, e.g. in situations
55
       * like these: '$db = new DB_Sql_Subclass;'
56
       */
57
      return 0;
52
    function query(string $Query_String)
53
    {
54
        /* No empty queries, please, since PHP4 chokes on them. */
55
        if ($Query_String == "")
56
            /* The empty query string is passed on from the constructor,
57
             * when calling the class without a query, e.g. in situations
58
             * like these: '$db = new DB_Sql_Subclass;'
59
             */
60
            return 0;
58 61

  
59
    $this->connect();
62
        $this->connect();
60 63

  
61
    if ($this->Debug)
62
      printf("<br>Debug: query = %s<br>\n", $Query_String);
64
        if ($this->Debug)
65
            printf("<br>Debug: query = %s<br>\n", $Query_String);
63 66

  
64
    $this->result = $this->connection->query($Query_String);
67
        $this->result = $this->connection->query($Query_String);
65 68

  
66 69
//    if ($this->result) {
67 70
//      $this->halt("Invalid SQL: ".$Query_String);
68 71
//    }
69 72

  
70
    return $this->result;
71
  }
72

  
73
  function next_record() {
74
    $this->row = mysqli_fetch_row($this->result);
75
    return $this->row;
76
  }
77

  
78
  function metadata($table="") {
79
    $count = 0;
80
    $id    = 0;
81
    $res   = array();
82

  
83
    if (!empty($table)) {
84
       $this->connect();
85
       $id = pg_exec($this->Link_ID, "select * from $table");
86
       if ($id < 0) {
87
          $this->Error = pg_ErrorMessage($id);
88
          $this->Errno = 1;
89
          $this->halt("Metadata query failed.");
90
       }
91
    } else {
92
      $id = $this->Query_ID;
93
      if (!$id) {
94
        $this->halt("No query specified.");
95
      }
73
        return $this->result;
96 74
    }
97 75

  
98
    $count = pg_NumFields($id);
99

  
100
    for ($i=0; $i<$count; $i++) {
101
      $res[$i]["table"] = $table;
102
      $res[$i]["name"]  = pg_FieldName  ($id, $i);
103
      $res[$i]["type"]  = pg_FieldType  ($id, $i);
104
      $res[$i]["len"]   = pg_FieldSize  ($id, $i);
105
      $res[$i]["flags"] = "";
76
    function next_record()
77
    {
78
        if ($this->result==null) return false;
79
        $this->row = mysqli_fetch_array($this->result);
80
        return $this->row;
106 81
    }
107 82

  
108
    if ($table) {
109
      pg_FreeResult($id);
110
    }
83
    function metadata($table = "")
84
    {
85
        $count = 0;
86
        $id = 0;
87
        $res = array();
88

  
89
        if (!empty($table)) {
90
            $this->connect();
91
            $id = pg_exec($this->Link_ID, "select * from $table");
92
            if ($id < 0) {
93
                $this->Error = pg_ErrorMessage($id);
94
                $this->Errno = 1;
95
                $this->halt("Metadata query failed.");
96
            }
97
        } else {
98
            $id = $this->Query_ID;
99
            if (!$id) {
100
                $this->halt("No query specified.");
101
            }
102
        }
111 103

  
112
    return $res;
113
  }
104
        $count = pg_NumFields($id);
105

  
106
        for ($i = 0; $i < $count; $i++) {
107
            $res[$i]["table"] = $table;
108
            $res[$i]["name"] = pg_FieldName($id, $i);
109
            $res[$i]["type"] = pg_FieldType($id, $i);
110
            $res[$i]["len"] = pg_FieldSize($id, $i);
111
            $res[$i]["flags"] = "";
112
        }
114 113

  
115
  function affected_rows() {
116
    return $this->connection->affected_rows;
117
  }
114
        if ($table) {
115
            pg_FreeResult($id);
116
        }
118 117

  
119
  function num_rows() {
120
    if ($this->result) {
121
      return $this->result->num_rows;
122
    }else{
123
      return 0;
118
        return $res;
124 119
    }
125
  }
126 120

  
127
  function num_fields() {
128
    if ($this->result) {
129
      return $this->result->field_count;
130
    }else{
131
      return 0;
121
    function affected_rows()
122
    {
123
        return $this->connection->affected_rows;
132 124
    }
133
  }
134 125

  
135
  function f($Name) {
136
    return $this->result[$Name];
137
  }
126
    function num_rows()
127
    {
128
        if ($this->result) {
129
            return $this->result->num_rows;
130
        } else {
131
            return 0;
132
        }
133
    }
134

  
135
    function num_fields()
136
    {
137
        if ($this->result) {
138
            return $this->result->field_count;
139
        } else {
140
            return 0;
141
        }
142
    }
143

  
144
    function f($Name)
145
    {
146
        return $this->result[$Name];
147
    }
138 148

  
139
  function halt($msg) {
140
    printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
141
    printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
142
      $this->connection->errno,
143
      $this->connection->error);
149
    function halt($msg)
150
    {
151
        printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
152
        printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
153
            $this->connection->errno,
154
            $this->connection->error);
144 155
//    die("Session halted."); // potřebuju vidět errory v logu
145
  }
146

  
147
  function table_names() {
148
    $this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
149
    $i=0;
150
    while ($this->next_record())
151
     {
152
      $return[$i]["table_name"]= $this->f(0);
153
      $return[$i]["tablespace_name"]=$this->Database;
154
      $return[$i]["database"]=$this->Database;
155
      $i++;
156
     }
157
    return $return;
158
  }
156
    }
157

  
158
    function table_names()
159
    {
160
        $this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
161
        $i = 0;
162
        while ($this->next_record()) {
163
            $return[$i]["table_name"] = $this->f(0);
164
            $return[$i]["tablespace_name"] = $this->Database;
165
            $return[$i]["database"] = $this->Database;
166
            $i++;
167
        }
168
        return $return;
169
    }
159 170
}
171

  
160 172
?>
old/html/multidic/app/webroot/examination.php
1 1
<?php
2
session_start();
2
@session_start();
3 3
require_once("./functions/dictionary.php");
4 4

  
5 5
//pr($_SESSION);flush(1);
6 6

  
7 7
if (!kontrola_pristupu(1)) {
8 8
  //echo "odhlas";
9
  Header("Location: ./?hlaska=".lang('Došlo k odhlášení')."&n=".$_SESSION["ses_nick"]);
9
  Header("Location: .?hlaska=".lang('Došlo k odhlášení')."&n=".$_SESSION["ses_nick"]);
10 10
}
11 11

  
12 12
?>
......
66 66
<div id="content">
67 67
 <div class="content_home">
68 68
    <?php
69
  if ($poprve == "ano") print_hlasku(lang("Gratulujeme. <br />
69
  if (@$_GET['poprve'] == "ano"){
70
      print_hlasku(lang("Gratulujeme. <br />
70 71
            Vítejte v registrované zóně. Díky ní si budete moci při příštím zkoušení ověřit,
71 72
            zda již znáte slovíčka, která jste minule neuměli."));
73
      $_SESSION['poprve'] = 'ne';
74
  }
72 75

  
73 76
  $cesta = "./examination/";
74 77

  
75 78
  //dulezite - urcuje zda jde o learning nebo examination
76
  $learning = (strstr($nav_id, 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
79
  $learning = (strstr(@$_REQUEST['nav_id'], 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
77 80

  
78 81
   //echo $nav_id;
79 82

  
80
  switch($_REQUEST['nav_id']) {
83
  switch(@$_REQUEST['nav_id']) {
81 84
    case("new_learning") :
82 85
    case("new_exam") :
83 86
      require_once($cesta."new_exam.php");
old/html/multidic/app/webroot/examination/article.php
236 236
  $radky = $spojeni->query($dotaz);
237 237
  $spojeni->next_record();
238 238

  
239
  if ($spojeni->Errno != 0) {
239
  if ($spojeni->connection->errno != 0) {
240 240
    print_hlasku("Slovo se nepodařilo načíst.");
241 241
  }
242 242

  
old/html/multidic/app/webroot/examination/do_exam.php
4 4
<?php
5 5
require_once("./examination/exam.php");
6 6

  
7
if (!Empty($action) && $action == "do_exam") {
7
if (!Empty(@$_REQUEST['action']) && @$_REQUEST['action'] == "do_exam") {
8 8
  //zavolat funkci, ktera otestuje zda je to dobre
9 9
  //podle toho nastavi priznakove bity
10 10

  
11
  $navrat = exam_word($IDdict, $IDexam, $type, $to);
11
  $navrat = exam_word(@$_REQUEST['IDdict'], @$_REQUEST['IDexam'], @$_REQUEST['type'], @$_REQUEST['to']);
12 12

  
13 13
  if ($navrat != NULL) {
14 14

  
15
    print_hlasku(sprintf(lang("Je mi líto, ale vaše odpověď '%s' není správná."), $to ));
15
    print_hlasku(sprintf(lang("Je mi líto, ale vaše odpověď '%s' není správná."), @$_REQUEST['to'] ));
16 16
    print_hlasku(lang("Slovo bylo:"));
17 17

  
18 18
    echo __get_word_in_card_format($navrat);
......
21 21
    print_hlasku(lang("Správně"));
22 22
  }
23 23
}
24
else if (!Empty($action) && $action == "do_learning") {
24
else if (!Empty(@$_REQUEST['action']) && @$_REQUEST['action'] == "do_learning") {
25 25
  if (!Empty( $sub_button ) && $sub_button == lang("Uměl")) {
26
    set_exam_status($IDexam, 1);
26
    set_exam_status(@$_REQUEST['IDexam'], 1);
27 27
    //echo "1";
28 28
  }
29 29
  else {
30
    set_exam_status($IDexam, 0);
30
    set_exam_status(@$_REQUEST['IDexam'], 0);
31 31
    //echo "0";
32 32
  }
33 33
}
34
$slovicko = get_exam_word($examing, $step);
34
$slovicko = get_exam_word(@$_REQUEST['examing'], @$_REQUEST['step']);
35 35

  
36 36
if ($slovicko == NULL) {
37 37
  //ukoncit zkouseni
38 38
  //tj. uklidit spravne zodpovezene polozky nastavit rating.
39 39
  //vypsat hlasku...
40 40

  
41
  $pocet_slov = get_pocet_slov_ve_zkouseni($examing);
42
  $pocet_spatnych_slov = get_pocet_spatnych_slov($examing);
41
  $pocet_slov = get_pocet_slov_ve_zkouseni(@$_REQUEST['examing']);
42
  $pocet_spatnych_slov = get_pocet_spatnych_slov(@$_REQUEST['examing']);
43 43
  $pocet_spravnych_slov = $pocet_slov - $pocet_spatnych_slov;
44 44
  $rating = ($pocet_spravnych_slov / $pocet_slov) * 100;
45 45

  
......
48 48
                       $pocet_slov, $rating));
49 49

  
50 50
  print_hlasku(get_vyslednou_hlasku($rating));
51
  uklid($examing, $rating);
51
  uklid(@$_REQUEST['examing'], $rating);
52 52
  exit;
53 53
}
54 54

  
......
97 97
  </script>
98 98
<?php } //end if ?>
99 99

  
100
<?php if ($type == "to_cz" || $type == "to_en") :?>
100
<?php if (@$_REQUEST['type'] == "to_cz" || @$_REQUEST['type'] == "to_en") :?>
101 101

  
102 102
  <table>
103 103
    <thead align="center"> <h3 class="nadpis2"><?php echo lang("Přeložte:") ?></h3> </thead>
......
130 130
        <td>
131 131
          <input type="hidden" name="IDdict" value="<?php echo $slovicko["IDdict"] ?>">
132 132
          <input type="hidden" name="IDexam" value="<?php echo $slovicko["IDexam"] ?>">
133
          <input type="hidden" name="examing" value="<?php echo $examing ?>">
134
          <input type="hidden" name="type" value="<?php echo $type ?>">
133
          <input type="hidden" name="examing" value="<?php echo @$_REQUEST['examing'] ?>">
134
          <input type="hidden" name="type" value="<?php echo @$_REQUEST['type'] ?>">
135 135
        <?php if ($learning != 'TRUE') { ?>
136 136
          <input type="hidden" name="action" value="do_exam">
137 137
          <input type="submit" value="<?php echo lang("Dál") ?>">
......
162 162
    <form action="" method="POST" name="do_exam_form">
163 163
      <tr class="akt">
164 164
        <td><?php echo lang("Originál:") ?></td>
165
        <td><?php echo (($type == "from_cz") ? $slovicko["czech"]:$slovicko["english"]) ?></td>
165
        <td><?php echo ((@$_REQUEST['type'] == "from_cz") ? $slovicko["czech"]:$slovicko["english"]) ?></td>
166 166
      </tr>
167 167
      <tr class="akt">
168 168
        <td><?php echo lang("Překlad:") ?></td>
......
186 186
        <td>
187 187
          <input type="hidden" name="IDdict" value="<?php echo $slovicko["IDdict"] ?>">
188 188
          <input type="hidden" name="IDexam" value="<?php echo $slovicko["IDexam"] ?>">
189
          <input type="hidden" name="examing" value="<?php echo $examing ?>">
190
          <input type="hidden" name="type" value="<?php echo $type ?>">
189
          <input type="hidden" name="examing" value="<?php echo @$_REQUEST['examing'] ?>">
190
          <input type="hidden" name="type" value="<?php echo @$_REQUEST['type'] ?>">
191 191
          <?php if ($learning != 'TRUE') { ?>
192 192
          <input type="hidden" name="action" value="do_exam">
193 193
          <input type="submit" value="<?php echo lang("Dál") ?>">
old/html/multidic/app/webroot/examination/exam.php
6 6
  $spojeni = new DB_Sql();
7 7
  //vybereme exam
8 8
  $dotaz = "SELECT count FROM examing
9
              WHERE \"IDexaming\" = '$examing'";
9
              WHERE IDexaming = '$examing'";
10 10
  $spojeni->query($dotaz);
11 11
  $spojeni->next_record();
12
  return $spojeni->Record["count"];
12
  return $spojeni->row["count"];
13 13
}
14 14

  
15 15
function get_pocet_spatnych_slov($examing) {
......
27 27
  require_once("./classes/db.php");
28 28
  $spojeni = new DB_Sql();
29 29

  
30
  $dotaz = "INSERT INTO examing (\"user\", date, rating, source, count, type, lection, learning)
30
  $dotaz = "INSERT INTO examing (user, date, rating, source, count, type, lection, learning)
31 31
            VALUES ('$user', 'NOW', -1, '$source', '$count', '$type', '$lection', '$learning')";
32
  $spojeni->query($dotaz);
33
  if ($spojeni->Errno != 0) {
32
  $result = $spojeni->query($dotaz);
33
  if ($spojeni->connection->errno != 0) {
34 34
    print_hlasku(lang("Chyba při vytváření zkoušení."));
35 35
    return NULL;
36 36
  }
37
  $dotaz = "SELECT currval('examing_id_seq')";
38
  $spojeni->query($dotaz);
39 37

  
40
  if ($spojeni->Errno != 0) {
41
    print_hlasku(lang("Chyba při vytváření zkoušení."));
42
    return NULL;
43
  }
44
  $spojeni->next_record();
45
  return $spojeni->Record["currval"];
38
  return $spojeni->connection->insert_id;
46 39
}
47 40

  
48 41
function words_to_repeat($source, $lection, $user) {
......
50 43
  $spojeni = new DB_Sql();
51 44
  $dotaz = "SELECT *
52 45
            FROM exam e, examing ex
53
            WHERE e.examing = ex.\"IDexaming\"
46
            WHERE e.examing = ex.IDexaming
54 47
              AND ex.source = '$source'
55
              AND ex.\"user\" = '$user'
48
              AND ex.user = '$user'
56 49
              AND ex.lection = '$lection'
57 50
              AND e.status = 0";
58 51
  $spojeni->query($dotaz);
59
  if ($spojeni->Errno != 0) {
52

  
53
  if ($spojeni->connection->errno != 0) {
60 54
    print_hlasku(lang("Chyba při vytváření zkoušení."));
61 55
    return NULL;
62 56
  }
......
78 72
      $dotaz = "UPDATE exam
79 73
                SET examing = $new_examing,
80 74
                    status = NULL
81
                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
75
                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
82 76
      $spojeni->query($dotaz);
83 77
    }
84 78
  }
......
88 82
      $dotaz = "UPDATE exam
89 83
                SET examing = $new_examing,
90 84
                    status = NULL
91
                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
85
                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
92 86
      $spojeni->query($dotaz);
93 87
    }
94 88
    while ($spojeni_k_opakovani->next_record()) {
95 89
      $dotaz = "DELETE FROM exam
96
                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
90
                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
97 91
      $spojeni->query($dotaz);
98 92
    }
99 93
  }
......
103 97
      $dotaz = "UPDATE exam
104 98
                SET examing = $new_examing,
105 99
                    status = NULL
106
                WHERE \"IDexam\" = ".$spojeni_k_opakovani->Record["IDexam"];
100
                WHERE IDexam = ".$spojeni_k_opakovani->row["IDexam"];
107 101
      $spojeni->query($dotaz);
108 102
      //tohle se pouzije az dale
109
      $pomoc .= " AND NOT \"IDdict\" = ".$spojeni_k_opakovani->Record["dict"];
103
      $pomoc .= " AND NOT IDdict = ".$spojeni_k_opakovani->row["dict"];
110 104
    }
111 105
    $dotaz = "SELECT *
112 106
              FROM dict
113 107
              WHERE source = '$source' AND
114 108
                    lection = '$lection'";
115 109
    $dotaz .= $pomoc;
116
    $dotaz .= " ORDER BY random()
110
    $dotaz .= " ORDER BY RAND()
117 111
                LIMIT ".($count-$pocet_k_opakovani);
118 112
    $spojeni->query($dotaz);
119
    if ($spojeni->Errno != 0) {
113

  
114
    if ($spojeni->connection->errno != 0) {
120 115
      print_hlasku(lang("Chyba při vytváření zkoušení."));
121 116
      return NULL;
122 117
    }
......
125 120
    while ($spojeni->next_record()) {
126 121
      //echo($spojeni->Record["czech"] . "<br />\n");
127 122
      $dotaz = "INSERT INTO exam (examing, status, dict)
128
                       VALUES ('$new_examing', NULL, ".$spojeni->Record["IDdict"].")";
123
                       VALUES ('$new_examing', NULL, ".$spojeni->row["IDdict"].")";
129 124
      $spojeni_na_vkladani->query($dotaz);
130
      if ($spojeni_na_vkladani->Errno != 0) {
125
      if ($spojeni_na_vkladani->connection->errno != 0) {
131 126
        print_hlasku(lang("Chyba při vytváření zkoušení."));
132 127
        return NULL;
133 128
      }
......
140 135
  require_once("./classes/db.php");
141 136
  $spojeni = new DB_Sql();
142 137
  //vybereme exam
143
  $dotaz = "SELECT e.\"IDexam\", d.* FROM exam e, dict d
138
  $dotaz = "SELECT e.IDexam, d.* FROM exam e, dict d
144 139
              WHERE e.examing = '$examing'
145 140
              	AND e.status is NULL
146
              	AND e.dict = d.\"IDdict\"
147
              ORDER BY random()
141
              	AND e.dict = d.IDdict
142
              ORDER BY RAND()
148 143
              LIMIT 1";
149 144
  $spojeni->query($dotaz);
150
  if ($spojeni->Errno != 0) {
145
  if ($spojeni->connection->errno != 0) {
151 146
    print_hlasku(lang("Chyba při zkoušení."));
152 147
    return NULL;
153 148
  }
......
156 151
  }
157 152

  
158 153
  $spojeni->next_record();
159
  return $spojeni->Record;
154
  return $spojeni->row;
160 155
}
161 156

  
162 157
function exam_word($IDdict, $IDexam, $type, $to) {
......
166 161
  
167 162
  $spojeni = new DB_Sql();
168 163
  $dotaz = "SELECT * FROM dict
169
            WHERE \"IDdict\" = '$IDdict'";
164
            WHERE IDdict = '$IDdict'";
170 165

  
171 166
  if(empty($to)) {
172 167
    $dotaz .= " AND 1 = 0 ";
......
174 169
  switch ($type) {
175 170
    case ("to_cz"):
176 171
    	$word = mb_strtolower($to, "UTF-8");
177
        $word = get_token_regexp($word); 
178
      $dotaz .= " AND lower(czech) ~ ('$word')";
172
      $dotaz .= " AND lower(czech) = ('$word')";
179 173
    break;
180 174
    case("to_en"):
181 175
    	$word = mb_strtolower($to, "UTF-8");
182
        $word = get_token_regexp($word);
183 176
      $dotaz .= " AND lower(english) = ('$word')";
184 177
    break;
185 178
    case("from_cz"):
186 179
    case("from_en"):
187 180
      $to = hebrew_add_vowel($to);
188
      $to = get_token_regexp($to);
189 181
      /*
190 182
      SELECT * FROM dict
191 183
            WHERE language = $language AND
......
193 185
                   (past    ~ ('$word')) OR
194 186
                   (valence ~ ('$word')))
195 187
                   */
196
      $dotaz .= " AND ((present ~ ('$to')) OR
197
                   (past    ~ ('$to')) OR
198
                   (valence ~ ('$to')))";
188
      $dotaz .= " AND ((present = ('$to')) OR
189
                   (past    = ('$to')) OR
190
                   (valence = ('$to')))";
199 191
    break;
200 192
    default:
201 193
      echo lang("Chyba");
......
221 213

  
222 214
  require_once("./classes/db.php");
223 215
  $spojeni = new DB_Sql();
224
  $dotaz = "UPDATE exam SET status = $status WHERE \"IDexam\" = '$IDexam'";
216
  $dotaz = "UPDATE exam SET status = $status WHERE IDexam = '$IDexam'";
225 217
  $spojeni->query($dotaz);
226
  if ($spojeni->Errno != 0) {
218
  if ($spojeni->connection->errno != 0) {
227 219
    print_hlasku(lang("Chyba při zkoušení."));
228 220
  }
229 221
}
......
234 226
  $dotaz = "DELETE FROM exam WHERE examing = '$examing'
235 227
                             AND status = 1";
236 228
  $spojeni->query($dotaz);
237
  if ($spojeni->Errno != 0) {
229
  if ($spojeni->connection->errno != 0) {
238 230
    print_hlasku(lang("Chyba při zkoušení."));
239 231
  }
240
  $dotaz = "UPDATE examing SET rating = $rating WHERE \"IDexaming\" = '$examing'";
232
  $dotaz = "UPDATE examing SET rating = $rating WHERE IDexaming = '$examing'";
241 233
  $spojeni->query($dotaz);
242 234
}
243 235

  
244 236
function delete_exam($IDexam) {
245 237
  require_once("./classes/db.php");
246 238
  $spojeni = new DB_Sql();
247
  $dotaz = "DELETE FROM exam WHERE \"IDexam\" = '$IDexam'";
239
  $dotaz = "DELETE FROM exam WHERE IDexam = '$IDexam'";
248 240
  $spojeni->query($dotaz);
249
  if ($spojeni->Errno != 0) {
241
  if ($spojeni->connection->errno != 0) {
250 242
    print_hlasku(lang("Chyba při zkoušení."));
251 243
  }
252 244
}
......
277 269
 *  @return do tabulky zformatovany zaznam
278 270
 */
279 271
function get_row_of_table_examing($learning, $Record) {
272
  $navrat = "";
280 273
  $navrat .= "<tr class=\"akt\">\n     ";
281 274
  $navrat .= '<td>'.$Record["date"].'</td>';
282 275
  $pomoc = ($learning == 'TRUE')? 'learning' : 'exam';
......
368 361

  
369 362

  
370 363
function print_table_of_examing($learning, $order = "IDexaming", $od = 0, $limit = 30) {
371
  global $ses_IDuser;
364

  
365
  $ses_IDuser = $_SESSION['ses_IDuser'];
372 366
  require_once("./classes/db.php");
373 367
  $spojeni = new DB_Sql();
374 368
  $dotaz = "SELECT s.title, e.* FROM examing e";
375
  $dotaz .= " LEFT OUTER JOIN source s ON (e.source = s.\"IDsource\")";
376
  $dotaz .= " WHERE e.\"user\" = $ses_IDuser AND e.learning = $learning";
377
  $dotaz .= " ORDER BY \"$order\" OFFSET $od LIMIT $limit";
369
  $dotaz .= " LEFT OUTER JOIN source s ON (e.source = s.IDsource)";
370
  $dotaz .= " WHERE e.user = $ses_IDuser AND e.learning = $learning";
371
  $dotaz .= " ORDER BY $order LIMIT $limit OFFSET $od";
378 372
  $spojeni->query($dotaz);
379 373
  $navrat = "<h3 class=\"nadpis2\">".lang("Výpis zkoušení")."</h3>";
380 374
  $navrat .= get_razeni_of_table_examing($order, $od, $limit);
381 375
  $navrat .= "<table><form action=\"\" method=\"post\">";
382 376
  $navrat .= get_header_of_table_examing();
377

  
383 378
  while ($spojeni->next_record()) {
384
    $navrat .= get_row_of_table_examing($learning, $spojeni->Record);
379
    $navrat .= get_row_of_table_examing($learning, $spojeni->row);
385 380
  }
386 381
  $navrat .= get_foot_of_table_examing();
387 382
  $navrat .= '';
......
402 397
  //echo $dotaz;
403 398
  $spojeni->query($dotaz);
404 399
  $spojeni->next_record();
405
  return $spojeni->Record[0];
400
  return $spojeni->row[0];
406 401
}
407 402
 /*
408 403

  
old/html/multidic/app/webroot/examination/list_exam.php
20 20
}
21 21
*/
22 22

  
23
$learning = (strstr($nav_id, 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
23
$learning = (strstr(@$_REQUEST['nav_id'], 'learning') != NULL ) ? 'TRUE' : 'FALSE' ;
24 24

  
25
if (!Empty($serad)) {
26
  print_table_of_examing($learning, $order, $od, $limit);
25
if (!Empty(@$_REQUEST['serad'])) {
26
  print_table_of_examing($learning, @$_REQUEST['order'], @$_REQUEST['od'], @$_REQUEST['limit']);
27 27
}
28 28
else {
29 29
  print_table_of_examing($learning);
old/html/multidic/app/webroot/examination/new_exam.php
1 1
<?php
2 2
require_once("./examination/exam.php");
3 3

  
4
if (Empty($source) || $source == "") {
4
if (empty(@$_REQUEST['source']) || @$_REQUEST['source'] == "") {
5 5
  $krok = 0;
6 6
}
7
else if (Empty($lection) || $lection == "") {
7
else if (Empty(@$_REQUEST['lection']) || @$_REQUEST['lection'] == "") {
8 8
  $krok = 1;
9 9
}
10
else if (Empty($count) || $count == "" || Empty($type)) {
10
else if (Empty(@$_REQUEST['count']) || @$_REQUEST['count'] == "" || Empty(@$_REQUEST['type'])) {
11 11
  $krok = 2;
12 12
}
13 13
else {
......
16 16
//echo $krok;
17 17

  
18 18
switch ($krok) {
19
  case (0):  
19
  case (0):
20 20
?>
21

  
21 22
  <table>
22 23
    <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>
23 24
    <tbody>
......
36 37
    </tbody>
37 38
  </table>
38 39
  <script language="javascript">
39
				<!--
40
					var chooser = document.choose_source_form.source;
41
  				chooser.focus();
42
				-->
40

  
41
					// var chooser = document.choose_source_form.source;
42
  				// chooser.focus();
43

  
43 44
  </script>
44 45

  
45 46
<?php
......
52 53
    <table border="0">
53 54
    <form action="" method="POST" name="choose_lection_form">
54 55
      <tr class="akt">
55
        <td><?php echo $language;
56
        echo(get_lection_chooser($source, 10))?></td>
56
        <td><?php
57
        echo(get_lection_chooser(@$_REQUEST['source'], 10))?></td>
57 58
      </tr>
58 59
      <tr class="nadpis_sekce">
59 60
        <td>
60 61
          <input type="hidden" name="action" value="select_lection">
61
          <input type="hidden" name="source" value="<?php echo $source ?>">
62
          <input type="hidden" name="source" value="<?php echo @$_REQUEST['source'] ?>">
62 63
          <input type="submit" value="<?php echo lang("Dál") ?>">
63 64
        </td>
64 65
      </tr>
......
76 77
    <table border="0">
77 78
    <form action="" method="POST" name="choose_count_form">
78 79
      <tr class="">
79
        <td><?php echo(get_count_chooser($source, $lection))?></td>
80
        <td><?php echo(get_count_chooser(@$_REQUEST['source'], @$_REQUEST['lection']))?></td>
80 81
      </tr>
81 82
      <tr class="">
82 83
        <td>
......
96 97
      <tr class="nadpis_sekce">
97 98
        <td>
98 99
          <input type="hidden" name="action" value="select_count">
99
          <input type="hidden" name="lection" value="<?php echo $lection ?>">
100
          <input type="hidden" name="source" value="<?php echo $source ?>">
100
          <input type="hidden" name="lection" value="<?php echo @$_REQUEST['lection'] ?>">
101
          <input type="hidden" name="source" value="<?php echo @$_REQUEST['source'] ?>">
101 102
          <input type="submit" value="<?php echo lang("Dál") ?>">
102 103
        </td>
103 104
      </tr>
......
108 109
<?php
109 110
  break;
110 111
  case (3):
111
  $IDexaming = create_examing($ses_IDuser, $source, $lection, $count, $type, $learning);
112
  $IDexaming = create_examing($_SESSION['ses_IDuser'], @$_REQUEST['source'], @$_REQUEST['lection'], @$_REQUEST['count'], @$_REQUEST['type'], @$_REQUEST['learning']);
112 113
  
113
  $pomoc = ($learning == 'TRUE')? 'learning' : 'exam';
114
  $pomoc = (@$_REQUEST['learning'] == 'TRUE')? 'learning' : 'exam';
114 115
?>
115 116
<h3 class="nadpis2"><?php echo lang("Zkoušení vytvořeno") ?></h3>
116 117
<a href="?nav_id=do_<?php 
......
118 119
                 ?>&examing=<?php 
119 120
                 echo $IDexaming
120 121
                 ?>&type=<?php 
121
                 echo $type?>"
122
                 echo @$_REQUEST['type']?>"
122 123
   class="velkybutton"><?php echo lang("Začít")?></a>
123 124
<?php
124 125
}
old/html/multidic/app/webroot/functions/dictionary.php
1 1
<?php
2 2
mb_internal_encoding('UTF-8');
3
session_start();
3
@session_start();
4 4

  
5 5
require_once("./classes/db.php");
6 6
require_once "./functions/new_hebrew_format.php";
......
54 54
            "and pass = '" . $DB->escape_string($heslo) . "'");//, array($jmeno, $heslo) );
55 55
        if ($DB->num_rows() != 1)
56 56
            return false;
57
        session_regenerate_id();
58
        $_SESSION['ses_nick'] = $DB->Record['nick'];
59
        $_SESSION['ses_IDuser'] = $DB->Record['IDuser'];
57

  
58
        $result = $result->fetch_assoc();
59
        $_SESSION = array();
60
        $_SESSION['ses_nick'] = $result['nick'];
61
        $_SESSION['ses_IDuser'] = $result['IDuser'];
60 62
        $_SESSION['ses_date_last_visit'] = time();
61
        $_SESSION['ses_level'] = $DB->Record['privileges'];
62
        $_SESSION['ses_name'] = $DB->Record['name'];
63
        $_SESSION['ses_surname'] = $DB->Record['surname'];
63
        $_SESSION['ses_level'] = $result['privileges'];
64
        $_SESSION['ses_name'] = $result['name'];
65
        $_SESSION['ses_surname'] = $result['surname'];
... Rozdílový soubor je zkrácen, protože jeho délka přesahuje max. limit.

Také k dispozici: Unified diff