public function updateUser($UserID)
 {
     $params = [];
     if ($this->dayOfBirth == 0) {
         $params['error'] = 'dayOfBirth';
         return $params;
     }
     if ($this->monthOfBirth == 0) {
         $params['error'] = 'monthOfBirth';
         return $params;
     }
     if ($this->yearOfBirth == 0) {
         $params['error'] = 'yearOfBirth';
         return $params;
     }
     $params["userID"] = $UserID;
     $params["familyName"] = $this->secondName;
     $params["firstName"] = $this->firstName;
     $params["patronymic"] = $this->thirdName;
     $params["login"] = $this->username;
     $params["password"] = Yii::$app->crypto->encrypt($this->password);
     $params["gender"] = $this->gender;
     $params["birthday"] = $this->yearOfBirth . '-' . DateModel::checkLen($this->monthOfBirth) . '-' . DateModel::checkLen($this->dayOfBirth);
     $params["phoneNumber"] = $this->phoneNumber;
     $params["phoneCountry"] = $this->country;
     $params["remark"] = $this->yearOfBirth . '-' . DateModel::checkLen($this->monthOfBirth) . '-' . DateModel::checkLen($this->dayOfBirth);
     $params = Yii::$app->businesslayer->update_user($params);
     $params['error'] = 0;
     $params['Password'] = $this->password;
     return $params;
 }
 public function registerUser()
 {
     if (strlen($this->school) == 0) {
         return 'school';
     }
     if (strlen($this->group) == 0) {
         return 'group';
     }
     $params = [];
     $params["familyName"] = $this->secondName;
     $params["firstName"] = $this->firstName;
     $params["patronymic"] = $this->thirdName;
     $params["login"] = $this->username;
     $params["password"] = Yii::$app->crypto->encript($this->password);
     $params["gender"] = $this->gender;
     $params["birthday"] = $this->yearOfBirth . '-' . DateModel::checkLen($this->monthOfBirth) . '-' . DateModel::checkLen($this->dayOfBirth);
     $params["phoneNumber"] = $this->phoneNumber;
     $params["phoneCountry"] = $this->country;
     $params["remark"] = $this->yearOfBirth . '-' . DateModel::checkLen($this->monthOfBirth) . '-' . DateModel::checkLen($this->dayOfBirth);
     $newUserID = Yii::$app->businesslayer->register_user($params);
     $this->sendRequest($newUserID);
     return 0;
 }
 public function insertUser()
 {
     $params = [];
     if (strlen($this->school) == 0 || $this->school == 0) {
         return 'school';
     }
     if (strlen($this->group) == 0 || $this->group == 0) {
         return 'group';
     }
     if ($this->dayOfBirth == 0) {
         return 'dayOfBirth';
     }
     if ($this->monthOfBirth == 0) {
         return 'monthOfBirth';
     }
     if ($this->yearOfBirth == 0) {
         return 'yearOfBirth';
     }
     $params["familyName"] = $this->familyName;
     $params["firstName"] = $this->firstName;
     $params["patronymic"] = $this->patronymic;
     $params["login"] = $this->login;
     $params["password"] = $this->password;
     $params["gender"] = $this->gender;
     $params["birthday"] = $this->yearOfBirth . '-' . DateModel::checkLen($this->monthOfBirth) . '-' . DateModel::checkLen($this->dayOfBirth);
     $params["phoneNumber"] = $this->phoneInput;
     $params["phoneCountry"] = $this->country;
     $params["remark"] = '-';
     Yii::$app->businesslayer->users->insert($params);
     return 0;
 }