Example #1
0
 public function ToHTMLEditing()
 {
     global $user_blocks_in_db;
     global $link_to_admin_user_block;
     global $positions;
     global $link_to_utility_sql_worker;
     $positions = Language::GetPositions();
     $res = '';
     $res .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">';
     $res .= '<div class="row">';
     $res .= '<div class="' . ColAllTypes(1) . '"></div>';
     $res .= '<div class="' . ColAllTypes(5) . ' vcenter" align="right">';
     $res .= '<div class="row">';
     $res .= '<img src="' . $this->path_to_photo . '" class="img-rounded img-avatar">';
     $res .= '</div>';
     $res .= '<div class="row">';
     $res .= PairLabelAndInputFile(3, 5, Language::Word('upload image'), 'img');
     $res .= '</div>';
     $res .= '</div>';
     $res .= '<div class="' . ColAllTypes(5) . ' vcenter" align="left">';
     $res .= PairLabelAndInput(2, 10, Language::Word('name'), 'name', Language::Word('insert name'), $this->name);
     $res .= PairLabelAndInput(2, 10, Language::Word('surname'), 'surname', Language::Word('insert surname'), $this->surname);
     $res .= PairLabelAndInput(2, 10, Language::Word('fathername'), 'fathername', Language::Word('insert fathername'), $this->fathername);
     if ($this->login != 'admin' && GetUserLogin() == 'admin') {
         $tmp = User::FetchAllByPosition(DirectorPositionNum);
         if (($tmp != NULL || GetUserLogin() != 'admin') && $this->position != DirectorPositionNum) {
             unset($positions[DirectorPositionNum]);
         }
         $res .= PairLabelAndSelect(2, 10, Language::Word('position'), 'position', $positions, $selected_field = array($this->position, $positions[$this->position]));
     } else {
         $res .= PairLabelAndPanel(2, 10, Language::Word('position'), htmlspecialchars(Language::Position($this->position)));
     }
     $res .= PairLabelAndInput(2, 10, Language::Word('mail'), 'email', Language::Word('insert mail'), $this->email);
     $res .= PairLabelAndInput(2, 10, Language::Word('telephone'), 'telephone', Language::Word('insert telephone'), $this->telephone);
     if ($this->login == GetUserLogin() && $this->login != 'admin') {
         $res .= PairLabelAndInput(2, 10, Language::Word('login'), 'login', Language::Word('insert login'), $this->login);
     } else {
         $res .= PairLabelAndPanel(2, 10, Language::Word('login'), $this->login);
     }
     $res .= PairLabelAndInput(2, 10, Language::Word('birthday'), 'birth_day', 'dd', date('j', $this->birthday));
     $res .= PairLabelAndInput(2, 10, Language::Word('birthmonth'), 'birth_month', 'mm', date('n', $this->birthday));
     $res .= PairLabelAndInput(2, 10, Language::Word('birthyear'), 'birth_year', 'yyyy', date('Y', $this->birthday));
     if ($this->login == GetUserLogin()) {
         $res .= PairLabelAndPassword(4, 8, Language::Word('old password'), 'password_old', Language::Word('only for password changing'));
         $res .= PairLabelAndPassword(4, 8, Language::Word('new password'), 'password_new1', Language::Word('only for password changing'));
         $res .= PairLabelAndPassword(4, 8, Language::Word('repeat new password'), 'password_new2', Language::Word('only for password changing'));
     }
     $res .= '</div>';
     $res .= '</div>';
     $res .= DialogInputsYesNo('edit', $_POST['type'], $_POST['id'], Language::Word('save'), Language::Word('cancel'));
     $res .= '</form>';
     return $res;
 }