Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5eb74cd6

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

Re #7580 osobní sféra - články

Zobrazit rozdíly:

old/html/multidic/app/webroot/administration/article.php
242 242
    $dotaz .= "AND lection = '$contrains_lection'";
243 243

  
244 244

  
245
  $dotaz .= " ORDER BY \"$order\" OFFSET $od LIMIT $limit";
245
  $dotaz .= " ORDER BY $order LIMIT $limit OFFSET $od";
246 246

  
247 247
  $radky = $spojeni->query($dotaz);
248 248

  
249 249
  while ($spojeni->next_record()) {
250
    $navrat .= get_row_of_table($spojeni->Record);
250
    $navrat .= get_row_of_table($spojeni->row);
251 251
  }
252 252
  $navrat .= get_foot_of_table();
253 253
  $navrat .= "</table>";
old/html/multidic/app/webroot/administration/list_article.php
5 5
else
6 6
  require_once("./administration/article.php");
7 7

  
8
if (Empty($language)) :
9 8

  
9
if (Empty(@$_REQUEST['language'])) :
10 10

  
11 11
?>
12 12
  <p>Vyberte jazyk:</p>
13 13
  <p>
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 />
14
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=1">arabský</a><br />
15
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=2">hebrejský</a><br />
16
    <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=3">akkadský</a><br /><br />
17 17

  
18 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

  
22
elseif ($language != "all" && Empty($contrains_source)):
22
elseif (@$_REQUEST['language'] != "all" && Empty(@$_REQUEST['contrains_source'])):
23 23
?>
24 24
  <p>Vyberte zdroj:</p>
25 25
  <p><form method="post">
26 26

  
27 27
     <?php
28
echo get_source_chooser($language, "contrains_source");
28
echo get_source_chooser(@$_REQUEST['language'], "contrains_source");
29 29
?>
30 30
     <input type="submit" value="Dál" />
31 31
     </form>
32
   <br /> <a href="?nav_id=<?php echo @$_REQUEST['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 @$_REQUEST['language']?>&contrains_source=all&contrains_lection=all">všechny</a>
33 33
  </p>
34 34
<?php
35
elseif ($language != "all" && $contrains_source != "all" && Empty($contrains_lection)):
35
elseif (@$_REQUEST['language'] != "all" && @$_REQUEST['contrains_source'] != "all" && Empty(@$_REQUEST['contrains_lection'])):
36 36
?>
37 37
  <p>Vyberte lekci:</p>
38 38
  <p><form method="post">
39 39

  
40 40
     <?php
41
echo get_lection_chooser_article($contrains_source, 1, "contrains_lection");
41
echo get_lection_chooser_article(@$_REQUEST['contrains_source'], 1, "contrains_lection");
42 42
?>
43 43
     <input type="submit" value="Dál" />
44
     <input type="hidden" name="contrains_source" value="<?php echo $contrains_source?>" title="Dál" />
44
     <input type="hidden" name="contrains_source" value="<?php echo @$_REQUEST['contrains_source']?>" title="Dál" />
45 45
     </form>
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>
46
   <br /> <a href="?nav_id=<?php echo @$_REQUEST['nav_id']?>&language=<?php echo @$_REQUEST['language']?>&contrains_source=<?php echo @$_REQUEST['contrains_source']?>&contrains_lection=all">všechny</a>
47 47
  </p>
