<?php

include_once(dirname(__FILE__).'/../../Base/View.php');

class DatabaseView extends View
{
  function Import()
  {
    $Output = '';
    if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
    {
      $Server = new Server($this->System, $_GET['Id']);
      if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
      {
        $Server->ImportDatabase(true);
        $Output .= $this->SystemMessage('Import čisté databáze', 'Úloha zařazena do fronty');
        $Output .= $this->ShowTaskList();
      } else $this->SystemMessage('Import databáze', 'Nemáte oprávnění');
    } else $Output .= USER_BAD_ROLE;
    return($Output);
  }
}
