Subversion-Projekte lars-tiefland.zeldi.de_alt

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
    $(document).ready(function() {
2
 
3
        // icon im Reiter
4
        $('.reiternav li').click(function() {
5
            $('.ui-state-default img').attr("src", "/images/webelemente/kit_act.png");
6
        });
7
 
8
        // login aufklapper header: focus
9
        $('.info .login, div, a, ul').hover(function(e) {
10
            if (($('.login .infocenter_submenu').css('display') == 'none' || !$('.login .infocenter_submenu').css('display')) && $(this).className == 'info login') {
11
                $('.login .infocenter_submenu').css('display', 'block');
12
                $('.login .infocenter_submenu').show();
13
            }
14
        });
15
 
16
/*
17
        $(document).on("click", function(e) {
18
            if (!$('.infocenter_submenu').is(e.target) && $('.infocenter_submenu').has(e.target).length === 0) {
19
                $('.header .login .infocenter_submenu').css('display', 'none');
20
            }
21
        });
22
        */
23
 
24
 
25
        $('button').button();
26
        $(".copy button").button({
27
            icons: {
28
                primary: "ui-icon-copy"
29
            }
30
        }).click(bill_to_ship);
31
        $('#gutschein').click(check_gutschein);
32
        $('#back_to_list button').button({
33
            icons: {
34
                primary: "ui-icon-arrow-1-w"
35
            }
36
        }).click(back_to_list);
37
 
38
        $('#session_dlg').dialog({
39
            autoOpen: false,
40
            modal: true,
41
            width: 600,
42
            height: 300
43
        });
44
        $('#show_session').css("cursor", "pointer").click(show_session);
45
        $('#submit_reg').button().click(submit_reg_form);
46
    });
47
 
48
    function js2session(jsKey,jsVal) {
49
        $('#session').load("/module/setSessionVars.php?" + jsKey + "=" + jsVal);
50
    }
51
 
52
    function submit_reg_form() {
53
        $('#reg_form').submit();
54
    }
55
 
56
    function show_session() {
57
        $('#session_dlg').load("/module/show_session.php").dialog("open");
58
    }
59
 
60
    function update_laender() {
61
        $('#liefer_Land').change();
62
        $('#Land').change();
63
    }
64
 
65
    function back_to_list() {
66
        $('#back_to_list').submit();
67
    }
68
 
69
 
70
 
71
    function text_search() {
72
        data = $('#form').serializeArray();
73
 
74
 
75
        $('.maincontent').html('<div class="box_2"><div class="box_top"></div><div class="box_middle" style="font-weight:bold!important;"><center><img src="/images/webelemente/loading.gif"><p>Searching. Please wait</p></center></div><div class="box_bottom"></div></div>');
76
        $('.maincontent').load('/module/search.php', data);
77
        return false;
78
    }
79
 
80
    function clear_search() {
81
        $('.menu_select option[value=""]').prop('selected', true);
82
 
83
        data = $("#search_ausp").serializeArray();
84
        $(".searchrefresh").load("/module/updateSearchFilter.php", data, function() {
85
            initTooltip();
86
        });
87
    }
88
 
89
    function select_search() {
90
        if (select_search_valid()) {
91
            data = $('#search_ausp').serializeArray();
92
 
93
 
94
            $('.maincontent').html('<div class="box_2"><div class="box_top"></div><div class="box_middle" style="font-weight:bold!important;"><center><img src="/images/webelemente/loading.gif"><p>Searching. Please wait</p></center></div><div class="box_bottom"></div></div>');
95
            $('.maincontent').load('/module/search.php', data);
96
 
97
        }
98
    }
99
 
100
    function select_search_valid() {
101
        var isValid = true;
102
        if ($("#auspraegung_1").val() == "" && $("#auspraegung_2").val() == "" && $("#auspraegung_3").val() == "" && $("#auspraegung_4").val() == "" && $("#category").val() == "") {
103
            isValid = false;
104
            alert(" Please select a filter! ");
105
        }
106
        return isValid;
107
    }
108
 
109
    function fine_search() {
110
 
111
        daten = $('#fine_search').serializeArray();
112
        $('.maincontent').html('<div class="box_2"><div class="box_top"></div><div class="box_middle" style="font-weight:bold!important;"><center><img src="/images/webelemente/loading.gif"><p>Searching. Please wait</p></center></div><div class="box_bottom"></div></div>');
113
        $('.maincontent').load('/module/search.php', daten);
114
    }
115
 
116
    function sort_search() {
117
 
118
        daten = $('#sort_search').serializeArray();
119
        $('.maincontent').html('<div class="box_2"><div class="box_top"></div><div class="box_middle" style="font-weight:bold!important;"><center><img src="/images/webelemente/loading.gif"><p>Searching. Please wait</p></center></div><div class="box_bottom"></div></div>');
120
        $('.maincontent').load('/module/search.php', daten);
121
    }
122
 
123
 
124
    function check_gutschein() {
125
        gs_code = $('#gs_code').val();
126
        $('#gs_check_result').removeClass("ui-state-error");
127
        if (gs_code == "") {
128
            meld_gs("Bitte geben Sie einen g&uuml;ltigen Code ein.|1");
129
            return false;
130
        }
131
        $('#gs_check_result').load("/module/check_code.php", { code: gs_code }, meld_gs);
132
    }
133
 
