Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
    $self = basename( $PHP_SELF );
3
    $tab = "lexikon";
4
    define( "modul_name", "Lexikon" );
5
    define( "tool_name", "lexikon" );
6
    require_once  "../Online-Shop/connect2.php";
7
    require_once "../Online-Shop/language_pack.php";
8
 
9
    session_start();
10
    if ( !$_SESSION[language] )
11
    {
12
        $_SESSION[language] = "DE";
13
    }
14
 
15
    // $charset laden um die jeweiligen ISO-Zeichensätzte zu laden.
16
    require_once  "../Online-Shop/charset.php";
17
 
18
    if ( $action == "update" )
19
    {
20
        if ( !$ID )
21
        { // insert Dummy-Entry
22
            $query = "insert into $tab (erstellt_am,erstellt_von) VALUES (NOW(),'$PHP_AUTH_USER')";
23
            if ( isset( $user_rechte[modul_name][tool_name]["language"] ) )
24
            {
25
                $query = "insert into $tab (language,erstellt_am,erstellt_von) VALUES ('$_SESSION[language]',NOW(),'$PHP_AUTH_USER')";
26
            }
27
            $result = mysql_query( $query ) or die( mysql_errno() . ": " .
28
                mysql_error() . "<hr>" . $query . "<hr>" );
29
            $ID = mysql_insert_id();
30
        }
31
 
32
        // Übersetzungen sind eigentlich updates
33
        // Verfahren für Einträge die nicht "DE" sind
34
        if ( $_SESSION[language] != "DE" )
35
        {
36
            // überprüfe ob der Eintrag schon übersetzt wurde
37
            $query = "select * from $tab where ID = '$ID' and language = '$_SESSION[language]'";
38
            $result = mysql_query( $query ) or die( mysql_errno() . ": " .
39
                mysql_error() . "<hr>" . $query . "<hr>" );
40
            if ( mysql_num_rows( $result ) == 0 )
41
            {
42
                // Eintrag wurde noch nicht übersetzt neuen Dummy in der entsprechenden Sprache erzeugen
43
                $query = "insert into $tab (ID,language,erstellt_am,erstellt_von) VALUES ($ID,'$_SESSION[language]',NOW(),'$PHP_AUTH_USER')";
44
                $result = mysql_query( $query ) or die( mysql_errno() . ": " .
45
                    mysql_error() . "<hr>" . $query . "<hr>" );
46
            }
47
            // Der Eintrag für die Sprache wurde erzeugt.
48
        }
49
 
50
        unset( $HTTP_POST_VARS[action] );
51
        unset( $HTTP_POST_VARS[ID] );
52
 
53
        foreach ( array_keys( $HTTP_POST_VARS ) as $elem )
54
        {
55
            if ( $elem[0] == "_" )
56
            {
57
                unset( $HTTP_POST_VARS[$elem] );
58
                $button = $$elem;
59
                $elem = substr( $elem, 1 );
60
                $Pfad = $HTTP_POST_VARS[$elem . "_Pfad"];
61
                unset( $HTTP_POST_VARS[$elem . "_Pfad"] );
62
                $image = $$elem;
63
                $image_name = $elem . "_name";
64
                $image_name = urlencode( $$image_name );
65
                switch ( $button )
66
                {
67
                    case 0:
68
                        break;
69
                    case 1:
70
                        $HTTP_POST_VARS[$elem] = '';
71
                        break;
72
                    case 2:
73
                        //$image_name=$ID."_".$image_name;
74
                        $image_name = $ID . strrchr( $image_name, "." );
75
                        $HTTP_POST_VARS[$elem] = $image_name;
76
 
77
                        /* ------------------------------------------------------------------------------------------ */
78
                        // $Imagenummer extrahieren
79
                        $Imagenummer = explode( "_", $elem );
80
                        $Imagenummer = $Imagenummer[1];
81
                        $DatenID = "bild" . $Imagenummer;
82
                        $Imagedaten = explode( ";", $web_rechte[modul_name][tool_name][$DatenID] );
83
                        /*
84
                        Imagedaten möglich Werte:
85
                        0: Titel des Feldes
86
                        1: max. Breite für Bild1
87
                        2: max. Höhe für Bild1
88
 
89
                        3: Pfad für mittleres Bild1
90
                        4: max. Breite für mittleres Bild1
91
                        5: max. Höhe für mittleres Bild1
92
 
93
                        6: Pfad für kleines Bild1
94
                        7: max. Breite für kleines Bild1
95
                        8: max. Höhe für kleines Bild1
96
                        */
97
 
98
                        // Höhe und Breite des Bildes bestimmen
99
                        $imgsize = GetImageSize( $image );
100
                        // $imgsize[0] $imgsize[1]
101
 
102
                        // ---- Hier wird abgefragt ob das grosse Bild angepasst werden soll ---- //
103
                        $resize = false;
104
                        if ( count( $Imagedaten ) > 1 )
105
                        {
106
                            $resize = true;
107
                        }
108
                        if ( ( $imgsize[0] < $Imagedaten[1] ) and ( $imgsize[1] <
109
                            $Imagedaten[2] ) )
110
                        {
111
                            $resize = false;
112
                        }
113
 
114
                        if ( $resize == true )
115
                        {
116
                            exec( "convert -scale " . $Imagedaten[1] . "x" .
117
                                $Imagedaten[2] . " " . $image . " " . $Pfad .
118
                                $image_name );
119
                        }
120
                        else
121
                        {
122
                            copy( $image, $Pfad . $image_name );
123
                        }
124
                        /* ------------------------------------------------------------------------------------------ */
125
 
126
                        // ---- falls mittleres Bild: erstellen---- //
127
                        if ( ( $Imagedaten[4] ) and ( $Imagedaten[5] ) )
128
                        {
129
                            exec( "convert -scale " . $Imagedaten[4] . "x" .
130
                                $Imagedaten[5] . " " . $image . " " . $Pfad .
131
                                $Imagedaten[3] . "/" . $image_name );
132
                        }
133
 
134
                        // ---- falls kleines Bild: erstellen---- //
135
                        if ( ( $Imagedaten[6] ) and ( $Imagedaten[7] ) )
136
                        {
137
                            exec( "convert -scale " . $Imagedaten[7] . "x" .
138
                                $Imagedaten[8] . " " . $image . " " . $Pfad .
139
                                $Imagedaten[6] . "/" . $image_name );
140
                        }
141
 
142
                        break;
143
                    default:
144
                        break;
145
                }
146
            }
147
        }
148
        $names = array();
149
        foreach ( array_keys( $HTTP_POST_VARS ) as $elem )
150
        {
151
            array_push( $names, "$elem='$HTTP_POST_VARS[$elem]'" );
152
        }
153
        $query = "update $tab set " . join( $names, ', ' );
154
 
155
        if ( isset( $user_rechte[modul_name][tool_name]["language"] ) )
156
        {
157
            $query = $query .
158
                ", letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER' where ID = '$ID' and language='$_SESSION[language]'";
159
        }
160
        else
161
        {
162
            $query = $query .
163
                ", letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER' where ID = '$ID'";
164
        }
165
        $result = mysql_query( $query ) or die( mysql_errno() . ": " .
166
            mysql_error() . "<hr>" . $query . "<hr>" );
167
        header( "Location: " . $self );
168
    }
