예제 #1
0
파일: reg.php 프로젝트: wancy86/BS_PHP
            exit;
        }
    } else {
        //注册
        $query = " insert into BS_User(account, email, pwd, invite_by, reg_date)";
        $query .= " values('{$email}', '{$email}', '{$pwd}', '{$invite_by}', now())";
        // echo "$query";
        // echo $query;
        $result = mysqli_query(connect(), $query);
        $msg = "注册成功,请登录!";
        $page = "login.php";
    }
    // insert into BS_User(account, email, phone, pwd, invite_code, invite_by, reg_date)
    // values('$account', '$email', '$phone', '$pwd', '$invite_code', $invite_by, now())
    // redirect
    AlertMessage($page, $msg);
}
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <title>注册</title>
        <?php 
require_once 'style.php';
?>
    </head>

    <body>
        <div class="container-fluid">
            <!--navbar-->
예제 #2
0
     $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;
             global $link_to_img_upload;
             global $link_to_img_browse;
             global $languages;
             $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">';
             $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')) . '<br>';
             $content .= PairLabelAndInputFile(4, 5, Language::Word('cover'), 'cover');
             $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages)));
             $content .= WrapToHiddenInputs(array('type' => Direction::$type, 'yes' => '', 'id' => $id, 'glob_id' => $direction->id));
             $content .= '<div class="row"><h3>' . Language::Word('text') . '</h3></div>';
             $content .= '<div class="row">';
             $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">';
예제 #3
0
파일: report.php 프로젝트: Gerold103/lgmis
 public function ToHTMLUserPrivateShortInTable()
 {
     $author = User::FetchBy(['select_list' => 'id, name, surname, login', 'eq_conds' => ['id' => $this->author_id], 'is_unique' => true]);
     $link_to_author = '';
     if (Error::IsError($author)) {
         if (Error::IsType($author, Error::not_found)) {
             $link_to_author = Language::Word('not found');
         } else {
             return AlertMessage('Error while fethching author of report: ' . Error::ToString($author));
         }
     } else {
         $link_to_author = $author->LinkToThis();
     }
     $users = '';
     $receivers = User::FetchBy(['select_list' => 'id, name, surname', 'where_addition' => '(received_reports LIKE "%\\"' . $this->id . '\\"%")']);
     foreach ($receivers as $key => $user) {
         $users .= '<div class="row">';
         $users .= '<div class="' . ColAllTypes(12) . '">';
         $users .= $user->LinkToThis();
         $users .= '</div>';
         $users .= '</div>';
     }
     $res = '<tr>';
     $res .= '<td>' . $link_to_author . '</td>';
     $res .= '<td>' . $users . '</td>';
     $res .= '<td>' . htmlspecialchars($this->GetName()) . '</td>';
     $res .= '<td>' . $this->GetCreatingDate() . '</td>';
     $res .= '<td>';
     $res .= '<div class="row">';
     $author_login = '';
     if (is_a($author, 'User')) {
         $author_login = $author->GetLogin();
     } else {
         $author_login = '';
     }
     if (GetUserLogin() === 'admin') {
         $res .= '<div class="' . ColAllTypes(4) . '">';
     } else {
         $res .= '<div class="' . ColAllTypes(12) . '">';
     }
     $res .= $this->ToHTMLFullVers();
     $res .= '</div>';
     if (GetUserLogin() === 'admin') {
         $res .= '<div class="' . ColAllTypes(4) . '">';
         $res .= $this->ToHTMLEdit();
         $res .= '</div>';
         $res .= '<div class="' . ColAllTypes(4) . '">';
         $res .= $this->ToHTMLDel();
         $res .= '</div>';
     }
     $res .= '</div>';
     $res .= '</td>';
     $res .= '</tr>';
     return $res;
 }
