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