<?php
namespace WpBookingHotelFrontend\app\views\checkout;

use WpBookingHotel\Factory as FactoryAlias;
use WpBookingHotel\Html\ToolBar;
use WpBookingHotel\Mvc\Model\Model;
use WpBookingHotel\Mvc\View\View;

class CheckoutView extends View
{
    public $tour;
    public $number_children;
    public $number_adult;
    public $infant_number;
    public $date_check_in;
    public $first_name;
    public $last_name;
    public function display($tpl){
        $input=FactoryAlias::getInput();
        switch ($tpl){
            case "thanks":
                $order_id = $input->getInt('order_id', 0);
                $modelOrder=Model::getInstance("order");
                $this->order=$modelOrder->getItem($order_id);
                break;
            
            default:
                $input = FactoryAlias::getInput();
                $data = $input->getData();
                $this->data = $data;
                $hotel_id = $input->getInt('hotel_id',0);
                $modelHotel=Model::getInstance("hotel");
                $this->hotel = $modelHotel->getItem($hotel_id);
                $this->form = $modelHotel->getForm();
                $order_id = $input->getInt('order_id', 0);
                $orderModel = Model::getInstance('order');
                if($order_id > 0) {
                    $this->order = $orderModel->getItem($order_id);
                    $paymentModel = Model::getInstance('payment');
                    $this->paymentPlugin = $paymentModel->getPaymentPlugin($this->order->payment_id);
                }





                break;
        }
        return parent::display($tpl);
    }


}