<?php

include_once(dirname(__FILE__).'/../../Base/Controller.php');
include_once(dirname(__FILE__).'/../../Application/View/Page.php');
include_once(dirname(__FILE__).'/View.php');

class ServerController extends Controller
{
  function Add()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Add()));
  }  
  
  function Create()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Create()));
  }  
  
  function Show()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Item()));
  }  

  function Edit()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Edit()));
  }  

  function Save()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Save()));
  }  
  
  function Start()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Start()));
  }  
  
  function Stop()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->Stop()));
  }  
  
  function DatabaseImport()
  {
    $Page = new PageView($this->System);
    $View = new DatabaseView($this->System);
    return($Page->GetOutput($View->Import()));
  }  

  function ItemList()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->ItemList()));
  }  

  function GameAccountRegister()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->AccountCreate()));
  }  

  function GameAccountRegisterFinish()
  {
    $Page = new PageView($this->System);
    $View = new ServerView($this->System);
    return($Page->GetOutput($View->AccountCreateFinish()));
  }  

  function RealmList()
  {
    $View = new ServerView($this->System);
    $View->RealmListfile();
  }  

  function PatchList()
  {
    $View = new ServerView($this->System);
    $View->PatchList();
  }  
  
  function XMLExport()
  {
    $View = new ServerView($this->System);
    $View->XMLExport();
  }    
  
  function UnLock()
  {
    $Model = new Server($this->System, $_GET['Id']);
    $Model->UnLock();
  }    

  function Lock()
  {
    $Model = new Server($this->System, $_GET['Id']);
    $Model->Lock();
  }      
}
