`; var workshift_taobao_html = ` 064-519-4158 แอดมินชาไทย
`; function make_currency() { $(".currency").each(function() { var v = $(this).text(); if (v == '') { v = $(this).val(); } if (v == ".00" || v == "-.00" || v == "0.00") { $(this).text('0.00'); $(this).val('0.00'); } else { $(this).text(add_commars(v)); $(this).val(add_commars(v)); } }); } function add_commars(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function successbox(title, detail = "", callback = '') { Swal.fire({ icon: 'success', title: title, text: detail, confirmButtonColor: '#2c7be5', confirmButtonText: 'ตกลง', allowOutsideClick : false }).then(function () { if(callback != '') { eval(callback); } }); } function successbox_noconfirm(title, detail = "", callback = '') { Swal.fire({ icon: 'success', title: title, text: detail, showConfirmButton: false, timer: 3000, allowOutsideClick : false }).then(function () { if(callback != '') { callback(); } }); } function errorbox(title, detail, callback) { Swal.fire({ icon: 'error', title: title, text: detail, confirmButtonColor: '#2c7be5', confirmButtonText: 'ตกลง', allowOutsideClick : false }).then(function () { if(callback != '') { eval(callback); } }); } function warningbox(title, detail, callback) { Swal.fire({ icon: 'warning', title: title, text: detail, showConfirmButton:false, confirmButtonColor: '#2c7be5', confirmButtonText: 'ตกลง', allowOutsideClick : false }).then(function () { if(callback != '') { callback(); } }); } function confirmbox(title, btnTextYes, btnTextNo, callbackYes = '', callbackNo = '') { Swal.fire({ icon: 'question', title: title, showCancelButton: true, confirmButtonColor: '#2c7be5', cancelButtonColor: '#738194', confirmButtonText: btnTextYes, cancelButtonText: btnTextNo, allowOutsideClick : false }).then((result) => { if (result.isConfirmed) { if (callbackYes) { callbackYes(); } } else { if (callbackNo) { callbackNo(); } } }) } function infobox(title, detail) { Swal.fire({ icon: 'info', title: title, text: detail, confirmButtonColor: '#2c7be5', confirmButtonText: 'ตกลง', allowOutsideClick : false }).then(function () { eval(callback); }); } function numformat(value, point) { value = String(value).replace(" ", ""); value = value.replace(",", ""); var exp = value.split("."); var front = exp[0]; var back = exp[1]; var v = ''; for(i = front.length; i >= 0; i--) { if(front[i] != undefined && front[i] != "undefined") { v = front[i] + v; } } v = v + "."; if(back != undefined && back != "undefined") { for(i = 0; i < point; i++) { if(back[i] == "") { v = v + "0"; } else { if(back[i] != undefined && back[i] != "undefined") { v = v + back[i]; } else { v = v + "0"; } } } } else { v = v + "00"; } return (v); } function loading_close() { Swal.close(); } function loading_open() { var l = $(".swal2-backdrop-show").length; if(l == 0) { warningbox('', 'กรุณารอ...' , ''); } } jQuery.fn.extend( { scrollTo : function(speed, extra, easing) { return this.each(function() { var targetOffset = $(this).offset().top + extra; $('html,body').animate({scrollTop: targetOffset}, speed, easing); }); } }); function toggleNotice() { var style = localStorage.getItem('noticeStyle'); if(style == 'false') { localStorage.setItem('noticeStyle', true); $('#notice').removeClass(`transparents`); } else { localStorage.setItem('noticeStyle', false); $('#notice').addClass(`transparents`); } } function fn_logout() { $.ajax({ type: 'POST', async: true, url: url + 'application/signin/logout', success: function(data) { eval(data); } }); }