Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<script>
2
    $(function(){
3
        $('.show_item').button({
4
            icons:
5
            {
6
                primary:"ui-icon-extlink"
7
            }
8
        }).click(show_item);
9
        $('#add_preis').button({
10
            icons:
11
            {
12
                primary:"ui-icon-plus"
13
            }
14
        }).click(add_preis);
15
        $('#add_preis_dialog').dialog("destroy").dialog({
16
            autoOpen:false,
17
            width:700,
18
            height:600,
19
            modal:true,
20
            resizable:false,
21
            buttons:
22
            {
23
                "speichern": function()
24
                {
25
                    $.post("/logins/preisstaffel.php",$('#add_preis_dialog_form').serializeArray(),function(html){
26
                        //alert(html);
27
                        login_id=$('#login_id').val();
28
                        $('#preise_dialog').load("/logins/preise.php?login="+login_id);
29
                    });
30
                    $(this).dialog("close");
31
                },
32
                "abbrechen": function()
33
                {
34
                    $(this).dialog("close");
35
                }
36
            }
37
        });
38
        $('.edit_preis').button({
39
            icons:{
40
                primary: "ui-icon-pencil"
41
            }
42
        }).click(edit_preis);
43
        $('#edit_preis_dialog').dialog("destroy").dialog({
44
            autoOpen:false,
45
            width:700,
46
            modal:true,
47
            resizable:false,
48
            buttons:
49
            {
50
                "speichern": function()
51
                {
52
                    $.post("/logins/preisstaffel.php",$('#edit_preis_dialog_form').serializeArray(),function(html){
53
                        //alert(html);
54
                        login_id=$('#login_id').val();
55
                        $('#preise_dialog').html("").load("/logins/preise.php?login="+login_id);
56
                    });
57
                    $(this).dialog("close");
58
                },
59
                "abbrechen": function()
60
                {
61
                    $(this).dialog("close");
62
                }
63
            }
64
        });
65
        $('#del_preis_dialog').dialog("destroy").dialog({
66
            autoOpen:false,
67
            width:700,
68
            modal:true,
69
            resizable:false,
70
            buttons:
71
            {
72
                "löschen": function()
73
                {
74
                    $.post("/logins/preisstaffel.php",$('#del_preis_dialog_form').serializeArray(),function(html){
75
                        //alert(html);
76
                        login_id=$('#login_id').val();
77
                        $('#preise_dialog').html("").load("/logins/preise.php?login="+login_id);
78
                    });
79
                    $(this).dialog("close");
80
                },
81
                "abbrechen": function()
82
                {
83
                    $(this).dialog("close");
84
                }
85
            }
86
        });
87
        $('#suche').keyup(suche);
88
        $('#shop_id').change(suche);
89
        function show_item()
90
        {
91
            id=this.id;
92
            id=id.split("_");
93
            a_id=id[2];
94
            s_id=id[3];
95
            $('#preise_dialog').load("/logins/preise.php?a_id="+a_id+"&s_id="+s_id);
96
            return false;
97
        }
98
        function suche()
99
        {
100
            $('#ergebnis').load("/logins/suche_artikel.php",$('#add_preis_dialog_form').serializeArray());
101
        }
102
        function add_preis()
103
        {
104
            $('#preis').hide();
105
            $("#artikel").hide();
106
            $('#artikel_suche').show();
107
            $('#add_preis_dialog').dialog("open");
108
            return false;
109
        }
110
        function edit_preis()
111
        {
112
            id=this.id;
113
            id=id.split("_");
114
            id=id[2];
115
            $('#edit_preis_dialog').load("/logins/preisstaffel.php?id="+id).dialog("open");
116
            return false;
117
        }
118
        $('.del_preis').button({
119
            icons:{
120
                primary: "ui-icon-trash"
121
            }
122
        }).click(del_preis);
123
 
124
        function del_preis()
125
        {
126
            id=this.id;
127
            id=id.split("_");
128
            id=id[2];
129
            //alert(id);
130
            $('.del_id').val(id);
131
            //alert($('.del_id').val());
132
            $('#del_preis_dialog').dialog("open");
133
            return false;
134
        }
135
    });