134
    function meld_gs(data) {
135
        arr = data.split('|');
136
        $('#gs_check_result').html(arr[0]);
137
        if (arr[1] == 1) {
138
            $('#gs_check_result').addClass("ui-state-error");
139
        } else {
140
            document.location.reload();
141
        }
142
        $('#gs_code').val("");
143
    }
144
 
145
    function bill_to_ship() {
146
        anrede = $('#Anrede').val();
147
        vorname = $('#vorname').val();
148
        nachname = $('#nachname').val();
149
        firma = $('#firma').val();
150
        strasse = $('#strasse').val();
151
        hausnummer = $('#hausnummer').val();
152
        strasse2 = $('#strasse2').val();
153
        plz = $('#plz').val();
154
        ort = $('#ort').val();
155
        land = $('#Land').val();
156
        email = $('#email').val();
157
        telefon = $('#telefon').val();
158
        fax = $('#fax').val();
159
        comment = $('#comnent').val();
160
        vat_id = $('#vat_id').val();
161
        state = $('#state').val();
162
        pro_title = $('#ProfTitle').val();
163
        $('#liefer_Anrede').val(anrede);
164
        $('#liefer_vorname').val(vorname);
165
        $('#liefer_nachname').val(nachname);
166
        $('#liefer_firma').val(firma);
167
        $('#liefer_strasse').val(strasse);
168
        $('#liefer_hausnummer').val(hausnummer);
169
        $('#liefer_strasse2').val(strasse2);
170
        $('#plz2').val(plz);
171
        $('#ort2').val(ort);
172
        $('#liefer_Land').val(land).change();
173
        $('#liefer_email').val(email);
174
        $('#liefer_telefon').val(telefon);
175
        $('#liefer_vat_id').val(vat_id);
176
        $('#liefer_state').val(state);
177
        $('#liefer_ProfTitle').val(pro_title);
178
        $('#liefer_fax').val(fax);
179
        $('#liefer_comment').val(comment);
180
        return false;
181
    }
182
 
183
    function upd_state() {
184
        f_id = this.id;
185
 
186
        if (f_id == "liefer_Land") {
187
            t_list = "liefer_state";
188
        } else {
189
            t_list = "state";
190
        }
191
 
192
 
193
        if ($('#' + f_id).val() == 173) {
194
            $('#' + t_list).show();
195
        } else {
196
            $('#' + t_list).hide();
197
        }
198
 
199
        land = $('#Land').val();
200
        liefer_land = $('#liefer_Land').val();
201
 
202
        if (land == 173) {
203
            $('#state_row').show();
204
        } else {
205
            $('#state_row').hide();
206
        }
207
 
208
        if (liefer_land == 173) {
209
            $('#liefer_state_row').show();
210
        } else {
211
            $('#liefer_state_row').hide();
212
        }
213
    }
214
 
215
    function change_vat() {
216
        land = $(this).val();
217
        liefer = 0;
218
        if (this.id == "liefer_Land") {
219
            liefer = 1;
220
        }
221
        $.ajax({
222
            url: "/update_vat.php?l_id=" + land + "&liefer=" + liefer,
223
            success: update_vat
224
        });
225
    }
226
 
227
    function update_vat(data) {
228
        res = data.split("|");
229
 
230
        if (res[0] == 1) {
231
 
232
            $('#' + res[1] + 'ustidnr_text').show();
233
            $('#' + res[1] + 'ustidnr_input').show();
234
            $("#" + res[1] + "ustidnrReq").val("ustidnr");
235
 
236
        } else {
237
 
238
            $('#' + res[1] + 'ustidnr_text').hide();
239
            $('#' + res[1] + 'ustidnr_input').hide();
240
            $("#" + res[1] + "ustidnrReq").val("");
241
        }
242
    }
243
 
244
    /*function query_amount()
245
    {
246
        a_id_str=this.id;
247
        a_id_arr=a_id_str.split('_');
248
        a_id=a_id_arr[1];
249
        load_item(a_id);
250
    }
251
 
252
    function load_item(a_id)
253
    {
254
        $.get("/module/load_item.php?item="+a_id, show_amount);
255
    }
256
 
257
 
258
    function show_amount(data)
259
    {
260
        rows=data.split("|");
261
        item_infos=rows[0].split("#");
262
        $('#preisstaffel').html(rows[1]);
263
        $('#item_name').html(item_infos[0]);
264
        $('#amount_dlg').dialog("open");
265
    }
266
    function refresh_page(data)
267
    {
268
        //alert(data);
269
        $('#item_count').html(data);
270
    }
271
 
272
    //$('.add_to_basket').click(query_amount).css("cursor","pointer");
273
    $('.add_mhc_to_basket').click(query_mhc_amount).css("cursor","pointer");
274
    $("#fine_search input:checkbox").click(fine_search);
275
 
276
    // MHC functions
277
    // kopierte Funktionen
278
    function query_mhc_amount()
279
    {
280
        a_id_str=this.id;
281
        a_id_arr=a_id_str.split('_');
282
        a_id=a_id_arr[1];
283
        load_mhc_item(a_id);
284
    }
285
 
286
    function load_mhc_item(a_id)
287
    {
288
        $.get("/module/load_item.php?mode=getItems&item="+a_id, show_mhc_amount);
289
    }
290
 
291
    function show_mhc_amount(data)
292
    {
293
        rows=data.split("|");
294
        item_infos=rows[0].split("#");
295
 
296
 
297
        $('#item_name').html(item_infos[0]);
298
        $('#preisstaffel').html( rows[1] );
299
 
300
 
301
        $('#amount_dlg').dialog("open");
302
 
303
    }*/