169
 
170
    if ( $action == "delete" )
171
    {
172
        if ( $ID )
173
        {
174
            $condition = array();
175
            foreach ( $ID as $elem )
176
            {
177
                array_push( $condition, " ID = '$elem'" );
178
            }
179
            $cond = join( " or ", $condition );
180
            $query = "DELETE FROM $tab WHERE $cond";
181
            $result = mysql_query( $query ) or die( mysql_errno() . ": " .
182
                mysql_error() . "<hr>" . $query . "<hr>" );
183
            header( "Location: " . $self );
184
        }
185
    }
186
    if ( !$action )
187
    {
188
        $action = "select_edit";
189
    }
190
    if ( !$sort )
191
    {
192
        $sort = 'begriff';
193
    }
194
    $range = 100;
195
?>
196
<html>
197
<head>
198
<title>Vorlage: Redaktionssystem</title>
199
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
200
<link rel=stylesheet type="text/css" href="../buttons.css">
201
<script language="javascript" src="../checkDate.js"></script>
202
<script language="JavaScript">
203
<!--
204
function MM_swapImgRestore() { //v3.0
205
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
206
}
207
 
208
function MM_preloadImages() { //v3.0
209
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
210
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
211
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
212
}
213
 
214
function MM_findObj(n, d) { //v4.01
215
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
216
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
217
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
218
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
219
  if(!x && d.getElementById) x=d.getElementById(n); return x;
220
}
221
 
222
function MM_swapImage() { //v3.0
223
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
224
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
225
}
226
//-->
227
</script>
228
<script language="JavaScript" src="../checkDate.js"></script>
229
<meta name="description" content="Redaktionssystem">
230
<meta name="author" content="Webagentur Niewerth">
231
<meta name="robots" content="noindex">
232
<style type="text/css">
233
<!--
234
a {  color: #<? echo $webs[font_color_rechts]
235
?>}
236
-->
237
</style>
238
</head>
239
 
240
<body bgcolor="#<? echo $webs[bgcolor_seite];
241
?>" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages('../images/navigation/bt_neu_f2.gif','../images/navigation/bt_delete_f2.gif','../images/navigation/bt_bearbeiten_f2.gif')" text="#<? echo
242
$webs[font_color_seite];
243
?>">
244
<form method="post" action="<?= $self;
245
?>" name="formname" enctype="multipart/form-data">
246
  <table width="662" border="0" cellspacing="0" cellpadding="0">
