Server IP : 150.95.80.236 / Your IP : 18.222.117.15 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/assets/js/custom/modals/ |
Upload File : |
// console.log('dkl;') "use strict"; var KTCreateAccount = (function () { var e, t, i, o, s, r, a = []; return { init: function () { (e = document.querySelector("#kt_modal_create_account")) && new bootstrap.Modal(e), (t = document.querySelector("#kt_create_account_stepper")), (i = t.querySelector("#form_addcase")), (o = t.querySelector('[data-kt-stepper-action="submit"]')), (s = t.querySelector('[data-kt-stepper-action="next"]')), (r = new KTStepper(t)).on("kt.stepper.changed", function (e) { // console.log(r.getCurrentStepIndex()); 5 === r.getCurrentStepIndex() ? (o.classList.remove("d-none"), o.classList.add("d-inline-block"), s.classList.add("d-none")) : (o.classList.remove("d-inline-block"), o.classList.remove("d-none"), s.classList.remove("d-none")); }), r.on("kt.stepper.next", function (e) { // console.log("stepper.next กูอยู่นี่ "); var t = a[e.getCurrentStepIndex() - 1]; t ? t.validate().then(function (t) { console.log("validated!"), "Valid" == t ? (e.goNext(), KTUtil.scrollTop()) : Swal.fire({ text: "กรุณากรอกข้อมูลให้ครบถ้วน", icon: "error", buttonsStyling: !1, confirmButtonText: "ตกลง", customClass: { confirmButton: "btn btn-light" }, }).then(function () { KTUtil.scrollTop(); }); }) : (e.goNext(), KTUtil.scrollTop()); }), r.on("kt.stepper.previous", function (e) { // console.log("stepper.previous"), e.goPrevious(), KTUtil.scrollTop(); }), a.push( FormValidation.formValidation(i, { fields: { case_tname: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_name: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, idcard: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, stringLength: { min: 13, max: 13, message: "เลขบัตรประชาชนไม่ครบ 13 หลัก", }, }, }, case_hn: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_sex: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_bday: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_nation: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_race: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_religion: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_marital: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, data_education: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, // case_education: { // validators: { // notEmpty: { // message: "กรุณากรอกข้อมูลให้ครบถ้วน", // }, // }, // }, // case_privilege: { // validators: { // notEmpty: { // message: "กรุณากรอกข้อมูลให้ครบถ้วน", // }, // }, // }, data_career: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, // case_career: { // validators: { // notEmpty: { // message: "กรุณากรอกข้อมูลให้ครบถ้วน", // }, // }, // }, admit_date: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_tel: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_address: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_moo: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_province: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_umpher: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_tumbol: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, data_privilege: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, case_country: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, }, plugins: { trigger: new FormValidation.plugins.Trigger(), bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: ".fv-row", eleInvalidClass: "", eleValidClass: "", }), }, }) ), a.push( FormValidation.formValidation(i, { fields: {}, plugins: { trigger: new FormValidation.plugins.Trigger(), bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: ".fv-row", eleInvalidClass: "", eleValidClass: "", }), }, }) ), a.push( FormValidation.formValidation(i, { fields: { total_rel: { validators: { notEmpty: { message: "กรุณากรอกข้อมูลให้ครบถ้วน", }, }, }, }, plugins: { trigger: new FormValidation.plugins.Trigger(), bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: ".fv-row", eleInvalidClass: "", eleValidClass: "", }), }, }) ), a.push( FormValidation.formValidation(i, { fields: {}, plugins: { trigger: new FormValidation.plugins.Trigger(), bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: ".fv-row", eleInvalidClass: "", eleValidClass: "", }), }, }) ), o.addEventListener("click", function (e) { a[3].validate().then(function (t) { console.log("validated!"), "Valid" == t ? (e.preventDefault(), (o.disabled = !0), o.setAttribute("data-kt-indicator", "on"), setTimeout(function () { o.removeAttribute("data-kt-indicator"), (o.disabled = !1), r.goNext(); }, 2e3)) : Swal.fire({ text: "Sorry, looks like there are some errors detected, please try again.", icon: "error", buttonsStyling: !1, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn btn-light" }, }).then(function () { KTUtil.scrollTop(); }); }); }), $(i.querySelector('[name="case_sex"]')).on("change", function () { a[0].revalidateField("case_sex"); }), $(i.querySelector('[name="case_nation"]')).on("change", function () { a[0].revalidateField("case_nation"); }), $(i.querySelector('[name="case_race"]')).on("change", function () { a[0].revalidateField("case_race"); }), $(i.querySelector('[name="case_religion"]')).on("change", function () { a[0].revalidateField("case_religion"); }), $(i.querySelector('[name="case_marital"]')).on("change", function () { a[0].revalidateField("case_marital"); }), $(i.querySelector('[name="data_education"]')).on("change", function () { a[0].revalidateField("data_education"); }), $(i.querySelector('[name="data_career"]')).on("change", function () { a[0].revalidateField("data_career"); }), $(i.querySelector('[name="case_province"]')).on("change", function () { a[0].revalidateField("case_province"); }), $(i.querySelector('[name="case_umpher"]')).on("change", function () { a[0].revalidateField("case_umpher"); }), $(i.querySelector('[name="case_tumbol"]')).on("change", function () { a[0].revalidateField("case_tumbol"); }), $(i.querySelector('[name="case_country"]')).on("change", function () { a[0].revalidateField("case_country"); }), $(i.querySelector('[name="admit_date"]')).on("change", function () { a[0].revalidateField("admit_date"); }), $(i.querySelector('[name="case_bday"]')).on("change", function () { a[0].revalidateField("case_bday"); }), $(i.querySelector('[name="case_tname"]')).on("change", function () { a[0].revalidateField("case_tname"); }), $(i.querySelector('[name="data_privilege"]')).on("change", function () { a[0].revalidateField("data_privilege"); }); }, }; })(); KTUtil.onDOMContentLoaded(function () { KTCreateAccount.init(); });