예제 #4
0
            $content .= 'allowedContent: true, });';
            $content .= 'CKEDITOR.config.height = 400;';
            $content .= '</script>';
            $content .= '<div class="row">';
            $content .= DialogInputsYesNo('edit', $_POST['type'], $ob_id, Language::Word('save'), Language::Word('cancel'));
            $content .= '</div>';
            $content .= '</form>';
            $title = Language::Word('report editing');
            $header = $title;
        }
    } else {
        if (!isset($_REQUEST['id'])) {
            echo 'user id is unset';
            exit;
        }
        $ob = Report::FetchBy(['eq_conds' => ['id' => $_REQUEST['id']], 'is_unique' => true]);
        $user_id = GetUserID();
        $user = User::FetchBy(['eq_conds' => ['id' => $user_id], 'is_unique' => true, 'select_list' => 'received_reports']);
        if ($user_id !== $ob->GetAuthorID() && !in_array($ob->GetID(), $user->GetReceivedReports()) && GetUserPrivileges() !== admin_user_id) {
            $content = AlertMessage('alert-danger', Language::Word('access denied'));
        } else {
            $title = '';
            $header = '';
            $content = '';
            $title = Language::Word('report');
            $header = htmlspecialchars($ob->GetName());
            $content = $ob->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
예제 #5
0
<?php

session_set_cookie_params(0);
session_start();
include_once 'utility_lgmis_lib.php';
if (isset($_REQUEST['lang'])) {
    $lang = $_REQUEST['lang'];
    if (CheckLanguage($lang) === false) {
        echo AlertMessage('danger', 'Язык ' . $lang . ' не найден');
        exit;
    }
    $_SESSION['lang'] = $lang;
}
예제 #6
0
<?php

$is_public = true;
include_once 'utility_lgmis_lib.php';
include_once $link_to_utility_authorization;
if (isset($_POST['id']) && isset($_GET['id']) && $_POST['id'] !== $_GET['id']) {
    $content = AlertMessage('alert-danger', 'Неоднозначные id');
} else {
    $user = User::FetchBy(['eq_conds' => ['id' => $_REQUEST['id']], 'is_unique' => true]);
    $header = '';
    $content = '';
    $footer = '';
    $header_type = 'h3';
    $title = Language::Translit($user->GetSurname() . ' ' . $user->GetName() . ' ' . $user->GetFathername());
    $header = htmlspecialchars(Language::Translit($user->GetSurname() . ' ' . $user->GetName() . ' ' . $user->GetFathername()));
    $content .= '<div class="row" align="center">';
    $content .= '<div class="' . ColAllTypes(4) . '"><img src="' . Link::Get($user->GetPathToPhoto()) . '" class="img-avatar"></div>';
    $content .= '<div class="' . ColAllTypes(8) . '">';
    $content .= '<br><div class="row" align="center">';
    $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('position') . ':</font></div>';
    $content .= '<div class="' . ColAllTypes(6) . '" align="left">' . $user->GetPosition() . '</div>';
    $content .= '</div>';
    $articles = Article::FetchCountOf(['where' => 'author_id = ' . $user->GetID()]);
    $content .= '<div class="row" align="center">';
    $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('news published') . ':</font></div>';
    $content .= '<div class="' . ColAllTypes(6) . '" align="left">' . $articles . '</div>';
    $content .= '</div>';
    $content .= '<hr>';
    $content .= ToPageHeader(Language::PublicMenu('contacts'), 'h4', 'grey');
    $content .= '<div class="row" align="center">';
    $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('mail') . ':</font></div>';
예제 #7
0
    $query2 .= " short_tbk_url ,tbk_url ,commission ,earn ,img_list ,show_order ,P.cat_id ,entrydate ,disabled ";
    $query2 .= " from BS_ProInfo AS P";
    $query2 .= " join BS_Category as C on P.cat_id=C.cat_id";
    $query2 .= " where P.disabled=0 and C.category ='{$category}'";
    $query2 .= " limit {$start}, {$end}";
    // echo $query2;
    // exit();
    $result2 = mysqli_query(connect(), $query2);
    while (@($row = mysqli_fetch_assoc($result2))) {
        $rows[] = $row;
    }
    //random order
    shuffle($rows);
    // echo $filename;
    // echo $query2;
    // echo "<br>";
    if (!file_exists($file_Path)) {
        // 文件所在目录
        // echo dirname($json_path);
        // mkdir($json_path, 0777);
        FileUtil::createFile($file_Path);
    }
    // 修改文件权限为读写可执行
    // Read 4 - 允许读文件
    // Write 2 - 允许写/修改文件
    // eXecute1 - 读/写/删除/修改/目录
    chmod($file_Path, 0777);
    file_put_contents($file_Path, json_encode($rows));
}
AlertMessage("admin_data.php", "JSON数据文件生成完成", "");
예제 #8
0
     $content .= 'allowedContent: true, });';
     $content .= 'CKEDITOR.config.height = 400;';
     $content .= '</script>';
     $content .= '<div class="row">';
     $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $block_id, Language::Word('save'), Language::Word('cancel'), true);
     $content .= '</div>';
     $content .= '</form>';
     $title = Language::Word('user block editing');
     $header = $title;
 } else {
     if (isset($_REQUEST['add_lang'])) {
         $user_block = UserBlock::FetchByID($_REQUEST['id']);
         $blk_langs = $user_block->FetchLanguages();
         $free_languages = array_diff($languages, $blk_langs);
         if (count($free_languages) === 0) {
             $content = AlertMessage('alert-danger', Language::Word('all languages of this user block is implemented'));
         } else {
             clear_tmp_images_dir(UserBlock::$type, $_REQUEST['id']);
             $title = Language::Word('language adding');
             $header = $title;
             $assoc = $_REQUEST;
             $assoc['edit'] = 'edit';
             $assoc['author_id'] = $user_block->author_id;
             $assoc['id'] = $user_block->GetID();
             global $link_to_utility_sql_worker;
             global $link_to_img_upload;
             $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '">';
             $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header'));
             $content .= PairLabelAndInput(4, 5, Language::Word('priority'), 'priority', Language::Word('number'));
             $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages)));
             $content .= WrapToHiddenInputs(array('type' => UserBlock::$type, 'yes' => '', 'id' => $_REQUEST['id'], 'glob_id' => $user_block->GetID(), 'author_id' => $user_block->author_id));
