<?php

namespace WpBookingProFrontend\app\controllers;

use WpBookingPro\Factory;
use WpBookingPro\Filesystem\Support\StringController;
use WpBookingPro\Mvc\Controller\ControllerFrontend;
use WpBookingPro\Mvc\Model\Model;
use WpBookingPro\Utilities\Utility;
use WpBookingProFrontend\app\helpers\ConfigHelper;
use WpBookingProFrontend\app\helpers\EmailHelper;

defined('_WPBOOKINGPRO_EXEC') or die;

/**
 * Class StateController
 */

class StateController extends ControllerFrontend
{
    public function save($data = array())
    {
        $input = Factory::getInput();
        $data = $input->getData();
        $page_my_state = isset($data['page_my_state'])?$data['page_my_state']:'';
        $modelState = Model::getInstance('state');
        $state =  $modelState->save($data); // TODO: Change the autogenerated stub
        Utility::redirect($page_my_state);

    }
    public function delete($id = 0)
    {
        $input = Factory::getInput();
        $state_id = $input->getInt('state_id',0);
        $page_my_state = $input->getString('page_my_state','');
        $modelState = Model::getInstance('state');
        $modelState->delete($state_id);
        Utility::redirect($page_my_state);
    }

}
