Example #1
0
		public function __get($var)
		{
			if( $var == 'table' )
			{
				return Table::getByID($this->tableid);
			}
			elseif( $var == 'user' )
			{
				return User::getByID($this->userid);
			}
			elseif( $var == 'status' )
			{
				return Status::getByID($this->statusid);
			}
			elseif( $var == 'items' )
			{
				return Order_Item::getByOrder($this->orderid);
			}
			else
			{
				return $this->$var;
			}
		}
Example #2
0
	require_once('Session.php');
	setSession(0, '/');
	
	$id = isset( $_GET['id'] ) ? $_GET['id'] : null;
	
	if( !$_SESSION['active'] || $_SESSION['roleid'] > 2 )
	{
		throw new RedirectBrowserException("../index.php");
	}
	
	if( $id == null )
	{
		throw new RedirectBrowserException("../table.php?code=1");
	}
	elseif( $id == -1 )
	{
		session_destroy();
		throw new RedirectBrowserException("../login.php?action=logout");
	}
	
	$table = Table::getByID($id);
	if( $table instanceof Table )
	{
		$_SESSION['umbrella']['tableid'] = $table->tableid;
		throw new RedirectBrowserException("../login.php?action=logout");
	}
	else
	{
		throw new RedirectBrowserException("../table.php?code=1");
	}
?>