48 48
<?php
49 49
else :
50 50
//obsluha mazani slovicek
51
if (!Empty($action) && $action == "delete_article") {
52
  if (delete_article($article_id))
51
if (!Empty(@$_REQUEST['action']) && @$_REQUEST['action'] == "delete_article") {
52
  if (delete_article(@$_REQUEST['article_id']))
53 53
    print_hlasku("Článek smazán.");
54 54
  else
55 55
    print_hlasku("Článek se nepodařilo smazat");
......
69 69
  else
70 70
    print_hlasku("Bohužel,$coun_false článků se nepodařilo smazat ($coun_true se podařilo smazat)");*/
71 71
}
72

  
73 72
//obsluha autorizace slovicka
74
if (!Empty($nav_id) && $nav_id == "autorize_article") {
75 73

  
76
  if (authorize_article($article_id))
74
if (!Empty(@$_REQUEST['nav_id']) && @$_REQUEST['nav_id'] == "autorize_article") {
75

  
76
  if (authorize_article(@$_REQUEST['article_id']))
77 77
    print_hlasku("Článek autorizován.");
78 78
  else
79 79
    print_hlasku("Bohužel, článek se nepodařilo autorizovat.");
80 80
}
81 81

  
82
if ($nav_id == "list_article") $pomocna = false;
83
else if ($nav_id == "list_nonauthorized_article") $pomocna = true;
84
else  $pomocna = ($nonauthorized == true);
82
if (@$_REQUEST['nav_id'] == "list_article") $pomocna = false;
83
else if (@$_REQUEST['nav_id'] == "list_nonauthorized_article") $pomocna = true;
84
else  $pomocna = (@$_REQUEST['nonauthorized'] == true);
85 85
//pr($nav_id);
86 86
//vypis
87
if (!Empty($serad)) {
88
    print_table_of_article($language, $contrains_source, $contrains_lection,$pomocna, $order, $od, $limit);
87

  
88
if (!Empty(@$_REQUEST['serad'])) {
89
    print_table_of_article(@$_REQUEST['language'], @$_REQUEST['contrains_source'], @$_REQUEST['contrains_lection'], $pomocna, @$_REQUEST['order'], @$_REQUEST['od'], @$_REQUEST['limit']);
89 90
}
90 91
else {
91
  print_table_of_article($language, $contrains_source, $contrains_lection, $pomocna);
92
  print_table_of_article(@$_REQUEST['language'], @$_REQUEST['contrains_source'], @$_REQUEST['contrains_lection'], $pomocna);
92 93
}
93 94

  
94 95
endif;
old/html/multidic/app/webroot/examination/article.php
23 23

  
24 24
  $nav_str = "language=$language&contrains_source=$contrains_source&contrains_lection=$contrains_lection";
25 25

  
26
  $navrat = "";
26 27
  $navrat .= "  <tr class=\"akt\">";
27 28
  $navrat .= "\n    <td>  ".$Record['language']." </td>";
28 29
  $navrat .= "\n    <td>  ".$Record['source']."</td>";
......
140 141
            FROM article ar, language lan, source so";
141 142

  
142 143
  if ($language != "all")
143
    $dotaz .= " WHERE ar.language LIKE '$language' ";
144
    $dotaz .= " WHERE ar.language LIKE '$language'";
144 145
  else
145 146
    $dotaz .= " WHERE TRUE ";
146 147

  
147 148
  if ($contrains_source != "all")
148
    $dotaz .= "AND ar.source = $contrains_source";
149
    $dotaz .= " AND ar.source = '$contrains_source'";
149 150
  if ($contrains_lection != "all")
150
    $dotaz .= "AND ar.lection = $contrains_lection";
151
    $dotaz .= " AND ar.lection = '$contrains_lection'";
151 152

  
152 153
  $dotaz .= " AND ar.language = lan.IDlanguage
153 154
              AND ar.source   = so.IDsource ";
......
185 186
 *
186 187
 */
187 188
function print_table_of_article($language = "all", $contrains_source = "all", $contrains_lection = "all",
189
                          $nonauthorized = false,
188 190
                          $order = "IDarticle", $od = 0, $limit = 30) {
189 191

  
190 192
  require_once("./classes/db.php");
......
205 207
  $navrat .= get_header_of_table();
206 208

  
207 209
  $dotaz = build_query_article($language, $contrains_source, $contrains_lection,$order, $od, $limit);
208
    //echo "dotaz: ".$dotaz;
210

  
211
  //echo "dotaz: ".$dotaz;
209 212
  $radky = $spojeni->query($dotaz);
210 213

  
211 214
  while ($spojeni->next_record()) {
212
    $navrat .= get_row_of_table($spojeni->Record);
215
    $navrat .= get_row_of_table($spojeni->row);
213 216
  }
214 217
  $navrat .= get_foot_of_table();
215 218
  $navrat .= "</table>";
......
217 220
}
218 221

  
219 222
function get_article($id) {
223

  
220 224
  require_once("./classes/db.php");
221 225
  $spojeni = new DB_Sql();
222
  $dotaz = "SELECT DISTINCT ON (ar.\"IDarticle\")
223
                         ar.\"IDarticle\"  as \"IDarticle\",
226
  $dotaz = "SELECT DISTINCT
227
                         ar.IDarticle  as IDarticle,
224 228
                         ar.title          as title,
225 229
                         ar.body           as body,
226 230
                         ar.note           as note,
......
228 232
                         lan.language      as language,
229 233
                         so.title          as source,
230 234
                         ar.lection        as lection,
231
                         ar.source         as \"IDsource\"
235
                         ar.source         as IDsource
232 236
             FROM article ar, language lan, source so
233
             WHERE \"IDarticle\" = '$id'
234
              AND ar.language = lan.\"IDlanguage\"
235
              AND ar.source   = so.\"IDsource\" ";
237
             WHERE IDarticle = '$id'
238
              AND ar.language = lan.IDlanguage
239
              AND ar.source   = so.IDsource ";
236 240
  $radky = $spojeni->query($dotaz);
237 241
  $spojeni->next_record();
238 242

  
......
240 244
    print_hlasku("Slovo se nepodařilo načíst.");
241 245
  }
242 246

  
243
  return $spojeni->Record;
247
  return $spojeni->row;
244 248
}
245 249

  
246 250

  
old/html/multidic/app/webroot/examination/detail_article.php
1 1
<?php
2 2
require_once("./examination/article.php");
3 3

  
4
$article = get_article($article_id);
4
$article = get_article(@$_REQUEST['article_id']);
5 5

  
6 6
?>
7 7
<h4>Detail článku</h4>
old/html/multidic/app/webroot/functions/dictionary.php
425 425

  
426 426
function get_lection_chooser_article($source, $size = 1, $nazev = "lection")
427 427
{
428
    $cisla = array();
429
    $hodnoty = array();
428 430
    require_once("./classes/db.php");
429 431
    $spojeni = new DB_Sql();
430 432
    $dotaz = "SELECT lection FROM article WHERE source = '$source' GROUP BY lection ORDER BY lection ";
......
432 434
    $navrat = "<select name=\"$nazev\" size=\"$size\">";
433 435
    $i = 0;
434 436
    while ($spojeni->next_record()) {
435
        $cisla[$i] = 0 + ($spojeni->Record["lection"]);
436
        $hodnoty[$i] = $spojeni->Record["lection"];
437
        $cisla[$i] = 0 + ($spojeni->row["lection"]);
438
        $hodnoty[$i] = $spojeni->row["lection"];
437 439
        $i++;
438 440
    }
439 441
    if (count($cisla) <= 0) {

Také k dispozici: Unified diff