<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_ServicesController")) {
    /**
     * Class WpBookingPro_ServicesController
     */
    class WpBookingPro_ServicesController extends woobooking_controller_frontend
    {
        /**
         * @return mixed
         * @throws Exception
         */
        public function ajax_search_service()
        {
            $input = Factory::getInput();
            $data = $input->getData();
            $modelServices = WoobookingModel::getInstance('services');
            return $modelServices->get_service_available($data);
        }

        /**
         * @return mixed
         * @throws Exception
         */
        public function get_service_available_date()
        {
            $input = Factory::getInput();
            $data = $input->getData();
            $service_id = (int)$data["service_id"];
            $modelServices = WoobookingModel::getInstance('services');
            return $modelServices->get_service_available_rate_by_service_id($service_id);
        }
    }
}
?>