Subversion-Projekte lars-tiefland.content-management

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
    $self = basename( $PHP_SELF );
3
    $DB = "artikel";
4
    define( "modul_name", "online_shop" );
5
    define( "tool_name", "artikel" );
6
    require_once  "connect2.php";
7
    require_once  "show_dir.php";
8
    session_start();
9
 
10
    // $charset laden um die jeweiligen ISO-Zeichensätzte zu laden.
11
    require_once  "charset.php";
12
    require_once "language_pack.php";
13
 
14
    if ( $action )
15
    {
16
        unset( $_POST[action] );
17
        $row = array_keys( $_POST );
18
        if ( $_POST["upd_artikel"] == 1 )
19
        {
20
            unset( $_POST["upd_artikel"] );
21
            foreach ( array_keys( $$row[0] ) as $ID )
22
            {
23
                unset( $query_row );
24
                foreach ( $row as $elem )
25
                {
26
                    if ( $elem == "artikel_status" || $elem == "artikel" ||
27
                        $elem == "del_artikel" || $elem == "upd_artikel" )
28
                    {
29
                        continue;
30
                    }
31
                    $buffer = $$elem;
32
                    if ( ereg( "^preis", $elem ) )
33
                    {
34
                        if ( ereg( "%$", $buffer[$ID] ) )
35
                        {
36
                            $buffer[$ID] = abs( $buffer[$ID] ) * ( -1 );
37
                        }
38
                    }
39
                    if ( $elem != "zubehoer_anzeigen_artikel" )
40
                    {
41
                        $query_row[] = $elem . "='" .
42
                            mysql_real_escape_string( $buffer[$ID] ) . "'";
43
                    }
44
                    else
45
                    {
46
                        $sql_d = "
47
                            DELETE FROM
48
                                shop_link_table
49
                            WHERE
50
                                Father=$ID
51
                            AND
52
                                Verwendung='a2a'
53
                        ";
54
                        mysql_query( $sql_d );
55
                        $z = explode( ",", $buffer[$ID] );
56
                        foreach ( $z as $z_val )
57
                        {
58
                            trim( $z_val );
59
                            if ( $z_val )
60
                            {
61
                                $sql_i = "
62
                                    INSERT INTO
63
                                        shop_link_table
64
                                    VALUES
65
                                    (
66
                                        $ID,
67
                                        $z_val,
68
                                        'a2a'
69
                                    )
70
                                ";
71
                                mysql_query( $sql_i );
72
                            }
73
                        }
74
                    }
75
                }
76
                if ( $ret = isset( $_SESSION["quick_edit_config.php"]["artikel_properties"]["zubehoer_anzeigen_artikel"] ) )
77
                {
78
                }
79
                $query = "
80
                    UPDATE
81
                        artikel
82
                    SET " . implode( ", ", $query_row ) . ",
83
                        letzte_Aenderung_von='$PHP_AUTH_USER'
84
                    WHERE
85
                        ID = $ID
86
                    AND
87
                        language = '$language'
88
                ";
89
 
90
                $result = mysql_query( $query ) or die( mysql_errno() . ": " .
91
                    mysql_error() . "<hr>$query<hr>" );
92
            }
93
        }
94
        if ( is_array( $_POST["artikel"] ) && $_POST["del_artikel"] == 1 )
95
        {
96
            $sql = "
97
                UPDATE
98
                    artikel
99
                SET
100
                    Father=-2,
101
                    letzte_Aenderung_von='$PHP_AUTH_USER'
102
                WHERE
103
                    ID IN (" . implode( ", ", $_POST["artikel"] ) . ")
104
                AND
105
                    language='$language'
106
            ";
107
            //echo $sql;
108
            mysql_query( $sql );
109
        }
110
        header( "Location:waren_tool.php" );
111
    }
112
 
113
    /* Bestimmen der Zielverzeichnisse */
114
    switch ( $_SESSION["quick_edit_config.php"]["nav_status_overide"] )
115
    {
116
        case 'off': // geöffnete Ordner
117
            $dirs = $_SESSION["tree.php"]["nav_status"];
118
            break;
119
        case - 1: // Alle Artikel
120
            $dirs = array( "-1" => "" );
121
            break;
122
        case 'select': // Alles unterhalb von
123
            $dirs = $_SESSION["quick_edit_config.php"]["nav_status_overide_selected"];
124
            break;
125
    }
