ผลลัพธ์การค้นหา สำหรับ "SMC1500IC"
"); $("#alert-all").modal('show'); countDown = setInterval(loginRedirect, 1000); redirectStatus = true; } } },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } function loginRedirect(){ $(".time-redirect").html(settime); settime--; if(settime < 0){ clearInterval(countDown); settime=settimeD; show_loading(); $(".time-redirect").html(''); window.location = "https://209.97.150.203.sta.inet.co.th/advicedealer/login"; } } $('#alert-all').on('hidden.bs.modal', function (e) { if($(this).attr('status') == 'zero'){ window.location = 'https://209.97.150.203.sta.inet.co.th/cart'; } if(redirectStatus){ clearInterval(countDown); settime=settimeD; //alert('...'); } // do something... }); function check_local(obj,id){ var stt = false; $.each(obj, function(key, val) { if (val == id) { stt = true; }; }); return stt; } function check_tran(){ $(".ship-type-2hr").show(); $("#2h").removeAttr("disabled", false); $(".ship-type-3hr").show(); $("#555").removeAttr("disabled", false); $(".ship-type-fast5").show(); $("#fast5").removeAttr("disabled", false); $(".ship-type-next").show(); $("#fast_next").removeAttr("disabled", false); $(".ship-type-normal").show(); $("#062").removeAttr("disabled", false); $(".ship-type-shop").show(); $("#shop").removeAttr("disabled", false); $(".ship-type-fast24").show(); $("#fast24").removeAttr("disabled", false); $(".ship-type-next-jt").show(); $("#jt_next").removeAttr("disabled", false);	var total = $('#tt_cart').val(); if($('.tran_cart').is(':checked')) { var dist = parseInt($(".tran_cart:checked").data('district')); var prov_id = parseInt($(".tran_cart:checked").data('addr')); var sub_dist = parseInt($(".tran_cart:checked").data('subdistrict')); var postcode = parseInt($(".tran_cart:checked").data('postcode')); }else if($('#other-address').is(':checked')) { var dist = parseInt($("#district option:selected").val()); var prov_id = parseInt($("#prov option:selected").val()); var sub_dist = parseInt($("#subdistrict option:selected").val()); var postcode = parseInt($("#zip").val()); }	////////////// ใบงาน MIT6201021 //////////////// var limit_branch = 0; if(prov_id <= 4){ //กรุงเทพและปริมณฑล limit_branch = 500; }else{//ต่างจังหวัด limit_branch = 1000; } if(total > limit_branch){ $(".ship-type-branch").show(); }else{ $(".ship-type-branch").hide(); } ///////////////////////////////////////////////// var check_product_set = 'F'; var check_trans_day = 'Sun'; var check_trans_time = 1586030910; var chk_comset = "F"; var result_555=false; var result = "062"; var fast2_chk = false; var fast3_chk = false; //var fast3_2_chk = false; var fast_next_jt_chk = false; var fast_24 = false; var fast5_chk = false; var fast_next = false; var fast5com = false; var shop = false; $("body").addClass("loading"); $.ajax({ type:"POST", dataType: "json", url: "https://209.97.150.203.sta.inet.co.th/get_shipping", data:'total='+total+"&province="+prov_id+"&district="+dist+"&sub_district="+sub_dist+"&day="+check_trans_day, success: function(data){ $.each(data.shipping, function( index, value ) { if(value.type == 'fast_next_jt'){ fast_next_jt_chk = true; $('.show-time-jt').html(value.text_show); } if(value.type == 'fast2'){ fast2_chk = true; $('.show-time-fast-2').html(value.text_show); } if(value.type == 'fast3'){ fast3_chk = true; $('.show-time-fast-3').html(value.text_show); } if(value.type == 'fast_next' ){ fast_next = true; $('.show-time-fast-next').html(value.text_show); } if(value.type == 'fast5'){ fast5_chk = true; $('.show-time-fast-5').html(value.text_show); } if(value.type == 'buildit5'){ fast5com = true; } if(value.type == 'shop'){ shop = true; $('.show-time-shop').html(value.text_show); } }); // var obj = JSON.parse('{"province_all":{"0":1},"province_some":{"0":3,"1":4},"district":{"0":58,"1":59,"2":60,"3":63,"4":66},"district_some":{"0":68,"1":70,"2":71},"sub_district":{"0":376,"1":391,"2":394,"3":8930},"sub_dist_not":{"0":3,"1":9,"2":10,"3":11,"4":12,"5":21,"6":23,"7":32,"8":44,"9":46,"10":47,"11":49}}'); // เลิกใช้ // var arr_province_all = obj.province_all; // var arr_province_some = obj.province_some; // var arr_district = obj.district; // var arr_district_some = obj.district_some; // var sub_district = obj.sub_district; // var sub_dist_not = obj.sub_dist_not; // var check_prov_all = check_local(arr_province_all,prov_id); // var check_prov_some = check_local(arr_province_some,prov_id); // var check_district = check_local(arr_district,dist); // var check_district_some = check_local(arr_district_some,dist); // var check_sub_dist_not = check_local(sub_dist_not,dist); // var check_sub_district = check_local(sub_district,sub_dist); // if( (check_prov_all || ( check_prov_some && check_district ) || (check_district_some && check_sub_district) ) && !check_sub_dist_not ){ // if( total >= 5000 && 1586030910 >= 1586019600 && 1586030910 <= 1586019600 ){ // if( sub_dist == '374' && postcode != '12130'){ // }else{ // fast_24 = true; // } // } // } // if(fast_24){ // $("#fast24").removeAttr("disabled", true); // $(".ship-type-fast24").show(); // }else{ // $("#fast24").attr("disabled", true).prop("checked",false);; // $(".ship-type-fast24").hide(); // } if(fast5_chk){ $("#fast5").removeAttr("disabled", true); $(".ship-type-fast5").show(); }else{ $("#fast5").attr("disabled", true).prop("checked",false); $(".ship-type-fast5").hide(); } if(fast_next){ $("#fast_next").removeAttr("disabled", true); $(".ship-type-next").show(); }else{ $("#fast_next").attr("disabled", true).prop("checked",false); $(".ship-type-next").hide(); } if(fast5com && chk_comset == 'T'){ $("#fast_5com").attr("disabled", false); $('.ship-type-fast_5com').show(); }else{ $("#fast_5com").attr("disabled", true).prop("checked",false); $('.ship-type-fast_5com').hide(); } if(!fast2_chk /*|| check_product_set == 'T'*/){ $("#2h").attr("disabled", true).prop("checked",false); $(".ship-type-2hr").hide(); } if(!fast3_chk){ $("#555").attr("disabled", true).prop("checked",false); $(".ship-type-3hr").hide(); } if(!fast_next_jt_chk){ $("#fast_jt").attr("disabled", true).prop("checked",false); $(".ship-type-next-jt").hide(); } if(check_product_set == 'T'){ $("#tran_branch").attr("disabled", true).prop("checked",false); $(".ship-type-branch").hide(); } if(!shop){ $("#shop").attr("disabled", true).prop("checked",false); $(".ship-type-shop").hide(); } $("body").removeClass("loading"); },error:function (xhr, ajaxOptions, thrownError){ console.log(xhr); return false; $("body").removeClass("loading"); checkErrorAjax(xhr); } }); } function tran_pay(){ var total = $('#tt_cart').val(); var true_total = total; var tran = 1000 ; var total1 = 0; var id ; if($('.tran_cart').is(':checked')){ id = $(".tran_cart:checked").data('addr'); }else if($('#other-address').is(':checked')) { id = $("#prov").val(); } $('#062_pay').html(''); if(id > 4){ if(total < 1000){ var pay_062 = (1000-total); $('#062_pay').html('(ซื้ออีก '+ pay_062 +' บ.)'); } $("#tran4_pay").html(1000); $("#ttran").html(tran); $("#ptran").html('ต่างจังหวัด'); }else{ if(total < 500){ var pay_062 = (500-total); $('#062_pay').html('(ซื้ออีก '+ pay_062 +' บ.)'); } $("#tran4_pay").html(500); $("#ttran").html(500); $("#ptran").html('กรุงเทพฯ และปริมณฑล'); } if(total < tran){ if(id > 4){ if('F' == 'T'){ total = 80; }else { total = 50; } total1	= total; $("#ttran").html(tran); $("#ptran").html('ต่างจังหวัด'); }else if(total < 500){ if('F' == 'T'){ total = 80; }else{ total = 35; } total1	= total; $("#ttran").html(500); $("#ttran").html('กรุงเทพฯ และปริมณฑล'); }else{ total = 0; } $('#tran_price').val(total); }else{ $('#tran_price').val(0); } } $('.agree_credit').click(function(){ var agree_credit = $('input[name=agree_credit]:checked').val(); if(agree_credit != undefined){ $('.agreement-credit').modal('hide'); }else{ } }); $('.agree_credit').click(function(){ var agree_credit = $('input[name=agree_credit]:checked').val(); if(agree_credit != undefined){ $('.agreement-credit').modal('hide'); }else{ } }); function show_niti(p){ if(p == 1){ $('#niti').slideDown("slow"); $('.niti_other').slideDown("slow"); $('#normal').slideUp("slow"); $('.normal_other').slideUp("slow"); }else{ $('#normal').slideDown("slow"); $('.normal_other').slideDown("slow"); $('#niti').slideUp("slow"); $('.niti_other').slideUp("slow"); } } function show_niti2(p,id){ if(p == 1){ $('.niti2-'+id).slideDown("slow"); $('.normal2-'+id).slideUp("slow"); }else{ $('.normal2-'+id).slideDown("slow"); $('.niti2-'+id).slideUp("slow"); } } $( "input[name='address']" ).click(function(){ var ship = $('input[name=address]:checked').val() if(ship == 'other'){ $('.other-address').show(); }else{ $('.other-address').hide(); } }); $( "input[name='branch']" ).click(function(){ if($( "input[name='branch']:checked" ).val() == 'big'){ $('#bv').removeClass('validate[required,custom[integer]]'); }else{ $('#bv').addClass('validate[required,custom[integer]]'); } }); $( "input[name='tax_id2']" ).change(function(){ if($(this).val().length > 0){ $(this).addClass('validate[required]'); }else{ $(this).removeClass('validate[required]'); } }); var modal_555 = true; var check_555 = ''; function confirm_555(result){ check_555 = ''; var chk_tran_type = $('input[name=tran_type]:checked').val(); modal_555=false; if(result == '2h'){ check_555 = "2h" ; }else if(result == '555'){ check_555 = '555'; }else if(result == 'fast_next'){ check_555 = 'fast_next'; }else if(result == 'fast5'){ check_555 = 'fast5'; }else if(result == 'fast24'){ check_555 = 'fast24';	} if(chk_tran_type == 'จัดส่งด่วนวันถัดไป' && check_555 == ''){ modal_555 = true; div_toggle(2); $("html, body").animate({ scrollTop: 200 }); }else{ check_step =2; $(".div_toggle_2").css("cursor" , "pointer"); $('html, body').animate({scrollTop: $(".shipping-select-box").offset().top-100}, 500); //chk_num_order(); } } function check_count_installment(){ var count_pro = $('#ncount').val(); var count_num = $('#tt_num').val(); if(count_pro > 1 || count_num > 1){ $(".installment-type-credit0").prop('checked', false); $(".installment-credit0").prop('checked', false); $(".zero_perc_month").prop('checked', false); $(".none_zero_credit").hide(); $(".zero_perc_month").hide(); $(".zero_credit_show").hide(); $(".installment-detail").hide(); $('#text-alert').text('ท่านมีสินค้ามากเกินกว่า 1 ชนิด กรุณาเลือกแค่ชนิดเดียวค่ะ'); $('#id1').modal('show'); $('#modal_alert').modal('show'); return false; }else{ return true; } } $('.installment-type').click(function(){ // new var type = $(this).val(); if(type=='credit-0'){ $(".installment-credit").prop('checked', false);	//$('.installment-detail').hide(); }else{ $(".installment-credit0").prop('checked', false); } }); $('.installment-credit').click(function(){ // new $(".installment-type-credit0").prop('checked', false); $(".installment-type-credit").prop('checked', true); }); $('.installment-credit0').click(function(){ // new $(".installment-type-credit0").prop('checked', true); $(".installment-type-credit").prop('checked', false); //$('.installment-detail').hide(); }); $('.installment-type-credit0').click(function(){ check_count_installment();	if(!$('.installment-credit0').is(':checked')){ $('input[name=agree_credit]').attr('checked', false); $('.none_zero_credit').hide(); $('.zero_credit_show').hide(); $('.installment-detail').hide(); } }); $('.installment-type-credit').click(function(){ if(!$('.installment-credit').is(':checked')){ $('input[name=agree_credit]').attr('checked', false); $('.none_zero_credit').hide(); $('.zero_credit_show').hide(); $('.installment-detail').hide(); } }); function clickCreditMonth () { $('.installment-detail').show(); $('.installment-detail2').hide(); var total = $('#tt_cart').val(); var service = $('#service').val(); var bank = $("input[name='credit']:checked" ).val(); if(total < 4000){ $(this).attr('disabled','disabled'); } if(bank == 'bbl' || bank == 'kbank' ){ dok = 0.008; $('.interest_credit').html('0.80%'); }else if(bank == 'tbank'){ dok = 0.008; $('.interest_credit').html('0.80%'); }else if(bank == 'ktc0' || bank == 'kbank0' || bank == 'tbank0'){ dok = 0.000; $('.interest_credit').html('0%'); $('.installment-detail2').hide(); service = 0; }else{ dok = 0.0089; $('.interest_credit').html('0.89%'); if(bank == 'ktc'){ dok = 0.008; $('.interest_credit').html('0.80%'); $('.installment-detail2').hide(); } if(bank == 'kbank'){ dok = 0.008; $('.interest_credit').html('0.80%'); $('.installment-detail2').hide(); } if(bank == 'uob'){ dok = 0.008; $('.interest_credit').html('0.80%'); $('.installment-detail2').hide(); } } if(bank == 'ktc0' || bank == 'kbank0' || bank == 'tbank0'){ var mon = $('#zero_perc').val(); if(bank == 'tbank0'){ mon = $('#zero_perc_tbank').val(); } $(".zero_perc_text").html(mon); $(".zero_perc_month").val(mon); $(".zero_perc_month").prop('checked', true); $(".none_zero_credit").hide(); $(".zero_credit_show").show(); }else{ $(".none_zero_credit").show(); if (total <= 10000) { $('.none_zero_ten').hide(); } $(".zero_credit_show").hide(); if(total <= 9999){ var mon = 6; $(".credit_month_six").prop('checked', true); } else{ var credit_six = $(".credit_month_six").prop( "checked"); var credit_ten = $(".credit_month_ten").prop( "checked"); if(!credit_six && !credit_ten){ $(".credit_month_ten").prop( "checked" , true); } if(bank == 'uob'){ $(".credit_month_six").prop("checked",true); $(".none_zero_ten").hide(); } var mon = $('.credit_month:checked').val(); } } if(bank == 'ktc0' || bank == 'kbank0'){ var sumtotal = parseFloat(total); var ss = (parseFloat(total))/mon; var sum_6 = 0; var ss_6 = 0; var sum_10 = 0; var ss_6 = 0; var ss_10 = 0; }else{ var sum = (((parseFloat(total) + parseFloat(service)) * dok) * mon) ; var sumtotal = parseFloat(total)+parseFloat(sum); var ss = (parseFloat(total)+parseFloat(sum))/mon; var sum_6 = (((parseFloat(total) + parseFloat(service)) * dok) * 6) ; var sum_10 = (((parseFloat(total) + parseFloat(service)) * dok) * 10) ; var ss_6 = (parseFloat(total)+parseFloat(sum_6))/6; var ss_10 = (parseFloat(total)+parseFloat(sum_10))/10; } $('#mou').text(mon); $('#dok').text(sumtotal.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); $('#dok_free_percent').text(ss.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); $('#dok_mon_6').text(ss_6.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); $('#dok_mon_10').text(ss_10.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); $('#dok_mon').text(ss.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); $('.month-inst').text(mon); $('.fee-inst').text(service); } function set_tax_addr(){ var text = '';//$('#name').val()+"\n"; if($('#no').val() != ''){ text += "เลขที "+$('#no').val() } if($('#moo').val() != ''){ text += " หมู่ "+$('#moo').val() } if($('#soi').val() != ''){ text += " ซอย"+$('#soi').val() } if($('#build').val() != ''){ text += " หมู่บ้าน "+$('#build').val() } if($('#road').val() != ''){ text += " ถนน"+$('#road').val() } if($('#subdistrict').val() && $('#subdistrict').val() != ''){ if($('#prov').val() == "1"){ text += " แขวง"+$('#subdistrict :selected').text().trim(); }else{ text += " ตำบล"+$('#subdistrict :selected').text().trim(); } } if($('#district').val() && $('#district').val() != ''){ if($('#prov').val() == "1"){ text += " "+$('#district :selected').text().trim(); }else{ text += " อำเภอ"+$('#district :selected').text().trim(); } } if($('#prov').val() != ''){ text += " จังหวัด"+$('#prov :selected').text().trim(); } if($('#zip').val() && $('#zip').val() != ''){ text += " "+$('#zip').val() } //$('input[name=tax_name2]').val($('#name').val()); $('#tax_addr').val( text ); } function confirm_tax(){ $("#agree-tax").prop( "checked",true); chk_tax(); next1('T'); $("#modal_tax").modal("hide"); } function cancel_tax(){ next1('T'); $('#modal_tax').modal('hide'); } function chk_tax(){ if($('#agree-tax').is(':checked')){ $('.tax-address').show(); $(".tax-input").addClass('validate[required]'); if($('#other-tax').is(':checked')){ $('.other-tax').show(); } $('.local_01').prop('hidden', true) $('.local_02').prop('hidden', false) }else{ $('.tax-address').hide(); $(".tax-input").removeClass('validate[required]'); $('.other-tax').hide(); $('.local_01').prop('hidden', false) $('.local_02').prop('hidden', true) } if($("#other-address").is(":checked")){ set_tax_addr();	$('input[name=tax_name2]').val($('#name').val()); }else{ var name = $('input[name=address]:checked').data("name"); var address = $('input[name=address]:checked').data("address"); $("input[name=tax_name2]").val(name); $("#tax_addr").val(address); } //$('input[name=tax_name2]').val($('#name').val()); $("input[name=tax_id2]").val($("#id_card").val()); } $('.tax-input').click(function(){ if($('#new-tax').is(':checked')){ $('.new-tax').show(); }else{ $('.new-tax').hide(); } if($('#other-tax').is(':checked')){ $('.other-tax').show(); $('input.shop-data[name="niti"]').addClass('validate[required]'); }else{ $('.other-tax').hide(); $('input.shop-data[name="niti"]').removeClass('validate[required]'); } }); function text_vat(){ var id =	$('.abc:checked').val(); var name = $('#na_add_'+id).text(); //alert(name); //$('#tax_addr').text(name); } function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function getAmphur(prov,id,s_amphur){ if(id){ if(s_amphur){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getAmphur", data: "prov="+prov+"&id="+id+"&s_amphur="+s_amphur, success: function(data){ $('.amphur-'+id).html(data); var amp = $('#district-'+id).val(); var s_sub = $('#s_subdistrict-'+id).val(); getSubdistrict(amp,id,s_sub); getZip(amp,id); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); }else{ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getAmphur", data: "prov="+prov+"&id="+id, success: function(data){ $('.amphur-'+id).html(data); var amp = $('#district-'+id).val(); getSubdistrict(amp,id); getZip(amp,id); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } } else{ if($('input[name=address]:checked').val() == 'new'){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getAmphur", data: "prov="+prov+"&class=new", success: function(data){ $('.amphur-new').html(data); var amp = $('#district-new').val(); getSubdistrict(amp); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } else{ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getAmphur", data: "prov="+prov, success: function(data){ $('.amphur').html(data); var amp = $('#district').val(); getSubdistrict(amp); getZip(amp); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } } } function getSubdistrict(amp,id,s_sub){ if(id){ if(s_sub){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getSubdistrict", data: "amp="+amp+"&s_sub="+s_sub+"&id="+id, success: function(data){ $('.subdistrict-'+id).html(data); getZip(amp,id); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }) }else{ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getSubdistrict", data: "amp="+amp+"&id="+id, success: function(data){ $('.subdistrict-'+id).html(data); getZip(amp,id); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }) }; } else{ if($('input[name=address]:checked').val() == 'new'){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getSubdistrict", data: "amp="+amp+"&class=new", success: function(data){ $('.subdistrict-new').html(data); getZip(amp); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); }else{ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getSubdistrict", data: "amp="+amp, success: function(data){ $('.subdistrict').html(data); getZip(amp); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } } } function getZip(amp,id){ if(id){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getZipcode", data: "amp="+amp+"&id="+id, success: function(data){ $('#zip-'+id).html(data); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } else{ if($('input[name=address]:checked').val() == 'new'){ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getZipcode", data: "amp="+amp, success: function(data){ $('#zip-new').val(data); if($("#prov-new").val() <= 4){ $('#zip-new').attr('readonly', true); }else{ $('#zip-new').attr('readonly', false); } hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); }else{ show_loading(); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/customer/profile/getZipcode", data: "amp="+amp, success: function(data){ $('#zip').html(data); hide_loading(); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } } } var original =''; function chg_zip (id){ if(id){ if ($('#check_zipcode_'+id).is(':checked')) { original = $('.chg_zip_'+id).html(); $('.chg_zip_'+id).html(' '); }else{ $('.chg_zip_'+id).html(original); } }else{ if ($('#check_zipcode').is(':checked')) { original = $('.chg_zip').html(); var text = ' '; $('.chg_zip').html(text); }else{ $('.chg_zip').html(original); } } } function show_condition(type){ if(type=="555"){ $("#show_detail555").slideToggle(400); } } var credit_s = ''; function show_paid(paid,credit){ //var total = $('#hi_total').val(); var total = $('#tt_cart').val(); var count_pro = $('#ncount').val(); var count_num = $('#tt_num').val(); var agree_credit = $('input[name=agree_credit]:checked').val(); var bank_true = $('#bank_true').val(); var bank_kbank =$('#bank_kbank').val(); var bank_ktc = $('#bank_ktc').val(); var bank_tbank =$('#bank_tbank').val(); if(credit == 'ktc0' || credit == 'kbank0'){ if(!check_count_installment()){ return false; } }	if(bank_true == 'T'){ $('#chk_bankl_true').show(); }else{$('#chk_bankl_true').remove();} if(bank_kbank == 'T'){ $('#chk_bankl_kbank').show(); }else{$('#chk_bankl_kbank').remove();} if(bank_tbank == 'T'){ $('#chk_bankl_tbank').show(); }else{$('#chk_bankl_tbank').remove();} if(bank_ktc == 'T'){ $('#chk_bankl_ktc').show(); }else{$('#chk_bankl_ktc').remove();} if(paid != 'installment'){ $('.none_zero_credit').hide(); $('.zero_credit_show').hide(); $('.installment-detail').hide(); $('input[name=agree_credit]').attr('checked', false); } if(paid == 'credit'){ $('#atm,#etc,#installment,#bank,#online_bank,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('ชำระด้วยบัตรเครดิต '); }else if(paid == 'atm'){ $('#atm').slideDown("slow"); $('#credit,#etc,#installment,#bank,#online_bank,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('โอนผ่านธนาคาร / ATM '); }else if(paid == 'online_bank'){ $('#online_bank').slideDown("slow"); $('#credit,#etc,#installment,#bank,#atm,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('โอนผ่าน Online Bankink '); }else if(paid == 'installment'){ $('.tab_red').addClass('danger'); $('#tab_').addClass('success').removeClass('danger'); $('#show_pay').html('ผ่อนชำระด้วยบัตรเครดิต '); if ($("#dis_amount").length){var dis_amount = parseInt($("#dis_amount").val()) || 0; }else{var dis_amount=0;} total = parseInt(total); total =total-dis_amount; total = total+(total*0.02); if ($("#theeten").length){theeten = parseInt($("#theeten").val()) || 0; }else{var theeten=0;} if(total < theeten){ $('#text-alert').text('ราคาสินค้าของท่านไม่สามารถผ่อนชำระได้ค่ะ'); $('#id1').modal('show'); $('#modal_alert').modal('show'); $('#radio_aey_ism').prop('checked', false); return false; } /*if(count_pro > 1 || count_num > 1){ $('#text-alert').text('ท่านมีสินค้ามากเกินกว่า 1 ชนิด กรุณาเลือกแค่ชนิดเดียวค่ะ'); $('#id1').modal('show'); $('#modal_alert').modal('show'); $('#radio_aey_ism').prop('checked', false); return false; }*/ if(total){ $('#installment').slideDown("slow"); $('.agreement-credit').modal('hide'); $('#credit,#etc,#atm,#bank').slideUp("slow"); if(credit){ if(credit == 'ktc0' || credit == 'kbank0'){ if(credit_s != '0'){ $('input[name=agree_credit]').attr('checked', false); agree_credit = $('input[name=agree_credit]:checked').val(); } if(credit == 'ktc0' ){ $('.credit-accept-text-1').html('บริการนี้ สำหรับสมาชิกผู้ถือบัตรเครดิตของ KTC เท่านั้น หากท่านยังไม่มีบัตรจะไม่สามารถดำเนินการอนุมัติได้ ท่านสามารถติดต่อบริษัทผู้ให้บริการบัตรโดยตรงเพื่อสมัครเป็นสมาชิกบัตรก่อน ทำรายการ'); }else if(credit == 'kbank0'){ $('.credit-accept-text-1').html('บริการนี้ สำหรับสมาชิกผู้ถือบัตรเครดิตของ Kbank เท่านั้น หากท่านยังไม่มีบัตรจะไม่สามารถดำเนินการอนุมัติได้ ท่านสามารถติดต่อบริษัทผู้ให้บริการบัตรโดยตรงเพื่อสมัครเป็นสมาชิกบัตรก่อน ทำรายการ'); } $('.credit-accept-text-3').hide(); credit_s = '0'; }else{ if(credit_s != '1'){ $('input[name=agree_credit]').attr('checked', false); $('.credit-accept-text-3').show(); agree_credit = $('input[name=agree_credit]:checked').val(); } $('.credit-accept-text-1').html('บริการนี้ สำหรับสมาชิกผู้ถือบัตรเครดิตของ กรุงเทพ, Citibank, Ktc, ธนชาต, กสิกรไทย, ไทยพาณิชย์ และ UOB ที่ออกโดยธนาคารสาขาในประเทศไทย เท่านั้น หากท่านยังไม่มีบัตรจะไม่สามารถดำเนินการอนุมัติได้ ท่านสามารถติดต่อบริษัทผู้ให้บริการบัตรโดยตรงเพื่อสมัครเป็นสมาชิกบัตรก่อน ทำรายการ'); credit_s = '1'; } if(agree_credit != 'Y'){ $('.agreement-credit').modal({backdrop: "static"}); }else{ $('.agreement-credit').modal('hide'); } } } }else if(paid == 'etc'){ $('input[name=agree_credit]').attr('checked', false); $('#etc').slideDown("slow"); $('#credit,#atm,#installment,#online_bank,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('ชำระด้วยช่องทางอื่น ๆ '); }else if(paid == 'bank'){ $('#bank').slideDown("slow"); $('#credit,#atm,#installment,#etc,#online_bank,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('โอนผ่านธนาคาร '); }else if(paid == 'c2c'){ $('input[name=agree_credit]').attr('checked', false); $('#credit,#atm,#installment,#online_bank,#etc,#avi').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('ชำระด้วย Cash2Coins '); }else if(paid == 'avi'){ //$('input[name=agree_credit]').attr('checked', false); $('#avi').slideDown("slow"); $('#credit,#atm,#installment,#online_bank,#etc,#bank').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('ชำระเงินที่สำนักงานใหญ่ (ท่าอิฐ นนทบุรี) '); } } function pad (str, max , para) { str = str.toString(); return str.length < max ? pad(para + str, max,para) : str; } var intu_temp=''; var check_cod=true; function chk_num_order(){ var inpu = $('input[name=type]:checked').val(); var bank = $('input[name=bank]:checked').val(); var c = $(".chk_ra:checked").val(); var tel = $("#tel_ad").val(); var agree = $("#agree-tax").prop( "checked"); var idcard = $('#id_card').val(); var tax_select = $('input[name=tax].shop-data:checked').val(); var niti = $('input[name=niti].shop-data:checked').val(); var name_niti = $('input[name=tax_name1].shop-data').val(); var id_niti = $('input[name=tax_id1].shop-data').val(); var branch = $('input[name=branch].shop-data:checked').val(); var code_branch = $('input[name=branch_val].shop-data').val(); var name_normal = $('input[name=tax_name2].shop-data').val(); var no_tran = $('#no').val(); var tax_addr = $('textarea[name=tax_addr].shop-data').val(); var agree_credit = $('input[name=agree_credit]:checked').val(); var d1 = new Date (); var d2 = new Date ( d1 ); d2.setMinutes ( d1.getMinutes() + 30 ); var date = pad( d2.getDate(),2,'0'); var month = pad( (d2.getMonth()+1) ,2,'0'); var year = d2.getFullYear(); var hours = pad( d2.getHours() ,2,'0'); var minute = pad(d2.getMinutes() ,2,'0'); var second = pad(d2.getSeconds() ,2,'0'); var expirydate = date+""+month+""+year+""+hours+""+minute+""+second; $("#RTPEXPIRYDATE").val(expirydate); intu_temp=inpu; if(agree){ if(!tax_select){ $('#text-alert').text('กรุณาเลือกใบกำกับภาษีก่อนค่ะ'); $('#id1').modal('show'); $('input[name=tax].shop-data').focus(); return false; } if(tax_select == 'other'){ if(!niti){ $('#text-alert').text('กรุณาเลือก นิติบุคคล หรือ บุคคลธรรมดา ก่อนค่ะ'); $('#id1').modal('show'); $('input[name=niti].shop-data').focus(); return false; } else if(niti=='niti'){ if(!name_niti){ $('#text-alert').text('กรุณาใส่ชื่อนิติบุคคลก่อนค่ะ'); $('#id1').modal('show'); $('input[name=tax_name1].shop-data').focus(); return false; } if($.trim(branch) == 'small'){ if(!code_branch){ $('#text-alert').text('กรุณาใส่รหัสสาขาก่อนค่ะ'); $('#id1').modal('show'); $('input[name=branch_val].shop-data').focus(); return false; } } //	} if(!id_niti){ $('#text-alert').text('กรุณาใส่เลขประจำตัวผู้เสียภาษีก่อนค่ะ'); $('#id1').modal('show'); $('input[name=tax_id1].shop-data').focus(); return false; } } else if(niti=='normal'){ if(!name_normal){ $('#text-alert').text('กรุณาใส่ชื่อก่อนค่ะ'); $('#id1').modal('show'); $('input[name=tax_name2].shop-data').focus(); return false; } } if(!tax_addr){ $('#text-alert').text('กรุณาใส่ที่อยู่ใบกำกับก่อนค่ะ'); $('#id1').modal('show'); $('textarea[name=tax_addr].shop-data').focus(); return false; } } } if(!tel){ $('#text-alert').text('กรุณาเพิ่มเบอร์โทรศัพท์ก่อนค่ะ'); $('#id1').addClass('edit-tel'); $('#id1').modal('show'); return false; } if(!inpu){ $('#text-alert').text('กรุณาเลือกช่องทางการชำระเงินค่ะ'); $('#id1').modal('show'); return false; } if(inpu == '2'){ // new if($('.installment-type-credit0').is(':checked')){ c = $('input[name=credit]:checked').val(); } if(agree_credit != 'Y'){ $('.agreement-credit').modal('show'); return false; }else{ $('.agreement-credit').modal('hide'); } } if(inpu == '6' && check_cod){ // new var check_email = $('#email').val(); var tel = $('#tel').val(); var tel_ad = $('#tel_ad').val(); if(tel_ad){ tel = tel_ad; } $('#cod_email').html('ระบบจะทำการส่งข้อความไปที่ : '+ check_email +' '); $('#cod_tel').html('และเบอร์โทรศัพท์ : '+ tel +' '); $('#btn_edit_mail_cod').data('email',check_email) $('#confirm_email_cod').modal(); return false; } if(c == undefined && (inpu != '1' && inpu != '3' && inpu != '6' && inpu != 'c2c') ){ $('#text-alert').text('กรุณาเลือกธนาคารก่อนค่ะ'); if(inpu == '8'){$('#text-alert').text('กรุณาเลือกช่องทางการชำระเงินก่อนค่ะ');} $('#id1').modal('show'); return false; } else if(!$('input[name=tran_type]').is(':checked')) { $('#text-alert').text('กรุณาเลือกรูปแบบการจัดส่งค่ะ'); $('#id1').modal('show'); $('html, body').animate({scrollTop: $(".shipping-select-box").offset().top-200}, 500); re_ship_select(); return false; } else{ if($('input[name=tran_type]').is(':checked')) { var tran_type = $('input[name=tran_type]:checked').val(); if(tran_type == 'จัดส่ง5ชั่วโมงประกอบคอม'){ if(!$("input[name='comset']").prop('checked')){ $('#step1').hide(); $('#step2').hide(); $('#step4').hide(); $('#step2').show(); focusTo('#step2'); return false; } } } var ship = $('input[name=address]:checked').val() var name = $('#name').val(); var tel_ad = $('#tel_ad').val(); var prov = $('#prov').val(); var district = $('#district').val(); var subdistrict = $('#subdistrict').val(); var zip = $('#zip').val(); if(ship == 'other' && (no_tran == '' || name == '' || tel_ad == '' || prov == '' || district == '' || subdistrict == '' || zip == '')){ $("body").addClass("loading"); $('#text-alert-all').html('
'; $("#modal_text_555").html(text); $("#modal_555").modal({backdrop: 'static', keyboard: false}); return true; }else{ return false; } } function check_bank_fast(){	check_555 = ''; var now_date = 'Sun'; var data_type = $('input[name="tran_type"]:checked').data('type'); var arr_type = ["fast2","fast3_555","fast5"]; //$("#div-cod").hide(); $("#div-avi").hide(); if(data_type == 'fast24' || ((now_date == 'Sun' || "2" == '1' ) && ( arr_type.indexOf(data_type) != -1 ) ) ){ //$("#div-cod").hide(); //$("#div-ibank").hide(); //$("#div-atm").hide(); $("#div-counter").hide(); //$("#div-pay-c2c").hide(); //-------- โอนผ่านธนาคาร ----------------- $(".scb").hide(); $(".bbl").hide(); $(".kbank").hide(); $(".ktb").hide(); $(".tmb").hide(); //--------ATM-------------- $(".scb_").hide(); $(".bbl_").hide(); $(".kbank_").hide(); $(".ktb_").hide(); $(".tmb_").hide(); $(".ksb_").hide(); }else{ if(data_type == 'fast3_555' || data_type == 'default'){ //$("#div-cod").show(); }else if(data_type == 'shop'){ $("#div-avi").show(); } $("#div-ibank").show(); $("#div-atm").show(); $("#div-counter").show(); //-------- โอนผ่านธนาคาร ----------------- $(".scb").show(); $(".bbl").show(); $(".kbank").show(); $(".ktb").show(); $(".tmb").show(); //--------ATM-------------- $(".scb_").show(); $(".bbl_").show(); $(".kbank_").show(); $(".ktb_").show(); $(".tmb_").show(); $(".ksb_").show(); //$("#div-pay-c2c").show(); } //check_comset_cod(); } $('input[name="tran_type"]').on("click",function(){ check_bank_fast(); }); $('input[name="type"]').on("click",function(){ var paid = $(this).val(); if(paid == 6){ $('#installment').slideUp("slow"); $('.installment-detail').hide(); $('#bank').slideUp("slow"); $('#atm').slideUp("slow"); $('.tab_red').removeClass('danger success'); $('#show_pay').html('ชำระเงินปลายทาง *รับเฉพาะเงินสดเท่านั้น (COD) '); } clear_payment_select(); }); function clear_payment_select(){ $("#show_tran").text(''); $("#tran_bath").val(0); $("#trrn").text(''); $('#tran_datatype').val(''); $('input[name="bank"]').prop('checked', false); $('input[name="installment-type"]').prop('checked', false); $('input[name="credit"]').prop('checked', false); $('input[name="credit_month"]').prop('checked', false); } function check_comset_cod(){ var tran_type = $('input[name=tran_type]:checked').val(); var total = $('#tt_cart').val(); $('.pament-type-select-cod').hide(); $('#txt-select-cod').val(''); if(tran_type == 'จัดส่งแบบธรรมดา'){ if(total >= 1000 && total<= 50000 && "T" == "T" && !$('input[name=comset]').is(':checked')){ $("#radio_cod").attr("disabled", false); $('.pament-type-select-cod').show(); $('#txt-select-cod').val('T'); }else{ $("#radio_cod").prop('checked', false); $("#radio_cod").attr("disabled", true); $('.pament-type-select-cod').hide(); $('#txt-select-cod').val(''); } }else if(tran_type == "จัดส่งแบบด่วน"){ if(total >= 5000 && total <= 50000 ){ if($('.tran_cart').is(':checked')) { var dist = parseInt($(".tran_cart:checked").data('district')); var prov_id = parseInt($(".tran_cart:checked").data('addr')); var sub_dist = parseInt($(".tran_cart:checked").data('subdistrict')); var postcode = parseInt($(".tran_cart:checked").data('postcode')); }else if($('#other-address').is(':checked')) { var dist = parseInt($("#district option:selected").val()); var prov_id = parseInt($("#prov option:selected").val()); var sub_dist = parseInt($("#subdistrict option:selected").val()); var postcode = parseInt($("#zip").val()); } var obj = JSON.parse('{"province_all":{"0":1,"1":3,"2":4},"province_some":{"0":2,"1":15,"2":59,"3":55,"4":60,"5":57,"6":58},"district":{"0":52,"1":54,"2":55,"3":814,"4":815,"5":807,"6":809,"7":813,"8":812,"9":775,"10":818,"11":803,"12":180}}'); var arr_province_all = obj.province_all; var arr_province_some = obj.province_some; var arr_district = obj.district; var check_prov_all = check_local(arr_province_all,prov_id); var check_prov_some = check_local(arr_province_some,prov_id); var check_district = check_local(arr_district,dist); var now_date = 'Sun'; if( ( check_prov_all || ( check_prov_some && check_district ) ) ){ if( "Sun" != "Sun" && 1586030910 >= 1586052000 && 1586030910 <= 1586077200 ){ $('.pament-type-select-cod').show(); $('#txt-select-cod').val('T'); } } } } } function getBranch(province_id){ $.ajax({ type: "POST", dataType: "JSON", data:{province_id:province_id}, url: "https://209.97.150.203.sta.inet.co.th/home/getprovince", success: function(data){ //alert(data); $("#branch").html("").append("สาขา"); $.each(data, function( index, value ) { $("#branch").append("" + value.name + ""); }); },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); } function showMap(select_map){ var map = select_map.find(':selected').data('map'); //var name = select_map.find(':selected').data('name'); //$("#show_map").html("แผนที่"); $("#show_map").html(""); if(map != ''){ $("#show_map").html(" "); } } function quotationOrder(){ var arr_data = []; $(".input-number").each(function(){ var code = $(this).attr('cart'); var qty = $(this).val(); var price = $(this).attr('pricefirst'); var price_true = $(this).attr('price_true'); var promo = $(this).attr('gold-time'); arr_data.push({code:code,qty:qty,price:price,price_true:price_true,promo:promo}); }); $.ajax({ type: "POST", url: "https://209.97.150.203.sta.inet.co.th/home/setquotation", data: {data:arr_data}, dataType : 'json', success: function(data){ if(data == 'discount'){ $('#text-alert-all').html('
' }); $('#tta').html(ordernum); $('.cart-modal').modal('hide'); $('#net_rept').modal('show'); hide_loading(); } function show_num_cart(){ /*var cart_data = []; $.ajax({ type: "POST", dataType: "json", async:false, url:"https://209.97.150.203.sta.inet.co.th/cart/cart-new?get=num", data: "cart=cart-new", success: function(data){ cart_data = data; },error:function (xhr, ajaxOptions, thrownError){ hide_loading(); checkErrorAjax(xhr); } }); return cart_data;*/ } $(document).on('click','.set-language',function(){ show_loading(); $.ajax({ dataType:'json', type: "POST", url: "https://209.97.150.203.sta.inet.co.th/language", data: "lang="+$(this).data('lang')+"&page="+encodeURIComponent('https://209.97.150.203.sta.inet.co.th/tag/SMC1500IC'), success: function(data){ //console.log(data); show_loading(); window.location.href = data.page; },error:function (xhr, ajaxOptions, thrownError){ checkErrorAjax(xhr); hide_loading(); } }); }); function modal_byorder(){ $("#modal_byorder").modal({backdrop: "static"}); } function goto_address(){ if($("#checked_byorder").is(":checked")){ window.location.href = 'https://209.97.150.203.sta.inet.co.th/byorder/address'; } } function save_byorder(){ var valid = $("#form-address-other").validationEngine('validate'); var q_mobile = $("#q_mobile").val(); if(q_mobile.substring(0, 2) == '02'){ $('#q_mobile').validationEngine('showPrompt', 'กรุณากรอกเบอร์มือถือ' , 'error', 'bottomLeft'); }else if(q_mobile.length != 10){ $('#q_mobile').validationEngine('showPrompt', 'กรุณากรอกเบอร์มือถือ ให้ครบ 10 หลัก' , 'error', 'bottomLeft') }else if(valid){ show_loading(); $("#show_modal_num").modal("hide"); $("#form-address-other").submit(); }else{ $("#q_mobile").focus(); } } ///////////////////////// emarsys script //////////////////////////// ///// cart ///// var item_cart = []; var cart = get_cart(); if(cart){ $.each(cart, function( index, value ) { item_cart.push({item: value.code, price: value.unit_price, quantity: value.num}); }); ScarabQueue.push(['cart', item_cart]); } ScarabQueue.push(['go']); var loading_img = 'https://img.advice.co.th/images_nas/advice/oneweb/assets/images/loading_blue.gif'; $('.home-promotion-online-menu').click(function(){ var menu = $(this).attr('category'); var item = $('.home-promotion-online-category[category="'+menu+'"]').find('.item'); if(item.length <= 0){ $('.home-promotion-online-category[category="'+menu+'"]').html('