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