예제 #9
0
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
                $title = Language::Word('language adding');
                $header = $title;
            }
        } else {
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $ob_id = $_REQUEST['id'];
            $ob = Article::FetchBy(['eq_conds' => array('id' => $ob_id), 'is_unique' => true]);
            if (Error::IsError($ob)) {
                $content = AlertMessage('alert-danger', Error::ToString($ob));
            } else {
                $title = '';
                $header = '';
                $content = '';
                $title = Language::Word('article');
                $header = htmlspecialchars($ob->GetName());
                $content = $ob->ToHTMLAutoFull(GetUserPrivileges());
            }
        }
    }
}
include_once $link_to_admin_template;
예제 #10
0
             case TextPart::$type:
                 $assoc = $_POST;
                 $assoc['author_id'] = $_POST['id'];
                 unset($assoc['id']);
                 $part = TextPart::FetchFromAssoc($assoc);
                 if ($part === NULL) {
                     $content = AlertMessage('alert-danger', Language::Word('error during text block adding'));
                 } else {
                     $glob_id = 0;
                     if (isset($_POST['glob_id'])) {
                         $glob_id = $_POST['glob_id'];
                     }
                     if (TextPart::InsertToDB($part, $_POST['language'], $glob_id)) {
                         $content = AlertMessage('alert-success', Language::Word('text block is successfully added'));
                     } else {
                         $content = AlertMessage('alert-danger', Language::Word('error during text block inserting'));
                     }
                 }
                 break;
             default:
                 # code...
                 break;
         }
         require_once $link_to_admin_template;
         exit;
     } else {
         echo 'id is not specified';
     }
 } else {
     echo 'type is not specified';
 }
예제 #11
0
function MenuButton($text, $action, $class = 'btn-default', $name = '', $method = 'post')
{
    $res = '';
    $res .= '<div class="row top-buffer20">';
    $res .= '<div class="' . ColAllTypes(12) . '">';
    if ($method === 'post') {
        $res .= '<form method="post" class="form-inline" action="' . $action . '">';
        $res .= '<div class="form-group">';
        $res .= '<input type="submit" name="' . $name . '" class="btn ' . $class . ' btn-lg btn-block" value="' . $text . '">';
        $res .= '</div>';
        $res .= '</form>';
    } else {
        if ($method === 'get') {
            $query = parse_url($url, PHP_URL_QUERY);
            $link = $action;
            if ($name !== '') {
                if ($query) {
                    $link .= '&' . $name . '=name';
                } else {
                    $link .= '?' . $name . '=name';
                }
            }
            $res .= '<form class="form-inline"><div class="form-group"><a href="' . $link . '" class="btn ' . $class . ' btn-lg btn-block">' . $text . '</a></div></form>';
        } else {
            $res = AlertMessage('alert-danger', 'Нет метода ' . $method);
            return $res;
        }
    }
    $res .= '</div>';
    $res .= '</div>';
    return $res;
}
예제 #12
0
    $content .= '<div class="row">';
    $content .= '<div class="' . ColAllTypes(2) . '"></div>';
    $content .= '<div class="' . ColAllTypes(8) . ' center-block">';
    $content .= '<table class="table table-striped text-center">';
    $content .= '<thead>';
    $content .= '<tr>';
    $content .= '<th class="text-center">' . Language::Word('name') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('surname') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('position') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('actions') . '</th>';
    $content .= '</tr>';
    $content .= '</thead>';
    $content .= '<tbody>';
    $from = -1;
    $to = -1;
    require $link_to_pagination_init_template;
    $users = User::FetchBy(['limit' => $count, 'offset' => $from]);
    for ($i = 0; $i < $count; ++$i) {
        $content .= $users[$i]->ToHTMLAutoShortForTable(GetUserPrivileges());
    }
    $content .= '</tbody>';
    $content .= '</table>';
    $content .= '</div>';
    $content .= '</div>';
    $pagination = '';
    require $link_to_pagination_show_template;
    $content .= $pagination;
} else {
    $content = AlertMessage('alert-danger', Language::Word('error') . ': ' . User::$last_error);
}
require $link_to_admin_template;
예제 #13
0
파일: logout.php 프로젝트: wancy86/BS_PHP
<?php

header("Content-type: text/html; charset=utf-8");
require_once './lib/mysql.func.php';
require_once './lib/common.func.php';
session_start();
// echo $_SESSION['uid'];
// echo $_SESSION['account'];
session_unset();
AlertMessage("index.php", "", "");