{"id":2812,"date":"2021-04-21T07:55:06","date_gmt":"2021-04-21T07:55:06","guid":{"rendered":"https:\/\/www.ube.co.th\/add-resume\/"},"modified":"2021-04-21T08:53:39","modified_gmt":"2021-04-21T08:53:39","slug":"add-resume","status":"publish","type":"page","link":"https:\/\/www.ube.co.th\/th\/add-resume\/","title":{"rendered":"Add Resume"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><style type=\"text\/css\"> \n.ui-datepicker{\n    float: left;\n}\n<\/style>\n<script type=\"text\/javascript\">\n    var maindivoffsettop = 0;\n    var currenttop = 0;\n    jQuery(document).ready(function () {\n        jQuery(\"input.jstokeninputcity\").each(function(){\n            var jsparent = jQuery(this).parent();\n            var cityid = jQuery(jsparent).find('input.jscityid').val();\n            var cityname = jQuery(jsparent).find('input.jscityname').val();\n            var datafor = jQuery(this).attr('data-for');\n            datafor = datafor.split('_');\n            getTokenInputResume(datafor, cityid, cityname);\n            try { tinymce.execCommand('mceAddEditor', true, 'resume'); } catch (e){console.log(e); }\n        });\n        \/\/More option\n        jQuery(\"body\").delegate('span.jsjobs-resume-moreoptiontitle', 'click', function(e){\n            e.preventDefault();\n            var img = jQuery(this).find('img');\n            if (jQuery('div.jsjobs-resume-moreoption').is(':hidden')) {\n                var srcimg = 'https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/resume\/up.png';\n            } else{\n                var srcimg = 'https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/resume\/down.png';\n            }\n            jQuery('div.jsjobs-resume-moreoption').toggle();\n            jQuery(img).attr('src', srcimg);\n        });\n    });\n\n    function removeLogo(id) {\n        var ajaxurl = \"https:\/\/www.ube.co.th\/wp-admin\/admin-ajax.php\";\n        jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'deleteresumelogo', resumeid: id, wpnoncecheck:common.wp_jm_nonce}, function (data) {\n            if (data) {\n                jQuery(\"img#rs_photo\").css(\"display\", \"none\");\n                jQuery(\"span.remove-file\").css(\"display\", \"none\");\n                jQuery(\"form#jsjobs-form\").append('<input type=\"hidden\" name=\"company_logo_deleted\">');\n            } else {\n                jQuery(\"div.logo-container\").append('<span style=\"color:Red;\">Error Deleting Logo');\n            }\n        });\n    }\n\n    function getTokenInputResume(datafor, cityid, cityname) {\n        var citylink = 'https:\/\/www.ube.co.th\/th\/add-resume\/?jsjobsme=city&task=getaddressdatabycityname&action=jsjobtask&jsjobspageid=2812';\n        citylink = citylink+\"&_wpnonce=e8887d21db\";\n        var inputfor = datafor[0];\n        var sectionid = datafor[1];\n        var city = jQuery(\"#\" + inputfor + \"cityforedit_\"+sectionid).val();     \n        if (city != \"\") {\n            jQuery(\"#\" + inputfor + \"_city_\"+sectionid).tokenInput(citylink, {\n                theme: \"jsjobs\",\n                preventDuplicates: true,\n                hintText: \"Type In A Search Term\",\n                noResultsText: \"No Results\",\n                searchingText: \"Searching\",\n                tokenLimit: 1,                \n                prePopulate: [{id: cityid, name: cityname}],\n                                    });\n        }else{\n            jQuery(\"#\" + inputfor + \"_city_\"+sectionid).tokenInput(citylink, {\n                theme: \"jsjobs\",\n                preventDuplicates: true,\n                hintText: \"Type In A Search Term\",\n                noResultsText: \"No Results\",\n                searchingText: \"Searching\",\n                tokenLimit: 1,\n                                });\n\n        }\n\n    }    \n\n\n    function showResumeSection( btn , sec_name){\n        var path = 'div#jssection_'+sec_name;\n        var obj = jQuery(path).find('.jssection_hide').first();\n        var islast = jQuery(path).find('.jssection_hide').next().hasClass('jssection_hide');\n        \/\/ now enable this section\n        jQuery(obj).removeClass('jssection_hide');\n        jQuery(obj).find('input.jsdeletethissection').val(0);\n        if(!islast){\n            jQuery(btn).remove();\n        }\n        \/\/ set required values\n        jQuery(obj).find(\"[data-myrequired]\").each(function(){\n            var classname = jQuery(this).attr('data-myrequired');\n            jQuery(this).addClass(classname);\n            jQuery(this).attr('data-validation',classname);\n        });\n    }\n\n    function deleteThisSection(obj){\n        jQuery(obj).hide();\n        \/\/ custom code\n        var main = jQuery(obj).parent();\n        jQuery(main).find(\"[data-validation]\").each(function(){\n            var classname = jQuery(this).attr('data-myrequired');\n            jQuery(this).removeClass(classname);\n            jQuery(this).attr('data-validation','');\n        });\n        main.find('input.jsdeletethissection').val(1);\n        main.find('div.jsundo').addClass('jsundodiv');\n        main.find('div.jsundo').show();\n    }\n    \n    function undoThisSection(obj){\n        var main = jQuery(obj).parent();\n        jQuery(main).find(\"[data-myrequired]\").each(function(){\n            var classname = jQuery(this).attr('data-myrequired');\n            jQuery(this).addClass(classname);\n            jQuery(this).attr('data-validation',classname);\n        });\n        main.hide();\n        main.removeClass('jsundodiv');\n        main.parent().find('input.jsdeletethissection').val(0);\n        main.parent().find('img.jsdeleteimage').show();\n    }\n\n    function showdiv(sectionid) {\n        document.getElementById('map_'+sectionid).style.visibility = 'visible';\n        document.getElementById('map_'+sectionid).style.display = '';\n    }\n    function hidediv(sectionid) {\n        document.getElementById('map_'+sectionid).style.visibility = 'hidden';\n        document.getElementById('map_'+sectionid).style.display = 'hidden';\n    }\n    \n    function loadMap( sectionid ) {\n\n        var default_latitude = \"33.654887\";\n        var default_longitude = \"73.03280589999997\";\n\n        var latitude = document.getElementById('latitude_'+sectionid).value;\n        var longitude = document.getElementById('longitude_'+sectionid).value;\n        var marker_flag = 0;\n        if ((latitude != '') && (longitude != '')) {\n            default_latitude = latitude;\n            default_longitude = longitude;\n            marker_flag = 1;\n        }\n        var latlng = new google.maps.LatLng(default_latitude, default_longitude);\n        zoom = 10;\n        var myOptions = {\n            zoom: zoom,\n            center: latlng,\n            scrollwheel: false,\n            mapTypeId: google.maps.MapTypeId.ROADMAP\n        };\n        var map = new google.maps.Map(document.getElementById(\"map_container_\"+sectionid), myOptions);\n        var lastmarker = new google.maps.Marker({\n            postiion: latlng,\n        });\n        var marker = new google.maps.Marker({\n            position: latlng,\n        });\n        if(marker_flag == 1){\n            marker.setMap(map);\n        }\n        \n        lastmarker = marker;\n        \/\/document.getElementById('latitude_'+sectionid).value = marker.position.lat();\n        \/\/document.getElementById('longitude_'+sectionid).value = marker.position.lng();\n\n        google.maps.event.addListener(map, \"click\", function (e) {\n            var latLng = new google.maps.LatLng(e.latLng.lat(), e.latLng.lng());\n            geocoder = new google.maps.Geocoder();\n            geocoder.geocode({'latLng': latLng}, function (results, status) {\n                if (status == google.maps.GeocoderStatus.OK) {\n                    if (lastmarker != ''){\n                        lastmarker.setMap(null);\n                    }\n                    var marker = new google.maps.Marker({\n                        position: results[0].geometry.location,\n                        map: map,\n                    });\n                    marker.setMap(map);\n                    lastmarker = marker;\n                    document.getElementById('latitude_'+sectionid).value = marker.position.lat();\n                    document.getElementById('longitude_'+sectionid).value = marker.position.lng();\n\n                } else {\n                    alert(\"Geocode was not successful for the following reason: \" + status);\n                }\n            });\n        });\n    }\n    \/\/jQuery(document).ready(function(){});\n    function getVisible() {    \n        if(jQuery('div#jsjobs-wrapper').length){\n            var div = jQuery('div#jsjobs-wrapper');\n        }else if(jQuery('div#'+common.theme_chk_prefix+'-reume-form-wrap').length){\n            var div = jQuery('div#'+common.theme_chk_prefix+'-reume-form-wrap');\n        }\n        var maxheight = jQuery(div).outerHeight();\n        var divheight = jQuery('div.js-jobs-resume-apply-now-visitor').height();\n        var scrolltop = jQuery(document).scrollTop();\n        tagheight = currenttop + scrolltop - divheight;\n        if(tagheight > maxheight){\n            tagheight = maxheight - divheight - 15;\n        }      \n        jQuery('div.js-jobs-resume-apply-now-visitor').css('top',tagheight+'px');\n    }\n    function cancelJobApplyVisitor(){\n        var result = confirm(\"Are you sure to cancel job apply\");\n        if(result == true){\n            jQuery.post(ajaxurl,{action: 'jsjobs_ajax', jsjobsme: 'jobapply', task: 'canceljobapplyasvisitor',wpnoncecheck:common.wp_jm_nonce},function(data){\n                if(data){\n                    window.location = data;\n                }   \n            });\n        }\n    }\n    function JobApplyVisitor(){\n        var resumeid = jQuery('#resume_temp').val();\n        if(resumeid == -1){\n            alert(\"Please first save the resume then apply\");\n        }else{                \n            jQuery.post(ajaxurl,{action: 'jsjobs_ajax', jsjobsme: 'jobapply', task: 'visitorapplyjob',wpnoncecheck:common.wp_jm_nonce},function(data){\n               if(data){\n                   window.location = data;\n               } \n           });\n        }\n    }\n\n    jQuery(document).ready(function(){\n\n        if(jQuery('div#jsjobs-wrapper').length){\n            maindivoffsettop = jQuery('div#jsjobs-wrapper').offset().top;\n        }else if(jQuery('div#'+common.theme_chk_prefix+'-reume-form-wrap').length){\n            maindivoffsettop = jQuery('div#'+common.theme_chk_prefix+'-reume-form-wrap').offset().top;\n        }\n        \n        currenttop = jQuery(window).height() - maindivoffsettop;\n        currenttop = currenttop - 12;\n        jQuery('div.js-jobs-resume-apply-now-visitor').css('top',currenttop+'px');\n        jQuery(window).on('scroll resize', getVisible);            \n    });\n\n\n\n    var ajaxurl = \"https:\/\/www.ube.co.th\/wp-admin\/admin-ajax.php\";\n    var resumefiles = [];\n    var k = 0;\n    var formvalidcheck = true;\n    \/\/Show resumefiles in the popup\n    function showResumeFilesArrayPopup(){\n        jQuery('div#resumefileswrapper span.livefiles').html('');\n        jQuery('span#resume-files-selected').html('');\n        for (i = 0; i < resumefiles.length; i++){\n            var obj = resumefiles[i];\n            var objHTML = '<div class=\"resumefileselected';\n            if (obj.canupload == 0){\n                objHTML += ' errormsg '\n            }\n            objHTML += '\"><span class=\"filename\">' + obj.file.name + '<\/span><span class=\"filesize\">( ' + (obj.file.size \/ 1024) + ' KB )<\/span>';\n            objHTML += '<button onclick=\"removeFileByIndex(' + i + ');\">Remove<\/button>';\n            objHTML += '<\/div>';\n            if (obj.canupload == 0){\n                objHTML += '<div class=\"error_msg\"><b>Error:<\/b> ' + obj.reason + '<\/div>';\n            }\n            jQuery('span#resume-files-selected').append(objHTML);\n            \/\/ append in main resume form\n            if (obj.canupload == 1){\n                var mHTML = '<a href=\"javascript:void(0);\" onclick=\"removeFileByIndex(' + i + ');\" class=\"file\"><span class=\"filename\">' + obj.file.name + '<\/span><span class=\"fileext\"> <\/span><img decoding=\"async\" class=\"filedownload\" src=\"https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/resume\/cancel.png\" \/><\/a>';\n                jQuery('div#resumefileswrapper span.livefiles').append(mHTML);\n            }\n        }\n    }\n\n    \/\/Personal files select\n    jQuery(\"body\").delegate(\"span.clickablefiles\", \"click\", function(e){\n        jQuery('input#resumefiles').click();\n        jQuery(\"input#resumefiles\").change(function(){\n            var srcimage = jQuery('img.rs_photo');\n            var files = this.files;\n            for (i = 0; i < files.length; i++){\n                var fileext = files[i].name.split('.').pop();\n                var filesize = (files[i].size \/ 1024);\n                var allowedExt = 'pdf,doc,docx,jpeg,png,jpg';\n                var allowedSize = '5000';\n                var maxFiles = 5;\n                allowedExt = allowedExt.split(',');\n                \/\/ check if the file is already inserted or not\n                var alreadyinserted = 0;\n                if (resumefiles.length > 0){\n                    for (m = 0; m < resumefiles.length; m++){\n                        var aobj = resumefiles[m];\n                        if (aobj.file.name == files[i].name){\n                            if (aobj.file.size == files[i].size){\n                                if (aobj.file.type == files[i].type){\n                                    alreadyinserted = 1;\n                                }\n                            }\n                        }\n                    }\n                }\n                if (alreadyinserted == 0){\n                    canupload = 0;\n                    reason = '';\n                    fileext = fileext.toLowerCase();\n                    if (maxFiles > k ){\n                        if (allowedSize > filesize){\n                            if (jQuery.inArray(fileext, allowedExt) != - 1){\n                                canupload = 1;\n                                k++;\n                            } else{\n                                reason = 'File extension mismatch';\n                            }\n                        } else{\n                            reason = 'File size exceeds limit';\n                        }\n                    } else{\n                        reason = 'Maximum files selected';\n                    }\n\n                    resumefiles.push({'canupload': canupload, 'reason': reason, 'file':files[i]});\n                }\n                console.log('alreadyinserted = ' + alreadyinserted + ' value of k ' + k);\n            }\n            showResumeFilesArrayPopup();\n        });\n    });\n    function addValidateCustom(){\n        config = {\n            onError: function(){\n                formvalidcheck = false;\n                console.log('Form invalid data not correct');\n            }\n        }\n        jQuery.validate(config);\n    }\n\n    \/\/Delete resume file stored in db\n    function deleteResumeFile(id){\n        var confirmDelete = confirm(\"Confirm to delete resume file ?\");\n        if (confirmDelete == false) {\n            return false;\n        }\n        jQuery.post(ajaxurl, {jsjobsme:'resume', action:'jsjobs_ajax', task:'removeResumeFileById', id:id,wpnoncecheck:common.wp_jm_nonce}, function (data){\n            if (data){\n                jQuery('a#file_' + id).remove();\n                k--;\n            }\n        });\n    }\n    \/\/Common section add\n    jQuery(\"body\").delegate('a.add', 'click', function(e){\n        e.preventDefault();\n        var anchor = jQuery(this);\n        var parentDiv = jQuery(this).before();\n        var section = jQuery(this).attr('data-section');\n        var resumeid = jQuery('input#resume_temp').val();\n        if (!resumeid.trim()){\n            alert(\"Please first save resume personal section then add any other section\");\n            return false;\n        }\n        jQuery('div#resume-wating').show();\n        jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'getResumeSectionAjax', section: section, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n            jQuery(parentDiv).after(data);\n            jQuery(anchor).remove();\n            addDatePicker();\n            addValidateCustom();\n            jQuery('div#resume-wating').hide();\n        });\n    });\n    function removeFileByIndex(index){\n        if (resumefiles.indexOf(index) == - 1){\n            resumefiles.splice(index, 1);\n            k--;\n            showResumeFilesArrayPopup();\n        }\n        return false;\n    }\n\n    function addDatePicker(){\n        jQuery('.custom_date').datepicker({dateFormat: 'd-m-yy'});\n    }\n    jQuery(document).ready(function () {\n        addDatePicker();\n        jQuery(\"div#black_wrapper_jobapply,div#warn-message span.close-warnmessage,div#resume-files-popup-wrapper span.close-resume-files\").click(function () {\n            jQuery(\"div#warn-message\").fadeOut();\n            jQuery(\"div#black_wrapper_jobapply\").fadeOut();\n            jQuery(\"div#resume-files-popup-wrapper\").fadeOut();\n        });\n        \/\/More option\n        jQuery(\"body\").delegate('span.resume-moreoptiontitle', 'click', function(e){\n            e.preventDefault();\n            var img = jQuery(this).find('img');\n            if (jQuery('div.resume-moreoption').is(':hidden')) {\n                var srcimg = 'https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/resume\/up.png';\n            } else{\n                var srcimg = 'https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/resume\/down.png';\n            }\n            jQuery('div.resume-moreoption').toggle();\n            jQuery(img).attr('src', srcimg);\n        });\n        \/\/Resume select file\n        jQuery(\"body\").delegate('span.resume-selectfiles', 'click', function(e){\n            e.preventDefault();\n            jQuery('div#black_wrapper_jobapply').show();\n            jQuery('div#resume-files-popup-wrapper').fadeIn();\n            showResumeFilesArrayPopup();\n        });\n        \/\/Common section edit\n        jQuery(\"body\").delegate('div.section_wrapper a.edit', 'click', function(e){\n            jQuery('div#resume-wating').show();\n            e.preventDefault();\n            var div = jQuery(this).parent().parent();\n            var section = jQuery(div).attr('data-section');\n            var sectionid = jQuery(div).attr('data-sectionid');\n            var resumeid = jQuery('input#resume_temp').val();\n            jQuery('a[data-section=\"' + section + '\"]').remove();\n            jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'getResumeSectionAjax', section: section, sectionid:sectionid, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n                jQuery(div).html(data);\n                addDatePicker();\n                addValidateCustom();\n                jQuery('div#resume-wating').hide();\n            });\n        });\n        \/\/Common section delete\n        jQuery(\"body\").delegate('div.section_wrapper a.delete', 'click', function(e){            \n            e.preventDefault();\n            var confirmDelete = confirm(\"Are you sure to delete ?\");\n            if (confirmDelete == false) {\n                return false;\n            }\n            jQuery('div#resume-wating').show();\n            var div = jQuery(this).parent().parent();\n            var section = jQuery(div).attr('data-section');\n            var sectionid = jQuery(div).attr('data-sectionid');\n            var resumeid = jQuery('input#resume_temp').val();\n            jQuery('a[data-section=\"' + section + '\"]').remove();\n            jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'deleteResumeSectionAjax', section: section, sectionid:sectionid, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n                var object = jQuery.parseJSON(data);\n                if (object.result == 1){\n                    jQuery(div).html(object.msg);\n                } else{\n                    jQuery(div).prepend(object.msg);\n                }\n                if (object.canadd == 1){\n                    jQuery(div).after(object.anchor);\n                }\n                jQuery('div#resume-wating').hide();\n            });\n        });\n        \/\/Personal section edit\n        jQuery(\"body\").delegate('a.personal_section_edit', 'click', function(e){\n            jQuery('div#resume-wating').show();\n            e.preventDefault();\n            var div = jQuery('div#resume-wrapper');\n            var section = 'personal';\n            var resumeid = jQuery('input#resume_temp').val();\n            jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'getResumeSectionAjax', section: section, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n                jQuery(div).find('div.resume-top-section').remove();\n                jQuery(div).find('div.resume-section-title.personal').remove();\n                jQuery(div).find('div[data-section=\"personal\"]').remove();\n                jQuery(div).prepend(data);\n                addDatePicker();\n                addValidateCustom();\n                jQuery('div#resume-wating').hide();\n            });\n        });\n        \/\/Skill section edit\n        jQuery(\"body\").delegate('a.skilledit', 'click', function(e){\n            e.preventDefault();\n            var div = jQuery(this).parent().next('div[data-section=\"skills\"]');\n            var section = 'skills';\n            var resumeid = jQuery('input#resume_temp').val();\n            if (!resumeid.trim()){\n                alert(\"Please first save resume personal section then add any other section\");\n                return false;\n            }\n            jQuery('div#resume-wating').show();\n            jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'getResumeSectionAjax', section: section, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n                jQuery(div).html(data);\n                addValidateCustom();\n                jQuery('div#resume-wating').hide();\n            });\n        });\n        \/\/Resume section edit\n        jQuery(\"body\").delegate('a.resumeedit', 'click', function(e){\n            e.preventDefault();\n            var div = jQuery(this).parent().next('div[data-section=\"resume\"]');\n            var section = 'resume';\n            var resumeid = jQuery('input#resume_temp').val();\n            if (!resumeid.trim()){\n                alert(\"Please first save resume personal section then add any other section\");\n                return false;\n            }\n            jQuery('div#resume-wating').show();\n            jQuery.post(ajaxurl, {action: 'jsjobs_ajax', jsjobsme: 'resume', task: 'getResumeSectionAjax', section: section, resumeid: resumeid,wpnoncecheck:common.wp_jm_nonce}, function(data){\n                jQuery(div).html(data);\n                try { tinymce.execCommand('mceAddEditor', true, 'resume'); } catch (e){console.log(e); }\n                addValidateCustom();\n                jQuery('div#resume-wating').hide();\n                \/*\n                 \/\/init quicktags\n                 quicktags({id : 'resume'});\n                 \/\/init tinymce\n                 tinymce.init(tinyMCEPreInit.mceInit['resume']);\n                 \/*\n                 tinymce.init({skin:'wordpress'}); \n                 tinyMCE.execCommand('mceAddEditor', true, 'resume');\n                 tinyMCE.execCommand('mceAddControl', true, 'resume');\n                 \/*                    \n                 tinyMCE.execCommand('mceRemoveEditor', true, 'resume');\n                 tinyMCE.init({\n                 skin : \"wordpress\",\n                 mode : \"exact\",\n                 elements : \"resumeeditor\"\n                 });\n                 tinyMCE.execCommand('mceAddEditor', false, 'resume');\n                 tinyMCE.execCommand('mceAddControl', true, 'resume');\n                 *\/\n             });\n        });\n        \/\/Personal Edit photo live change\n        jQuery(\"body\").delegate(\"img.rs_photo\", \"click\", function(e){\n            jQuery('#photo').click();\n            jQuery(\"input#photo\").change(function(){\n                var srcimage = jQuery('img.rs_photo');\n                readURL(this, srcimage);\n            });\n        });\n        addValidateCustom();\n    });\nfunction readURL(input, srcimage) {\n    if (input.files && input.files[0]) {\n        var fileext = input.files[0].name.split('.').pop();\n        var filesize = (input.files[0].size \/ 1024);\n        var allowedsize = 5048;\n        var allowedExt = 'pdf,docx,doc,png,jpeg,gif,jpg';\n        allowedExt = allowedExt.split(',');\n        if (jQuery.inArray(fileext, allowedExt) != - 1){\n            if (allowedsize > filesize){\n                var reader = new FileReader();\n                reader.onload = function (e) {\n                    jQuery(srcimage).attr('src', e.target.result);\n                }\n                reader.readAsDataURL(input.files[0]);\n            } else{\n                jQuery('input#photo').replaceWith(jQuery('input#photo').val('').clone(true));\n                alert(\"File size is greater then allowed file size\");\n            }\n        } else{\n            jQuery('input#photo').replaceWith(jQuery('input#photo').val('').clone(true));\n            alert(\"File ext. is mismatched\");\n        }\n    }\n}\nfunction submitresume(){\n    var formvalid = jQuery('form.has-validation-callback').isValid({\n        onfocusout: false,\n        invalidHandler: function(form, validator) {\n            var errors = validator.numberOfInvalids();\n            if (errors) {                    \n                validator.errorList[0].element.focus();\n            }\n        }             \n    });\n    if(formvalid == false){\n        event.preventDefault();\n        return;\n    }\n    var test = true;\n    jQuery(\"form#resumeform :input[type=email]\").each(function(){\n        var emailValue = jQuery(this).val();\n        if(emailValue.length != 0){\n            var pattern = \/^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$\/;\n            test = pattern.test(emailValue);\n            if (test == false) {\n                jQuery(this).css({ \"border-color\": 'red'});\n            }\n        }\n    });\n    if (test == false) {\n        alert('Email is not of correct Format');\n        event.preventDefault();\n        return;\n    }\n    \n    jQuery('div#resume-wating').show();\n    var resume = '';\n    if(tinyMCE.editors.length > 0){\n        var resume = tinyMCE.activeEditor.getContent();\n    }\n    jQuery('input#resume_edit_val').val(resume);\n    jQuery('#resumeform').submit();\n}\n    \/\/Common resume submit\n    function submitresumesection(section, sectionid){\n        var resumeid = jQuery('input#resume_temp').val();\n        var formdata = new FormData();\n        var form = jQuery('div[data-section=\"' + section + '\"]').find('form');\n        formvalidcheck = true; \/\/ make it always true before submitting the form\n        jQuery(form).submit(function(e){\n            e.preventDefault();\n        });\n        jQuery(form).submit();\n        if (formvalidcheck == false){\n            return false;\n        }\n        jQuery('div#resume-wating').show();\n        jQuery('div[data-section=\"' + section + '\"] input, div[data-section=\"' + section + '\"] select, div[data-section=\"' + section + '\"] textarea').each (\n            function(index){\n                var input = jQuery(this);\n                if(input.attr('type') == 'checkbox'){\n                    if(input.attr('checked')){\n                        formdata.append(input.attr('name'), input.val());\n                    }\n                }else if(input.attr('type') == 'radio'){\n                    if(input.is(\":checked\")){\n                        formdata.append(input.attr('name'), input.val());\n                    }\n                }else{\n                    formdata.append(input.attr('name'), input.val());\n                }\n            }\n            );\n        if (section == 'personal'){\n            var videotype = jQuery('input[name=videotype]:checked', form).val();\n            formdata.append('videotype', videotype);\n            if (jQuery('input#photo').length > 0){\n                if (typeof jQuery('input#photo').get(0).files[0] != 'undefined'){\n                    var file = jQuery('input#photo').get(0).files[0];\n                    formdata.append('photo', file);\n                }\n            }\n            if (resumefiles.length > 0){\n                j = 0;\n                for (i = 0; i < resumefiles.length; i++){\n                    var obj = resumefiles[i];\n                    if (obj.canupload == 1){\n                        formdata.append('resumefiles[' + j + ']', obj.file);\n                        j++;\n                    }\n                }\n            }\n            resumefiles = []; \/\/ reset the resume file object to not upload again\n        }\n        formdata.append('action', 'jsjobs_ajax');\n        formdata.append('jsjobsme', 'resume');\n        formdata.append('task', 'saveResumeSectionAjax');\n        formdata.append('section', section);\n        formdata.append('sectionid', sectionid);\n        formdata.append('id', sectionid);\n        formdata.append('resumeid', resumeid);\n        formdata.append('wpnoncecheck', common.wp_jm_nonce);\n        if (section == 'resume'){\n            var resume = tinyMCE.get('resume').getContent();\n            formdata.append('resume', resume);\n        }\n        jQuery.ajax({\n            url: ajaxurl,\n            \/\/Ajax events\n            beforeSend: function (e) {\n                            \/\/alert('Are you sure you want to upload document.');\n                        },\n                        success: function (data) {\n                            if (section == 'resume'){\n                                tinyMCE.remove();\n                            }\n                            var object = jQuery.parseJSON(data);\n                            if (section != 'resume' && section != 'skills' && section != 'personal'){\n                                if (object.canadd == 1){\n                                    jQuery('div[data-section=\"' + section + '\"][data-sectionid=\"' + sectionid + '\"]').after(object.anchor);\n                                }\n                            }\n                            if (section == 'personal'){\n                                if (object.html === 'error'){\n                                    location.reload();\n                                }\n                                jQuery('input#resume_temp').val(object.resumeid);\n                                jQuery('div#jsresume-tags-wrapper').replaceWith(object.tags);\n                            }\n                            jQuery('div[data-section=\"' + section + '\"][data-sectionid=\"' + sectionid + '\"]').replaceWith(object.html);\n                            if (section == 'addresses'){\n                                var htmlobject = jQuery.parseHTML(object.html);\n                                var id = jQuery(htmlobject).find('div.map').attr('id');\n                                if (document.getElementById('script_' + id) != 'undefined' && document.getElementById('script_' + id) != null){\n                                    document.getElementById('script_' + id).innerHTML;\n                                }\n                            }\n                            jQuery('div#resume-wating').hide();\n                        },\n                        error: function (e) {\n                        \/\/alert('error ' + e.message);\n                    },\n            \/\/ Form data\n            data: formdata,\n            type: 'POST',\n            \/\/Options to tell jQuery not to process data or worry about content-type.\n            cache: false,\n            contentType: false,\n            processData: false\n        });\n    }\n    \/\/Common resume cancel\n\n    function cancelresume(){\n\n\n    }\n\n    function cancelresumesection1(section, sectionid){\n        jQuery('div#resume-wating').show();\n        var resumeid = jQuery('input#resume_temp').val();\n        var params = {};\n        params['action'] = 'jsjobs_ajax';\n        params['jsjobsme'] = 'resume';\n        params['task'] = 'cancelResumeSectionAjax';\n        params['section'] = section;\n        params['sectionid'] = sectionid;\n        params['resumeid'] = resumeid;\n        params['wpnoncecheck'] = common.wp_jm_nonce;\n        jQuery.post(ajaxurl, params, function(data){\n            if (section == 'resume'){\n                tinyMCE.remove();\n            }\n            var object = jQuery.parseJSON(data);\n            if (section != 'resume' && section != 'skills' && section != 'personal'){\n                if (object.canadd == 1){\n                    jQuery('div[data-section=\"' + section + '\"][data-sectionid=\"' + sectionid + '\"]').after(object.anchor);\n                }\n            }\n            jQuery('div[data-section=\"' + section + '\"][data-sectionid=\"' + sectionid + '\"]').replaceWith(object.html);\n            if (section == 'addresses'){\n                var htmlobject = jQuery.parseHTML(object.html);\n                var id = jQuery(htmlobject).find('div.map').attr('id');\n                if (document.getElementById('script_' + id) != 'undefined' && document.getElementById('script_' + id) != null){\n                    document.getElementById('script_' + id).innerHTML;\n                }\n            }\n            jQuery('div#resume-wating').hide();\n        });\n    }\n\n    function getTokenInput(fieldname, fieldeditname) {\n        var citylink = 'https:\/\/www.ube.co.th\/th\/add-resume\/?jsjobsme=city&task=getaddressdatabycityname&action=jsjobtask&jsjobspageid=2812';\n        citylink = citylink+\"&_wpnonce=e8887d21db\";\n\n        var city = jQuery(\"#\" + fieldeditname).val();\n        alert(city);\n        if (city != \"\") {\n            city = jQuery.parseJSON(city);\n            jQuery(\"#\" + fieldname).tokenInput(citylink, {\n                theme: \"jsjobs\",\n                preventDuplicates: true,\n                hintText: \"Type In A Search Term\",\n                noResultsText: \"No Results\",\n                searchingText: \"Searching\",\n                tokenLimit: 1,\n                prePopulate: [{id:city.id, name:city.name}],\n                        });\n        } else {\n            jQuery(\"#\" + fieldname).tokenInput(citylink, {\n                theme: \"jsjobs\",\n                preventDuplicates: true,\n                hintText: \"Type In A Search Term\",\n                noResultsText: \"No Results\",\n                searchingText: \"Searching\",\n                tokenLimit: 1,\n                                });\n        }\n\n    }\n\n    function initialize(lat, lang, div) {\n        var myLatlng = new google.maps.LatLng(lat, lang);\n        var myOptions = {\n            zoom: 8,\n            center: myLatlng,\n            mapTypeId: google.maps.MapTypeId.ROADMAP\n        }\n        var map = new google.maps.Map(document.getElementById(div), myOptions);\n        var marker = new google.maps.Marker({\n            map: map,\n            position: myLatlng\n        });\n    }\n\n    function initializeEdit(lat, lang, div) {\n        var myLatlng = new google.maps.LatLng(lat, lang);\n        var myOptions = {\n            zoom: 8,\n            center: myLatlng,\n            mapTypeId: google.maps.MapTypeId.ROADMAP\n        }\n        var map = new google.maps.Map(document.getElementById(div), myOptions);\n        var marker = new google.maps.Marker({\n            map: map,\n            position: myLatlng\n        });\n        var lastmarker = marker;\n        google.maps.event.addListener(map, \"click\", function (e) {\n            var latLng = new google.maps.LatLng(e.latLng.lat(), e.latLng.lng());\n            geocoder = new google.maps.Geocoder();\n            geocoder.geocode({'latLng': latLng}, function (results, status) {\n                if (status == google.maps.GeocoderStatus.OK) {\n                    if (lastmarker != '')\n                        lastmarker.setMap(null);\n                    var marker = new google.maps.Marker({\n                        position: results[0].geometry.location,\n                        map: map,\n                    });\n                    marker.setMap(map);\n                    lastmarker = marker;\n                    document.getElementById('latitude_' + div).value = marker.position.lat();\n                    document.getElementById('longitude_' + div).value = marker.position.lng();\n                } else {\n                    alert(\"Geocode was not successful for the following reason: \" + status);\n                }\n            });\n        });\n    }\n    jQuery(document).ready(function(){\n        var print_link = document.getElementById('print-link');\n        if (print_link) {\n                        var href = 'https:\/\/www.ube.co.th\/th\/add-resume\/resume-print\/0';\n            print_link.addEventListener('click', function (event) {\n                print = window.open(href, 'print_win', 'width=1024, height=800, scrollbars=yes');\n                event.preventDefault();\n            }, false);\n        }\n    });\n\n<\/script>\n<div id=\"jsjobs-main-up-wrapper\">\n<input type=\"hidden\" name=\"resume_temp\" id=\"resume_temp\" value=\"\" \/><div id=\"jsjobs-header-main-wrapper\"><a class=\"headerlinks\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/jobseeker-control-panel?_wpnonce=5d0cab1bc5\">Control Panel<\/a><a class=\"headerlinks\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/job-categories?_wpnonce=2fee6434bb\">Jobs By Categories<\/a><a class=\"headerlinks\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/job-search?_wpnonce=63bae68c17\">Job Search<\/a><a class=\"headerlinks\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/newest-jobs?_wpnonce=428ad76fd5\">Newest Jobs<\/a><a class=\"headerlinks\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/my-resumes?_wpnonce=89fba3466e\">My Resume<\/a><\/div>\n            <div id=\"jsjobs-main-up-wrapper\">\n                <div class=\"js_job_error_messages_wrapper\">\n                    <div class=\"message1\">\n                        <span>\n                            Oops...\n                        <\/span>\n                    <\/div>    \n                    <div class=\"message2\">\n                         <span class=\"img\">\n                        <img decoding=\"async\" class=\"js_job_messages_image lazyload\" data-src=\"https:\/\/www.ube.co.th\/wp-content\/plugins\/js-jobs\/includes\/images\/notallow.png\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 126px; --smush-placeholder-aspect-ratio: 126\/126;\" \/>\n                         <\/span> \n                         <span class=\"message-text\">\n                            You are not logged in\n                         <\/span>\n                    <\/div>\n                    <div class=\"footer\">\n                    <a href=\"https:\/\/www.ube.co.th\/th\/add-resume\/jsjobs-login\/aHR0cHM6Ly93d3cudWJlLmNvLnRoL3RoL2FkZC1yZXN1bWUvYWRkLXJlc3VtZQ==\">Login<\/a><a href=\"https:\/\/www.ube.co.th\/th\/add-resume\/user-register\">Register<\/a>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":55,"featured_media":982,"parent":0,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"views\/template-jsjobs.blade.php","meta":{"_acf_changed":false,"footnotes":""},"folder":[],"class_list":["post-2812","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Add Resume - UBE<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ube.co.th\/th\/add-resume\/\" \/>\n<meta property=\"og:locale\" content=\"th_TH\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Resume - UBE\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ube.co.th\/th\/add-resume\/\" \/>\n<meta property=\"og:site_name\" content=\"UBE\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-21T08:53:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ube.co.th\/wp-content\/uploads\/2020\/09\/career-12.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1539\" \/>\n\t<meta property=\"og:image:height\" content=\"520\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 \u0e19\u0e32\u0e17\u0e35\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/\",\"url\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/\",\"name\":\"Add Resume - UBE\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.ube.co.th\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/career-12.jpg\",\"datePublished\":\"2021-04-21T07:55:06+00:00\",\"dateModified\":\"2021-04-21T08:53:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/#breadcrumb\"},\"inLanguage\":\"th\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"th\",\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.ube.co.th\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/career-12.jpg\",\"contentUrl\":\"https:\\\/\\\/www.ube.co.th\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/career-12.jpg\",\"width\":1539,\"height\":520},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/add-resume\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Resume\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/#website\",\"url\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/\",\"name\":\"UBE\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.ube.co.th\\\/th\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"th\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add Resume - UBE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ube.co.th\/th\/add-resume\/","og_locale":"th_TH","og_type":"article","og_title":"Add Resume - UBE","og_url":"https:\/\/www.ube.co.th\/th\/add-resume\/","og_site_name":"UBE","article_modified_time":"2021-04-21T08:53:39+00:00","og_image":[{"width":1539,"height":520,"url":"https:\/\/www.ube.co.th\/wp-content\/uploads\/2020\/09\/career-12.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 \u0e19\u0e32\u0e17\u0e35"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.ube.co.th\/th\/add-resume\/","url":"https:\/\/www.ube.co.th\/th\/add-resume\/","name":"Add Resume - UBE","isPartOf":{"@id":"https:\/\/www.ube.co.th\/th\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.ube.co.th\/th\/add-resume\/#primaryimage"},"image":{"@id":"https:\/\/www.ube.co.th\/th\/add-resume\/#primaryimage"},"thumbnailUrl":"https:\/\/www.ube.co.th\/wp-content\/uploads\/2020\/09\/career-12.jpg","datePublished":"2021-04-21T07:55:06+00:00","dateModified":"2021-04-21T08:53:39+00:00","breadcrumb":{"@id":"https:\/\/www.ube.co.th\/th\/add-resume\/#breadcrumb"},"inLanguage":"th","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ube.co.th\/th\/add-resume\/"]}]},{"@type":"ImageObject","inLanguage":"th","@id":"https:\/\/www.ube.co.th\/th\/add-resume\/#primaryimage","url":"https:\/\/www.ube.co.th\/wp-content\/uploads\/2020\/09\/career-12.jpg","contentUrl":"https:\/\/www.ube.co.th\/wp-content\/uploads\/2020\/09\/career-12.jpg","width":1539,"height":520},{"@type":"BreadcrumbList","@id":"https:\/\/www.ube.co.th\/th\/add-resume\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ube.co.th\/th\/"},{"@type":"ListItem","position":2,"name":"Add Resume"}]},{"@type":"WebSite","@id":"https:\/\/www.ube.co.th\/th\/#website","url":"https:\/\/www.ube.co.th\/th\/","name":"UBE","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ube.co.th\/th\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"th"}]}},"_links":{"self":[{"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/pages\/2812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/comments?post=2812"}],"version-history":[{"count":0,"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/pages\/2812\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/media?parent=2812"}],"wp:term":[{"taxonomy":"folder","embeddable":true,"href":"https:\/\/www.ube.co.th\/th\/wp-json\/wp\/v2\/folder?post=2812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}