Esempio n. 1
0
 public function onsubmit($sender)
 {
     $this->setError('');
     if ($this->_login == '') {
         $this->setError('Введите логин');
     } else {
         if ($this->_password == '') {
             $this->setError('Введите пароль');
         } else {
             if ($this->_confirm == '') {
                 $this->setError('Подтвердите пароль');
             } else {
                 if ($this->_confirm != $this->_password) {
                     $this->setError('Неверное подтверждение');
                 } else {
                     if ($user = Helper::login($this->_login) != false) {
                         $this->setError('Логин уже существует');
                     }
                 }
             }
         }
     }
     if (!$this->isError()) {
         $user = new User();
         $user->userlogin = $this->_login;
         $user->userpass = \password_hash($this->_password, PASSWORD_DEFAULT);
         $user->Save();
         App::Redirect('\\ZippyERP\\System\\Pages\\UserInfo', $user->user_id);
     }
     $this->_confirm = '';
     $this->_password = '';
 }
Esempio n. 2
0
 public function __construct()
 {
     $this->add(new \ZippyERP\System\Blocks\Header("header"));
     $this->add(new \Zippy\Html\Label("errormessage", new \Zippy\Binding\PropertyBinding($this, '_errormsg'), false, true))->setVisible(false);
     $user = System::getUser();
     if ($user->user_id == 0) {
         App::Redirect("\\ZippyERP\\System\\Pages\\Userlogin");
     }
 }
Esempio n. 3
0
function autoload($className)
{
    $className = str_replace("\\", "/", ltrim($className, '\\'));
    if (strpos($className, 'ZippyERP/ERP/') === 0) {
        $file = __DIR__ . DIRECTORY_SEPARATOR . strtolower(str_replace("ZippyERP/ERP/", "", $className)) . ".php";
        if (file_exists($file)) {
            require_once $file;
        } else {
            \ZippyERP\System\Application::Redirect('\\ZippyERP\\System\\Pages\\Error', "Класс {$className} не  найден");
        }
    }
}
Esempio n. 4
0
 public function __construct()
 {
     $this->title = 'Страница администратора';
     $this->add(new \ZippyERP\System\Blocks\Header("header"));
     $this->add(new \Zippy\Html\Label("errormessage", new \Zippy\Binding\PropertyBinding($this, '_errormsg'), false, true))->setVisible(false);
     $user = System::getUser();
     if ($user->user_id == 0) {
         App::Redirect("\\ZippyERP\\System\\Pages\\Userlogin");
     }
     if ($user->userlogin !== 'admin') {
         App::Redirect('\\ZippyERP\\Pages\\Error', 'Вы не админ');
     }
 }
Esempio n. 5
0
 public function __construct()
 {
     $this->add(new \ZippyERP\System\Blocks\Header("header"));
     $this->add(new Label("errormessage", new \Zippy\Binding\PropertyBinding($this, '_errormsg'), false, true))->setVisible(false);
     $this->add(new Label("warnmessage", new \Zippy\Binding\PropertyBinding($this, '_warnmsg'), false, true))->setVisible(false);
     $this->add(new Label("successmessage", new \Zippy\Binding\PropertyBinding($this, '_successmsg'), false, true))->setVisible(false);
     $this->add(new Label("menudoc", Helper::generateMenu(1), true));
     $this->add(new Label("menurep", Helper::generateMenu(2), true));
     $this->add(new Label("menureg", Helper::generateMenu(3), true));
     $this->add(new Label("menuref", Helper::generateMenu(4), true));
     $this->add(new Label("menupage", Helper::generateMenu(5), true));
     $this->add(new ClickLink("pageinfo"))->setAttribute("data-content", $this->getPageInfo());
     $user = System::getUser();
     if ($user->user_id == 0) {
         App::Redirect("\\ZippyERP\\System\\Pages\\Userlogin");
     }
 }
Esempio n. 6
0
function autoload($className)
{
    $className = str_replace("\\", "/", ltrim($className, '\\'));
    /*
     if (strpos($className, 'ZippyERP/System/Pages/') === 0) {
     require_once(__DIR__ . "/" . strtolower(str_replace("ZippyERP/", "", $className)) . ".php");
     } else
     if (strpos($className, 'ZippyERP/System/Blocks/') === 0) {
     require_once(__DIR__ . "/" . strtolower(str_replace("ZippyERP/", "", $className)) . ".php");
     } else
    */
    if (strpos($className, 'ZippyERP/System/') === 0) {
        $file = __DIR__ . DIRECTORY_SEPARATOR . strtolower(str_replace("ZippyERP/System/", "", $className)) . ".php";
        if (file_exists($file)) {
            require_once $file;
        } else {
            \ZippyERP\System\Application::Redirect('\\ZippyERP\\System\\Pages\\Error', 'Неверный URL');
        }
    }
}
Esempio n. 7
0
 public function editOnClick($sender)
 {
     $item = $sender->owner->getDataItem();
     $type = H::getMetaType($item->type_id);
     $class = "\\ZippyERP\\ERP\\Pages\\Doc\\" . $type['meta_name'];
     //   $item = $class::load($item->document_id);
     App::Redirect($class, $item->document_id);
 }
Esempio n. 8
0
 public function editOnClick($sender)
 {
     $item = $sender->owner->getDataItem();
     $type = H::getMetaType($item->type_id);
     $class = "\\ZippyERP\\ERP\\Pages\\Doc\\" . $type['meta_name'];
     //   $item = $class::load($item->document_id);
     //запоминаем страницу пагинатора
     $filter = Filter::getFilter("doclist");
     $filter->page = $this->doclist->getCurrentPage();
     App::Redirect($class, $item->document_id);
 }
Esempio n. 9
0
 public function detailDocOnClick($sender)
 {
     $id = $sender->owner->getDataItem()->document_id;
     App::Redirect('\\ZippyERP\\ERP\\Pages\\Register\\DocList', $id);
 }