示例#1
0
文件: user.php 项目: Gerold103/lgmis
 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;
 }
示例#2
0
     $content .= '<div class="row"><h3>' . Language::Word('text') . '</h3></div>';
     $content .= '<div class="row">';
     $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">';
     $content .= '<textarea id="text_block" name="text_block">' . $direction->text_block . '</textarea>';
     $content .= '</div>';
     $content .= '</div>';
     $content .= '<script>';
     $content .= 'CKEDITOR.replace("text_block",';
     $content .= '{ filebrowserImageUploadUrl: "' . $link_to_img_upload . '?type=' . Direction::$type . '&id=' . $dir_id . '&edit=edit",';
     $content .= 'filebrowserImageBrowseUrl : "' . $link_to_img_browse . '?type=' . Direction::$type . '&id=' . $dir_id . '&edit=edit",';
     $content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],';
     $content .= 'allowedContent: true, });';
     $content .= 'CKEDITOR.config.height = 400;';
     $content .= '</script>';
     $content .= '<div class="row">';
     $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $dir_id, Language::Word('save'), Language::Word('cancel'));
     $content .= '</div>';
     $content .= '</form>';
     $title = Language::Word('direction editing');
     $header = $title;
 } else {
     if (isset($_REQUEST['add_lang'])) {
         $direction = Direction::FetchByID($_REQUEST['id']);
         $dir_langs = $direction->FetchLanguages();
         $free_languages = array_diff($languages, $dir_langs);
         if (count($free_languages) === 0) {
             $content = AlertMessage('alert-danger', Language::Word('all languages of this direction is implemented'));
         } else {
             $id = User::GetIDByLogin($_SESSION['user_login']);
             clear_tmp_images_dir(Direction::$type, $id);
             global $link_to_utility_sql_worker;
示例#3
0
function DialogFormYesNo($action_link, $action_type, $object_type, $id_, $val_yes = 0, $val_no = 0, $need_prev_page = true, $method = 'post')
{
    if ($val_yes === 0) {
        $val_yes = Language::Word('yes');
    }
    if ($val_no === 0) {
        $val_no = Language::Word('no');
    }
    $res = '';
    if ($method === 'post') {
        $res .= '<form action="' . $action_link . '" method="post">';
        $res .= DialogInputsYesNo($action_type, $object_type, $id_, $val_yes, $val_no, $need_prev_page);
        $res .= '</form><br>';
    } else {
        if ($method === 'get') {
            $get_variables = array('type' => $object_type, 'id' => $id_, $action_type => '');
            $res .= '<a href="' . $action_link . '?' . WrapToGetVariables($get_variables) . '&yes=yes">' . $val_yes . '</a>';
            $res .= '<a href="' . $action_link . '?' . WrapToGetVariables($get_variables) . '&no=no">' . $val_no . '</a>';
        }
    }
    return $res;
}