<?php
namespace WpBookingProAdmin\app\controllers;
use WpBookingPro\Factory;
use WpBookingPro\Mvc\Controller\Controller;
use WpBookingPro\Mvc\Controller\ControllerForm ;
use WpBookingPro\Mvc\Model\Model;
use WpBookingPro\Utilities\Utility;

defined('_WPBOOKINGPRO_EXEC') or die;
class OrderController extends ControllerForm
{
    public $view="orders";
    public function delete($id = 0)
    {
        return parent::delete($id); // TODO: Change the autogenerated stub
    }

    public function edit_order_by_order_id() {
        $input = Factory::getInput();
        $data = $input->getData();
        $link_redirect = isset($data['link_redirect'])?$data['link_redirect']:'';
        $modelOrder = Model::getInstance('order');
        $modelOrder->editOrderbyOrderId($data);
        Utility::redirect($link_redirect);
    }
    public function remove_order_by_order_id() {
        $input = Factory::getInput();
        $data = $input->getData();
        $link_redirect = isset($data['link_redirect'])?$data['link_redirect']:'';
        $modelOrder = Model::getInstance('order');
        $modelOrder->removeOrderbyOrderId($data);
        Utility::redirect($link_redirect);
    }
    public function send_request_payment() {
        $input = Factory::getInput();
        $data = $input->getData();
        $link_redirect = isset($data['link_redirect'])?$data['link_redirect']:'';
        $modelOrder = Model::getInstance('order');
        $modelOrder->sendRequestPayment($data);
        Utility::redirect($link_redirect);
    }

}