mirror of
https://github.com/claradex/nativegallery.git
synced 2025-04-23 16:43:04 +03:00
Compare commits
4 commits
dce7aa906a
...
2918dd347b
Author | SHA1 | Date | |
---|---|---|---|
|
2918dd347b | ||
|
a665b92e11 | ||
|
07a6a41468 | ||
|
61c0e0cc9e |
20 changed files with 1243 additions and 139 deletions
|
@ -55,7 +55,6 @@ NativeGallery - это реверсивный open-source движок попу
|
||||||
- [x] Полноценный EXIF
|
- [x] Полноценный EXIF
|
||||||
- [x] Модерация
|
- [x] Модерация
|
||||||
- [ ] Редактирование
|
- [ ] Редактирование
|
||||||
- [ ] Примечания (для сущностей)
|
|
||||||
- [ ] Обновления:
|
- [ ] Обновления:
|
||||||
- [x] Новые фотографии
|
- [x] Новые фотографии
|
||||||
- [x] Новые фотографии из подписок
|
- [x] Новые фотографии из подписок
|
||||||
|
|
|
@ -321,7 +321,9 @@ class Register
|
||||||
if (NGALLERY['root']['registration']['emailverify'] === true) {
|
if (NGALLERY['root']['registration']['emailverify'] === true) {
|
||||||
$status === 3;
|
$status === 3;
|
||||||
}
|
}
|
||||||
|
$token = GenerateRandomStr::gen_uuid();
|
||||||
DB::query('INSERT INTO users VALUES (\'0\', :username, :email, :password, :photourl, 5, :online, 0, :status, :content)', array(':username' => ltrim($username), ':password' => password_hash(ltrim($password), PASSWORD_BCRYPT), ':photourl' => '/static/img/avatar.png', ':email' => $email, ':content' => $content, ':online' => time(), ':status'=>$status));
|
DB::query('INSERT INTO users VALUES (\'0\', :username, :email, :password, :photourl, 5, :online, 0, :status, :content)', array(':username' => ltrim($username), ':password' => password_hash(ltrim($password), PASSWORD_BCRYPT), ':photourl' => '/static/img/avatar.png', ':email' => $email, ':content' => $content, ':online' => time(), ':status'=>$status));
|
||||||
|
$user_id = DB::query('SELECT id FROM users WHERE username=:username', array(':username' => $username))[0]['id'];
|
||||||
if (NGALLERY['root']['registration']['emailverify'] === true) {
|
if (NGALLERY['root']['registration']['emailverify'] === true) {
|
||||||
$disposableEmailFilter = new DisposableEmailFilter();
|
$disposableEmailFilter = new DisposableEmailFilter();
|
||||||
if ($disposableEmailFilter->isDisposableEmailAddress($_POST['email'])) {
|
if ($disposableEmailFilter->isDisposableEmailAddress($_POST['email'])) {
|
||||||
|
@ -334,8 +336,6 @@ class Register
|
||||||
);
|
);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$token = GenerateRandomStr::gen_uuid();
|
|
||||||
$user_id = DB::query('SELECT id FROM users WHERE username=:username', array(':username' => $username))[0]['id'];
|
|
||||||
$key = GenerateRandomStr::gen_uuid();
|
$key = GenerateRandomStr::gen_uuid();
|
||||||
$content = Json::return(
|
$content = Json::return(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -16,6 +16,11 @@ class MainController
|
||||||
{
|
{
|
||||||
Page::set('Main');
|
Page::set('Main');
|
||||||
|
|
||||||
|
}
|
||||||
|
public static function page()
|
||||||
|
{
|
||||||
|
Page::set('Page');
|
||||||
|
|
||||||
}
|
}
|
||||||
public static function about()
|
public static function about()
|
||||||
{
|
{
|
||||||
|
@ -47,11 +52,6 @@ class MainController
|
||||||
{
|
{
|
||||||
Page::set('Top30');
|
Page::set('Top30');
|
||||||
|
|
||||||
}
|
|
||||||
public static function vehicle()
|
|
||||||
{
|
|
||||||
Page::set('Vehicle');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public static function feed()
|
public static function feed()
|
||||||
{
|
{
|
||||||
|
|
23
app/Controllers/VehicleController.php
Normal file
23
app/Controllers/VehicleController.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use \App\Services\{Router, Auth, DB, Json};
|
||||||
|
use \App\Controllers\ExceptionRegister;
|
||||||
|
use \App\Core\Page;
|
||||||
|
|
||||||
|
class VehicleController
|
||||||
|
{
|
||||||
|
public static function i()
|
||||||
|
{
|
||||||
|
Page::set('Vehicle/Index');
|
||||||
|
}
|
||||||
|
public static function iedit()
|
||||||
|
{
|
||||||
|
Page::set('Vehicle/IndexEdit');
|
||||||
|
}
|
||||||
|
public static function dbedit()
|
||||||
|
{
|
||||||
|
Page::set('Vehicle/DBEdit');
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,12 +17,12 @@ class Routes
|
||||||
Router::get('/register', 'RegisterController@i');
|
Router::get('/register', 'RegisterController@i');
|
||||||
Router::get('/photo/$id', 'PhotoController@i');
|
Router::get('/photo/$id', 'PhotoController@i');
|
||||||
Router::get('/author/$id', 'ProfileController@i');
|
Router::get('/author/$id', 'ProfileController@i');
|
||||||
|
Router::get('/page/$id', 'MainController@page');
|
||||||
Router::post('/api/login', 'ApiController@login');
|
Router::post('/api/login', 'ApiController@login');
|
||||||
Router::post('/api/register', 'ApiController@register');
|
Router::post('/api/register', 'ApiController@register');
|
||||||
Router::get('/api/photo/stats', 'ApiController@photostats');
|
Router::get('/api/photo/stats', 'ApiController@photostats');
|
||||||
Router::get('/about', 'MainController@about');
|
Router::get('/about', 'MainController@about');
|
||||||
Router::get('/rules', 'MainController@rules');
|
Router::get('/rules', 'MainController@rules');
|
||||||
Router::get('/vehicle/$id', 'MainController@vehicle');
|
|
||||||
Router::get('/rules/pub', 'MainController@publicationRules');
|
Router::get('/rules/pub', 'MainController@publicationRules');
|
||||||
Router::get('/rules/photo', 'MainController@photoRules');
|
Router::get('/rules/photo', 'MainController@photoRules');
|
||||||
Router::get('/rules/video', 'MainController@videoRules');
|
Router::get('/rules/video', 'MainController@videoRules');
|
||||||
|
@ -41,6 +41,7 @@ class Routes
|
||||||
Router::get('/comments', 'MainController@comments');
|
Router::get('/comments', 'MainController@comments');
|
||||||
if (Auth::userid() > 0) {
|
if (Auth::userid() > 0) {
|
||||||
$user = new \App\Models\User(Auth::userid());
|
$user = new \App\Models\User(Auth::userid());
|
||||||
|
|
||||||
Router::get('/lk', 'ProfileController@lk');
|
Router::get('/lk', 'ProfileController@lk');
|
||||||
Router::get('/lk/upload', 'ProfileController@upload');
|
Router::get('/lk/upload', 'ProfileController@upload');
|
||||||
Router::get('/lk/history', 'ProfileController@lkhistory');
|
Router::get('/lk/history', 'ProfileController@lkhistory');
|
||||||
|
@ -52,6 +53,8 @@ class Routes
|
||||||
|
|
||||||
Router::get('/fav', 'MainController@fav');
|
Router::get('/fav', 'MainController@fav');
|
||||||
|
|
||||||
|
Router::get('/vehicle/edit', 'VehicleController@iedit');
|
||||||
|
Router::get('/vehicle/dbedit', 'VehicleController@dbedit');
|
||||||
Router::post('/api/upload', 'ApiController@upload');
|
Router::post('/api/upload', 'ApiController@upload');
|
||||||
Router::post('/api/profile/update', 'ApiController@updateprofile');
|
Router::post('/api/profile/update', 'ApiController@updateprofile');
|
||||||
Router::post('/api/photo/comment', 'ApiController@photocomment');
|
Router::post('/api/photo/comment', 'ApiController@photocomment');
|
||||||
|
@ -80,5 +83,6 @@ class Routes
|
||||||
} else {
|
} else {
|
||||||
Router::redirect('/login?return='.$_SERVER['HTTP_REFERER']);
|
Router::redirect('/login?return='.$_SERVER['HTTP_REFERER']);
|
||||||
}
|
}
|
||||||
|
Router::get('/vehicle/$id', 'VehicleController@i');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
89
static/css/tabs.css
Normal file
89
static/css/tabs.css
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
.v-header {
|
||||||
|
/**
|
||||||
|
* Redefine media queries, because header mobile styles are enabled
|
||||||
|
* when page width is less than two-columns layout width (~960px)
|
||||||
|
*/
|
||||||
|
--border-radius: 8px;
|
||||||
|
--offset-x: var(--island-offset-x, 20px);
|
||||||
|
--offset-y: 24px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: var(--offset-y) var(--offset-x);
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 999px) {
|
||||||
|
.v-header {
|
||||||
|
--offset-x: var(--island-offset-x, 16px);
|
||||||
|
--offset-y: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.v-header__tabs {
|
||||||
|
margin-bottom: calc(var(--offset-y)* -1);
|
||||||
|
margin-left: calc(var(--offset-x)* -1);
|
||||||
|
margin-right: calc(var(--offset-x)* -1);
|
||||||
|
}
|
||||||
|
.v-tabs {
|
||||||
|
--height: 63px;
|
||||||
|
--nav-size: 36px;
|
||||||
|
--tab-offset: 12px;
|
||||||
|
font-size: var(--font-size);
|
||||||
|
height: var(--height);
|
||||||
|
position: relative;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.v-tabs__scroll {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: hidden;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
.v-header__tabs .v-tabs__content {
|
||||||
|
padding-left: var(--offset-x);
|
||||||
|
padding-right: var(--offset-x);
|
||||||
|
}
|
||||||
|
.v-tabs__content {
|
||||||
|
display: -ms-inline-flexbox;
|
||||||
|
display: inline-flex;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.v-tab:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.v-tab--active {
|
||||||
|
pointer-events: none;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.v-tab {
|
||||||
|
padding: 0 var(--tab-offset);
|
||||||
|
-ms-flex-negative: 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #000000;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.v-tab--active .v-tab__label {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.v-tab__label {
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-align: baseline;
|
||||||
|
align-items: baseline;
|
||||||
|
height: var(--height);
|
||||||
|
line-height: calc(var(--height) + 1px);
|
||||||
|
}
|
||||||
|
.v-tab--active .v-tab__label::after {
|
||||||
|
content: '';
|
||||||
|
width: 100%;
|
||||||
|
height: 3px;
|
||||||
|
background-color: #306bff;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
border-radius: 500px;
|
||||||
|
}
|
||||||
|
.active__block, .active__blockm {
|
||||||
|
display: block !important;
|
||||||
|
transition: 0.3s all;
|
||||||
|
}
|
28
static/js/changeTab.js
Normal file
28
static/js/changeTab.js
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
function changeTab(id) {
|
||||||
|
const $activeTabs = $('.v-tab-b.v-tab--active');
|
||||||
|
const $activeBlocks = $('.active__block');
|
||||||
|
|
||||||
|
if ($activeTabs.length) {
|
||||||
|
$activeTabs.removeClass('v-tab--active');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#' + id).addClass('v-tab--active');
|
||||||
|
|
||||||
|
if ($activeBlocks.length) {
|
||||||
|
$activeBlocks.animate({
|
||||||
|
opacity: 0,
|
||||||
|
}, 200, function () {
|
||||||
|
$(this).css('display', 'none').removeClass('active__block');
|
||||||
|
|
||||||
|
// Вторая анимация
|
||||||
|
$('#' + id + '__block').css({
|
||||||
|
display: 'block',
|
||||||
|
opacity: 0
|
||||||
|
}).animate({
|
||||||
|
opacity: 1
|
||||||
|
}, 150, function () {
|
||||||
|
$(this).addClass('active__block');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,11 +15,13 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<script src="/static/js/changeTab.js" defer></script>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js" integrity="sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js" integrity="sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js" integrity="sha384-ODmDIVzN+pFdexxHEHFBQH3/9/vQ9uori45z4JjnFsRydbmQbmL5t1tQ0culUzyK" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js" integrity="sha384-ODmDIVzN+pFdexxHEHFBQH3/9/vQ9uori45z4JjnFsRydbmQbmL5t1tQ0culUzyK" crossorigin="anonymous"></script>
|
||||||
<link rel="stylesheet" href="/static/css/header.admin.css">
|
<link rel="stylesheet" href="/static/css/header.admin.css">
|
||||||
|
<link rel="stylesheet" href="/static/css/tabs.css">
|
||||||
<div class="layout__left-column layout__sticky">
|
<div class="layout__left-column layout__sticky">
|
||||||
<header style="background-color: #0d1012;" class="header">
|
<header style="background-color: #0d1012;" class="header">
|
||||||
<div class="header__container">
|
<div class="header__container">
|
||||||
|
@ -82,6 +84,10 @@ body {
|
||||||
<i class="bx bx-world nav__icon"></i>
|
<i class="bx bx-world nav__icon"></i>
|
||||||
<span class="nav__name">GeoDB<span class="badge text-bg-warning">BETA</span></span>
|
<span class="nav__name">GeoDB<span class="badge text-bg-warning">BETA</span></span>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="/admin?type=Pages" class="nav__link">
|
||||||
|
<i class="bx bx-file-blank nav__icon"></i>
|
||||||
|
<span class="nav__name">Страницы</span>
|
||||||
|
</a>
|
||||||
<!--a href="/admin?type=Settings" class="nav__link">
|
<!--a href="/admin?type=Settings" class="nav__link">
|
||||||
<i class="bx bx-cog nav__icon"></i>
|
<i class="bx bx-cog nav__icon"></i>
|
||||||
<span class="nav__name">Настройки<span class="badge text-bg-warning">BETA</span></span>
|
<span class="nav__name">Настройки<span class="badge text-bg-warning">BETA</span></span>
|
||||||
|
|
|
@ -112,7 +112,7 @@ if (NGALLERY['root']['registration']['emailverify'] === true && $user->i('status
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<li><a href="/lk/history" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-images"></i></span><span class="mm-label">Журнал</span></a></li>
|
<li><a href="/lk/history" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-images"></i></span><span class="mm-label">Журнал</span></a></li>
|
||||||
<li><a href="/lk/konkurs.php" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-compass"></i></span><span class="mm-label">Конкурс</span></a></li>
|
<li><a href="/lk/konkurs.php" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-compass"></i></span><span class="mm-label">Конкурс</span></a></li>
|
||||||
<li><a href="/lk/vehicles.php" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-folder-plus"></i></span><span class="mm-label"><b>Правка БД</b></span></a></li>
|
<li><a href="/vehicle/edit" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-folder-plus"></i></span><span class="mm-label"><b>Правка БД</b></span></a></li>
|
||||||
<li><a href="/lk/ticket.php" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-question-circle"></i></span><span class="mm-label">Мои заявки</span></a></li>
|
<li><a href="/lk/ticket.php" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-question-circle"></i></span><span class="mm-label">Мои заявки</span></a></li>
|
||||||
<li><a href="/lk/profile" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-cog"></i></span><span class="mm-label">Настройки профиля</span></a></li>
|
<li><a href="/lk/profile" class="mm-item"><span class="mm-icon"><i class="fas fa-sm fa-fw fa-cog"></i></span><span class="mm-label">Настройки профиля</span></a></li>
|
||||||
<li><a href="/search?id=<?=Auth::userid()?>" class="mm-item"><span class="mm-icon"><i class="far fa-sm fa-fw fa-images"></i></span><span class="mm-label">Мои фотографии</span></a></li>
|
<li><a href="/search?id=<?=Auth::userid()?>" class="mm-item"><span class="mm-icon"><i class="far fa-sm fa-fw fa-images"></i></span><span class="mm-label">Мои фотографии</span></a></li>
|
||||||
|
|
151
views/pages/Admin/PageCreate.php
Normal file
151
views/pages/Admin/PageCreate.php
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function submitUpload() {
|
||||||
|
$('#buttonUpload').html('<button style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3" disabled><span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Загружаем...</button>');
|
||||||
|
$('#buttonUploadModal').html('<button type="submit" id="createpost" class="btn btn-primary" disabled><span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Загружаем...</button>');
|
||||||
|
$('#buttonPreView').html('<button style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3" disabled>Предпросмотр</button>');
|
||||||
|
$.ajax({
|
||||||
|
|
||||||
|
type: "POST",
|
||||||
|
url: '/exapi/dialogs/create',
|
||||||
|
data: JSON.stringify( { "bodypost":$("#bodypost").val(), "title": $("#title").val(), "did": '00000' } ),
|
||||||
|
dataType: "json",
|
||||||
|
success: function(response) {
|
||||||
|
var jsonData = JSON.parse(JSON.stringify(response));
|
||||||
|
|
||||||
|
console.log(jsonData);
|
||||||
|
if (jsonData.errorcode == "1") {
|
||||||
|
$('#buttonUpload').html('<button href="#" data-bs-toggle="modal" data-bs-target="#createDialogModal" style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3">Опубликовать</button>');
|
||||||
|
$('#buttonPreView').html('<button onclick="submitPreview()" style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3">Предпросмотр</button>');
|
||||||
|
$('#buttonUploadModal').html('<button onclick="submitUpload()"type="submit" class="btn btn-primary">Да, я уверен</button>');
|
||||||
|
Notify.noty('danger', 'Мало контента!');
|
||||||
|
} else {
|
||||||
|
$('#buttonUpload').html('<button href="#" data-bs-toggle="modal" data-bs-target="#createDialogModal" style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3">Опубликовать</button>');
|
||||||
|
$('#buttonPreView').html('<button onclick="submitPreview()" style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3">Предпросмотр</button>');
|
||||||
|
$('#buttonUploadModal').html('<button onclick="submitUpload()"type="submit" class="btn btn-primary">Да, я уверен</button>');
|
||||||
|
window.location.replace("/dialogs/<?=$id_dialog?>/topic/<?=$id_topic?>/post/"+jsonData.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function submitPreview() {
|
||||||
|
$('#buttonUpload').html('<button style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3" disabled>Опубликовать</button>');
|
||||||
|
$('#buttonPreView').html('<button style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3" disabled><span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Загружаем...</button>');
|
||||||
|
$.ajax({
|
||||||
|
|
||||||
|
type: "POST",
|
||||||
|
url: '/exapi/dialogs/createPreview',
|
||||||
|
data: JSON.stringify( { "bodypost":$("#bodypost").val(), "title": $("#title").val() } ),
|
||||||
|
dataType: "json",
|
||||||
|
success: function(response) {
|
||||||
|
var jsonData = JSON.parse(JSON.stringify(response));
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
|
console.log(jsonData);
|
||||||
|
if (jsonData.errorcode == "1") {
|
||||||
|
$('#buttonUpload').html('<button href="#" data-bs-toggle="modal" data-bs-target="#createDialogModal" style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3">Опубликовать</button>');
|
||||||
|
$('#buttonPreView').html('<button onclick="submitPreview()" style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3">Предпросмотр</button>');
|
||||||
|
$("#result").html("<div class='alert alert-dangernew container' role='alert'>Может, что-нибудь напишите в свой пост?</div>");
|
||||||
|
} else {
|
||||||
|
$('#buttonUpload').html('<button href="#" data-bs-toggle="modal" data-bs-target="#createDialogModal" style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3">Опубликовать</button>');
|
||||||
|
$('#buttonPreView').html('<button onclick="submitPreview()" style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-primarynew mb-3 mt-3">Предпросмотр</button>');
|
||||||
|
window.open('/dialogs/preview?id='+jsonData.preid, '_blank');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="exampleFormControlInput1" class="form-label">Заголовок</label>
|
||||||
|
<input name="title" id="title" type="text" class="form-control" id="exampleFormControlInput1">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-auto d-flex align-items-center">
|
||||||
|
<button onclick="document.getElementById('bodypost').value += '[b] [/b]';" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-bold"></i></button>
|
||||||
|
<button onclick="document.getElementById('bodypost').value += '[i] [/i]';" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-italic"></i></button>
|
||||||
|
<button onclick="document.getElementById('bodypost').value += '[u] [/u]';" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-underline"></i></button>
|
||||||
|
<button onclick="document.getElementById('bodypost').value += '[s] [/s]';" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-strikethrough"></i></button>
|
||||||
|
<button onclick="document.getElementById('bodypost').value += '[link=] [/link]';" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 36px;"><i class="bx bx-link"></i></button>
|
||||||
|
<button href="#" data-bs-toggle="modal" data-bs-target="#pickImageModal" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-image-alt"></i></button>
|
||||||
|
<button href="#" data-bs-toggle="modal" data-bs-target="#pickVideoModal" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-video"></i></button>
|
||||||
|
<button href="#" data-bs-toggle="modal" data-bs-target="#pickMusicModal" type="button" class="btn btn-primary btn-sm mb-2" style="margin-right: 6px;"><i class="bx bx-music"></i></button>
|
||||||
|
</div>
|
||||||
|
<textarea id="bodypost" class="form-control" name="bodypost" placeholder="Вы можете написать свою историю" cols="30" rows="10"></textarea>
|
||||||
|
<div class="btn-group" role="group" aria-label="Basic example">
|
||||||
|
<div id="buttonUpload">
|
||||||
|
<button href="#" data-bs-toggle="modal" data-bs-target="#createDialogModal" style="border-radius: 10px 0px 0px 10px !important;" type="submit" id="createpost" class="btn btn-primary mb-3 mt-3">Опубликовать</button>
|
||||||
|
</div>
|
||||||
|
<div id="buttonPreView">
|
||||||
|
<button onclick="submitPreview()" style="border-radius: 0px 10px 10px 0px !important;" type="submit" id="createpost" class="btn btn-outline-primary mb-3 mt-3">Предпросмотр</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="modal fade" id="pickImageModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Прикрепление фотографии</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<form enctype="multipart/form-data" id="pickImageForm">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3">
|
||||||
|
<input id="filebody" type="file" name="filebodyImage" class="form-control" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div><button type="button" class="btn-r btn-secondary" data-bs-dismiss="modal">Отмена</button></div>
|
||||||
|
<div id="r"><button id="t" type="submit" class="btn btn-primary" data-bs-dismiss="modal">Прикрепить</button></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal fade" id="pickMusicModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Прикрепление музыки</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3">
|
||||||
|
<input id="filebody" type="file" name="filebody" class="form-control" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div><button type="button" class="btn-r btn-secondary" data-bs-dismiss="modal">Отмена</button></div>
|
||||||
|
<div id="r"><button id="t" type="submit" class="btn btn-primary">Прикрепить</button></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal fade" id="pickVideoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Прикрепление видео</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<form enctype="multipart/form-data" id="pickVideoForm">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3">
|
||||||
|
<input id="filebody" type="file" name="filebodyVideo" class="form-control" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div><button type="button" class="btn-r btn-secondary" data-bs-dismiss="modal">Отмена</button></div>
|
||||||
|
<div id="r"><button id="t" type="submit" class="btn btn-primary" data-bs-dismiss="modal">Прикрепить</button></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
19
views/pages/Admin/Pages.php
Normal file
19
views/pages/Admin/Pages.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use \App\Services\{Auth, DB, Date};
|
||||||
|
use \App\Models\User;
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<h1><b>Страницы</b></h1>
|
||||||
|
<a href="?type=PageCreate" class="btn btn-primary mb-3">Создать</a>
|
||||||
|
|
||||||
|
<div id="pages">
|
||||||
|
<?php
|
||||||
|
$pages = DB::query('SELECT * FROM pages ORDER BY id');
|
||||||
|
foreach ($pages as $p) {
|
||||||
|
echo '<div class="card mb-3"><div class="card-body">' . Date::zmdate($n['time']) . '<br>' . $n['body'] . '</div></div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
|
@ -36,9 +36,25 @@ use \App\Models\User;
|
||||||
</style>
|
</style>
|
||||||
<td class="main">
|
<td class="main">
|
||||||
<h1><b>Фотографии</b></h1>
|
<h1><b>Фотографии</b></h1>
|
||||||
|
<div class="v-header__tabs">
|
||||||
|
<div class="v-tabs">
|
||||||
|
<div class="v-tabs__scroll">
|
||||||
|
<div class="v-tabs__content"><a href="#" onclick="changeTab('full')" id="full" class="v-tab v-tab--active"><span class="v-tab__label">
|
||||||
|
Полный список
|
||||||
|
|
||||||
|
</span></a><a href="#" onclick="changeTab('moderate')" id="moderate" class="v-tab"><span class="v-tab__label">
|
||||||
|
Ожидают модерации
|
||||||
|
|
||||||
|
</span></a>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script src="/js/diff.js"></script>
|
<script src="/js/diff.js"></script>
|
||||||
<script src="/js/pwrite-compare.js"></script>
|
<script src="/js/pwrite-compare.js"></script>
|
||||||
<br clear="all"><br>
|
<div style="display: none;" id="moderate__block">
|
||||||
<div class="p20w" style="display:block">
|
<div class="p20w" style="display:block">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -202,7 +218,10 @@ use \App\Models\User;
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div><br>
|
</div></div>
|
||||||
|
<div style="display: none;" class="active__block" id="full__block">
|
||||||
|
fgdfg
|
||||||
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
0
views/pages/Live.php
Normal file
0
views/pages/Live.php
Normal file
0
views/pages/Page.php
Normal file
0
views/pages/Page.php
Normal file
|
@ -1,58 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use App\Services\{Router, Auth, DB, Date};
|
|
||||||
?>
|
|
||||||
<html lang="ru">
|
|
||||||
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="backgr"></div>
|
|
||||||
<table class="tmain">
|
|
||||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
|
||||||
<tr>
|
|
||||||
<td class="main">
|
|
||||||
<h1>Результаты поиска</h1>
|
|
||||||
<div>Найдено изображений: <b><?=DB::query('SELECT COUNT(*) FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']))[0]['COUNT(*)']?></b> · <a href="#sf">Новый поиск</a></div><br>
|
|
||||||
<?php
|
|
||||||
$photos = DB::query('SELECT * FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']));
|
|
||||||
foreach ($photos as $p) {
|
|
||||||
echo '<div class="p20p">
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td class="pb_photo" id="p1936120"><a href="/photo/'.$p['id'].'" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'">
|
|
||||||
<div class="hpshade">
|
|
||||||
';
|
|
||||||
if (DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'] >= 1) {
|
|
||||||
echo '<div class="com-icon">'.DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div>';
|
|
||||||
}
|
|
||||||
echo '
|
|
||||||
<div class="eye-icon">'.DB::query('SELECT COUNT(*) FROM photos_views WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div></div>
|
|
||||||
</a></td>
|
|
||||||
<td class="pb_descr">
|
|
||||||
|
|
||||||
<p><b class="pw-place">'.htmlspecialchars($p['place']).'</b></p>
|
|
||||||
<span class="pw-descr">'.htmlspecialchars($p['postbody']).'</span>
|
|
||||||
<p class="sm"><b>'.Date::zmdate($p['timeupload']).'</b><br>Автор: <a href="/author/'.$p['user_id'].'/">'.htmlspecialchars($p['username']).'</a></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
515
views/pages/Search/Index.php
Normal file
515
views/pages/Search/Index.php
Normal file
|
@ -0,0 +1,515 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Services\{Router, Auth, DB, Date};
|
||||||
|
?>
|
||||||
|
<html lang="ru">
|
||||||
|
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="backgr"></div>
|
||||||
|
<table class="tmain">
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
||||||
|
<tr>
|
||||||
|
<td class="main">
|
||||||
|
<h1>Результаты поиска</h1>
|
||||||
|
<div>Найдено изображений: <b><?=DB::query('SELECT COUNT(*) FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']))[0]['COUNT(*)']?></b> · <a href="#sf">Новый поиск</a></div><br>
|
||||||
|
<?php
|
||||||
|
$photos = DB::query('SELECT * FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']));
|
||||||
|
foreach ($photos as $p) {
|
||||||
|
echo '<div class="p20p">
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="pb_photo" id="p1936120"><a href="/photo/'.$p['id'].'" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'">
|
||||||
|
<div class="hpshade">
|
||||||
|
';
|
||||||
|
if (DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'] >= 1) {
|
||||||
|
echo '<div class="com-icon">'.DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div>';
|
||||||
|
}
|
||||||
|
echo '
|
||||||
|
<div class="eye-icon">'.DB::query('SELECT COUNT(*) FROM photos_views WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div></div>
|
||||||
|
</a></td>
|
||||||
|
<td class="pb_descr">
|
||||||
|
|
||||||
|
<p><b class="pw-place">'.htmlspecialchars($p['place']).'</b></p>
|
||||||
|
<span class="pw-descr">'.htmlspecialchars($p['postbody']).'</span>
|
||||||
|
<p class="sm"><b>'.Date::zmdate($p['timeupload']).'</b><br>Автор: <a href="/author/'.$p['user_id'].'/">'.htmlspecialchars($p['username']).'</a></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<form method="get" id="mform" class="p20w" style="padding:10px 20px 10px 10px">
|
||||||
|
<table>
|
||||||
|
<tbody><tr>
|
||||||
|
<td colspan="2"><h4 style="margin:-5px 0 10px">Условия, относящиеся к ТС:</h4></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Страна:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="vrid" id="vrid" value="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="vrname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Город ТС:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="vcid" id="vcid" value="-1" data-vrid="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="vcname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Вид транспорта:</td>
|
||||||
|
<td>
|
||||||
|
<select name="vtype" id="vtype" class="">
|
||||||
|
<option value="-1" class="" selected="">Не имеет значения</option>
|
||||||
|
<option value="1" class="s5">Трамвай</option>
|
||||||
|
<option value="2" class="s8">Троллейбус</option>
|
||||||
|
<option value="3" class="s7">Метрополитен</option>
|
||||||
|
<option value="4" class="s9">Монорельс</option>
|
||||||
|
<option value="5" class="s2">Фуникулёр</option>
|
||||||
|
<option value="6" class="s6">Транслор</option>
|
||||||
|
<option value="7" class="s9">Мувер (АТН)</option>
|
||||||
|
<option value="8" class="s9">Маглев</option>
|
||||||
|
<option value="9" class="s3">Электробус</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Локация:</td>
|
||||||
|
<td>
|
||||||
|
<select name="loid" id="loid" style="width:400px" data-vcid="-1" disabled="">
|
||||||
|
<option value="0">Не имеет значения</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Депо/Парк:</td>
|
||||||
|
<td>
|
||||||
|
<select name="did" id="did" style="width:400px" data-vcid="-1" data-vtype="-1" data-loid="0" disabled="">
|
||||||
|
<option value="0">Не имеет значения</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Система:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="vgrid" id="vgrid" value="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="vgrname" style="width: 400px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Назначение:</td>
|
||||||
|
<td style="padding-bottom:17px">
|
||||||
|
<select name="serv">
|
||||||
|
<option value="-1" selected="">Не имеет значения</option>
|
||||||
|
<option value="0">Пассажирский</option>
|
||||||
|
<option value="1">Служебный</option>
|
||||||
|
<option value="2">Музейный</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Номер:</td>
|
||||||
|
<td><input type="text" name="num" style="width:100px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Госномер:</td>
|
||||||
|
<td style="padding-bottom:17px"><input type="text" name="gos" style="width:100px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Модель:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="mid" id="mid" value="-1" data-vtype="-1">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="mname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" disabled="" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
<input type="checkbox" name="sub" id="sub" value="1"> <label for="sub">Учесть подмодели</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Шасси:</td>
|
||||||
|
<td style="padding-bottom:17px">
|
||||||
|
<input type="hidden" name="chid" id="chid" value="-1" data-vtype="-1">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="chname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" disabled="" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
<input type="checkbox" name="sub2" id="sub2" value="1"> <label for="sub2">Учесть подмодели</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><h4 style="margin:0 0 10px">Условия, относящиеся к галереям:</h4></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Город галереи:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="gcid" id="gcid" value="-1">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="gcname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Вид транспорта:</td>
|
||||||
|
<td>
|
||||||
|
<select name="gtype" id="gtype" class="">
|
||||||
|
<option value="-1" class="" selected="">Не имеет значения</option>
|
||||||
|
<option value="0" class="s0">Без вида транспорта</option>
|
||||||
|
<option value="1" class="s5">Трамвай</option>
|
||||||
|
<option value="2" class="s8">Троллейбус</option>
|
||||||
|
<option value="3" class="s7">Метрополитен</option>
|
||||||
|
<option value="4" class="s9">Монорельс</option>
|
||||||
|
<option value="5" class="s2">Фуникулёр</option>
|
||||||
|
<option value="6" class="s6">Транслор</option>
|
||||||
|
<option value="7" class="s9">Мувер (АТН)</option>
|
||||||
|
<option value="8" class="s9">Маглев</option>
|
||||||
|
<option value="9" class="s3">Электробус</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Раздел:</td>
|
||||||
|
<td>
|
||||||
|
<select name="sid" id="sid" style="width:400px">
|
||||||
|
<option value="0" selected="">Не имеет значения</option>
|
||||||
|
<option value="1">События ГЭТ</option>
|
||||||
|
<option value="2">Фотогалереи ГЭТ</option>
|
||||||
|
<option value="6">Транспортное сообщество</option>
|
||||||
|
<option value="7">Выставки</option>
|
||||||
|
<option value="8">Обзоры</option>
|
||||||
|
<option value="9">Строительство и реконструкция</option>
|
||||||
|
<option value="13">Железная дорога</option>
|
||||||
|
<option value="14">Оборудование электротранспорта</option>
|
||||||
|
<option value="15">Творчество</option>
|
||||||
|
<option value="20">Метрополитены</option>
|
||||||
|
<option value="21">Монорельсы</option>
|
||||||
|
<option value="22">Фуникулёры</option>
|
||||||
|
<option value="112">События метрополитена</option>
|
||||||
|
<option value="113">Карты и схемы</option>
|
||||||
|
<option value="114">Временный раздел</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Галерея:</td>
|
||||||
|
<td style="padding-bottom:17px">
|
||||||
|
<select name="gid" id="gid" style="width:400px" data-gcid="-1" data-gtype="-1" data-sid="0" disabled="">
|
||||||
|
<option value="0">Не имеет значения</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><h4 style="margin:0 0 10px">Условия, относящиеся к фото:</h4></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Вид транспорта:</td>
|
||||||
|
<td><select name="ptype" id="ptype" class="">
|
||||||
|
<option value="-1" class="" selected="">Не имеет значения</option>
|
||||||
|
<option value="0" class="s0">Без вида транспорта</option>
|
||||||
|
<option value="1" class="s5">Трамвай</option>
|
||||||
|
<option value="2" class="s8">Троллейбус</option>
|
||||||
|
<option value="3" class="s7">Метрополитен</option>
|
||||||
|
<option value="4" class="s9">Монорельс</option>
|
||||||
|
<option value="5" class="s2">Фуникулёр</option>
|
||||||
|
<option value="6" class="s6">Транслор</option>
|
||||||
|
<option value="7" class="s9">Мувер (АТН)</option>
|
||||||
|
<option value="8" class="s9">Маглев</option>
|
||||||
|
<option value="9" class="s3">Электробус</option>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Страна:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="prid" id="prid" value="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="prname" style="width: 250px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Система:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="pgrid" id="pgrid" value="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="pgrname" style="width: 400px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Город съёмки:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="pcid" id="pcid" value="-1" data-prid="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="pcname" style="width: 400px; padding-left: 3px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Место съёмки:</td>
|
||||||
|
<td style="padding-bottom:15px">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" name="place" id="place" style="width:400px; margin-bottom:3px" value="" class="ui-autocomplete-input" autocomplete="off"><br>
|
||||||
|
<input type="checkbox" name="strict" id="strict" value="1"> <label for="strict">Строгое соответствие места съёмки</label><br>
|
||||||
|
<input type="checkbox" name="no_ren" id="no_ren" value="1" disabled=""> <label for="no_ren" style="color:#888">Без учёта переименований</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Маршрут:</td>
|
||||||
|
<td><input type="text" name="route" style="width:60px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Примечание:</td>
|
||||||
|
<td><input type="text" name="notes" style="width:200px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Описание:</td>
|
||||||
|
<td style="padding-bottom:17px"><input type="text" name="descr" style="width:400px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Конкурсное:</td>
|
||||||
|
<td><select name="konk">
|
||||||
|
<option value="0" selected="">Не имеет значения</option>
|
||||||
|
<option value="10">Все участники</option>
|
||||||
|
<option value="9">3 место и выше</option>
|
||||||
|
<option value="8">2 место и выше</option>
|
||||||
|
<option value="7">1 место и выше</option>
|
||||||
|
<option value="5">Пятёрка лучших за месяц</option>
|
||||||
|
<option value="4">Фото месяца</option>
|
||||||
|
<option value="2">Тройка лучших за год</option>
|
||||||
|
<option value="1">Фото года</option>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Ракурс:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="view" id="view" value="-1">
|
||||||
|
<input type="text" id="view_txt" value="Не имеет значения" style="width:300px; cursor:pointer" readonly="">
|
||||||
|
<div id="views-selector" style="position:absolute; padding:5px; z-index:20; display:none" class="p20 shadow">
|
||||||
|
<table id="views">
|
||||||
|
<tbody><tr>
|
||||||
|
<td colspan="3" style="text-align:center"><input type="checkbox" name="view_top" value="20" id="v20"> <label for="v20">Вид сверху</label></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="radio" name="view_s" value="4" title="Сзади-слева (окна)" class="views-radio-single" style="position:relative; top:7px; left:7px"></td>
|
||||||
|
<td style="text-align:center">
|
||||||
|
<input type="radio" name="view_s" value="8" title="Левый борт" class="views-radio-single">
|
||||||
|
</td>
|
||||||
|
<td><input type="radio" name="view_s" value="2" title="Спереди-слева (окна)" style="position:relative; top:7px; left:-7px"></td>
|
||||||
|
<td style="padding:0 35px; line-height:23px" rowspan="3">
|
||||||
|
<div><input type="radio" name="view_s" value="12" id="v12"> <label for="v12">Заводская табличка</label></div>
|
||||||
|
<div><input type="radio" name="view_s" value="13" id="v13"> <label for="v13">Отдельные элементы ТС</label></div>
|
||||||
|
<div class="twoside-old"><input type="radio" name="view_s" value="14" id="v14"> <label for="v14">Не определяется (двухстороннее ТС)</label></div>
|
||||||
|
<div><input type="radio" name="view_s" value="0" id="v0"> <label for="v0">Не указан</label></div>
|
||||||
|
<div><input type="radio" name="view_s" value="-1" id="vnone"> <label for="vnone">Не имеет значения</label></div>
|
||||||
|
<div class="sm" style="margin-top:15px"><a href="#" class="views-toggle-link dot">Переключить на: <span class="twoside-single">Одностороннее ТС</span><span class="twoside-twoside">Двухстороннее ТС</span></a></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding:0 2px"><input type="radio" name="view_s" value="7" title="Вид строго сзади" class="views-radio-single"></td>
|
||||||
|
<td class="views-image">
|
||||||
|
<table style="width:138px; height:82px">
|
||||||
|
<tbody><tr>
|
||||||
|
<td style="text-align:left; padding-left:25px">
|
||||||
|
<input type="radio" name="view_s" value="9" title="Салон, вид вперёд">
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right; padding:0">
|
||||||
|
<input type="radio" name="view_s" value="10" title="Салон, вид назад" class="views-radio-single">
|
||||||
|
<input type="radio" name="view_s" value="11" title="Кабина" style="position:relative; top:-7px">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
</td>
|
||||||
|
<td style="padding:0 2px"><input type="radio" name="view_s" value="5" title="Вид строго спереди"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="radio" name="view_s" value="3" title="Сзади-справа (двери)" class="views-radio-single" style="position:relative; top:-7px; left:7px"></td>
|
||||||
|
<td style="text-align:center">
|
||||||
|
<input type="radio" name="view_s" value="6" title="Правый борт">
|
||||||
|
</td>
|
||||||
|
<td><input type="radio" name="view_s" value="1" title="Спереди-справа (двери)" style="position:relative; top:-7px; left:-7px"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" style="text-align:center"><input type="checkbox" name="view_bottom" value="40" id="v40"> <label for="v40">Вид снизу</label></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function openViewSelector(val, el, twoside)
|
||||||
|
{
|
||||||
|
var selector = $('#views-selector');
|
||||||
|
|
||||||
|
var view = val % 20;
|
||||||
|
var modifier = val - view;
|
||||||
|
|
||||||
|
$('input[value="' + view + '"]', selector).prop('checked', true);
|
||||||
|
$('#v20').prop('checked', modifier == 20);
|
||||||
|
$('#v40').prop('checked', modifier == 40);
|
||||||
|
|
||||||
|
if (view != 14)
|
||||||
|
{
|
||||||
|
selector.attr('data-twoside', twoside);
|
||||||
|
$('.twoside-old').hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selector.attr('data-twoside', 1);
|
||||||
|
$('.twoside-old').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var p = el.offset();
|
||||||
|
selector.css('left', p.left + 'px').css('top', (p.top + el.height() + 3) + 'px').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setView(e, func)
|
||||||
|
{
|
||||||
|
var selector = $('#views-selector');
|
||||||
|
|
||||||
|
var view = parseInt($('input[type="radio"]:checked', selector).val());
|
||||||
|
var modifier = parseInt($('input[type="checkbox"]:checked', selector).val());
|
||||||
|
if (isNaN(modifier)) modifier = 0;
|
||||||
|
|
||||||
|
var label = view || !modifier ? views[view] : '';
|
||||||
|
if (label != '' && modifier) label += ' + ';
|
||||||
|
if (modifier) label += views[modifier];
|
||||||
|
|
||||||
|
func(e, view, modifier, label);
|
||||||
|
|
||||||
|
selector.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setViewSelectorCallback(func)
|
||||||
|
{
|
||||||
|
var selector = $('#views-selector');
|
||||||
|
|
||||||
|
$('input[type="radio"]', selector).on('click', function(e)
|
||||||
|
{
|
||||||
|
setView(e, func);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('input[type="checkbox"]', selector).on('click', function()
|
||||||
|
{
|
||||||
|
if ($(this).is('#v20:checked')) $('#v40').prop('checked', false); else
|
||||||
|
if ($(this).is('#v40:checked')) $('#v20').prop('checked', false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', function(e)
|
||||||
|
{
|
||||||
|
if ($(e.target).closest('#views-selector').length == 0 && $('#views-selector').is(':visible'))
|
||||||
|
{
|
||||||
|
setView(e, func);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.on('keydown', function(e)
|
||||||
|
{
|
||||||
|
// Закрытие селектора ракурса по Esc или Backspace
|
||||||
|
if ((e.which == 27 || e.which == 8) && $('#views-selector').is(':visible'))
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
setView(e, func);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
$('.views-toggle-link').on('click', function()
|
||||||
|
{
|
||||||
|
var selector = $('#views-selector');
|
||||||
|
var twoside = selector.attr('data-twoside');
|
||||||
|
|
||||||
|
selector.attr('data-twoside', twoside == 1 ? 0 : 1);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Модель камеры:</td>
|
||||||
|
<td style="padding-bottom:17px"><input type="text" name="cammod" style="width:300px" value=""></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Пользователь:</td>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="aid" id="aid" value="0">
|
||||||
|
<div class="ac-loader"></div><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="aname" style="width: 200px; padding-left: 4px; padding-right: 3px;" value="Не имеет значения" class="ui-autocomplete-input" autocomplete="off"><div class="xsign" style="display: none;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Авторство:</td>
|
||||||
|
<td><select name="auth">
|
||||||
|
<option value="0" selected="">Не имеет значения</option>
|
||||||
|
<option value="1">только авторские</option>
|
||||||
|
<option value="2">присланные этим пользователем</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="fav" id="fav" value="1"> <label for="fav">Поиск в Избранном</label></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="checkbox" name="lost" id="lost" value="1"> <label for="lost">Потерянные фотографии</label><br> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Дата съёмки с</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="date1" id="date1" size="10" maxlength="10" value="12.02.2025" disabled=""> по
|
||||||
|
<input type="text" name="date2" id="date2" size="10" maxlength="10" value="12.02.2025" disabled="">
|
||||||
|
<input type="checkbox" name="anydate" id="anydate" value="1" checked="checked"> <label for="anydate">Не имеет значения</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Опубликовано с</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="pub1" id="pub1" size="10" maxlength="10" value="12.02.2025" disabled=""> по
|
||||||
|
<input type="text" name="pub2" id="pub2" size="10" maxlength="10" value="12.02.2025" disabled="">
|
||||||
|
<input type="checkbox" name="anypub" id="anypub" value="1" checked="checked"> <label for="anypub">Не имеет значения</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td class="sm" style="color:#888">Даты в формате ДД.ММ.ГГГГ<br> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td><td> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Лицензии:</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" id="license_cc1" value="1" name="license_cc"> <label for="license_cc1">Выбрать только с свободными лицензиями</label><br>
|
||||||
|
<input type="checkbox" id="license_cc2" value="1" name="license_cc_commerce" disabled=""> <label for="license_cc2">Материалы для коммерческого использования</label><br>
|
||||||
|
<input type="checkbox" id="license_cc3" value="1" name="license_cc_derivatives" disabled=""> <label for="license_cc3">Материалы, которые можно изменять, адаптировать или использовать как основу</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td><td> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">Сортировать по </td>
|
||||||
|
<td><select name="order">
|
||||||
|
<option value="0">городу, бортовому номеру, дате съёмки</option>
|
||||||
|
<option value="1">дате съёмки, городу, бортовому номеру</option>
|
||||||
|
<option value="2">времени публикации (сверху старые)</option>
|
||||||
|
<option value="3" selected="">времени публикации (сверху новые)</option>
|
||||||
|
<option value="4">числу просмотров</option>
|
||||||
|
<option value="5">рейтингу</option>
|
||||||
|
<option value="6">числу комментариев</option>
|
||||||
|
</select> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><br><input type="submit" value=" Искать "></td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
</form>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
274
views/pages/Vehicle/DBEdit.php
Normal file
274
views/pages/Vehicle/DBEdit.php
Normal file
|
@ -0,0 +1,274 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use \App\Services\{Auth, DB, Date};
|
||||||
|
use \App\Models\{Vehicle, User};
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="backgr"></div>
|
||||||
|
<table class="tmain">
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
||||||
|
<tr>
|
||||||
|
<td class="main">
|
||||||
|
<h1>Внесение изменений в БД</h1>
|
||||||
|
<script src="/js/jquery-ui.js?1633005526"></script>
|
||||||
|
<script src="/js/selector.js?1730197663"></script>
|
||||||
|
<script>
|
||||||
|
addTexts({
|
||||||
|
'VF_MAXLENGTH': 'Буфер обмена содержит %s знаков, но значение в этом поле не может быть длиннее %s знаков!\nВероятно, вы пытаетесь вставить некорректные данные'
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#mname').autocompleteSelector('mid', '/api.php?action=get-models&type=2', {
|
||||||
|
minLength: 1,
|
||||||
|
defaultLabel: '(модель неизвестна)',
|
||||||
|
defaultValue: 632
|
||||||
|
});
|
||||||
|
$('#chname').autocompleteSelector('chid', '/api.php?action=get-chassis&type=2', {
|
||||||
|
minLength: 1,
|
||||||
|
defaultLabel: '(нет)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#state, #service').change(function() {
|
||||||
|
$(this).attr('class', $('option:selected', this).attr('class'));
|
||||||
|
}).change();
|
||||||
|
|
||||||
|
$('#mform').on('submit', function() {
|
||||||
|
var built_y_len = $('#built_y').val().length;
|
||||||
|
var scrap_y_len = $('#scrap_y').val().length;
|
||||||
|
|
||||||
|
if (built_y_len > 1 && built_y_len < 4 ||
|
||||||
|
scrap_y_len > 1 && scrap_y_len < 4) {
|
||||||
|
alert('Неверное значение в поле «год» (0, 1 либо 4 символа).');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var source = $('#source');
|
||||||
|
|
||||||
|
if (source.val().trim().length < 4) {
|
||||||
|
alert('Не указан источник сведений. Пожалуйста, заполните соответствующее поле..');
|
||||||
|
source[0].focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('input[type="submit"]', this).prop('disabled', true);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Фильтрация вставляемых из буфера данных
|
||||||
|
$('#num, #gos, #zn, #vin, #cn, #start_y, #leave_y, #built_y, #scrap_y').on('paste', function(e) {
|
||||||
|
var field = $(this);
|
||||||
|
var text = e.originalEvent.clipboardData.getData('Text').trim();
|
||||||
|
|
||||||
|
var maxlength = parseInt(field.attr('maxlength'));
|
||||||
|
if (maxlength && text.length > maxlength)
|
||||||
|
alert(_text['VF_MAXLENGTH'].replace('%s', text.length).replace('%s', maxlength) + '.');
|
||||||
|
else field.insertAtCaret(text);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Опции даты
|
||||||
|
$('.approx-aprx').css('font-weight', 'normal').on('change', function() {
|
||||||
|
$(this).attr('class', 'approx-aprx ' + $('option:selected', this).attr('class'))
|
||||||
|
}).change();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$.fn.insertAtCaret = function(myValue) {
|
||||||
|
return this.each(function() {
|
||||||
|
if (document.selection) {
|
||||||
|
// For browsers like Internet Explorer
|
||||||
|
this.focus();
|
||||||
|
var sel = document.selection.createRange();
|
||||||
|
sel.text = myValue;
|
||||||
|
this.focus();
|
||||||
|
} else
|
||||||
|
if (this.selectionStart || this.selectionStart == '0') {
|
||||||
|
// For browsers like Firefox and Webkit based
|
||||||
|
var startPos = this.selectionStart;
|
||||||
|
var endPos = this.selectionEnd;
|
||||||
|
var scrollTop = this.scrollTop;
|
||||||
|
this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos, this.value.length);
|
||||||
|
this.focus();
|
||||||
|
this.selectionStart = startPos + myValue.length;
|
||||||
|
this.selectionEnd = startPos + myValue.length;
|
||||||
|
this.scrollTop = scrollTop;
|
||||||
|
} else {
|
||||||
|
this.value += myValue;
|
||||||
|
this.focus();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<form method="post" id="mform" action="?action=write">
|
||||||
|
<input type="hidden" name="cid" value="14">
|
||||||
|
<input type="hidden" name="type" value="2">
|
||||||
|
<input type="hidden" name="link_gos" value="0">
|
||||||
|
|
||||||
|
<input type="hidden" name="num" id="num" value="">
|
||||||
|
|
||||||
|
<h4>Какую запись вы хотите уточнить?</h4>
|
||||||
|
<div class="p20w">
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>№</th>
|
||||||
|
<th>Название</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="s1">
|
||||||
|
<td class="ds"><input type="radio" name="base_nid" value="0" checked="checked" onclick="fillFields(0)"></td>
|
||||||
|
<td class="d" colspan="7">Никакую, я хочу добавить новое ТС</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$entities = DB::query('SELECT * FROM entities_data WHERE entityid=:id AND (LOWER(title) LIKE :title) OR id=:title', array(':title'=>$_GET['num'], ':id'=>$_GET['type']));
|
||||||
|
foreach ($entities as $e) {
|
||||||
|
echo '<tr>
|
||||||
|
<td class="ds"><input type="radio" name="base_nid" id="n'.$e['id'].'" value="'.$e['id'].'" onclick="fillFields('.$e['id'].')"></td>
|
||||||
|
<td class="n"><a href="/vehicle/'.$e['id'].'" target="_blank">'.$e['id'].'</a></td>
|
||||||
|
<td class="ds">'.$e['title'].'</td>
|
||||||
|
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<br clear="all"><br>
|
||||||
|
|
||||||
|
<div class="p20" style="padding-left:5px; margin-bottom:15px">
|
||||||
|
<table class="nospaces" width="100%">
|
||||||
|
<input type="hidden" name="did" value="27">
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$vehicle = DB::query('SELECT * FROM entities WHERE id=:id', array(':id' => $_GET['type']))[0];
|
||||||
|
$data = json_decode($vehicle['sampledata'], true);
|
||||||
|
$count = 1;
|
||||||
|
foreach ($data as $d) {
|
||||||
|
|
||||||
|
if ($d['important'] === "1") {
|
||||||
|
$imp = 'required';
|
||||||
|
}
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">' . $d['name'] . '</td>
|
||||||
|
<td style="padding-bottom:15px"><input type="text" name="modelinput_'.$count.'" id="num" style="width:80px" maxlength="21" value=""></td>
|
||||||
|
</tr>';
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 10%"></td>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var vdata = {};
|
||||||
|
|
||||||
|
vdata[0] = [0, '', '', '', 632, '(модель неизвестна)', 0, '(нет)', 0, 1, '', '', '', 0, '', 0, 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', ''];
|
||||||
|
vdata[594939] = [27, '48', '', '', 135, 'ПТЗ-5283', 0, '(нет)', 0, 5, '14', '', '', 11, '2002', 10, 0, '', 10, '2018-11-30', 10, '0000-00-00', 0, '0000-00-00', 0, '2022-00-00', 0, '', ''];
|
||||||
|
|
||||||
|
function setDateByYM(field, y, m, approx) {
|
||||||
|
$('#' + field + '_m').val(m == 0 ? '' : m);
|
||||||
|
$('#' + field + '_y').val(y == '0000' ? '' : y);
|
||||||
|
$('#' + field + '_approx_aprx').val(approx).change();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setDateByDate(field, date, approx) {
|
||||||
|
var d = date.substring(8, 10);
|
||||||
|
var m = date.substring(5, 7);
|
||||||
|
var y = date.substring(0, 4);
|
||||||
|
|
||||||
|
$('#' + field + '_d').val(d == 0 ? '' : d);
|
||||||
|
$('#' + field + '_m').val(m == 0 ? '' : m);
|
||||||
|
$('#' + field + '_y').val(y == 0 ? '' : y);
|
||||||
|
$('#' + field + '_approx_aprx').val(approx).change();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fillFields(nid) {
|
||||||
|
var i = 0;
|
||||||
|
|
||||||
|
$('#did').val(vdata[nid][i++]);
|
||||||
|
$('#num').val(vdata[nid][i++]);
|
||||||
|
$('#gos').val(vdata[nid][i++]);
|
||||||
|
$('#nu2').val(vdata[nid][i++]);
|
||||||
|
$('#mid').val(vdata[nid][i++]);
|
||||||
|
$('#mname').val(vdata[nid][i++]);
|
||||||
|
$('#chid').val(vdata[nid][i++]);
|
||||||
|
$('#chname').val(vdata[nid][i++]);
|
||||||
|
$('#service').val(vdata[nid][i++]).change();
|
||||||
|
$('#state').val(vdata[nid][i++]).change();
|
||||||
|
$('#zn').val(vdata[nid][i++]);
|
||||||
|
$('#cn').val(vdata[nid][i++]);
|
||||||
|
$('#vin').val(vdata[nid][i++]);
|
||||||
|
|
||||||
|
setDateByYM('built', vdata[nid][i + 1], vdata[nid][i], vdata[nid][i + 2]);
|
||||||
|
i += 3;
|
||||||
|
setDateByYM('scrap', vdata[nid][i + 1], vdata[nid][i], vdata[nid][i + 2]);
|
||||||
|
i += 3;
|
||||||
|
|
||||||
|
setDateByDate('start', vdata[nid][i], vdata[nid][i + 1]);
|
||||||
|
i += 2;
|
||||||
|
setDateByDate('launc', vdata[nid][i], vdata[nid][i + 1]);
|
||||||
|
i += 2;
|
||||||
|
setDateByDate('haltd', vdata[nid][i], vdata[nid][i + 1]);
|
||||||
|
i += 2;
|
||||||
|
setDateByDate('leave', vdata[nid][i], vdata[nid][i + 1]);
|
||||||
|
i += 2;
|
||||||
|
|
||||||
|
$('#note').val(vdata[nid][i++]);
|
||||||
|
$('#history').val(vdata[nid][i++]);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<br>
|
||||||
|
<input type="submit" value=" Отправить ">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div><a href="vehicles.php?cid=14&type=2&mid=632">Вернуться назад</a></div><br>
|
||||||
|
<div class="p20">
|
||||||
|
<h4>Правила заполнения формы</h4>
|
||||||
|
<ul class="straight">
|
||||||
|
<li>Обязательные для заполнения поля выделены жирным шрифтом.</li>
|
||||||
|
<li>Если какие-либо данные отсутствуют, оставьте соответствующее поле пустым. Пожалуйста, не вписывайте дефис и тому подобные знаки.</li>
|
||||||
|
<li>Если требуемой модели нет в списке — укажите её в поле «Примечание». После публикации фотографии модель будет добавлена в список.</li>
|
||||||
|
<li>Если Вы обладаете информацией о приписке данного ТС, а поле «Депо/Парк» отсутствует, укажите эти данные в поле «Примечание».</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
104
views/pages/Vehicle/IndexEdit.php
Normal file
104
views/pages/Vehicle/IndexEdit.php
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use \App\Services\{Auth, DB, Date};
|
||||||
|
use \App\Models\{Vehicle, User};
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="backgr"></div>
|
||||||
|
<table class="tmain">
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
||||||
|
<tr><td class="main">
|
||||||
|
<h1>Внесение изменений в БД</h1>
|
||||||
|
<p>На этой странице Вы можете ввести данные о Сущности, которые отсутствуют в базе данных сайта, либо требуют уточнения.<br />Информация добавляется в базу после проверки редактором.</p>
|
||||||
|
<script src="/js/jquery-ui.js?1633005526"></script>
|
||||||
|
<script src="/js/selector.js?1730197663"></script>
|
||||||
|
<form action="dbedit" id="mform" method="get" class="p20" style="float:left">
|
||||||
|
<input type="hidden" name="action" value="add">
|
||||||
|
<h4>Добавить/редактировать Сущность</h4>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">Вид сущности:</td>
|
||||||
|
<td><select name="type" id="type">
|
||||||
|
<?php
|
||||||
|
$entities = DB::query('SELECT * FROM entities');
|
||||||
|
foreach ($entities as $e) {
|
||||||
|
echo ' <option value="' . $e['id'] . '" style="background-color: ' . $e['color'] . '">' . $e['title'] . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lcol">
|
||||||
|
<input type="radio" name="link_gos" id="link_gos0" value="0" checked="checked">
|
||||||
|
<label for="link_gos0">ID:</label>
|
||||||
|
</td>
|
||||||
|
<td style="padding-right:10px">
|
||||||
|
<input type="text" name="num" id="num" maxlength="20" style="width:80px" value=''>
|
||||||
|
<input type="radio" name="link_gos" id="link_gos1" value="1">
|
||||||
|
<label for="link_gos1">Название:</label>
|
||||||
|
<input type="text" name="gos" id="gos" maxlength="20" style="width:120px" value=''>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><input type="submit" id="submit" style="width:100px; margin-top:15px" value="Далее >>" disabled="disabled"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type="hidden" name="mid" value="0">
|
||||||
|
</form>
|
||||||
|
<br clear="all">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function numKeyUp()
|
||||||
|
{
|
||||||
|
$('#submit').prop('disabled', $('#num').val().trim() + $('#gos').val().trim() == '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function radioClick()
|
||||||
|
{
|
||||||
|
$('#num').prop('disabled', $('#link_gos1').is(':checked'));
|
||||||
|
$('#gos').prop('disabled', $('#link_gos0').is(':checked'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
$('#cname').citySelector('cid', { params: { with_null: true } });
|
||||||
|
$('#type').change(function() { $(this).attr('class', $('option:selected', this).attr('class')); }).change();
|
||||||
|
|
||||||
|
$('#num, #gos').on('keyup', numKeyUp);
|
||||||
|
$('input[name="link_gos"]').on('click', radioClick);
|
||||||
|
|
||||||
|
numKeyUp();
|
||||||
|
radioClick();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,69 +0,0 @@
|
||||||
<html lang="fr">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Mini Vidéoplayer</title>
|
|
||||||
<style>
|
|
||||||
body { font-family: Arial, sans-serif; text-align: center; }
|
|
||||||
.player { width: 60%; margin: auto; position: relative; }
|
|
||||||
video { width: 100%; display: block; }
|
|
||||||
.controls { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: #333; color: white; }
|
|
||||||
.controls button { background: none; border: none; color: white; cursor: pointer; }
|
|
||||||
.progress-bar { width: 100%; height: 5px; background: gray; position: relative; cursor: pointer; }
|
|
||||||
.progress { width: 0%; height: 100%; background: red; position: absolute; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="player">
|
|
||||||
<video id="video" src="video.mp4"></video>
|
|
||||||
<div class="controls">
|
|
||||||
<button id="playPause">▶</button>
|
|
||||||
<input type="range" id="volume" min="0" max="1" step="0.1" value="1">
|
|
||||||
<button id="fullscreen">⛶</button>
|
|
||||||
</div>
|
|
||||||
<div class="progress-bar" id="progressBar">
|
|
||||||
<div class="progress" id="progress"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
const video = document.getElementById('video');
|
|
||||||
const playPause = document.getElementById('playPause');
|
|
||||||
const volume = document.getElementById('volume');
|
|
||||||
const progressBar = document.getElementById('progressBar');
|
|
||||||
const progress = document.getElementById('progress');
|
|
||||||
const fullscreen = document.getElementById('fullscreen');
|
|
||||||
|
|
||||||
playPause.addEventListener('click', () => {
|
|
||||||
if (video.paused) {
|
|
||||||
video.play();
|
|
||||||
playPause.textContent = '⏸';
|
|
||||||
} else {
|
|
||||||
video.pause();
|
|
||||||
playPause.textContent = '▶';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
volume.addEventListener('input', () => {
|
|
||||||
video.volume = volume.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
video.addEventListener('timeupdate', () => {
|
|
||||||
const progressPercent = (video.currentTime / video.duration) * 100;
|
|
||||||
progress.style.width = progressPercent + '%';
|
|
||||||
});
|
|
||||||
|
|
||||||
progressBar.addEventListener('click', (e) => {
|
|
||||||
const newTime = (e.offsetX / progressBar.offsetWidth) * video.duration;
|
|
||||||
video.currentTime = newTime;
|
|
||||||
});
|
|
||||||
|
|
||||||
fullscreen.addEventListener('click', () => {
|
|
||||||
if (!document.fullscreenElement) {
|
|
||||||
video.requestFullscreen();
|
|
||||||
} else {
|
|
||||||
document.exitFullscreen();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in a new issue