247
    <tr valign="top">
248
      <td width="585">
249
        <!--  Auswahl Löschen START  -->
250
        <?
251
    if ( $action == "delete" )
252
    {
253
        $cond = "";
254
        if ( isset( $user_rechte[modul_name][tool_name]["language"] ) )
255
        {
256
            $cond = "where language='" . $_SESSION[language] . "'";
257
        }
258
 
259
        $query = "SELECT * FROM $tab $cond order by $sort";
260
        $result = mysql_query( $query ) or die( mysql_errno() . ": " .
261
            mysql_error() );
262
        $count = mysql_num_rows( $result );
263
        if ( $count == 0 )
264
        {
265
?>
266
        <p class="error"><font color="#<? echo $webs[font_color_seite]
267
?>">Es
268
          sind keine Daten eingetragen !</font></p>
269
        <p></p>
270
        <?
271
        }
272
        else
273
        {
274
            if ( !$start )
275
            {
276
                $start = 0;
277
            }
278
            $query = $query . " limit $start, $range";
279
?>
280
        <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
281
          <tr>
282
            <td colspan="3" class="headline" bgcolor="#<? echo $webs[bgcolor_links]
283
?>"><font color="#<? echo
284
$webs[font_color_links]
285
?>">Lexikon</font><font color="#<? echo
286
$webs[font_color_links]
287
?>"></font><font color="#<? echo
288
$webs[font_color_links]
289
?>">:
290
              L&ouml;schen</font><br>
291
              <?
292
            if ( $count >= $range )
293
            {
294
?>
295
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
296
                <tr>
297
                  <td width="10%" class="rechts"> <a href="<? echo $self
298
?>?action=<? echo
299
$action
300
?>&sort=<? echo
301
$sort
302
?>&start=<? if ( $start >
303
 
304
                {
305
                    echo $start - $range;
306
                }
307
                else
308
                {
309
                    echo "0";
310
                }
311
?>"><font color="#<? echo
312
$webs[font_color_links]
313
?>">zurück</font></a>
314
                  </td>
315
                  <td width="85%" align="center" class="rechts">|
316
                    <?
317
                for ( $a = 0; $a < $count; $a += $range )
318
                {
319
?>
320
                    <? if ( $start == $a )
321
                    {
322
                        echo "<b>";
323
                    }
324
?>
325
                    <a href="<? echo $self
326
?>?action=<? echo $action
327
?>&sort=<? echo
328
$sort
329
?>&start=<? echo
330
$a
331
?>">
332
                    <font color="#<? echo $webs[font_color_links]
333
?>">
334
                    <? echo $a
335
?>
336
                    -
337
                    <? if ( $count - $a > $range - 1 )
338
                    {
339
                        echo $a + $range - 1;
340
                    }
341
                    else
342
                    {
343
                        echo $count;
344
                    }
345
?>
346
                    <? if ( $start == $a )
347
                    {
348
                        echo "</b>";
349
                    }
350
?>
351
                    | </font> </a>
352
                    <?
353
                }
354
?>
355
                  </td>
356
                  <td width="10%" align="right" class="rechts" nowrap>&nbsp; <a href="<? echo
357
$self
358
?>?action=<? echo
359
$action
360
?>&sort=<? echo
361
$sort
362
?>&start=<? if ( $start +
363
$range < $count )
364
                {
365
                    echo $start + $range;
366
                }
367
                else
368
                {
369
                    echo $start;
370
                }
371
?>"><font color="#<? echo
372
$webs[font_color_links]
373
?>">weiter</font></a>
374
                  </td>
375
                </tr>
376
              </table>
377
              <?
378
            }
379
?>
380
            </td>
381
          </tr>
382
<?
383
            $result = mysql_query( $query ) or die( mysql_errno() . ": " .
384
                mysql_error() . "<hr>$query" );
385
            while ( $zeile = mysql_fetch_array( $result ) )
386
            {
387
?>
388
          <tr>
389
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
390
?>"><a href="<? echo
391
$self
392
?>?action=edit&ID=<? echo
393
$zeile[ID];
394
?>">
395
              <?= $zeile[begriff];
396
?>
397
              </a> </td>
398
            <td width="5%" align="center" bgcolor="#<? echo $webs[bgcolor_rechts]
399
?>">
400
              <input type="checkbox" name="ID[]" value="<?= $zeile[ID]
401
?>">
402
            </td>
403
          </tr>
404
          <?
405
            }
406
?>
407
          <tr>
408
            <td colspan="3" align="right" bgcolor="#<? echo $webs[bgcolor_links]
409
?>">
410
              <?
411
            if ( $count >= $range )
412
            {
413
?>
414
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
415
                <tr>
416
                  <td width="10%" class="rechts"> <a href="<? echo $self
417
?>?action=<? echo
418
$action
419
?>&sort=<? echo
420
$sort
421
?>&start=<? if ( ( $start ) >
422
 
423
                {
424
                    echo $start - $range;
425
                }
426
                else
427
                {
428
                    echo "0";
429
                }
430
?>"><font color="#<? echo
431
$webs[font_color_links]
432
?>">zurück</font></a>
433
                  </td>
434
                  <td width="85%" align="center" class="rechts">|
435
                    <?
436
                for ( $a = 0; $a < $count; $a += $range )
437
                {
438
?>
439
                    <? if ( $start == $a )
440
                    {
441
                        echo "<b>";
442
                    }
443
?>
444
                    <a href="<? echo $self
445
?>?action=<? echo $action
446
?>&sort=<? echo
447
$sort
448
?>&start=<? echo
449
$a
450
?>">
451
                    <font color="#<? echo $webs[font_color_links]
452
?>">
453
                    <? echo $a
454
?>
455
                    -
456
                    <? if ( $count - $a > $range - 1 )
457
                    {
458
                        echo $a + $range - 1;
459
                    }
460
                    else
461
                    {
462
                        echo $count;
463
                    }
464
?>
465
                    <? if ( $start == $a )
466
                    {
467
                        echo "</b>";
468
                    }
469
?>
470
                    | </font> </a>
471
                    <?
472
                }
473
?>
474
                  </td>
475
                  <td width="10%" align="right" class="rechts" nowrap>&nbsp; <a href="<? echo
476
$self
477
?>?action=<? echo
478
$action
479
?>&sort=<? echo
480
$sort
481
?>&start=<? if ( $start +
482
$range < $count )
483
                {
484
                    echo $start + $range;
485
                }
486
                else
487
                {
488
                    echo $start;
489
                }
490
?>"><font color="#<? echo
491
$webs[font_color_links]
492
?>">weiter</font></a>
493
                  </td>
494
                </tr>
495
              </table>
496
              <?
497
            }
498
?>
499
              <input type="hidden" name="action" value='delete'>
500
              <input type="submit" value="LÖSCHEN">
501
              <input type="reset" value="Zur&uuml;cksetzen">
502
            </td>
503
          </tr>
504
        </table>
505
        <?
506
        }
507
?>
508
        <?
509
    }
510
?>
511
        <!--  Auswahl Löschen ENDE  -->
512
        <!--  Auswahl SELECT_EDIT START  -->
513
        <?
514
    if ( $action == "select_edit" )
515
    {
516
        $cond = "";
517
        if ( isset( $user_rechte[modul_name][tool_name]["language"] ) )
518
        {
519
            $cond = "where language='DE'";
520
        }
521
 
522
        $query = "
523
			SELECT
524
				$tab.*
525
			FROM
526
				$tab
527
			$cond
528
			ORDER BY
529
				$sort
530
			";
531
 
532
        $result = mysql_query( $query ) or die( mysql_errno() . ": " .
533
            mysql_error() );
534
        $count = mysql_num_rows( $result );
535
 
536
        if ( mysql_num_rows( $result ) == 0 )
537
        {
538
?>
539
        <p class="error"><font color="#<? echo $webs[font_color_seite]
540
?>">Es
541
          sind keine Daten eingetragen !</font></p>
542
        <p></p>
543
        <?
544
        }
545
        else
546
        {
547
            if ( !$start )
548
            {
549
                $start = 0;
550
            }
551
            $query = $query . " limit $start, $range";
552
?>
553
        <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
554
          <tr bgcolor="#<? echo $webs[bgcolor_links]
555
?>">
556
            <td class="headline" colspan="2" bgcolor="#<? echo $webs[bgcolor_links]
557
?>"><font color="#<? echo
558
$webs[font_color_links]
559
?>">Lexikon</font><font color="#<? echo
560
$webs[font_color_links]
561
?>"></font><font color="#<? echo
562
$webs[font_color_links]
563
?>">:
564
              Bearbeiten</font>
565
              <?
566
            if ( $count >= $range )
567
            {
568
?>
569
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
570
                <tr>
571
                  <td width="10%" class="rechts"> <a href="<? echo $self
572
?>?action=<? echo
573
$action
574
?>&sort=<? echo
575
$sort
576
?>&start=<? if ( ( $start ) >
577
 
578
                {
579
                    echo $start - $range;
580
                }
581
                else
582
                {
583
                    echo "0";
584
                }
585
?>"><font color="#<? echo
586
$webs[font_color_links]
587
?>">zurück</font></a>
588
                  </td>
589
                  <td width="85%" align="center" class="rechts">|
590
                    <?
591
                for ( $a = 0; $a < $count; $a += $range )
592
                {
593
?>
594
                    <? if ( $start == $a )
595
                    {
596
                        echo "<b>";
597
                    }
598
?>
599
                    <a href="<? echo $self
600
?>?action=<? echo $action
601
?>&sort=<? echo
602
$sort
603
?>&start=<? echo
604
$a
605
?>">
606
                    <font color="#<? echo $webs[font_color_links]
607
?>">
608
                    <? echo $a
609
?>
610
                    -
611
                    <? if ( $count - $a > $range - 1 )
612
                    {
613
                        echo $a + $range - 1;
614
                    }
615
                    else
616
                    {
617
                        echo $count;
618
                    }
619
?>
620
                    <? if ( $start == $a )
621
                    {
622
                        echo "</b>";
623
                    }
624
?>
625
                    | </font> </a>
626
                    <?
627
                }
628
?>
629
                  </td>
630
                  <td width="10%" align="right" class="rechts" nowrap>&nbsp; <a href="<? echo
631
$self
632
?>?action=<? echo
633
$action
634
?>&sort=<? echo
635
$sort
636
?>&start=<? if ( $start +
637
$range < $count )
638
                {
639
                    echo $start + $range;
640
                }
641
                else
642
                {
643
                    echo $start;
644
                }
645
?>"><font color="#<? echo
646
$webs[font_color_links]
647
?>">weiter</font></a>
648
                  </td>
649
                </tr>
650
              </table>
651
              <?
652
            }
653
?>
654
            </td>
655
          </tr>
656
          <?
657
            $result = mysql_query( $query ) or die( mysql_errno() . ": " .
658
                mysql_error() . "<hr>$query" );
659
            while ( $zeile = mysql_fetch_array( $result ) )
660
            {
661
                // Versuchen den Artikel in language nachzuladen
662
                $query_lang = "select * from $tab where language='$_SESSION[language]' and ID = $zeile[ID]";
663
                if ( $result_lang = mysql_query( $query_lang ) )
664
                {
665
                    if ( $zeile_lang = mysql_fetch_array( $result_lang ) )
666
                    {
667
                        $zeile = $zeile_lang;
668
                    }
669
                }
670
?>
671
          <tr>
672
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
673
?>" width="100%">
674
			<?
675
                if ( ( $_SESSION[language] != $zeile[language] ) && ( isset
676
                    ( $user_rechte[modul_name][tool_name]["language"] ) ) )
677
                {
678
?><img src="../images/Online-Shop/directory/file!.gif"><? }
679
?>
680
 
681
			<a href="<? echo $self
682
?>?action=edit&ID=<? echo $zeile[ID];
683
?>">
684
    <? echo $zeile[begriff]
685
?>
686
	          </a></td>
687
          </tr>
688
          <?
689
            }
690
?>
691
          <tr bgcolor="#<? echo $webs[bgcolor_links]
692
?>">
693
            <td colspan="2">
694
              <?
695
            if ( $count >= $range )
696
            {
697
?>
698
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
699
                <tr>
700
                  <td width="10%" class="rechts"> <a href="<? echo $self
701
?>?action=<? echo
702
$action
703
?>&sort=<? echo
704
$sort
705
?>&start=<? if ( ( $start ) >
706
 
707
                {
708
                    echo $start - $range;
709
                }
710
                else
711
                {
712
                    echo "0";
713
                }
714
?>"><font color="#<? echo
715
$webs[font_color_links]
716
?>">zurück</font></a>
717
                  </td>
718
                  <td width="85%" align="center" class="rechts">|
719
                    <?
720
                for ( $a = 0; $a < $count; $a += $range )
721
                {
722
?>
723
                    <? if ( $start == $a )
724
                    {
725
                        echo "<b>";
726
                    }
727
?>
728
                    <a href="<? echo $self
729
?>?action=<? echo $action
730
?>&sort=<? echo
731
$sort
732
?>&start=<? echo
733
$a
734
?>">
735
                    <font color="#<? echo $webs[font_color_links]
736
?>">
737
                    <? echo $a
738
?>
739
                    -
740
                    <? if ( $count - $a > $range - 1 )
741
                    {
742
                        echo $a + $range - 1;
743
                    }
744
                    else
745
                    {
746
                        echo $count;
747
                    }
748
?>
749
                    <? if ( $start == $a )
750
                    {
751
                        echo "</b>";
752
                    }
753
?>
754
                    | </font> </a>
755
                    <?
756
                }
757
?>
758
                  </td>
759
                  <td width="10%" align="right" class="rechts" nowrap>&nbsp; <a href="<? echo
760
$self
761
?>?action=<? echo
762
$action
763
?>&sort=<? echo
764
$sort
765
?>&start=<? if ( $start +
766
$range < $count )
767
                {
768
                    echo $start + $range;
769
                }
770
                else
771
                {
772
                    echo $start;
773
                }
774
?>"><font color="#<? echo
775
$webs[font_color_links]
776
?>">weiter</font></a>
777
                  </td>
778
                </tr>
779
              </table>
780
              <?
781
            }
782
            else
783
            {
784
?>
785
              &nbsp;
786
              <? }
787
?>
788
            </td>
789
          </tr>
790
        </table>
791
        <?
792
        }
793
?>
794
        <?
795
    }
796
?>
797
        <!--  Auswahl SELECT_EDIT ENDE  -->
798
        <?
799
    if ( $action == "edit" )
800
    {
801
        if ( $ID )
802
        {
803
            $result = mysql_query( "SELECT * FROM $tab where ID = '$ID'" ) or
804
                die( mysql_errno() . ": " . mysql_error() );
805
            $zeile = mysql_fetch_array( $result );
806
 
807
            // Versuchen den Artikel in language nachzuladen
808
            $query_lang = "select * from $tab where language='$_SESSION[language]' and ID = $ID";
809
            if ( $result_lang = mysql_query( $query_lang ) )
810
            {
811
                if ( $zeile_lang = mysql_fetch_array( $result_lang ) )
812
                {
813
                    $zeile = $zeile_lang;
814
                }
815
            }
816
        }
817
        $zeile[gueltig_von] = date2human( $zeile[gueltig_von] );
818
        $zeile[gueltig_bis] = date2human( $zeile[gueltig_bis] );
819
?>
820
        <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
821
          <tr>
822
            <td colspan="2" class="headline" bgcolor="#<? echo $webs[bgcolor_links]
823
?>"><font color="#<? echo
824
$webs[font_color_links]
825
?>">Lexikon</font><font color="#<? echo
826
$webs[font_color_links]
827
?>">:
828
              <?
829
        if ( $ID )
830
        {
831
?>
832
              Bearbeiten
833
              <?
834
        }
835
        else
836
        {
837
?>
838
              Neueintrag
839
              <?
840
        }
841
?>
842
              </font> </td>
843
          </tr>
844
          <?
845
        $Feld = "begriff";
846
        if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
847
        {
848
?>
849
          <tr>
850
            <td bgcolor="#<? echo $webs[bgcolor_links]
851
?>" class="headline" width="20%"><font color="#<? echo
852
$webs[font_color_links]
853
?>"><b>
854
              <?
855
            if ( $web_rechte[modul_name][tool_name][$Feld] )
856
            {
857
                echo $web_rechte[modul_name][tool_name][$Feld];
858
            }
859
            else
860
            {
861
?>
862
              Begriff:
863
              <?
864
            }
865
?>
866
              </b></font></td>
867
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
868
?>">
869
              <input type="text" name="begriff" size="40" value="<? echo
870
htmlentities( $zeile[begriff] )
871
?>" maxlength="255">
872
            </td>
873
          </tr>
874
<?
875
        }
876
 
877
        $Feld = "erklaerung";
878
        if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
879
        {
880
?>
881
          <tr>
882
            <td bgcolor="#<? echo $webs[bgcolor_links]
883
?>" class="headline" width="20%" valign="top"><font color="#<? echo
884
$webs[font_color_links]
885
?>"><b>
886
              <?
887
            if ( $web_rechte[modul_name][tool_name][$Feld] )
888
            {
889
                echo $web_rechte[modul_name][tool_name][$Feld];
890
            }
891
            else
892
            {
893
?>Erklärung:<?
894
            }
895
?>
896
              </b></font></td>
897
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
898
?>">
899
              <textarea name="erklaerung" cols="70" rows="6"><? echo $zeile[erklaerung]
900
?></textarea>
901
            </td>
902
          </tr>
903
          <?
904
        }
905
 
906
        /* ############################################################################################################## */
907
 
908
        for ( $bild_nr = 1; $bild_nr < 3; $bild_nr++ )
909
        {
910
            $Feld = "bild$bild_nr";
911
            if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
912
            {
913
?>
914
          <tr>
915
            <td bgcolor="#<? echo $webs[bgcolor_links]
916
?>" valign="top" width="21%">
917
              <font color="#<? echo $webs[font_color_links]
918
?>"><b>
919
              <?
920
                $Felddaten = explode( ";", $web_rechte[modul_name][tool_name][$Feld] );
921
                if ( !empty( $Felddaten[0] ) )
922
                {
923
                    echo $Felddaten[0];
924
                }
925
                else
926
                {
927
?>Bild <? echo $bild_nr;
928
?><?
929
                }
930
?>
931
			</b></font> </td>
932
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
933
?>" width="79%">
934
              <table border="0" width="100%" cellspacing="0" cellpadding="0">
935
                <tr>
936
                  <td width="55%" nowrap colspan="2"> <font color="#<? echo
937
$webs[font_color_rechts]
938
?>">
939
                    <?
940
                $image_name = "bild_" . $bild_nr . "_url";
941
                $image_Path = $webs[verzeichnis] . "images/news/" . $bild_nr .
942
                    "/";
943
?>
944
                    <input type="hidden" name="<? echo $image_name
945
?>_Pfad" value="<? echo
946
$image_Path
947
?>">
948
                    <?
949
                if ( $zeile[$image_name] != "" )
950
                {
951
?>
952
                    <input type="radio" name="_<? echo $image_name
953
?>" value="0" checked>
954
                    <a href="http://www.<? echo $site . "/images/news/" . $bild_nr .
955
"/" . $zeile[$image_name]
956
?>" target="blank">
957
                    <? echo $zeile[$image_name];
958
?>
959
                    </a>
960
                    <?
961
                    $size = filesize( $image_Path . $zeile[$image_name] ) >>
962
                        10;
963
                    $imgsize = GetImageSize( $image_Path . $zeile[$image_name] );
964
                    echo "&nbsp;( $size KB $imgsize[0]x$imgsize[1])<BR>";
965
                }
966
?>
967
                    <input type="radio" name="_<? echo $image_name
968
?>" value="1" <? if ( $zeile[$image_name] ==
969
"" )
970
                {
971
                    echo "checked";
972
                }
973
?>>
974
                    kein Bild<br>
975
                    <input type="radio" name="_<? echo $image_name
976
?>" value="2">
977
                    <input type="File" name="<? echo $image_name
978
?>" size="17" maxlength="255" onFocus="this.form._<? echo
979
$image_name
980
?>[<? if ( $zeile[$image_name] !=
981
"" )
982
                {
983
                    echo "2";
984
                }
985
                else
986
                {
987
                    echo "1";
988
                }
989
?>].checked=true;">
990
                    </font> </td>
991
                  <td width="45%" nowrap align="center">
992
                    <? if ( $zeile[$image_name] != "" )
993
                {
994
?>
995
                    <a href="http://www.<? echo $site . "/images/news/" . $bild_nr .
996
"/" . $zeile[$image_name]
997
?>" target="blank"><img height="60" src="http://www.<? echo
998
$site . "/images/news/" . $bild_nr . "/" . $zeile[$image_name]
999
?>" border="0"></a>
1000
                    <? }
1001
?>
1002
                  </td>
1003
                </tr>
1004
              </table>
1005
            </td>
1006
          </tr>
1007
          <?
1008
            }
1009
 
1010
            $Feld = "bild_text$bild_nr";
1011
            if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
1012
            {
1013
?>
1014
          <tr>
1015
            <td bgcolor="#<? echo $webs[bgcolor_links]
1016
?>" class="headline" width="20%"><font color="#<? echo
1017
$webs[font_color_links]
1018
?>"><b>
1019
              <?
1020
                if ( $web_rechte[modul_name][tool_name][$Feld] )
1021
                {
1022
                    echo $web_rechte[modul_name][tool_name][$Feld];
1023
                }
1024
                else
1025
                {
1026
?>
1027
              Bildtext:
1028
              <?
1029
                }
1030
?>
1031
              </b></font></td>
1032
            <td bgcolor="#<? echo $webs[bgcolor_rechts]
1033
?>">
1034
              <input type="text" name="bildunterschrift1" size="40" value="<? echo
1035
htmlentities( $zeile[bildunterschrift1] )
1036
?>" maxlength="255">
1037
            </td>
1038
          </tr><?
1039
            }
1040
        }
1041
 
1042
        if ( $ID )
1043
        {
1044
            $Feld = "erstellt";
1045
            if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
1046
            {
1047
?>
1048
          <tr>
1049
            <td class="headline" width="20%" bgcolor="#<? echo $webs[bgcolor_links]
1050
?>"><font color="#<? echo
1051
$webs[font_color_links]
1052
?>"><b>
1053
              <?
1054
                if ( $web_rechte[modul_name][tool_name][$Feld] )
1055
                {
1056
                    echo $web_rechte[modul_name][tool_name][$Feld];
1057
                }
1058
                else
1059
                {
1060
?>
1061
              erstellt am:
1062
              <?
1063
                }
1064
?>
1065
              </b></font></td>
1066
            <? $erstellt_am = datetime2human( $zeile[erstellt_am] );
1067
?>
1068
            <td class="headline" bgcolor="#<? echo $webs[bgcolor_rechts]
1069
?>"><font color="#<? echo
1070
$webs[font_color_rechts]
1071
?>">am:
1072
              <? echo $erstellt_am[Datum]
1073
?>
1074
              um:
1075
              <? echo $erstellt_am[Zeit]
1076
?>
1077
              von:
1078
              <? echo $zeile[erstellt_von]
1079
?>
1080
              </font> </td>
1081
          </tr>
1082
<?
1083
            }
1084
 
1085
            $Feld = "letzte_aenderung";
1086
            if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
1087
            {
1088
?>
1089
          <tr>
1090
            <td class="headline" width="20%" bgcolor="#<? echo $webs[bgcolor_links]
1091
?>"><font color="#<? echo
1092
$webs[font_color_links]
1093
?>"><b>
1094
              <?
1095
                if ( $web_rechte[modul_name][tool_name][$Feld] )
1096
                {
1097
                    echo $web_rechte[modul_name][tool_name][$Feld];
1098
                }
1099
                else
1100
                {
1101
?>
1102
              letzte &Auml;nderung:
1103
              <?
1104
                }
1105
?>
1106
              </b></font></td>
1107
            <? $letzte_Aenderung_am = datetime2human( $zeile[letzte_Aenderung_am] );
1108
?>
1109
            <td class="headline" bgcolor="#<? echo $webs[bgcolor_rechts]
1110
?>"><font color="#<? echo
1111
$webs[font_color_rechts]
1112
?>">am:
1113
              <? echo $letzte_Aenderung_am[Datum]
1114
?>
1115
              um:
1116
              <? echo $letzte_Aenderung_am[Zeit]
1117
?>
1118
              von:
1119
              <? echo $zeile[letzte_Aenderung_von]
1120
?>
1121
              </font> </td>
1122
          </tr>
1123
<?
1124
            }
1125
        }
1126
?>
1127
          <tr>
1128
            <td align="right" colspan="2" bgcolor="#<? echo $webs[bgcolor_links]
1129
?>">
1130
              <input type="hidden" name="ID" value="<? echo $ID
1131
?>">
1132
              <input type="hidden" name="action" value="update">
1133
              <input type="submit" value="   OK   ">
1134
              <input type="reset" name="Button" value="Abbrechen">
1135
            </td>
1136
          </tr>
1137
        </table>
1138
        <?
1139
    }
1140
?>
1141
      </td>
1142
      <td width="77" align="right">
1143
        <table width="67" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999">
1144
		<?
1145
    if ( ( $_SESSION[language] != "DE" ) && ( isset( $user_rechte[modul_name][tool_name]["language"] ) ) )
1146
    {
1147
    }
1148
    else
1149
    {
1150
?>
1151
          <tr>
1152
            <td><a href="<? echo $self
1153
?>?action=edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('new','','../images/navigation/bt_neu_f2.gif',1)"><img name="new" border="0" src="../images/navigation/bt_neu.gif" width="67" height="40" alt="Neueintrag"></a></td>
1154
          </tr>
1155
		<? }
1156
?>
1157
          <tr>
1158
            <td><a href="<? echo $self
1159
?>?action=select_edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('edit','','../images/navigation/bt_bearbeiten_f2.gif',1)"><img name="edit" border="0" src="../images/navigation/bt_bearbeiten.gif" width="67" height="40" alt="Eintrag bearbeiten"></a></td>
1160
          </tr>
1161
		<?
1162
    if ( ( $_SESSION[language] != "DE" ) && ( isset( $user_rechte[modul_name][tool_name]["language"] ) ) )
1163
    {
1164
    }
1165
    else
1166
    {
1167
?>
1168
          <tr>
1169
            <td><a href="<? echo $self
1170
?>?action=delete" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('delete','','../images/navigation/bt_delete_f2.gif',1)"><img name="delete" border="0" src="../images/navigation/bt_delete.gif" width="67" height="40" alt="Eintrag l&ouml;schen"></a></td>
1171
          </tr>
1172
		<? }
1173
?>
1174
        </table>
1175
      </td>
1176
      <td width="77" align="right">
1177
<?
1178
    if ( isset( $user_rechte[modul_name][tool_name]["language"] ) )
1179
    {
1180
?>
1181
<input type="hidden" name="language" value="<?= $_SESSION[language]
1182
?>">
1183
<table border="0" cellspacing="5" cellpadding="2">
1184
<?
1185
        $flaggen_pro_zeile = 1;
1186
        if ( count( $language_pack ) < $flaggen_pro_zeile )
1187
        {
1188
            $flaggen_pro_zeile = count( $language_pack );
1189
        }
1190
        $zeilen = count( $language_pack ) / $flaggen_pro_zeile;
1191
        for ( $j = 0; $j < $zeilen; $j++ )
1192
        {
1193
?>
1194
<tr>
1195
<?
1196
            for ( $i = 0; $i < $flaggen_pro_zeile; $i++ )
1197
            {
1198
                $index = ( $j * $flaggen_pro_zeile ) + $i;
1199
?>
1200
	<td align="center" valign="middle"<? if ( $_SESSION[language] == $language_pack[$index][0] )
1201
                {
1202
?> bgcolor="#FF0000"<? }
1203
?>><a href="../Online-Shop/select_language.php?language=<? echo
1204
$language_pack[$index][0]
1205
?>"><img src="../images/Online-Shop/language/<? echo
1206
$language_pack[$index][1]
1207
?>" alt="<? echo
1208
$language_pack[$index][2]
1209
?>" width="32" height="22" border="0"></a></td>
1210
<?
1211
            }
1212
?>
1213
</tr>
1214
<?
1215
        }
1216
?>
1217
</table>
1218
<? }
1219
?>
1220
	  </td>
1221
    </tr>
1222
  </table>
1223
</form>
1224
</body>