136
</script>
137
<button id="add_preis" title="neuen Preis zuordnen"></button>
138
<table width="800">
139
    <tr>
140
        <th colspan="8" style="font-size:24px;">Preise für Login {$login_id} - {$daten.login_name}:</th>
141
    </tr>
142
    <tr>
143
        <td>ID</td>
144
        <td>Artikelnummer</td>
145
        <td>Artikelname</td>
146
        <td>Shopnummer</td>
147
        <td>Shopname</td>
148
        <td>Shoppreis</td>
149
        <td>Kundenpreis</td>
150
        <td>Aktionen</td>
151
    </tr>
152
{foreach $daten.artikel as $zeile}
153
    <tr>
154
        <td>{$zeile.id}</td>
155
        <td>{$zeile.artikel_id}</td>
156
        <td>{$zeile.kurzbezeichnung}</td>
157
        <td>{$zeile.shop_id}</td>
158
        <td>{$zeile.name}</td>
159
        <td>
160
            {if $zeile.preis1 < 0}
161
            {$zeile.preis1|abs}%
162
            {else}
163
            {$zeile.preis1|money_format}
164
            {/if}
165
        </td>
166
        <td>
167
            {if $zeile.preis.preis[0] < 0}
168
            {$zeile.preis.preis[0]|abs}%
169
            {else}
170
            {$zeile.preis.preis[0]|money_format}
171
            {/if}
172
        </td>
173
        <td>
174
            <button id="edit_preis_{$zeile.id}" class="edit_preis" title="ändern"></button>
175
            <button id="del_preis_{$zeile.id}" class="del_preis" title="löschen"></button>
176
            <button id="show_item_{$zeile.artikel_id}_{$zeile.shop_id}" class="show_item" title="alle Kundenpreise für diesen Artikel"></button>
177
        </td>
178
    </tr>
179
{/foreach}
180
</table>
181
 
182
<div id="edit_preis_dialog" title="Preise bearbeiten">
183
</div>
184
 
185
<div id="add_preis_dialog" title="Artikelpreis zuordnen">
186
    <form id="add_preis_dialog_form">
187
        <table>
188
            <tr>
189
                <td>Shop</td>
190
                <td>
191
                    {html_options options=$shops name="shop_id" id="shop_id"}
192
                </td>
193
            </tr>
194
            <tr id="artikel">
195
                <td valign="top">Artikel</td>
196
                <td>
197
                    <span id="artikel_name"></span>
198
                    <input type="hidden" name="artikel_id" id="artikel_id" />
199
                </td>
200
            </tr>
201
            <tr id="artikel_suche">
202
                <td valign="top">Artikelsuche</td>
203
                <td>
204
                    <input type="text" name="suche" id="suche" />
205
                    <div id="ergebnis">
206
                    </div>
207
                </td>
208
            </tr>
209
            <tr id="preis">
210
                <td>Preis</td>
211
                <td>
212
                    <input type="text" name="staffel[1][preis][0]" value="" />
213
                    <input type="hidden" name="mode" value="save" />
214
                    <input type="hidden" name="login_id" value="{$login_id}" />
215
                </td>
216
            </tr>
217
        </table>
218
    </form>
219
</div>
220
 
221
<div id="del_preis_dialog" title="Preise löschen">
222
    <form id="del_preis_dialog_form">
223
        <table>
224
            <tr>
225
                <td>Wollen Sie diese Zuordnung wirklich löschen</td>
226
                <td>
227
                    <input type="hidden" name="id" class="del_id" />
228
                    <input type="hidden" name="mode" value="delete" />
229
                </td>
230
            </tr>
231
        </table>
232
    </form>
233
</div>