<?php

class order_display extends mainController {

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

    public function landing() {
//        $vars['pageName'] = 'order_display';
        $vars['error'] = false; //no error, stay on page; if true redirect to 404
        $vars['title'] = CommonLanguage::getMessage('order_display');
        $url = $_SERVER['REQUEST_URI'];
        $result = explode('/', $url);
        $vars['id'] = is_numeric($result[count($result) - 1]) ? $result[count($result) - 1] : 0;
        $vars['display_data'] = !empty($vars['id']) ? CommonFunctions::CommonView('tbl_display',['display_id'],[$vars['id']])[0]: array();
        $vars['orders'] = !empty($vars['id']) ? $this->_registry->order_display_class->get_orders_to_display($vars['display_data']['printer_ids']) : array();
        $vars['no_left_bar'] = true;
        //$vars['no_top_header'] = true;
	//
        $this->load->view('order_display', $vars, null, true);
    }


}
