{"id":1003,"date":"2019-04-05T11:24:21","date_gmt":"2019-04-05T11:24:21","guid":{"rendered":"https:\/\/demo.harutheme.com\/shang\/?page_id=1003"},"modified":"2019-04-05T11:24:21","modified_gmt":"2019-04-05T11:24:21","slug":"time-table","status":"publish","type":"page","link":"https:\/\/busscuts.com\/index.php\/time-table\/","title":{"rendered":"Time Table"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row css=&#8221;.vc_custom_1554463448815{padding-bottom: 8% !important;}&#8221;][vc_column][vc_row_inner][vc_column_inner]\n        <div class=\" \">\n                <div class=\"timetable-shortcode-wrap style_1 \">\n                <div class=\"salons\">\n            <select name=\"salon\" id=\"salon\">\n                <option value=\"\">Select Salon<\/option>\n                                <option value=\"1011\">Haru Shine<\/option>\n                                <option value=\"973\">Shang Shine<\/option>\n                                <option value=\"779\">Barber Shine<\/option>\n                            <\/select>\n        <\/div>\n        <div class=\"timetable-content\">\n                                <\/div>\n    <\/div>\n    <!-- <div class=\"item-not-found\">No item found<\/div> -->\n<script>\n    !function($){\n        $(document).ready(function() {\n            $('.timetable-shortcode-wrap').find('select[name=\"salon\"]').select2();\n\n            \/\/ @SEE: https:\/\/stackoverflow.com\/questions\/33392774\/filtering-fullcalendar-events-on-client-side\n            $('.timetable-content').fullCalendar({\n                header: { \/\/ Viewmore: https:\/\/fullcalendar.io\/docs\/display\/header\/\n                    left: 'prev,next today',\n                    center: 'title',\n                    right: 'month,agendaWeek,listWeek,agendaDay' \/\/ Viewmore: https:\/\/fullcalendar.io\/docs\/views\/Available_Views\/\n                },\n                defaultView: \"month\", \/\/ listWeek\n                eventSources: [\n                    {\n                        events: [\n                                                    ]\n                    }\n                ],\n                timeFormat: 'HH:mm', \/\/ https:\/\/fullcalendar.io\/wiki\/Upgrading-to-v2\/\n                views: {\n                    basic: {\n                        \/\/ options apply to basicWeek and basicDay views\n                        displayEventEnd: true\n                    },\n                    agenda: {\n                        \/\/ options apply to agendaWeek and agendaDay views\n                        displayEventEnd: true\n                    },\n                    week: {\n                        \/\/ options apply to basicWeek and agendaWeek views\n                        displayEventEnd: true\n                    },\n                    day: {\n                        \/\/ options apply to basicDay and agendaDay views\n                        displayEventEnd: true\n                    }\n                },\n                eventMouseover: function (event, element, view) { \/\/ See: http:\/\/stackoverflow.com\/questions\/9802179\/tooltip-for-fullcalendar-in-year-view\n                    tooltip = event.tooltip;\n\n                    $(\"body\").append(tooltip);\n                    $(this).mouseover(function (e) {\n                        $(this).css('z-index', 10000);\n                        $('.appointment-tooltip').fadeIn('500');\n                        $('.appointment-tooltip').fadeTo('10', 1.9);\n                    }).mousemove(function (e) {\n                        $('.appointment-tooltip').css('top', e.pageY + 10);\n                        $('.appointment-tooltip').css('left', e.pageX + 20);\n                    });\n                },\n                eventMouseout: function (event, element, view) {\n                    $(this).css('z-index', 8);\n                    $('.appointment-tooltip').remove();\n                }\n            });\n\n            $('#salon').change(function() {\n                $(\".timetable-content\").fullCalendar('removeEvents'); \/\/ Remove the old filtered events\n\n                var idSalon = $('#salon option:selected').val();\/\/filter based on the select value\n\n                $.ajax({\n                    type: \"POST\",\n                    url: haru_framework_ajax_url,\n                    data : {\n                        action: 'haru_ajax_get_appointment',\n                        salon: idSalon\n                    },\n                    success: function(data){\n                        if (data) {\n                            var items = $.parseJSON(data);\n\n                            $.each(items,function(index,value){ \/\/ For each event, I will compare the value with the filter, if true, render it.\n                                $(\".timetable-content\").fullCalendar('renderEvent', value, true);\n                            })\n                        }\n                    }\n                });\n            });\n        });\n    }(jQuery);\n<\/script>        <\/div>  \n\n        [\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row css=&#8221;.vc_custom_1554463448815{padding-bottom: 8% !important;}&#8221;][vc_column][vc_row_inner][vc_column_inner][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_joinchat":[],"footnotes":""},"class_list":["post-1003","page","type-page","status-publish","hentry","clearfix"],"_links":{"self":[{"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/pages\/1003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/comments?post=1003"}],"version-history":[{"count":0,"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/pages\/1003\/revisions"}],"wp:attachment":[{"href":"https:\/\/busscuts.com\/index.php\/wp-json\/wp\/v2\/media?parent=1003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}