<?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 CustomerController extends ControllerFrontend
{
    public function save($data = array())
    {
        $input = Factory::getInput();
        $data = $input->getData();
        $page_my_customer = isset($data['page_my_customer'])?$data['page_my_customer']:'';
        $modelCustomer = Model::getInstance('customer');
        $customer =  $modelCustomer->save($data); // TODO: Change the autogenerated stub
        Utility::redirect($page_my_customer);

    }
    public function delete($id = 0)
    {
        $input = Factory::getInput();
        $customer_id = $input->getInt('customer_id',0);
        $page_my_customer = $input->getString('page_my_customer','');
        $modelCustomer = Model::getInstance('customer');
        $modelCustomer->delete($customer_id);
        Utility::redirect($page_my_customer);
    }

}
