<?php

class kitchen_order extends mainController {

    public function __construct() {
        parent::__construct();
        $this->load->model('mainpage');
    }

    public function landing() {
        $vars['pageName'] = 'kitchen_order';
        $vars['error'] = false; //no error, stay on page; if true redirect to 404
        $vars['title'] = 'kitchen_order';
//        $logged_id = Session::getUserID();
        //        $vars['available_reserved'] = $this->_registry->restaurant->available_tables();
        $vars['takeaway_order'] = $this->_registry->restaurant->get_takeaway_pos();

        $vars['available_reserved'] = $this->_registry->restaurant->available_tables();
        $vars['reserved'] = $this->_registry->restaurant->get_all_tables_reserved();
        $vars['users'] = CommonFunctions::CommonView('tbl_common_users');
        
        $today = Date::gettoday();
        $vars['year'] = date("Y", strtotime($today)); // get the year from today
        $vars['month'] = date("m", strtotime($today)); // get the month from today
        $vars['monthName'] = date("F", mktime(0, 0, 0, $vars['month'], 10)); // get Month Name
        $vars['money_tags'] = $this->_registry->jv->viewCashCategories();
        $vars['Org_Type'] = 1;
        $vars['functions_all']=false;

        $vars['suppliers'] = $this->_registry->vendor->setData(array('Status_ID' => 1))->viewSuppliersForAutoComplete();
        $vars['CurList'] = CurrencyFactory::GetLIListCurrency();
                $vars['cash_customer_arr'] = Customer::get_cash_customer_acc();

        $vars['no_left_bar'] = true;
	
        $this->load->view('kitchen_order', $vars);
    }

    public function get_related_tables() {
        $data = $this->_registry->restaurant->setdata($_GET)->getRelatedTables();
        die(json_encode($data));
    }

}
