Example #1
0
 public static function FormForCreating()
 {
     global $link_to_utility_sql_worker;
     $res = '';
     $res .= '<form method="post" action="' . $link_to_utility_sql_worker . '" onsubmit="return checkRegistrationForm(this);">';
     $res .= WrapToHiddenInputs(array('type' => RequestOnRegister::$type));
     $res .= PairLabelAndInput(4, 5, Language::Word('your name'), 'name', Language::Word('name')) . '<br>';
     $res .= PairLabelAndInput(4, 5, Language::Word('your surname'), 'surname', Language::Word('surname')) . '<br>';
     $res .= PairLabelAndInput(4, 5, Language::Word('your fathername'), 'fathername', Language::Word('fathername')) . '<br>';
     $res .= PairLabelAndInput(4, 5, Language::Word('your login'), 'login', Language::Word('a login')) . '<br>';
     $res .= PairLabelAndPassword(4, 5, Language::Word('insert password'), 'password', Language::Word('password')) . '<br>';
     $res .= PairLabelAndInput(4, 5, Language::Word('your email'), 'email', '*****@*****.**') . '<br>';
     $res .= PairLabelAndInput(4, 5, Language::Word('your phone'), 'telephone', '8-123-456-78-90') . '<br>';
     $res .= PairLabelAndTextarea(4, 5, Language::Word('comment for request'), 'text') . '<br>';
     $res .= '<div class="row">';
     $res .= '<input type="submit" class="btn btn-primary btn-lg" name="new" value="' . Language::Word('send request') . '">';
     $res .= '</div>';
     $res .= '</form>';
     return $res;
 }
Example #2
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;
 }