- ระบบเสียงเซอร์ราวด์ 7.1 ให้มิติเสียงรอบทิศทาง
- น้ำหนักเบาใช้งานได้เป็นเวลานาน
- มีไฟรอบที่ครอบหู
- ที่ครอบหุ่มด้วยหนัง
- ที่รองหูนุ่มใส่สบายไม่เจ็บหู
- เหมาะกับใช้เล่นเกมแนว FPS, RTS, MMORPG ,MOBA ,RPG
- สายหนาแบบพิเศษทำให้มีอายุการใช้งานที่ยาวนาน
- เชื่อมต่อด้วยปลั๊ก USB
- ใช้คู่ไดร์เวอร์เฉพาะของ Fantech HG16
FANTECH รุ่น HG16 (SNIPER 7.1) Stereo Headset for Gaming หูฟังเกมมิ่ง แบบครอบหัว มีไมโครโฟน ระบบสเตอริโอ กระหึ่ม ระบบเสียงเซอร์ราวด์ 7.1 สำหรับเกมแนว FPS TPS (สีดำ)
Model HG16 Sniper
Cable length 2m Plastic Cable
Microphone Omni Directial
Sensitivity Mic. 42+/-2dB
'; text = text.replace(regEx, '$1'); //text.replaceAll(searchStr, ''+val+''); }); return text; } $(".search-txtbox").easyAutocomplete(options); $(".shop-data").change(function(){ if($(this).val() == 'small'){ if($(".check_branch").is(':checked')){ $(".branch_num").show(); }else{ $(".branch_num").hide(); } }else{ if($(".check_branch").is(':checked')){ $(".branch_num").show(); }else{ $(".branch_num").hide(); } } }); window.fbAsyncInit = function() { FB.init({ appId : '903978352997310', xfbml : true, version : 'v2.3' }); FB.AppEvents.logPageView(); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); $(".btn-facebook").click(function(){ show_loading(); }); $("#btn-login").click(function(){ $(".login-fail-alert").hide(); $("#form-redirect").remove(); let form_login; form_login = '.login-form-new'; var form_valid = $(form_login).validationEngine('validate'); if(form_valid === true){ var url_login = "https://209.97.150.203.sta.inet.co.th/adviceonline/login/chklogin"; show_loading(); var user = $("#login-user").val(); var pass = encodeURIComponent($("#login-pass").val()); var pass_input = $("#login-pass").val(); var type = $(this).attr('login-type'); $.ajax({ type: "POST", url: url_login, dataType:'json', data: "user="+user+"&pass="+pass+"&type="+type+"&seg=headset-7-1-fantech-sniper-hg16-gaming", success: function(data){ if(data.status == 'success'){ if(type == 'personal'){ //$(".login-form").attr("action", "https://online.advice.co.th/login/chklogin?advice=login"); //$(".login-form").submit(); $('body').append('
'); $("#form-redirect").submit(); hide_loading(); }else if(type == 'supplier'){ $(form_login).attr("action", "https://sys.advice.co.th/supp/login_sup.php");//ของจริง //$(form_login).attr("action", "http://203.154.135.180/~thesystem/supp/login_sup.php");//สำหรับเทสอย่าอัพจริง $('#sup_code').val(user); $('#sup_pass').val(pass_input); $(form_login).submit(); }else if(type == 'dealer' || data.type == 'dealer'){ $(form_login).attr("action", "https://209.97.150.203.sta.inet.co.th/advicedealer/chklogin"); $('#dealer_user').val(user); $('#dealer_pass').val(pass_input); $(form_login).submit(); }else if(type == 'technician'){ $(form_login).attr("action", "https://209.97.150.203.sta.inet.co.th/advicetechnician/regislogin/headset-7-1-fantech-sniper-hg16-gaming"); $('#dealer_user').val(user); $('#dealer_pass').val(pass_input); $(form_login).submit(); } }else if(data.status == 'dealer_old'){ hide_loading(); $(".login-fail-alert").html('รหัสลูกค้าถูกยกเลิกใช้โดยระบบ').show(); }else{ hide_loading(); if(type == 'dealer'){ if(data.status == 'customer'){ var text = 'รหัสสมาชิกของท่านได้ปรับเป็น "ลูกค้าทั่วไป" '; text += '
"); $("#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 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; //ขนส่ง JT var obj = JSON.parse('{"province_all":{"0":4,"1":2,"2":3,"3":59,"4":60,"5":58,"6":5,"7":6,"8":8,"9":15,"10":11,"11":47,"12":19},"province_some":{"0":1},"district":{"0":11}}'); 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); if ( check_prov_all || ( check_prov_some && check_district ) ) { if(1579600328 >= 1579572000 && 1579600328 <= 1579593600 && 'Tue' != 'Sat' && 'Tue' != 'Sun' ){ fast_next_jt_chk = true; } } //ขนส่ง 2 ชั่วโมง var obj = JSON.parse('{"province_all":{"0":1,"1":3},"province_some":{"0":4,"1":2,"2":59,"3":58},"district":{"0":66,"1":70,"2":52,"3":815,"4":813},"sub_dist_not":{"0":246,"1":248,"2":244,"3":240,"4":237}}'); var arr_province_all = obj.province_all; var arr_province_some = obj.province_some; var arr_district = obj.district; var arr_sub_district_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_sub_district = check_local(arr_sub_district_not,sub_dist); if( ( check_prov_all || ( check_prov_some && check_district ) ) && !check_sub_district ){ if(1579600328 >= 1579572000 && 1579600328 <= 1579615200 ){ result = "2h"; fast2_chk = true; } } //ขนส่ง 3 ชั่วโมง var obj = JSON.parse('{"province_all":{"0":1},"province_some":{"0":2,"1":59,"2":60,"3":58,"4":5,"5":55,"6":57,"7":15,"8":17},"district":{"0":52,"1":55,"2":54,"3":814,"4":815,"5":818,"6":807,"7":809,"8":813,"9":812,"10":74,"11":79,"12":77,"13":83,"14":84,"15":775,"16":803,"17":180,"18":205}}'); var arr_province_all = obj.province_all; var arr_province_some = obj.province_some; var arr_district = obj.district; var fast_next = false; 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); if( ( check_prov_all || ( check_prov_some && check_district ) ) ){ if(total >= 3900 && 1579600328 >= 1579572000 && 1579600328 <= 1579618800 ){ result = "555"; fast3_chk = true; } if(prov_id!= 15 && total >= 3900 && 1579600328 >= 1579593600 && 1579600328 <= 1579658400 ){ fast_next = true; } } if(fast_next){ $("#fast_next").removeAttr("disabled", true); $(".ship-type-next").show(); }else{ $("#fast_next").attr("disabled", true); $(".ship-type-next").hide(); } //ขนส่ง 071 var obj = JSON.parse('{"province_all":{"0":3,"1":4},"province_some":{"0":5,"1":15,"2":17,"3":10},"district":{"0":205,"1":125,"2":74,"3":77,"4":79,"5":83,"6":84},"district_some":{"0":87},"sub_district":{"0":604,"1":595,"2":596},"sub_dist_not":{}}'); 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,sub_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 >= 3900 && 1579600328 >= 1579572000 && 1579600328 <= 1579618800 ){ result = "071"; fast3_2_chk = true; } if(total >= 3900 && 1579600328 >= 1579593600 && 1579600328 <= 1579658400 ){ fast_next = true; } } var fast5_local = JSON.parse('{"province_all":{"0":1,"1":3},"province":{"0":11,"1":15,"2":17,"3":58,"4":5,"5":55,"6":2,"7":60,"8":59,"9":10,"10":57},"amphur":{"0":136,"1":137,"2":140,"3":141,"4":142,"5":178,"6":181,"7":182,"8":202,"9":204,"10":811,"11":808,"12":810,"13":85,"14":87,"15":83,"16":78,"17":777,"18":774,"19":776,"20":57,"21":817,"22":816,"23":123,"24":126,"25":127,"26":800,"27":805},"postcode":{"0":20160,"1":20150,"2":20110,"3":20000,"4":24000,"5":24130,"6":24140,"7":26000,"8":26110,"9":73130,"10":73140,"11":73150,"12":13110,"13":13210,"14":13230,"15":13250,"16":70120,"17":70130,"18":70160,"19":10540,"20":75000,"21":74120,"22":18000,"23":18150,"24":18170,"25":72000,"26":72150,"27":72160},"sub_dist_not":{"0":604,"1":595,"2":596}}'); var fast5_chk = false; var fast5_postcode = fast5_local.postcode; var fast5_prov = fast5_local.province; var fast5_amphur = fast5_local.amphur; var fast5_prov_all = fast5_local.province_all; var sub_dist_not = fast5_local.sub_dist_not; var check_prov_all = check_local(fast5_prov_all,prov_id); var check_prov = check_local(fast5_prov,prov_id); var check_amphur = check_local(fast5_amphur,dist); var check_postcode = check_local(fast5_postcode,postcode); var check_sub_dist_not = check_local(sub_dist_not,sub_dist); if( (check_prov_all || ((check_prov) && (check_amphur) )) && !check_sub_dist_not /*&& (check_postcode)*/ ){ if(1579600328 >= 1579572000 && 1579600328 <= 1579593600 ){ if(total >= 5000){ fast5_chk = true; } } } //ขนส่ง 3 24pm 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 fast_24 = false; 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 && 1579600328 >= 1579615200 && 1579600328 <= 1579618800 ){ 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(!fast2_chk){ $("#2h").attr("disabled", true).prop("checked",false); $(".ship-type-2hr").hide(); } if(!fast3_chk && !fast3_2_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(fast3_2_chk){ $("#2h").attr("disabled", true); $(".ship-type-2hr").hide(); }*/ $.ajax({ type:"POST", dataType: "json", async: false, url: "https://209.97.150.203.sta.inet.co.th/policy/check-delivery", data:'total='+total+"&prov="+prov_id+"&district="+dist+"&postcode="+postcode, success: function(data){ //console.log(data); if(data.fast5com == '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(); } },error:function (xhr, ajaxOptions, thrownError){ console.log(xhr); return false; hide_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 = 'Tue'; 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($('.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},"district":{"0":52,"1":54,"2":55}}'); 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 = 'Tue'; if( ( check_prov_all || ( check_prov_some && check_district ) ) ){ if( "Tue" != "Sun" && 1579600328 >= 1579572000 && 1579600328 <= 1579597200 ){ $('.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/product/gaming-headset/fantech/headset-7-1-fantech-sniper-hg16-gaming'), 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 //////////////////////////// ///// view ///// ScarabQueue.push(['view', 'A0120326']); ///// category ///// ScarabQueue.push(['category', ' > > ']); ///// 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('