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

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

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