<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_CountryController")) {
    /**
     * Class WpBookingPro_CountryController
     */
    class WpBookingPro_CountryController extends woobooking_controller
    {
        /**
         * @return mixed
         * @throws Exception
         */
        public function ajax_add_new_country()
        {
            return self::view("country.form");
        }

        /**
         * @return mixed
         * @throws Exception
         */
        public function ajax_get_item()
        {
            return self::view("country.form");
        }

        /**
         * @return bool
         * @throws Exception
         */
        public function ajax_delete()
        {
            $countryModel = WoobookingModel::getInstance('country');
            $input = Factory::getInput();
            $list_delete_country_id = $input->get('list_delete_country_id', array(), 'array');
            foreach ($list_delete_country_id as $country_id) {
                $countryModel->delete($country_id);
            }
            return true;
        }
    }
}
?>