126
?>
127
<html>
128
<head>
129
<title><? echo $webs[kunde_bezeichnung]
130
?>: Redaktionssystem</title>
131
<meta http-equiv="Content-Type" content="text/html; charset=<? echo $charset
132
?>">
133
<link rel="stylesheet" type="text/css" href="redaktion.css">
134
<style type="text/css">
135
A:link {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000}
136
A:visited {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #333333}
137
A:active {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #CC0000}
138
A:hover {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #669933}
139
p {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000096}
140
p.error {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000; font-weight: bold}
141
span {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
142
span.blue {font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; background-color:#0000A0; font-size: 10pt}
143
span.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: none}
144
td {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
145
td.timeout {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FF0000;}
146
td.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
147
td.headline {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FFFFFF; font-weight: bold}
148
td.haupt {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold}
149
td.selectet_language {border: 1px outset; border-color: #CCCCCC #999999 #999999 #CCCCCC}
150
input {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
151
select {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
152
textarea {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}.button {  border-style: outset; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; cursor: auto; width: 100%}
153
</style>
154
<script language="JavaScript">
155
<!--
156
function killkomma(w)
157
{
158
 return w.replace(/,/,'.');
159
}
160
//-->
161
</script>
162
<meta name="description" content="Redaktionssystem">
163
<meta name="author" content="Webagentur Niewerth">
164
<meta name="robots" content="noindex">
165
<script type="text/javascript" language="javascript">
166
    function del_item(a_id)
167
    {
168
        var trash = document.getElementById('trash');
169
        var letzteReihe = trash.rows.length;
170
        var iteration = letzteReihe;
171
        var reihe = trash.insertRow(letzteReihe);
172
 
173
        var zelle1 = reihe.insertCell(0);
174
        var zelle2 = reihe.insertCell(1);
175
        var zelle3 = reihe.insertCell(2);
176
 
177
        var artikel = document.createElement('input');
178
        artikel.setAttribute('type', 'hidden');
179
        artikel.setAttribute('name', 'artikel[]');
180
        artikel.setAttribute('value', a_id);
181
 
182
        var artikel_id = document.createElement('input');
183
        artikel_id.setAttribute('type', 'text');
184
        artikel_id.setAttribute('value', a_id);
185
        artikel_id.setAttribute('readonly', 'readonly');
186
        artikel_id.setAttribute('disabled', 'disabled');
187
        artikel_id.setAttribute('size', 10);
188
 
189
        var loeschen = document.createElement('input');
190
        loeschen.setAttribute('type', 'image');
191
        loeschen.setAttribute('src', '/dokumente/gfx/delete_record.gif');
192
        loeschen.onclick = new Function ("restore_item(this,'artikel_"+a_id+"')");
193
        loeschen.setAttribute('alt', "Artikel "+a_id+" wiederherstellen");
194
        loeschen.setAttribute('title', "Artikel "+a_id+" wiederherstellen");
195
 
196
        zelle1.setAttribute('id', iteration);
197
        zelle1.appendChild(artikel);
198
 
199
        zelle2.setAttribute('id', iteration);
200
        zelle2.appendChild(artikel_id);
201
 
202
        zelle3.setAttribute('id', iteration);
203
        zelle3.appendChild(loeschen);
204
 
205
        document.getElementById("artikel_"+a_id).style.display='none';
206
        document.getElementById('trash_used').value=1;
207
    }
208
    function restore_item(x, a_id)
209
    {
210
        while (x.tagName.toLowerCase() !='tr')
211
        {
212
            if(x.parentElement)
213
            {
214
                x=x.parentElement;
215
            }
216
            else if(x.parentNode)
217
            {
218
                x=x.parentNode;
219
            }
220
            else
221
            {
222
                return;
223
            }
224
        }
225
        var rowNum=x.rowIndex;
226
        while (x.tagName.toLowerCase() !='table')
227
        {
228
            if(x.parentElement)
229
            {
230
                x=x.parentElement;
231
            }
232
            else if(x.parentNode)
233
            {
234
                x=x.parentNode;
235
            }
236
            else
237
            {
238
                return;
239
            }
240
        }
241
        x.deleteRow(rowNum);
242
        anz=x.rows.length;
243
        if(anz==0)
244
        {
245
            document.getElementById('trash_used').value=0;
246
        }
247
        document.getElementById(a_id).style.display='block';
248
    }
249
 
250
    function check_del()
251
    {
252
        ret=true;
253
        ret1=false;
254
        ret2=false;
255
        ret1=ret1=confirm('Wollen Sie alle Änderungen speichern ?');
256
        if(ret1)
257
        {
258
            document.getElementById('upd_artikel').value=1;
259
        }
260
        if(document.getElementById('trash_used').value==1)
261
        {
262
            ret2=confirm("Sollen die als gelöscht markierten Artikel tatsächlich gelöscht werden?\nACHTUNG: Dies kann NICHT rückgängig gemacht werden!");
263
            if(ret2)
264
            {
265
                document.getElementById('del_artikel').value=1;
266
            }
267
        }
268
        if(ret1==false&&ret2==false)
269
        {
270
            ret=false;
271
        }
272
        return ret;
273
    }
274
</script>
275
<script type="text/javascript" language="javascript" src="/js/jquery-1.6.4.min.js"></script>
276
<script type="text/javascript" language="javascript" src="/js/jquery-ui-1.8.9.custom.min.js"></script>
277
<?php
278
    if ( file_exists( "../css/$site/jquery-ui.custom.css" ) )
279
    {
280
        $css_file = "/css/$site/jquery-ui.custom.css";
281
    }
282
    else
283
    {
284
        $css_file = "/css/ui-darkness/jquery-ui.custom.css";
285
    }
286
?>
287
<link rel="stylesheet" href="<?= $css_file;
288
?>" />
289
<script type="text/javascript" language="javascript">
290
    $(function(){
291
        $('.edit_desc').button({
292
            icons:
293
            {
294
                primary: "ui-icon-pencil"
295
            }
296
        }).click(edit_desc);
297
        $('#edit_desc_dialog').dialog("destroy").dialog({
298
            autoOpen:false,
299
            modal: true,
300
            //height:270,
301
            width:700,
302
            height:500,
303
            resizable:true,
304
            buttons:
305
            {
306
                speichern: function()
307
                {
308
                    $.post("/Online-Shop/edit_desc.php",$('#edit_desc_form').serializeArray(), function(html){
309
                        alert(html);
310
                    });
311
                    $(this).dialog("close");
312
                },
313
                abbrechen: function()
314
                {
315
                    $(this).dialog("close");
316
                }
317
            }
318
        })
319
        function edit_desc()
320
        {
321
            id=this.id;
322
            id=id.split("_");
323
            id=id[2];
324
            $('#edit_desc_dialog').load("/Online-Shop/get_desc.php?item="+id).dialog("open");
325
            return false;
326
        }
327
    });
328
</script>
329
</head>
330
 
331
<body bgcolor="#<? echo $webs[bgcolor_seite];
332
?>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#000000">
333
<form method="post" action="<? echo $self
334
?>" name="schnell" onsubmit="return check_del();">
335
  <table width="100%" border="0" cellspacing="0" cellpadding="3">
336
    <tr>
337
        <td align="center" bgcolor="#<? echo $webs[bgcolor_links]
338
?>">
339
            <img src="../images/navigation/trashcan.gif" title="Artikel löschen" alt="Artikel löschen">
340
        </td>
341
        <td align="center" bgcolor="#<? echo $webs[bgcolor_links]
342
?>">
343
            <font color="#<? echo $webs[font_color_links]
344
?>"><b>ID</b></font>
345
        </td>
346
<?
347
    foreach ( $_SESSION["quick_edit_config.php"]["artikel_properties"]  as
348
        $Feld =>$f_name )
349
    {
350
        if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
351
        {
352
?>
353
      <td align="center" bgcolor="#<? echo $webs["bgcolor_links"]
354
?>" nobr><font color="#<? echo
355
            $webs["font_color_links"]
356
?>"><b>
357
        &nbsp;<?
358
 
359
            $fname = $web_rechte[modul_name][tool_name][$Feld];
360
            if ( ( $fname ) /*			and
361
                (
362
                !strrpos($web_rechte[modul_name][tool_name][$Feld],";")
363
                )*/ )
364
            {
365
                if ( $fname[0] == "!" )
366
                {
367
                    $fname = substr( $fname, 1 );
368
                } elseif ( stristr( $fname, ';' ) )
369
                {
370
                    if ( stristr( $Feld, 'eigenschaft' ) )
371
                    {
372
                        $namen = explode( ";", $fname );
373
                        $fname = $namen[0];
374
                    }
375
                    else
376
                    {
377
                        $fname = $Feld;
378
                    }
379
                }
380
                echo $fname;
381
            }
382
            else
383
            {
384
                echo $f_name;
385
            }
386
?>&nbsp;</b></font></td><?
387
 
388
        }
389
    }
390
?>
391
  </tr>
392
<?
393
if(is_array($dirs)) {
394
    foreach ( $dirs as $dir => $dirname )
395
    {
396
        show_dir( $dir, $dirname );
397
    }
398
 
399
}
400
 
401
    //	show_dir(-1,"");
402
 
403
?>
404
    <tr>
405
      <td bgcolor="#<? echo $webs[bgcolor_links]
406
?>" align="right" colspan="<? echo
407
    count( $_SESSION["quick_edit_config.php"][artikel_properties] ) + 2
408
?>">
409
        <input type="hidden" id="trash_used" value="0">
410
        <input type="hidden" name="upd_artikel" id="upd_artikel" value="0">
411
        <input type="hidden" name="del_artikel" id="del_artikel" value="0">
412
        <input type="hidden" name="artikel_status" value="<? echo $HTTP_POST_VARS[artikel_status]
413
?>">
414
        <input type="submit" name="action" value="&Auml;nderung &uuml;bernehmen">
415
        <input type="reset" name="reset" value="Zur&uuml;cksetzen" onclick="confirm('Wollen Sie alle Änderungen verwerfen ?')">
416
      </td>
417
  </tr>
418
</table>
419
<table id="trash">
420
</table>
421
</form>
422
<div id="edit_desc_dialog" title="Beschreibung editieren">
423
</div>
424
</body>