{"id":997,"date":"2021-06-16T09:39:18","date_gmt":"2021-06-16T09:39:18","guid":{"rendered":"http:\/\/www.rmabodyandpaint.com\/?p=997"},"modified":"2021-06-16T10:29:11","modified_gmt":"2021-06-16T10:29:11","slug":"elementor-997","status":"publish","type":"post","link":"https:\/\/www.rmabodyandpaint.com\/th\/2021\/06\/16\/elementor-997\/","title":{"rendered":"Promotion 1"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"997\" class=\"elementor elementor-997\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6d7cbe13 elementor-section-height-min-height elementor-section-boxed elementor-section-height-default elementor-section-items-middle\" data-id=\"6d7cbe13\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-159f6589\" data-id=\"159f6589\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-79770f2 elementor-widget elementor-widget-heading\" data-id=\"79770f2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Promotion<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3555dd6a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3555dd6a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-66 elementor-top-column elementor-element elementor-element-14830cb2\" data-id=\"14830cb2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f6a00d3 elementor-widget elementor-widget-heading\" data-id=\"f6a00d3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">promotion title<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0ab7f7d elementor-widget elementor-widget-image\" data-id=\"0ab7f7d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"600\" src=\"https:\/\/www.rmabodyandpaint.com\/wp-content\/uploads\/2021\/05\/Ex-Promotion.png\" class=\"attachment-large size-large wp-image-184\" alt=\"\" srcset=\"https:\/\/www.rmabodyandpaint.com\/wp-content\/uploads\/2021\/05\/Ex-Promotion.png 900w, https:\/\/www.rmabodyandpaint.com\/wp-content\/uploads\/2021\/05\/Ex-Promotion-300x200.png 300w, https:\/\/www.rmabodyandpaint.com\/wp-content\/uploads\/2021\/05\/Ex-Promotion-768x512.png 768w, https:\/\/www.rmabodyandpaint.com\/wp-content\/uploads\/2021\/05\/Ex-Promotion-16x12.png 16w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5ada6e3 elementor-widget elementor-widget-text-editor\" data-id=\"5ada6e3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-6a7ae330\" data-id=\"6a7ae330\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-7bca33f5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7bca33f5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-a6f8465\" data-id=\"a6f8465\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-53416785 elementor-widget elementor-widget-heading\" data-id=\"53416785\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-large\">MAKE AN APPOINTMENT<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-36bf7bac elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"36bf7bac\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-50af320 sidebar-appointment\" data-id=\"50af320\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-35a950fb elementor-widget elementor-widget-sidebar\" data-id=\"35a950fb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"sidebar.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<section id=\"custom_html-2\" class=\"widget_text widget widget_custom_html\"><div class=\"textwidget custom-html-widget\"><script type=\"text\/javascript\">console.log(\"SSL: no alternative certificate subject name matches target host name 'api.autocardealer.app'\")<\/script>\n\n\n<link rel=\"stylesheet\" href=\"\/\/code.jquery.com\/ui\/1.12.1\/themes\/base\/jquery-ui.css\">\n<link rel=\"stylesheet\" href=\"\/resources\/demos\/style.css\">\n<script src=\"https:\/\/code.jquery.com\/jquery-1.12.4.js\"><\/script>\n<script src=\"https:\/\/code.jquery.com\/ui\/1.12.1\/jquery-ui.js\"><\/script>\n\n<script>\n\n  $( function() {\n    $( \"#appointment_date\" ).datepicker( {\n        onSelect: function(date) {\n        \t$('.loading').removeClass('hide');\n        \tif($( \"#service\" ).find(\":selected\").val()==''){\n        \t\talert('Please select branch and service first');\n        \t\t$('.loading').addClass('hide');\n        \t\treturn false;\n        \t}\n\n            $.ajax({\n                url: $('#baseURL').val()+'\/ajax-action.php?action=booking-availability',\n                type: 'POST',\n                data: {date: $( \"#appointment_date\" ).val(), service: $( \"#service\" ).find(\":selected\").val()},\n                success: function (status) {\n                    var result = JSON.parse(status);\n                    \n                    $('#booking-time').html('');\n                    if(result.status){\n                    \tfor(var x=0;x<result.data.timeslots.length;x++){\n                    \t\tif(result.data.available.includes(result.data.timeslots[x])){\n                    \t\t $('#booking-time').append('<span id=\"time'+x+'\" class=\"col-md-3 col-sm-4 btn btn-outline-secondary aval-time\" onclick=\"update_time(`time'+x+'`,`'+result.data.timeslots[x]+'`)\" > '+result.data.timeslots[x]+' <\/span>');\n                    \t\t}else{\n                    \t\t\t$('#booking-time').append('<span id=\"time'+x+'\" class=\"col-md-3 col-sm-4 btn btn-outline-secondary disabled\"> <strike>'+result.data.timeslots[x]+'<\/strike> <\/span>');\n                    \t\t}\n                    \t}\n                    \t$('.loading').addClass('hide');\n                    }else{\n                        $('.error-message').html(\"Error occur, please contact our customer service\");\n                        $('.error').removeClass('hide');\n                        console.log(result);\n                        $('.loading').addClass('hide');\n                        $('#booking-time').html('');\n                    }\n                },\n                error: function(jqXHR, exception){\n                    ajax_error_handling(jqXHR, exception);\n                }\n            });\n        },\n        minDate:new Date(),\n        selectWeek: true,\n        inline: true,\n        firstDay: 1\n    });\n\n    $('#branch').on('change', function() {\n        var branches = JSON.parse($('#branchJson').val());\n        $('#service').html('');\n        $('#service').append('<option value=\"\">--- Choose One ---<\/option>');\n        $('#booking-time').html('');\n        $(\"#appointment_date\").val('');\n        $(\"#appointment_date\").attr(\"disabled\", true);\n        $('.to-hide').addClass('hide');\n        \/\/console.log(branches['services']);\n        if($(this).find(\":selected\").val()!=''){\n\n            for (var key in branches){ \n                if($(this).find(\":selected\").val()==branches[key]['id']){\n                \tfor(var x=0;x<branches[key]['services'].length;x++){\n\t                    $('#service').append('<option value=\"'+branches[key]['services'][x]['id']+'\">'+branches[key]['services'][x]['name']+'<\/option>');\n\t                }\n\t   \t\t\t\t\/\/$(\"#appointment_date\").attr(\"disabled\", false);\n\t                break;\n                }\n            }\n            $('#service').attr(\"disabled\", false);\n        }else{\n            $('#service').attr(\"disabled\", true);\n            $(\"#appointment_date\").attr(\"disabled\", true);\n            $(\"#appointment_date\").val(\"\");\n            $('#booking-time').html('');\n        }\n    });\n\n    $('#service').on('change', function() {\n    \t$(\"#appointment_date\").attr(\"disabled\", true);\n        \/\/$(\"#appointment_date\").val(\"\");\n\n    \tif($(this).find(\":selected\").val()!=''){\n    \t\t$(\"#appointment_date\").attr(\"disabled\", false);\n    \t}\n\n    });\n\n    $(\"#form-booking-submit\").click(function() {\n    \t$('.final-hide').addClass('hide');\n        $('.loading').removeClass('hide');\n        $('.error').addClass('hide');\n\n        if($(\"#name\").val()=='' || $(\"#number\").val()=='' || $(\"#branch\").val()=='' || $(\"#service\").val()=='' || $(\"#appointment_date\").val()=='' || $(\"#appointment_time\").val()=='' || $(\"#brand\").val()=='' || $(\"#model\").val()=='' || $(\"#year\").val()=='' || $(\"#plate_number\").val()=='' || $(\"#email\").val()==''){\n\n        \t$('.error-message').html(\"All fields with start (*) sign are required!\");\n\t        $('.error').removeClass('hide');\n\t        $('.loading').addClass('hide');\n\t        $('.final-hide').removeClass('hide');\n\n        }else{\n\n\t        $.ajax({\n\t            url: $('#baseURL').val()+'\/ajax-action.php?action=submit-booking',\n\t            type: 'POST',\n\t            data: $('#rma-booking-form').serialize(),\n\t            success: function (status) {\n\t                var result = JSON.parse(status);\n\t                if(result.status){\n\t                    \/\/location.reload();\n\t                    \/*var url = window.location.href;    \n\t\t\t\t\t\tif (url.indexOf('?') > -1){\n\t\t\t\t\t\t   url += '&success=1'\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t   url += '?success=1'\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.location.href = url;*\/\n\t\t\t\t\t\t$('.form-hide').addClass('hide');\n\t\t\t\t\t\t$('.success-message').html(\"Thank you for your submission! We will contact you shortly.\");\n\t                    $('.success').removeClass('hide');\n\n\n\t                }else{\n\t                \t$('.error-message').html(\"Error occur, please contact our customer service\");\n\t                    $('.error').removeClass('hide');\n\t                    console.log(result);\n\t                    $('.loading').addClass('hide');\n\t                    $('.final-hide').removeClass('hide');\n\t                }\n\t            },\n\t            error: function(jqXHR, exception){\n\t                \/\/ajax_error_handling(jqXHR, exception);\n\t                $('.error-message').html(\"Error occur, please contact our customer service\");\n\t                $('.error').removeClass('hide');\n\t                console.log(result);\n\t                $('.loading').addClass('hide');\n\t                $('.final-hide').removeClass('hide');\n\t            }\n\t        });\n\n    \t}\n    });\n\n    $('#service').attr(\"disabled\", true);\n\n  } );\n\n  function update_time($id,$val){\n    \t$('.aval-time').removeClass('selected-time');\n    \t$('#'+$id).addClass('selected-time');\n    \t$('#appointment_time').val($val);\n    \t$('.to-hide').removeClass('hide');\n    }\n<\/script>\n\n<style type=\"text\/css\">\n\t\/* Create four equal columns that floats next to each other *\/\n\t.hide {\n\t\tdisplay: none;\n\t}\n\t.aval-time{\n\t\tbackground-color: transparent;\n    \tcolor: black;\n    \tmargin: 5px;\n\t}\n\t.aval-time:hover{\n\t\topacity: 0.80;\n\t\tbackground-color: transparent;\n    \tcolor: grey;\n    \tmargin: 5px;\n\t}\n\t.selected-time{\n\t\tbackground-color: #6c757d;\n\t\tfont-weight: 500;\n\t\tborder: 2px solid #154360;\n\t\tcolor:black;\n\n\t}\n\t.selected-time:hover{\n\t\tbackground-color: #6c757d;\n\t\tfont-weight: 500;\n\t\tborder: 2px solid #154360;\n\t\tcolor:black;\n\n\t}\n\t.error{\n\t\tcolor: red;\n\t\ttext-align: center;\n\t}\n\t.loading{\n\t\ttext-align: center;\n\t}\n<\/style>\n\n<div class=\"rma-dealer-booking\">\n\n\t\n\t<div style=\"text-align: center;\">Error Occurs. Please contact our customer service.<\/div>\n\n\t\n<\/div><\/div><\/section>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Promotion promotion title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. MAKE AN APPOINTMENT<\/p>","protected":false},"author":3,"featured_media":184,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-promotion"],"_links":{"self":[{"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":12,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/posts\/997\/revisions\/1041"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rmabodyandpaint.com\/th\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}