3076 lines
169 KiB
PHP
3076 lines
169 KiB
PHP
|
|
<?php
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|||
|
|
|
|||
|
|
ini_set('display_errors', 1);
|
|||
|
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE);
|
|||
|
|
|
|||
|
|
// закрываем доступ на выполнение запросов
|
|||
|
|
if (!isset($_SESSION['superadmin'])) {
|
|||
|
|
header("location:/index.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/ImportRecord.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/BlockImage.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/DocTarget.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/BlockProgressImageFacade.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/BlockPlusFacade.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/Block.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/ImporterService.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/DocumentManager.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/provider/DocProvider.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/provider/DbDocProvider.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/Dir.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/RootDir.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/File.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/DocCollection.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/ar/Document.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/exception/DocNotFoundException.php';
|
|||
|
|
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/exception/TargetNotFoundException.php';
|
|||
|
|
|
|||
|
|
if (isset($_POST['save_params'])) {
|
|||
|
|
$errParams = "";
|
|||
|
|
$postParams = clearInputData($_POST);
|
|||
|
|
if (isset($postParams['id'])) {
|
|||
|
|
if (strlen($errParams) == 0) {
|
|||
|
|
$blockToSave = new Block();
|
|||
|
|
$blockToSave->id = $postParams['id'];
|
|||
|
|
$blockToSave->fee = $postParams['fee'];
|
|||
|
|
$blockToSave->video_url = '';//$postParams['video_url'];
|
|||
|
|
$blockToSave->type = $postParams['type'];
|
|||
|
|
$blockToSave->phone = $postParams['phone'];
|
|||
|
|
|
|||
|
|
$blockToSave->recommended = 0;
|
|||
|
|
if(isset($postParams['recommended'])){
|
|||
|
|
$blockToSave->recommended = 1;
|
|||
|
|
}
|
|||
|
|
// данное значение не экринируем
|
|||
|
|
$blockToSave->additional = $_POST['additional'];
|
|||
|
|
$blockToSave->additog = $_POST['additog'];
|
|||
|
|
$blockToSave->updateParameters();
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if (strlen($errParams) > 0) {
|
|||
|
|
$err = $errParams . "<br/>";
|
|||
|
|
}
|
|||
|
|
$errParams .= "Не найден идентификатор комплекса в запросе.";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (isset($_POST['save_author_desc'])) {
|
|||
|
|
$name = "";
|
|||
|
|
if ($_FILES['author_photo']['error'] == 0) {
|
|||
|
|
$ext = strtolower(pathinfo($_FILES['author_photo']['name'], PATHINFO_EXTENSION));
|
|||
|
|
|
|||
|
|
$name = md5($_FILES['author_photo']['tmp_name'].time()).".".$ext;
|
|||
|
|
|
|||
|
|
if (!is_dir($_SERVER['DOCUMENT_ROOT'] . "/block_images/")) {
|
|||
|
|
mkdir($_SERVER['DOCUMENT_ROOT'] . "/block_images");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (!is_dir($_SERVER['DOCUMENT_ROOT'] . "/block_images/author_desc")) {
|
|||
|
|
mkdir($_SERVER['DOCUMENT_ROOT'] . "/block_images/author_desc");
|
|||
|
|
}
|
|||
|
|
$photo="/block_images/author_desc/".$name;
|
|||
|
|
move_uploaded_file($_FILES['author_photo']['tmp_name'],$_SERVER['DOCUMENT_ROOT'].$photo);
|
|||
|
|
} else {
|
|||
|
|
$author_result = "Превышен размер файла ".$_FILES['author_photo']['name'];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$errParams = "";
|
|||
|
|
$postParams = clearInputData($_POST);
|
|||
|
|
|
|||
|
|
if (isset($postParams['id'])) {
|
|||
|
|
if (strlen($errParams) == 0) {
|
|||
|
|
$blockToSave = new Block();
|
|||
|
|
$blockToSave->id = $postParams['id'];
|
|||
|
|
$blockToSave->author_name = $_POST['author_name'];
|
|||
|
|
$blockToSave->author_photo = $name;
|
|||
|
|
$blockToSave->author_desc = $_POST['author_desc'];
|
|||
|
|
$blockToSave->updateAuthorDesc();
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if (strlen($errParams) > 0) {
|
|||
|
|
$err = $errParams . "<br/>";
|
|||
|
|
}
|
|||
|
|
$errParams .= "Не найден идентификатор комплекса в запросе.";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$get = clearInputData($_GET);
|
|||
|
|
|
|||
|
|
if (!isset($get['id'])) {
|
|||
|
|
header("location:/admin/blocks.php");
|
|||
|
|
exit();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/templates/header-admin.php");
|
|||
|
|
|
|||
|
|
$block = new Block();
|
|||
|
|
|
|||
|
|
if ($get['id'] > 0) {
|
|||
|
|
$block = Block::findOne($get['id']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.file-list tbody tr td:last-child{ width: 100px; }
|
|||
|
|
.file-list a.name{ display: inline-block; width: 100%}
|
|||
|
|
</style>
|
|||
|
|
<style>
|
|||
|
|
.show_block_wizard_btn, .show_block_nowizard_btn, .block_features_btn {
|
|||
|
|
background: #f5f5f5;
|
|||
|
|
border: 1px solid #d0d0d0;
|
|||
|
|
color: #757575;
|
|||
|
|
line-height: 30px;
|
|||
|
|
padding: 0 13px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form fieldset {
|
|||
|
|
border: none;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form legend {
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form p {
|
|||
|
|
margin-top: 10px;
|
|||
|
|
}
|
|||
|
|
#block_wizard_save {
|
|||
|
|
margin-top: 10px;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form textarea {
|
|||
|
|
width: 100%;
|
|||
|
|
}
|
|||
|
|
/*Benefits*/
|
|||
|
|
#benefits_list {
|
|||
|
|
margin-top: 20px;
|
|||
|
|
}
|
|||
|
|
.benefit_item {
|
|||
|
|
display: table;
|
|||
|
|
border: 1px solid #d2d2d2;
|
|||
|
|
}
|
|||
|
|
.benefit_item_prop {
|
|||
|
|
display: table-cell;
|
|||
|
|
vertical-align: middle;
|
|||
|
|
padding: 10px;
|
|||
|
|
word-wrap: break-word;
|
|||
|
|
}
|
|||
|
|
.benefit_item_ico {
|
|||
|
|
width: 5%;
|
|||
|
|
}
|
|||
|
|
.benefit_item_name {
|
|||
|
|
min-width: 300px;
|
|||
|
|
max-width: 300px;
|
|||
|
|
width: 300px;
|
|||
|
|
border-left: 1px solid #d2d2d2;
|
|||
|
|
border-right: 1px solid #d2d2d2;
|
|||
|
|
}
|
|||
|
|
.benefit_item_description {
|
|||
|
|
width: 60%;
|
|||
|
|
}
|
|||
|
|
.show_add_review_btn, .show_add_benefit_btn, .show_add_plus_minus_btn {
|
|||
|
|
margin-top: 20px;
|
|||
|
|
}
|
|||
|
|
.block_benefit_icon_label {
|
|||
|
|
width: 55px;
|
|||
|
|
height: 55px;
|
|||
|
|
display: block;
|
|||
|
|
float: left;
|
|||
|
|
border: 2px solid #e8e8e8;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
}
|
|||
|
|
.block_benefit_icon_label.active {
|
|||
|
|
border-color: #419d45;
|
|||
|
|
}
|
|||
|
|
.block_benefit_icon_label input{
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
.benefit_act {
|
|||
|
|
color: #aca7a7;
|
|||
|
|
}
|
|||
|
|
.benefit_act:hover {
|
|||
|
|
color: #388E3C;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
/*ожидание-реальность*/
|
|||
|
|
.block_progress_img_date {
|
|||
|
|
bottom: 0;
|
|||
|
|
height: 26px;
|
|||
|
|
width: 100%;
|
|||
|
|
position: absolute;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
}
|
|||
|
|
.block_progress_img_date .datepicker-here2 {
|
|||
|
|
width: 100% !important;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
color: #5c5e60;
|
|||
|
|
text-align: center;
|
|||
|
|
background-color: rgba(105, 178, 138, 0.4);
|
|||
|
|
}
|
|||
|
|
#block_wizard_form fieldset a {
|
|||
|
|
ackground: #f5f5f5;
|
|||
|
|
border: 1px solid #43a047;
|
|||
|
|
color: #43a047;
|
|||
|
|
line-height: 30px;
|
|||
|
|
padding: 0 13px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
padding: 10px 15px 11px 11px;
|
|||
|
|
margin-right: 3px;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form fieldset a:hover {
|
|||
|
|
border-color: #43a047 !important;
|
|||
|
|
background-color: #43a047 !important;
|
|||
|
|
color: white !important;
|
|||
|
|
}
|
|||
|
|
#block_wizard_form input[type='number'] {
|
|||
|
|
font-size: 30px;
|
|||
|
|
color: #4d4b4b;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
#block_wizard_save {
|
|||
|
|
display: block;
|
|||
|
|
color: #43a047;
|
|||
|
|
border: 1px solid #43a047;
|
|||
|
|
padding: 15px;
|
|||
|
|
margin-top: 30px;
|
|||
|
|
border-radius: 5px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 15px;
|
|||
|
|
background-color: white;
|
|||
|
|
}
|
|||
|
|
#block_wizard_save:hover {
|
|||
|
|
background-color: #43a047;
|
|||
|
|
color: white;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<!--analisis-->
|
|||
|
|
<style>
|
|||
|
|
#analysis_children~.test3 .ui-slider-range {
|
|||
|
|
background: #d6ffcf none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_children~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#analysis_infrastructure~.test3 .ui-slider-range {
|
|||
|
|
background: #d6ffcf none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_infrastructure~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#analysis_area~.test3 .ui-slider-range {
|
|||
|
|
background: #d3ff9a none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_area~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#analysis_security~.test3 .ui-slider-range {
|
|||
|
|
background: #f8ffab none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_security~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#analysis_transport~.test3 .ui-slider-range {
|
|||
|
|
background: #fff6c5 none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_transport~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#analysis_apartment~.test3 .ui-slider-range {
|
|||
|
|
background: #ffe9ce none repeat scroll 0% 0%;
|
|||
|
|
}
|
|||
|
|
#analysis_apartment~.test3 .benefit_val_wrap {
|
|||
|
|
color: #4fb240;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.test3 .ui-slider-range {
|
|||
|
|
height: 37px;
|
|||
|
|
}
|
|||
|
|
.test3 {
|
|||
|
|
left: 0 !important;
|
|||
|
|
right: 0 !important;
|
|||
|
|
}
|
|||
|
|
.test3 .ui-slider-handle {
|
|||
|
|
opacity: 0;
|
|||
|
|
}
|
|||
|
|
.benefit_val_wrap {
|
|||
|
|
position: absolute;
|
|||
|
|
top: 9px;
|
|||
|
|
left: 10px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
.benefit_val_wrap {
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
.benefit_input {
|
|||
|
|
opacity: 0;
|
|||
|
|
}
|
|||
|
|
.test3 .ui-slider-range {
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
.benefit_wrap {
|
|||
|
|
margin-bottom: 5px;
|
|||
|
|
}
|
|||
|
|
.block_benefit_action_btn {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
.block_benefit_action_btn.active {
|
|||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<div class="main-title">
|
|||
|
|
<h1>Комплекс: <?php echo $block->name; ?></h1>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="users fr__users" style="margin-right: 20px;">
|
|||
|
|
<div class="new-object flat__modal" style="width: auto; margin: 0; padding: 0 20px 20px;">
|
|||
|
|
<div class="jw-tabs" id="flatModalTabs">
|
|||
|
|
<ul class="tabs__caption">
|
|||
|
|
<li><span>Просмотр</span></li>
|
|||
|
|
<li><span>Параметры</span></li>
|
|||
|
|
<li><span>Документы</span></li>
|
|||
|
|
<li><span>Документы api</span></li>
|
|||
|
|
<li><span>Ход строительства</span></li>
|
|||
|
|
<li><span>Дополнительные картинки</span></li>
|
|||
|
|
<li><span>Акции</span></li>
|
|||
|
|
<li><span>Отзывы</span></li>
|
|||
|
|
<li><span>Авторское описание ЖК</span></li>
|
|||
|
|
<li><span>Плюсы</span></li>
|
|||
|
|
<li><span>Минусы</span></li>
|
|||
|
|
<li><span>Метатеги</span></li>
|
|||
|
|
</ul>
|
|||
|
|
<div>
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Адрес</div>
|
|||
|
|
<div class="NB__value address"><?php echo $block->address; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Название</div>
|
|||
|
|
<div class="NB__value"><?php echo $block->name; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">ProNovostroyki Slug</div>
|
|||
|
|
<div class="NB__value">
|
|||
|
|
<?php
|
|||
|
|
$cyr = [
|
|||
|
|
'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п',
|
|||
|
|
'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',
|
|||
|
|
'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П',
|
|||
|
|
'Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я',' ',',',':','(',')','!','?','.','’'
|
|||
|
|
];
|
|||
|
|
$lat = [
|
|||
|
|
'a','b','v','g','d','e','io','zh','z','i','y','k','l','m','n','o','p',
|
|||
|
|
'r','s','t','u','f','h','ts','ch','sh','sht','a','i','y','e','yu','ya',
|
|||
|
|
'A','B','V','G','D','E','Io','Zh','Z','I','Y','K','L','M','N','O','P',
|
|||
|
|
'R','S','T','U','F','H','Ts','Ch','Sh','Sht','A','I','Y','e','Yu','Ya','','_','','','','','','',''
|
|||
|
|
];
|
|||
|
|
echo '<a href="http://pronovostroyki.com/zhk/'.str_replace($cyr, $lat, $block->name).'">http://pronovostroyki.com/zhk/'.str_replace($cyr, $lat, $block->name).'</a>';
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Описание</div>
|
|||
|
|
<div class="NB__value"><?php echo $block->note; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Тип договора</div>
|
|||
|
|
<div class="NB__value"><?php echo $block->getTypeName(); ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Комиссия</div>
|
|||
|
|
<div class="NB__value"><?php echo number_format($block->getCalculatedFee(), 2, ',', ' ') . '%'; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Время последнего обновления</div>
|
|||
|
|
<div class="NB__value"><?php echo $block->updated_at; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Характеристики комплекса</div>
|
|||
|
|
<div class="NB__value">
|
|||
|
|
<button block_id="<?php echo $block->id ?>" class="action-button actionJW show_block_wizard_btn">Анкета</button>
|
|||
|
|
<button block_id="<?php echo $block->id ?>" class="action-button actionJW show_block_nowizard_btn">Список</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Ожидание реальность -->
|
|||
|
|
<!-- Тип изображения в БД - 1 -->
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Ожидание-реальность</div>
|
|||
|
|
<div class="NB__value">
|
|||
|
|
<div class="inputs">
|
|||
|
|
<?php
|
|||
|
|
$images = $block->getImages(1);
|
|||
|
|
$photos = "";
|
|||
|
|
foreach ($images as $image) {
|
|||
|
|
$name = $image->image;
|
|||
|
|
$ph_url = $name;
|
|||
|
|
if(stripos($name,"http") === false) {
|
|||
|
|
$ph_url = "http://" . $_SERVER['SERVER_NAME'] . $name;
|
|||
|
|
}
|
|||
|
|
$photos1 ="<div class='block_img_wrap'>
|
|||
|
|
<div class='del_photo' style='margin-bottom: 7px;background:url($ph_url) no-repeat;background-size:cover;background-position:center;'>
|
|||
|
|
<div class='deleteBlockImage' data-id='" . $image->id . "' style='background-image: url(/images/del_Icon.png); width: 37px; height: 48px'></div>
|
|||
|
|
</div>
|
|||
|
|
<input placeholder='Дата..' type='text' class='text datepicker-here2' name='birthday' style='width:400px;' value=''>
|
|||
|
|
</div>";
|
|||
|
|
$photos.="<div class='del_photo' style='position: relative; margin-bottom: 7px;background:url($ph_url) no-repeat;background-size:cover;background-position:center;'>
|
|||
|
|
<div class='deleteBlockImage' data-id='" .$image->id . "' style='background-image: url(/images/del_Icon.png); width: 37px; height: 48px'></div>
|
|||
|
|
</div>";
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<form method="post" enctype="multipart/form-data" id="block-real-images-form" style="display: inline;">
|
|||
|
|
<div id="block-real-images-container" class="">
|
|||
|
|
<input type="hidden" name="blockId" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="file" name="blockRealPhoto[]" accept="image/jpg,image/jpeg" multiple="">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div id="image-block-real-result">
|
|||
|
|
<?php echo $photos; ?>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Ход строительства (фото с указанием дат) -->
|
|||
|
|
<!-- Тип изображения в БД - 2 -->
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label">Ход строительства (фото)</div>
|
|||
|
|
<div class="NB__value">
|
|||
|
|
<div class="inputs" id="months_wrapper">
|
|||
|
|
<style>
|
|||
|
|
.month_ttl {
|
|||
|
|
margin-bottom: 5px;
|
|||
|
|
}
|
|||
|
|
.month_images .del_photo {
|
|||
|
|
height: 100px;
|
|||
|
|
width: 100px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
float: left;
|
|||
|
|
margin-right: 20px;
|
|||
|
|
float: left;
|
|||
|
|
border: 1px solid #d0d0d0;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
}
|
|||
|
|
#month_date {
|
|||
|
|
width: 90px;
|
|||
|
|
margin: 10px 0 10px;
|
|||
|
|
padding: 5px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
border: 1px solid #81b083;
|
|||
|
|
border-radius: 5px;
|
|||
|
|
}
|
|||
|
|
.month_wrap {
|
|||
|
|
border-bottom: 1px solid #4caf50;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<?php
|
|||
|
|
//get months
|
|||
|
|
$Months = [
|
|||
|
|
"01" => "январь",
|
|||
|
|
"02" => "февраль",
|
|||
|
|
"03" => "март",
|
|||
|
|
"04" => "апрель",
|
|||
|
|
"05" => "май",
|
|||
|
|
"06" => "июнь",
|
|||
|
|
"07" => "июль",
|
|||
|
|
"08" => "август",
|
|||
|
|
"09" => "сентябрь",
|
|||
|
|
"10" => "октябрь",
|
|||
|
|
"11" => "ноябрь",
|
|||
|
|
"12" => "декабрь"
|
|||
|
|
];
|
|||
|
|
$images = $block->getImages(2);
|
|||
|
|
|
|||
|
|
$photos = "";
|
|||
|
|
$month_imgs = [];
|
|||
|
|
foreach ($images as $image) {
|
|||
|
|
if ($image->img_date) {
|
|||
|
|
if ($date = strtotime($image->img_date)) {
|
|||
|
|
$month_imgs[date('Y-m-01' , $date )][] = $image;
|
|||
|
|
} else {
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
foreach ($month_imgs as $date => $images) {
|
|||
|
|
?>
|
|||
|
|
<div class="month_wrap" id="date-<?php echo date('m-Y' , strtotime($date) ) ?>">
|
|||
|
|
<div class="month_ttl"><?php echo $Months[date('m' , strtotime($date) )].' '.date('Y' , strtotime($date) ); ?></div>
|
|||
|
|
<div class="month_images">
|
|||
|
|
<?php
|
|||
|
|
foreach ($images as $image) {
|
|||
|
|
$name = $image->image;
|
|||
|
|
$ph_url = $name;
|
|||
|
|
if (stripos($name,"http") === false) {
|
|||
|
|
$ph_url = "http://" . $_SERVER['SERVER_NAME'] . $name;
|
|||
|
|
}
|
|||
|
|
$photos="<div class='del_photo' style='position: relative; margin-bottom: 7px;background:url($ph_url) no-repeat;background-size:cover;background-position:center;'>
|
|||
|
|
<div class='deleteBlockImage' data-id='" .$image->id . "' style='background-image: url(/images/del_Icon.png); width: 37px; height: 48px'></div>
|
|||
|
|
<div style='display:none' class='block_progress_img_date'>
|
|||
|
|
<input placeholder='Дата..' type='text' class='text datepicker-here2' name='birthday' style='width:400px;' value=''>
|
|||
|
|
</div>
|
|||
|
|
</div>";
|
|||
|
|
echo $photos;
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<div class="add_month_img">Добавить изображение:</div>
|
|||
|
|
<input type="text" name="month_date" id="month_date">
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
<form method="post" enctype="multipart/form-data" id="block-progress-images-form" style="display: inline;">
|
|||
|
|
<div id="block-progress-images-container" class="">
|
|||
|
|
<input type="hidden" name="mdate" id="mdate">
|
|||
|
|
<input type="hidden" name="blockId" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="file" name="blockProgressPhoto[]" accept="image/jpg,image/jpeg" multiple="">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div id="image-block-progress-result">
|
|||
|
|
<?php
|
|||
|
|
// echo $photos;
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Параметры -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<form method="post">
|
|||
|
|
<div class="new-object__form">
|
|||
|
|
<?php if (isset($errParams) && strlen($errParams) > 0) { ?>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="block" style="border-bottom: none; color: red;"><?php echo $errParams; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Телефон</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<input style="width: 90%;" type="text" class="text" name="phone" maxlength="1500"
|
|||
|
|
value="<? if (isset($postParams)) { echo $postParams['phone']; } else { echo $block->phone; }?>">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Рекомендованный</div>
|
|||
|
|
<div class="NB__value checkbox" style="width: 80%;">
|
|||
|
|
<input name="recommended" id="recommended" type="checkbox" <?=((isset($postParams) && isset($postParams['recommended'])) || $block->recommended == 1) ? 'checked' : ''?>>
|
|||
|
|
<label for="recommended"></label>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Ссылка на видео</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<input style="width: 90%;" type="text" class="text" name="video_url" maxlength="1500"
|
|||
|
|
value="<? if (isset($postParams)) { echo $postParams['video_url']; } else { echo $block->video_url; }?>">
|
|||
|
|
</div>
|
|||
|
|
</div>-->
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Дополнительные видео</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<style>
|
|||
|
|
#block_videos_wrap {
|
|||
|
|
padding: 8px 10px 9px 0;
|
|||
|
|
margin-left: 5px;
|
|||
|
|
font-size: 15px;
|
|||
|
|
border-bottom: 1px solid #4caf50;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
#video_add_btn {
|
|||
|
|
border: 1px solid #43a047;
|
|||
|
|
color: #43a047;
|
|||
|
|
line-height: 14px;
|
|||
|
|
padding: 0 13px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
padding: 10px 15px 11px 11px;
|
|||
|
|
margin-right: 3px;
|
|||
|
|
margin-left: 5px;
|
|||
|
|
width: 69px;
|
|||
|
|
float: left;
|
|||
|
|
}
|
|||
|
|
#video_add_btn:hover {
|
|||
|
|
border-color: #43a047 !important;
|
|||
|
|
background-color: #43a047 !important;
|
|||
|
|
color: white !important;
|
|||
|
|
}
|
|||
|
|
#video_urls {
|
|||
|
|
width: 77% !important;
|
|||
|
|
float: left;
|
|||
|
|
}
|
|||
|
|
.block_video_url {
|
|||
|
|
display: block;
|
|||
|
|
width: 80%;
|
|||
|
|
border: 1px solid #4caf50;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
padding: 3px 4px;
|
|||
|
|
float: left;
|
|||
|
|
line-height: 1;
|
|||
|
|
color: #424242;
|
|||
|
|
height: 29px;
|
|||
|
|
}
|
|||
|
|
.block_video_del {
|
|||
|
|
border: 1px solid #43a047;
|
|||
|
|
color: #43a047;
|
|||
|
|
line-height: 14px;
|
|||
|
|
padding: 0 13px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
padding: 10px 15px 11px 11px;
|
|||
|
|
margin-right: 3px;
|
|||
|
|
margin-left: 5px;
|
|||
|
|
width: 69px;
|
|||
|
|
float: left;
|
|||
|
|
}
|
|||
|
|
.block_video_del:hover {
|
|||
|
|
border-color: #43a047 !important;
|
|||
|
|
background-color: #43a047 !important;
|
|||
|
|
color: white !important;
|
|||
|
|
}
|
|||
|
|
.block_video_wrap {
|
|||
|
|
margin-bottom: 5px;
|
|||
|
|
}
|
|||
|
|
.block_video_add_ttl {
|
|||
|
|
margin-left: 5px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<div id="block_videos_wrap">
|
|||
|
|
<?php
|
|||
|
|
$images = $block->getImages(10);
|
|||
|
|
$videoImg = array();
|
|||
|
|
foreach ($images as $image) {
|
|||
|
|
$videoImg[$image->video_id]['photo'] = $image->image;
|
|||
|
|
$videoImg[$image->video_id]['id'] = $image->id;
|
|||
|
|
}
|
|||
|
|
$sql = "SELECT * FROM block_videos WHERE block_id=" . $block->id;
|
|||
|
|
try {
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
while ($obj = mysql_fetch_assoc($result)) {
|
|||
|
|
?>
|
|||
|
|
<div class="block_video_wrap">
|
|||
|
|
<span class="block_video_url"><?php echo $obj['url'] ?></span>
|
|||
|
|
<span class="block_video_del" block_id="<?php echo $block->id ?>" video_id="<?php echo $obj['id'] ?>">Удалить</span>
|
|||
|
|
<div class="checkbox">
|
|||
|
|
<input class="recommended_video" name="recommended_video" data-id="<?=$obj['id']?>"
|
|||
|
|
id="recommended_video<?=$obj['id']?>" type="checkbox" <?=($obj['recommended'] == 1) ? 'checked' : ''?>>
|
|||
|
|
<label for="recommended_video<?=$obj['id']?>"></label>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<form></form>
|
|||
|
|
<div>
|
|||
|
|
<div class="add_month_img">Добавить изображение:</div>
|
|||
|
|
|
|||
|
|
<form method="post" enctype="multipart/form-data" class="block-video-images-form" id="block-video-images-form_<?=$obj['id']?>" style="display: inline;">
|
|||
|
|
<div class="block-video-images-container" id="block-video-images-container_<?=$obj['id']?>" class="">
|
|||
|
|
<input type="hidden" name="blockId" value="<?=$block->id?>">
|
|||
|
|
<input type="hidden" name="video_id" value="<?php echo $obj['id'] ?>">
|
|||
|
|
<input data-id="<?=$obj['id']?>" type="file" name="blockVideoPhoto[]" accept="image/jpg,image/jpeg" multiple="">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div class="image-block-video-result month_images" id="image-block-video-result_<?=$obj['id']?>">
|
|||
|
|
<?php
|
|||
|
|
if(isset($videoImg[$obj['id']])) { ?>
|
|||
|
|
<div class="col-md-1 del_photo" style="margin-bottom: 7px;margin-left: 7px;background:url(<?=$videoImg[$obj['id']]['photo']?>) no-repeat;background-size:cover;background-position:center;">
|
|||
|
|
<div class="deleteBlockImage" data-id="<?=$videoImg[$obj['id']]['id']?>" style="background-image: url(/images/del_Icon.png); width: 37px; height: 48px">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
} catch (Exception $e) {
|
|||
|
|
echo $e->getMessage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div class="block_video_add_ttl">Добавить видео URL:</div>
|
|||
|
|
<input style="width: 90%;" type="text" class="text" id="video_urls" name="video_urls" maxlength="1500" value="">
|
|||
|
|
<div id="video_add_btn" block_id="<?php echo $block->id ?>">Добавить</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<script>
|
|||
|
|
$(document).ready(function () {
|
|||
|
|
$('#video_add_btn').on('click', function(){
|
|||
|
|
param = {
|
|||
|
|
block_id : $(this).attr('block_id'),
|
|||
|
|
url : $('#video_urls').val()
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockVideo.php', param, function (data) {
|
|||
|
|
$('#block_videos_wrap').empty();
|
|||
|
|
$('#block_videos_wrap').append(data);
|
|||
|
|
$('#video_urls').val('');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#block_videos_wrap').on('click', '.block_video_del', function(){
|
|||
|
|
param = {
|
|||
|
|
block_id : $(this).attr('block_id'),
|
|||
|
|
video_id : $(this).attr('video_id')
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/deleteBlockVideo.php', param, function (data) {
|
|||
|
|
$('#block_videos_wrap').empty();
|
|||
|
|
$('#block_videos_wrap').append(data);
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Тип договора</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<select name="type">
|
|||
|
|
<?php
|
|||
|
|
foreach (Block::$types as $key => $val) {
|
|||
|
|
?>
|
|||
|
|
<option value="<?php echo $key?>" <? if (isset($postParams)) { if ($postParams['type'] == $key) {echo "selected"; } } else { if ($block->type == $key) {echo "selected"; } }?>><?php echo $val?></option>
|
|||
|
|
<?php } ?>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Комиссия</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<input type="number" max="100" min="0" step="0.1" class="text" name="fee" maxlength="3"
|
|||
|
|
value="<? if (isset($postParams)) { echo $postParams['fee']; } else { echo $block->fee; }?>">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Условия покупки</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<textarea id="additional" name="additional" rows="10"><? if (isset($postParams)) { echo $_POST['additional']; } else { echo $block->additional; }?></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Итоги</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<textarea cols="100" id="additog" name="additog" rows="10"><? if (isset($postParams)) { echo $_POST['additog']; } else { echo $block->additog; }?></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="text-align: right;">
|
|||
|
|
<button type="submit" class="medium-button">Сохранить</button>
|
|||
|
|
<input type="hidden" name="save_params" value="1">
|
|||
|
|
<input type="hidden" name="id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
jQuery(document).ready(function () {
|
|||
|
|
tinymce.init({"selector":"#additional","style_formats_merge":true,"theme":"modern","plugins":["advlist autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons template paste textcolor"],"templates":[],"height":300,"fontsize_formats":"6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 24pt 28pt 36pt 40pt 48pt","toolbar":"undo redo | fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor | print preview media","image_advtab":"true"})
|
|||
|
|
|
|||
|
|
/* tinymce.init({"selector":"#additog","style_formats_merge":true,"theme":"modern","plugins":["advlist autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons template paste textcolor"],"templates":[],"height":300,"fontsize_formats":"6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 24pt 28pt 36pt 40pt 48pt","toolbar":"undo redo | fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor | print preview media","image_advtab":"true"})
|
|||
|
|
*/ });
|
|||
|
|
</script>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Документы -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div style="float: left; width:70%;" id="documentsContent<?php echo DocTarget::TYPE_BLOCK; ?>">
|
|||
|
|
<?php
|
|||
|
|
$manager = new DocumentManager($block);
|
|||
|
|
$dirObject = $manager->getDir(0);
|
|||
|
|
$path = $manager->getParents($dirObject->getId());
|
|||
|
|
$collection = $manager->getChildren($dirObject->getId());
|
|||
|
|
include($_SERVER['DOCUMENT_ROOT']."/admin/documentsWidget.php");
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div style="float: right; width:30%;">
|
|||
|
|
<div style="margin-left: 20px;">
|
|||
|
|
<div class="add-folder">
|
|||
|
|
<button type="button" class="medium-button" id="createFolderButton"
|
|||
|
|
data-targetid="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>"
|
|||
|
|
data-targettype="<?php echo DocTarget::TYPE_BLOCK; ?>" data-id="0">Создать папку</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group field-block-fee">
|
|||
|
|
<form id="upload-docs-form" method="post" enctype="multipart/form-data">
|
|||
|
|
<div style="margin-top: 20px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<h2>Загрузить файл</h2>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 15px; margin-bottom: 15px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="form-group field-docform-files has-success">
|
|||
|
|
<input type="file" name="docFiles[]" multiple="">
|
|||
|
|
<input type="hidden" id="load_doc_target_id" name="target_id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="hidden" id="load_doc_fold_id" name="fold_id" value="0">
|
|||
|
|
<input type="hidden" id="load_doc_target_type" name="target_type" value="<?php echo DocTarget::TYPE_BLOCK; ?>">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<a type="button" class="medium-button" id="upload-docs-button">Загрузить</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="doc-loader" id="doc-loader" style="width: 64px;height: 64px;margin-top: 15px;">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Документы + -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div style="float: left; width:70%;" id="documentsContent<?php echo DocTarget::TYPE_BLOCK_PLUS; ?>">
|
|||
|
|
<?php
|
|||
|
|
$manager = new DocumentManager(new BlockPlusFacade($block));
|
|||
|
|
$dirObject = $manager->getDir(0);
|
|||
|
|
$path = $manager->getParents($dirObject->getId());
|
|||
|
|
$collection = $manager->getChildren($dirObject->getId());
|
|||
|
|
include($_SERVER['DOCUMENT_ROOT']."/admin/documentsWidget.php");
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div style="float: right; width:30%;">
|
|||
|
|
<div style="margin-left: 20px;">
|
|||
|
|
<div class="add-folder">
|
|||
|
|
<button type="button" class="medium-button" id="createPlusFolderButton"
|
|||
|
|
data-targetid="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>"
|
|||
|
|
data-targettype="<?php echo DocTarget::TYPE_BLOCK_PLUS; ?>" data-id="0">Создать папку</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group field-block-fee">
|
|||
|
|
<form id="upload-plus-form" method="post" enctype="multipart/form-data">
|
|||
|
|
<div style="margin-top: 20px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<h2>Загрузить файл</h2>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 15px; margin-bottom: 15px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="form-group field-docform-files has-success">
|
|||
|
|
<input type="file" name="docFiles[]" multiple="">
|
|||
|
|
<input type="hidden" id="load_plus_target_id" name="target_id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="hidden" id="load_plus_fold_id" name="fold_id" value="0">
|
|||
|
|
<input type="hidden" id="load_plus_target_type" name="target_type" value="<?php echo DocTarget::TYPE_BLOCK_PLUS; ?>">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<a type="button" class="medium-button" id="upload-plus-button">Загрузить</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="doc-loader" id="doc-plus-loader" style="width: 64px;height: 64px;margin-top: 15px;">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Progress DOCS -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div style="float: left; width:70%;" id="documentsContent<?php echo DocTarget::TYPE_BLOCK_PROGRESS; ?>">
|
|||
|
|
<?php
|
|||
|
|
$manager = new DocumentManager(new BlockProgressImageFacade($block));
|
|||
|
|
$dirObject = $manager->getDir(0);
|
|||
|
|
$path = $manager->getParents($dirObject->getId());
|
|||
|
|
$collection = $manager->getChildren($dirObject->getId());
|
|||
|
|
include($_SERVER['DOCUMENT_ROOT']."/admin/documentsWidget.php");
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div style="float: right; width:30%;">
|
|||
|
|
<div style="margin-left: 20px;">
|
|||
|
|
<div class="add-folder">
|
|||
|
|
<button type="button" class="medium-button " id="createProgressFolderButton"
|
|||
|
|
data-targetid="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>"
|
|||
|
|
data-targettype="<?php echo DocTarget::TYPE_BLOCK_PROGRESS; ?>" data-id="0">Создать папку</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group field-block-fee">
|
|||
|
|
<form id="upload-progress-form" method="post" enctype="multipart/form-data">
|
|||
|
|
<div style="margin-top: 20px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<h2>Загрузить файл</h2>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 15px; margin-bottom: 15px;">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="form-group field-docform-files has-success">
|
|||
|
|
<input type="file" name="docFiles[]" multiple="">
|
|||
|
|
<input type="hidden" id="load_progress_target_id" name="target_id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="hidden" id="load_progress_fold_id" name="fold_id" value="0">
|
|||
|
|
<input type="hidden" id="load_progress_target_type" name="target_type" value="<?php echo DocTarget::TYPE_BLOCK_PROGRESS; ?>">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<a type="button" class="medium-button" id="upload-progress-button">Загрузить</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="doc-loader" id="doc-progress-loader" style="width: 64px;height: 64px;margin-top: 15px;"></div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Доп. изображения -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div class="inputs">
|
|||
|
|
<?php
|
|||
|
|
$images = $block->getImages();
|
|||
|
|
$photos = "";
|
|||
|
|
foreach ($images as $image) {
|
|||
|
|
$name = $image->image;
|
|||
|
|
$ph_url = $name;
|
|||
|
|
if(stripos($name,"http") === false) {
|
|||
|
|
$ph_url = "http://" . $_SERVER['SERVER_NAME'] . $name;
|
|||
|
|
}
|
|||
|
|
$photos.="<div class='del_photo' style='margin-bottom: 7px;background:url($ph_url) no-repeat;background-size:cover;background-position:center;'>
|
|||
|
|
<div class='deleteBlockImage' data-id='" .$image->id . "' style='background-image: url(/images/del_Icon.png); width: 37px; height: 48px'></div>
|
|||
|
|
</div>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<form method="post" enctype="multipart/form-data" id="block-images-form" style="display: inline;">
|
|||
|
|
<div id="block-images-container" class="">
|
|||
|
|
<input type="hidden" name="blockId" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
<input type="file" name="blockPhoto[]" accept="image/jpg,image/jpeg" multiple="">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div id="image-block-result">
|
|||
|
|
<?php echo $photos; ?>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Акции -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<h2>Акции</h2>
|
|||
|
|
<div id="benefits_list">
|
|||
|
|
<?php
|
|||
|
|
$sql="SELECT * FROM block_benefits WHERE block_id=" . $block->id;
|
|||
|
|
try {
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
while ($obj = mysql_fetch_assoc($result)) {
|
|||
|
|
?>
|
|||
|
|
<div class="benefit_item" benefit_id="<?php echo $obj['id'] ?>">
|
|||
|
|
<div class="benefit_item_prop benefit_item_ico">
|
|||
|
|
<img src="../images/benefits/<?php echo $obj['benefit_icon'] ?>" alt="">
|
|||
|
|
</div>
|
|||
|
|
<div class="benefit_item_prop benefit_item_name"><?php echo $obj['benefit_name'] ?></div>
|
|||
|
|
<div class="benefit_item_prop benefit_item_description"><?php echo $obj['benefit_description'] ?></div>
|
|||
|
|
<div class="benefit_item_prop benefit_item_edit">
|
|||
|
|
<div class="benefit_edit benefit_act" benefit_id="<?php echo $obj['id'] ?>">Редактировать</div>
|
|||
|
|
<div class="benefit_del benefit_act" block_id="<?php echo $block->id ?>" benefit_id="<?php echo $obj['id'] ?>">Удалить</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
} catch (Exception $e) {
|
|||
|
|
echo $e->getMessage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<button block_id="<?php echo $block->id ?>" class="action-button actionJW show_add_benefit_btn block_features_btn">Добавить</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Reviews -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<style>
|
|||
|
|
.review_del_btn {
|
|||
|
|
color: #e77;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
|
|||
|
|
<div id="reviews_wrap">
|
|||
|
|
<?php
|
|||
|
|
$sql = "SELECT * FROM block_reviews WHERE block_id=".$block->id;
|
|||
|
|
$reviews = [];
|
|||
|
|
try {
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
while ($obj = mysql_fetch_assoc($result)) {
|
|||
|
|
$reviews[$obj['id']] = $obj;
|
|||
|
|
}
|
|||
|
|
} catch (Exception $e) {
|
|||
|
|
echo $e->getMessage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
if (!empty($reviews)) {
|
|||
|
|
?>
|
|||
|
|
<table id="reviews_table_id" class="display reviews_table_id">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>id</th>
|
|||
|
|
<th>Имя</th>
|
|||
|
|
<th>Отзыв</th>
|
|||
|
|
<th>Дата</th>
|
|||
|
|
<th></th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
<?php
|
|||
|
|
foreach ($reviews as $id => $review) {
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td><?php echo $id ?></td>
|
|||
|
|
<td><?php echo $review['name'] ?></td>
|
|||
|
|
<td><?php echo $review['review'] ?></td>
|
|||
|
|
<td><?php echo date('d.m.Y H:i', strtotime($review['created_at'])) ?></td>
|
|||
|
|
<td><span class="review_del_btn" id="<?php echo $id ?>">Удалить</span></td>
|
|||
|
|
</tr>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<button block_id="<?php echo $block->id ?>" class="action-button actionJW show_add_review_btn block_features_btn">Добавить</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<!-- Авторское описание ЖК -->
|
|||
|
|
<style>
|
|||
|
|
#author_name {
|
|||
|
|
margin-left: 0;
|
|||
|
|
}
|
|||
|
|
.author_prop_ttl {
|
|||
|
|
margin-top: 20px;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
color: #424242;
|
|||
|
|
}
|
|||
|
|
#author_photo_view_wrap {
|
|||
|
|
height: 100px;
|
|||
|
|
width: 100px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
float: left;
|
|||
|
|
margin-left: 20px;
|
|||
|
|
float: left;
|
|||
|
|
border: 1px solid #d0d0d0;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background-size:cover;
|
|||
|
|
background-position:center;
|
|||
|
|
}
|
|||
|
|
#author_photo_label {
|
|||
|
|
width: 100px;
|
|||
|
|
height: 100px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
display: inline-block;
|
|||
|
|
color: #757575;
|
|||
|
|
background: -moz-linear-gradient(top, #fff, #f5f5f5);
|
|||
|
|
background: -webkit-linear-gradient(top, #fff, #f5f5f5);
|
|||
|
|
background: -o-linear-gradient(top, #fff, #f5f5f5);
|
|||
|
|
background: -ms-linear-gradient(top, #fff, #f5f5f5);
|
|||
|
|
background: linear-gradient(top, #fff, #f5f5f5);
|
|||
|
|
border: 1px solid #d0d0d0;
|
|||
|
|
font-size: 16px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
box-shadow: 0 1px 2px rgba(0,0,0,.1);
|
|||
|
|
position: relative;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
float: left;
|
|||
|
|
}
|
|||
|
|
#author_photo_label:after {
|
|||
|
|
content: "\e61a";
|
|||
|
|
font-family: 'themify';
|
|||
|
|
speak: none;
|
|||
|
|
font-style: normal;
|
|||
|
|
font-weight: normal;
|
|||
|
|
font-variant: normal;
|
|||
|
|
text-transform: none;
|
|||
|
|
line-height: 1;
|
|||
|
|
-webkit-font-smoothing: antialiased;
|
|||
|
|
font-size: 42px;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 50%;
|
|||
|
|
margin-top: -42px;
|
|||
|
|
left: 50%;
|
|||
|
|
margin-left: -42px;
|
|||
|
|
padding: 20px;
|
|||
|
|
background: rgba(255, 255, 255, .8);
|
|||
|
|
border-radius: 3px;
|
|||
|
|
border: 1px solid #fff;
|
|||
|
|
}
|
|||
|
|
#author_photo_view_wrap img {
|
|||
|
|
/*width: 100%;*/
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<form method="post" enctype="multipart/form-data">
|
|||
|
|
<div class="new-object__form">
|
|||
|
|
<?php if (isset($errParams) && strlen($errParams) > 0) { ?>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="block" style="border-bottom: none; color: red;"><?php echo $errParams; ?></div>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Авторское описание ЖК</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<h4 class="author_prop_ttl">ФИО автора:</h4>
|
|||
|
|
<input value="<? echo $block->author_name ?>" type="text" name="author_name" id="author_name">
|
|||
|
|
<h4 class="author_prop_ttl">Фото автора:</h4>
|
|||
|
|
<input style="display:none" type="file" name="author_photo" id="author_photo" accept="image/jpg,image/jpeg">
|
|||
|
|
<label id="author_photo_label" for="author_photo"></label>
|
|||
|
|
<div id="author_photo_view_wrap" style="background-image: url('/block_images/author_desc/<? echo $block->author_photo ?>')"></div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
<h4 class="author_prop_ttl">Описание:</h4>
|
|||
|
|
<textarea id="author_desc" name="author_desc" rows="10"><? echo $block->author_desc ?></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="text-align: right;">
|
|||
|
|
<button type="submit" class="medium-button">Сохранить</button>
|
|||
|
|
<input type="hidden" name="save_author_desc" value="1">
|
|||
|
|
<input type="hidden" name="id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<script>
|
|||
|
|
$(document).ready(function () {
|
|||
|
|
$("#author_photo").change(function () {
|
|||
|
|
author_photo = ($(this))[0];
|
|||
|
|
if (author_photo.files && author_photo.files[0]) {
|
|||
|
|
console.log(author_photo.files[0]);
|
|||
|
|
var reader = new FileReader();
|
|||
|
|
reader.onload = function (e) {
|
|||
|
|
$('#author_photo_view_wrap').css("background-image", "url("+e.target.result+")");
|
|||
|
|
}
|
|||
|
|
reader.readAsDataURL(author_photo.files[0]);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!--Плюсы-->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<style>
|
|||
|
|
.plus_minus_del_btn {
|
|||
|
|
color: #e77;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<!--<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">-->
|
|||
|
|
<div id="plus_wrap">
|
|||
|
|
<?php
|
|||
|
|
$sql = "SELECT * FROM block_plus_minus WHERE block_id=".$block->id." AND plus_minus = 1" ;
|
|||
|
|
|
|||
|
|
$pluses = [];
|
|||
|
|
try {
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
while ($obj = mysql_fetch_assoc($result)) {
|
|||
|
|
$pluses[$obj['id']] = $obj;
|
|||
|
|
}
|
|||
|
|
} catch (Exception $e) {
|
|||
|
|
echo $e->getMessage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
// if (!empty($pluses)) {
|
|||
|
|
?>
|
|||
|
|
<table id="plus_table_id" class="display">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>id</th>
|
|||
|
|
<th>Текст</th>
|
|||
|
|
<th>Дата</th>
|
|||
|
|
<th></th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
<?php
|
|||
|
|
foreach ($pluses as $id => $plus) {
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td><?php echo $id ?></td>
|
|||
|
|
<td><?php echo $plus['text'] ?></td>
|
|||
|
|
<td><?php echo date('d.m.Y H:i', strtotime($plus['create_date'])) ?></td>
|
|||
|
|
<td><span class="plus_minus_del_btn" id="<?php echo $id ?>">Удалить</span></td>
|
|||
|
|
</tr>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
// }
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<button block_id="<?php echo $block->id ?>" data-plus="1" class="action-button actionJW show_add_plus_minus_btn block_features_btn">Добавить</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<!--Минусы-->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<style>
|
|||
|
|
.plus_minus_del_btn {
|
|||
|
|
color: #e77;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<!--<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">-->
|
|||
|
|
<div id="minus_wrap">
|
|||
|
|
<?php
|
|||
|
|
$sql = "SELECT * FROM block_plus_minus WHERE block_id=".$block->id." AND plus_minus = 0" ;
|
|||
|
|
|
|||
|
|
$pluses = [];
|
|||
|
|
try {
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
while ($obj = mysql_fetch_assoc($result)) {
|
|||
|
|
$pluses[$obj['id']] = $obj;
|
|||
|
|
}
|
|||
|
|
} catch (Exception $e) {
|
|||
|
|
echo $e->getMessage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
// if (!empty($pluses)) {
|
|||
|
|
?>
|
|||
|
|
<table id="minus_table_id" class="display">
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>id</th>
|
|||
|
|
<th>Текст</th>
|
|||
|
|
<th>Дата</th>
|
|||
|
|
<th></th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
<?php
|
|||
|
|
foreach ($pluses as $id => $plus) {
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td><?php echo $id ?></td>
|
|||
|
|
<td><?php echo $plus['text'] ?></td>
|
|||
|
|
<td><?php echo date('d.m.Y H:i', strtotime($plus['create_date'])) ?></td>
|
|||
|
|
<td><span class="plus_minus_del_btn" id="<?php echo $id ?>">Удалить</span></td>
|
|||
|
|
</tr>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
// }
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<button block_id="<?php echo $block->id ?>" data-plus="0" class="action-button actionJW show_add_plus_minus_btn block_features_btn">Добавить</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Метатеги -->
|
|||
|
|
<div class="tabs__content" style="display: none;">
|
|||
|
|
<div>
|
|||
|
|
<div id="metategs_block">
|
|||
|
|
<div class="new-object__form">
|
|||
|
|
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="block" style="border-bottom: none; color: red;"></div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
$block_meta_id = 0;
|
|||
|
|
if(isset($block))
|
|||
|
|
{
|
|||
|
|
$block_meta_id = $block->id;
|
|||
|
|
} else {
|
|||
|
|
if (isset($post))
|
|||
|
|
{
|
|||
|
|
$block_meta_id = $post['id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$metas = array('title' => '', 'description' => '', 'keywords' => '');
|
|||
|
|
$sql_meta = "SELECT * FROM `block_meta` WHERE `block_id` = ".$block_meta_id;
|
|||
|
|
|
|||
|
|
$q_meta = mysql_query($sql_meta);
|
|||
|
|
if(mysql_num_rows($q_meta) > 0){
|
|||
|
|
$r_meta = mysql_fetch_assoc($q_meta);
|
|||
|
|
$metas['title'] = $r_meta['title'];
|
|||
|
|
$metas['description'] = $r_meta['description'];
|
|||
|
|
$metas['keywords'] = $r_meta['keywords'];
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="NB__label" style="margin-top: 12px;width: 20%;">Метатеги ЖК</div>
|
|||
|
|
<div class="NB__value" style="width: 80%;">
|
|||
|
|
<h4 class="author_prop_ttl">title:</h4>
|
|||
|
|
<input style="width: 90%" value="<?=$metas['title']?>" type="text" name="title" id="titlezhk">
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
<h4 class="author_prop_ttl">description:</h4>
|
|||
|
|
<textarea style="width: 90%" id="desc_block" name="desc" rows="10"><?=$metas['description']?></textarea>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
<h4 class="author_prop_ttl">keywords:</h4>
|
|||
|
|
<textarea style="width: 90%" id="keywords_block" name="keywords" rows="10"><?=$metas['keywords']?></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="text-align: right;">
|
|||
|
|
<button type="submit" class="medium-button">Сохранить</button>
|
|||
|
|
<input type="hidden" id="block_meta_id" value="<?php if (isset($block)) { echo $block->id; } else { if (isset($post)) { echo $post['id']; }} ?>">
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<script src="/js/admin-edit.js?t=<?php echo ceil(microtime(true)); ?>"></script>
|
|||
|
|
<script src="/js/tinymce/tinymce.min.js"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
jQuery(document).ready(function () {
|
|||
|
|
tinymce.init({
|
|||
|
|
"selector":"#block-additional",
|
|||
|
|
"style_formats_merge":true,
|
|||
|
|
"theme":"modern",
|
|||
|
|
"plugins":["advlist autolink lists link image charmap print preview hr anchor pagebreak",
|
|||
|
|
"searchreplace wordcount visualblocks visualchars code fullscreen",
|
|||
|
|
"insertdatetime media nonbreaking save table contextmenu directionality",
|
|||
|
|
"emoticons template paste textcolor"],
|
|||
|
|
"templates":[],
|
|||
|
|
"height":300,
|
|||
|
|
"fontsize_formats":"6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 24pt 28pt 36pt 40pt 48pt",
|
|||
|
|
"toolbar":"undo redo | fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor | print preview media",
|
|||
|
|
"image_advtab":"true"})
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
jQuery(document).ready(function () {
|
|||
|
|
tinymce.init({
|
|||
|
|
"language": "ru",
|
|||
|
|
"selector":"#author_desc",
|
|||
|
|
"style_formats_merge":true,
|
|||
|
|
"theme":"modern",
|
|||
|
|
"plugins":[
|
|||
|
|
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
|
|||
|
|
"searchreplace wordcount visualblocks visualchars code fullscreen",
|
|||
|
|
"insertdatetime media nonbreaking save table contextmenu directionality",
|
|||
|
|
"emoticons template paste textcolor responsivefilemanager code"],
|
|||
|
|
"toolbar1": "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
|
|||
|
|
"toolbar2": "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor | print preview code ",
|
|||
|
|
"image_advtab": true ,
|
|||
|
|
|
|||
|
|
"external_filemanager_path":"/filemanager/",
|
|||
|
|
"filemanager_title":"Файловый менеджер" ,
|
|||
|
|
"external_plugins": { "filemanager" : "/js/tinymce/plugins/responsivefilemanager/plugin.min.js"},
|
|||
|
|
|
|||
|
|
"templates":[],
|
|||
|
|
"height":300,
|
|||
|
|
"fontsize_formats":"6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 24pt 28pt 36pt 40pt 48pt",
|
|||
|
|
"toolbar":"undo redo | fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor | print preview media",
|
|||
|
|
"image_advtab":"true"})
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="full_modal-bg" id="newFolder_bg" style="display: none;">
|
|||
|
|
|
|||
|
|
<div class="full_modal" id="newFolder" style="display: none;">
|
|||
|
|
|
|||
|
|
<span class="pseudo-link closer" onclick="hideFileFolderName(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
|
|||
|
|
<div class="modal-form">
|
|||
|
|
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
|
|||
|
|
<h2>Создать папку</h2>
|
|||
|
|
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div id="newFolderError" style="color: red;"></div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-block">
|
|||
|
|
|
|||
|
|
<div class="label">Название:</div>
|
|||
|
|
|
|||
|
|
<div class="inputs">
|
|||
|
|
|
|||
|
|
<input type="text" class="text" name="newFolderName" id="newFolderName" value="">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="newFolder_target_id" id="newFolder_target_id" value="">
|
|||
|
|
<input type="hidden" name="newFolder_target_type" id="newFolder_target_type" value="">
|
|||
|
|
<input type="hidden" name="newFolder_dir_id" id="newFolder_dir_id" value="">
|
|||
|
|
|
|||
|
|
<button class="fr-btn" type="button" name="ok" id="newFolderSaveButton" value="1">Сохранить <i class="ti-angle-right"></i></button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="f__modal-bg" id="delete_confirm_bg" style="display: none;">
|
|||
|
|
<div class="f__modal sign" id="delete_confirm" style="display: none;padding-bottom: 0;">
|
|||
|
|
<span class="pseudo-link closer" onclick="hideDeleteMessage(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
|
|||
|
|
<div class="f-col">
|
|||
|
|
|
|||
|
|
<div class="f-col-3"> </div>
|
|||
|
|
|
|||
|
|
<div class="f-col-6">
|
|||
|
|
|
|||
|
|
<div class="bg-danger" style="font-size:1.2em; border-radius:5px; text-align:center;" >
|
|||
|
|
Вы действительно хотите удалить папку/файл? <br>
|
|||
|
|
(Все вложенные файлы и папки будут удалены).
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<input type="hidden" name="id" id="deleteModal_fid">
|
|||
|
|
<input type="hidden" name="targetId" id="deleteModal_fTargetId">
|
|||
|
|
<input type="hidden" name="targetType" id="deleteModal_fTargetType">
|
|||
|
|
|
|||
|
|
<div style="width:240px; margin:20px auto;text-align: center;"><a href="#" id="deleteMessageButton" class="fr-btn medium-button">Удалить</a></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="f-col-3"> </div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="full_modal-bg" id="renameDoc_bg" style="display: none;">
|
|||
|
|
|
|||
|
|
<div class="full_modal" id="renameDoc" style="display: none;">
|
|||
|
|
|
|||
|
|
<span class="pseudo-link closer" onclick="hideRename(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
|
|||
|
|
<div class="modal-form">
|
|||
|
|
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
|
|||
|
|
<h2>Переименовать</h2>
|
|||
|
|
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div id="newFolderError" style="color: red;"></div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-block">
|
|||
|
|
|
|||
|
|
<div class="label">Название:</div>
|
|||
|
|
|
|||
|
|
<div class="inputs">
|
|||
|
|
|
|||
|
|
<input type="text" class="text" name="newDocName" id="newDocName" value="">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="doc_target_id" id="doc_target_id" value="">
|
|||
|
|
<input type="hidden" name="doc_target_type" id="doc_target_type" value="">
|
|||
|
|
<input type="hidden" name="doc_id" id="doc_id" value="">
|
|||
|
|
|
|||
|
|
<button class="fr-btn" type="button" name="ok" id="renameSaveButton" value="1">Сохранить <i class="ti-angle-right"></i></button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/templates/footer-admin.php");
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<div class="full_modal-bg" id="show_block_wizard_bg" style="display: none">
|
|||
|
|
<span class="pseudo-link closer event-modal-closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="full_modal edit-modal" id="show_block_wizard" style="display: none;">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2>Характеристики комплекса</h2>
|
|||
|
|
<form id="block_wizard_form" action=""></form>
|
|||
|
|
<button id="block_wizard_save" block_id="<?php echo $block->id ?>">Сохранить</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="full_modal-bg" id="show_block_nowizard_bg" style="display: none">
|
|||
|
|
<span class="pseudo-link closer event-modal-closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="full_modal edit-modal" id="show_block_nowizard" style="display: none;">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2>Характеристики комплекса</h2>
|
|||
|
|
<form id="block_nowizard_form" action=""></form>
|
|||
|
|
<button id="block_nowizard_save" block_id="<?php echo $block->id ?>">Сохранить</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--Review-->
|
|||
|
|
<div class="full_modal-bg" id="show_add_review_bg" style="display: none">
|
|||
|
|
<div class="full_modal" id="show_add_review" style="display: none">
|
|||
|
|
<span class="pseudo-link closer" onclick="hidechangeTarif(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
<form id="add_review_form" action="">
|
|||
|
|
<div class="modal-form">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2>Добавить отзыв</h2>
|
|||
|
|
<!-- <div class="form-block">-->
|
|||
|
|
<!-- <div class="label">Порядок:</div>-->
|
|||
|
|
<!-- <div class="inputs">-->
|
|||
|
|
<!-- <input type="number" min="0" class="text" name="num" value="1" style="width:70px;">-->
|
|||
|
|
<!-- </div>-->
|
|||
|
|
<!-- <div class="clear"></div>-->
|
|||
|
|
<!-- </div>-->
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Имя:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<input type="text" class="text" id="block_review_name" name="block_review_name" value="" style="width:100%">
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Описание:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<textarea class="text" id="block_review_text" name="block_review_text" style="width:100%; height:200px;"></textarea>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
<button id="block_review_save" class="fr-btn1" block_id="<?php echo $block->id ?>">Сохранить <i class="ti-angle-right"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--Плюсы - Минусы-->
|
|||
|
|
<div class="full_modal-bg" id="show_add_plus_minus_bg" style="display: none">
|
|||
|
|
<div class="full_modal" id="show_add_plus_minus" style="display: none">
|
|||
|
|
<span class="pseudo-link closer" onclick="hidechangeTarif(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
<form id="add_review_form" action="">
|
|||
|
|
<div class="modal-form">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2>Добавить Плюсы/Минусы</h2>
|
|||
|
|
<!-- <div class="form-block">-->
|
|||
|
|
<!-- <div class="label">Порядок:</div>-->
|
|||
|
|
<!-- <div class="inputs">-->
|
|||
|
|
<!-- <input type="number" min="0" class="text" name="num" value="1" style="width:70px;">-->
|
|||
|
|
<!-- </div>-->
|
|||
|
|
<!-- <div class="clear"></div>-->
|
|||
|
|
<!-- </div>-->
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Плюс/Минус</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<select style="width:100%" id="block_plus_minus_plusminus">
|
|||
|
|
<option value="0" selected>Минус</option>
|
|||
|
|
<option value="1">Плюс</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Текст:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<textarea class="text" id="block_plus_minus_text" name="block_plus_minus_text" style="width:100%; height:200px;"></textarea>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
<button id="block_plus_minus_save" class="fr-btn1" block_id="<?php echo $block->id ?>">Сохранить <i class="ti-angle-right"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!--Benefits-->
|
|||
|
|
<div class="full_modal-bg" id="show_add_benefit_bg" style="display: none">
|
|||
|
|
<div class="full_modal" id="show_add_benefit" style="display: none">
|
|||
|
|
<span class="pseudo-link closer" onclick="hidechangeTarif(); return false;"><i class="ti-close"></i></span>
|
|||
|
|
<form id="add_benefit_form" action="">
|
|||
|
|
<div class="modal-form">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2>Добавить акцию</h2>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Название:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<input type="text" class="text" id="block_benefit_name" name="block_benefit_name" value="" style="width:70px;">
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Описание:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<textarea class="text" id="block_benefit_description" name="block_benefit_description" style="width:100%; height:200px;"></textarea>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div class="label">Изображение:</div>
|
|||
|
|
<div class="inputs">
|
|||
|
|
<?php
|
|||
|
|
$dir = "../images/benefits";
|
|||
|
|
$icons = [];
|
|||
|
|
if (is_dir($dir)) {
|
|||
|
|
if ($dh = opendir($dir)) {
|
|||
|
|
while (($file = readdir($dh)) !== false) {
|
|||
|
|
if ($file != "." && $file != "..") {
|
|||
|
|
$icons[] = $file;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
closedir($dh);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
foreach ($icons as $icon) {
|
|||
|
|
?>
|
|||
|
|
<label class="block_benefit_icon_label" style="background: url('../images/benefits/<?php echo $icon ?>') no-repeat" icon="<?php echo $icon ?>">
|
|||
|
|
<input type="radio" name="block_benefit_icon" value="<?php echo $icon ?>" style="width:70px;">
|
|||
|
|
</label>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
<button id="block_benefit_save" class="fr-btn1 block_benefit_action_btn active" block_id="<?php echo $block->id ?>">Сохранить <i class="ti-angle-right"></i></button>
|
|||
|
|
<button id="block_benefit_update" class="fr-btn1 block_benefit_action_btn" block_id="<?php echo $block->id ?>" benefit_id="">Обновить <i class="ti-angle-right"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
$(document).ready(function () {
|
|||
|
|
$("#block_wizard_save").hide();
|
|||
|
|
$("#block_wizard_form").before("<ul style='display:none' id='steps'></ul>");
|
|||
|
|
|
|||
|
|
$('#show_block_wizard_bg .closer').on('click', function(){
|
|||
|
|
$("#show_block_wizard_bg").toggle(10);
|
|||
|
|
});
|
|||
|
|
$('#show_block_nowizard_bg .closer').on('click', function(){
|
|||
|
|
$("#show_block_nowizard_bg").toggle(10);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('body .show_block_wizard_btn').on('click', function(e) {
|
|||
|
|
$("#block_wizard_save").hide();
|
|||
|
|
btn = $(this);
|
|||
|
|
block_id = btn.attr('block_id');
|
|||
|
|
param = {
|
|||
|
|
"block_id": block_id,
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockWizardData.php', param, function (data) {
|
|||
|
|
if (data) {
|
|||
|
|
let obj = JSON.parse(data);
|
|||
|
|
$('#block_wizard_form').empty();
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Облицовка фасада</legend><textarea id="facade" name="facade">'+(obj["facade"]?obj["facade"]:"")+'</textarea></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="storerooms" id="storerooms" type="checkbox" '+(obj["storerooms"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="storerooms">Кладовые</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="prams" id="prams" type="checkbox" '+(obj["prams"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="prams">Колясочные</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Количество квартир</legend><input class="text" type="number" id="apartments_count" name="apartments_count" value="'+(obj["apartments_count"]?obj["apartments_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Жилая площадь</legend><input class="text" type="number" id="living_space" name="living_space" value="'+(obj["living_space"]?obj["living_space"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Планируемое число жителей</legend><input class="text" type="number" id="planned_residents_count" name="planned_residents_count" value="'+(obj["planned_residents_count"]?obj["planned_residents_count"]:"")+'"></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="furniture" id="furniture" type="checkbox" '+(obj["furniture"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="furniture">Квартира с мебелью</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Квартира с мебелью</legend><input type="checkbox" id="furniture" name="furniture" '+(obj["furniture"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="smart_house" id="smart_house" type="checkbox" '+(obj["smart_house"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="smart_house">Элементы системы Умный Дом</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Элементы системы Умный Дом</legend><input type="checkbox" id="smart_house" name="smart_house" '+(obj["smart_house"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Остекление Окон</legend><textarea id="glass" name="glass">'+(obj["glass"]?obj["glass"]:"")+'</textarea></fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Остекление Окон</legend><input type="text" id="glass" name="glass" value="'+(obj["glass"]?obj["glass"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Количество машиномест</legend><input class="text" type="number" id="parking_count" name="parking_count" value="'+(obj["parking_count"]?obj["parking_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>В том числе платных</legend><input class="text" type="number" id="paid_parking_count" name="paid_parking_count" value="'+(obj["paid_parking_count"]?obj["paid_parking_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset><legend>Стоимость машиномест</legend><input class="text" type="number" id="parking_cost" name="parking_cost" value="'+(obj["parking_cost"]?obj["parking_cost"]:"")+'"></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<legend>Тип платной парковки</legend>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="paid_parking_type_on" id="paid_parking_type_on" type="checkbox" '+(obj["paid_parking_type_on"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="paid_parking_type_on">Наземная</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="paid_parking_type_under" id="paid_parking_type_under" type="checkbox" '+(obj["paid_parking_type_under"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="paid_parking_type_under">Подземная</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Тип платной парковки</legend><input type="checkbox" id="paid_parking_type" name="paid_parking_type" '+(obj["paid_parking_type"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_traffic" id="yard_traffic" type="checkbox" '+(obj["yard_traffic"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_traffic">Продумано движение во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Продумано движение во дворе</legend><input type="checkbox" id="yard_traffic" name="yard_traffic" '+(obj["yard_traffic"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_kindergarten" id="yard_kindergarten" type="checkbox" '+(obj["yard_kindergarten"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_kindergarten">Детский сад во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детский сад во дворе</legend><input type="checkbox" id="yard_kindergarten" name="yard_kindergarten" '+(obj["yard_kindergarten"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_school" id="yard_school" type="checkbox" '+(obj["yard_school"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_school">Школа во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Школа во дворе</legend><input type="checkbox" id="yard_school" name="yard_school" '+(obj["yard_school"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="children_objects" id="children_objects" type="checkbox" '+(obj["children_objects"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="children_objects">Другие объекты для детей</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Другие объекты для детей</legend><input type="checkbox" id="children_objects" name="children_objects" '+(obj["children_objects"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="playground" id="playground" type="checkbox" '+(obj["playground"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="playground">Детская площадка</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детская площадка</legend><input type="checkbox" id="playground" name="playground" '+(obj["playground"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="trade_service" id="trade_service" type="checkbox" '+(obj["trade_service"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="trade_service">Торговля и сервис</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Торговля и сервис</legend><input type="checkbox" id="trade_service" name="trade_service" '+(obj["trade_service"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="medical" id="medical" type="checkbox" '+(obj["medical"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="medical">Медицинские учреждения</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Медицинские учреждения</legend><input type="checkbox" id="medical" name="medical" '+(obj["medical"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="walk_place" id="walk_place" type="checkbox" '+(obj["walk_place"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="walk_place">Благоустроенное место для прогулок</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Благоустроенное место для прогулок</legend><input type="checkbox" id="walk_place" name="walk_place" '+(obj["walk_place"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_close" id="yard_close" type="checkbox" '+(obj["yard_close"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_close">Закрытый двор</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Закрытый двор</legend><input type="checkbox" id="yard_close" name="yard_close" '+(obj["yard_close"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="security" id="security" type="checkbox" '+(obj["security"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="security">Охрана территории</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Охрана территории</legend><input type="checkbox" id="security" name="security" '+(obj["security"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="without_cars" id="without_cars" type="checkbox" '+(obj["without_cars"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="without_cars">Двор без машин</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Двор без машин</legend><input type="checkbox" id="without_cars" name="without_cars" '+(obj["without_cars"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="video" id="video" type="checkbox" '+(obj["video"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="video">Видеонаблюдение</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Видеонаблюдение</legend><input type="checkbox" id="video" name="video" '+(obj["video"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="dispatcher" id="dispatcher" type="checkbox" '+(obj["dispatcher"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="dispatcher">Помещение для консьержа-диспетчера</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Помещение для консьержа-диспетчера</legend><input type="checkbox" id="dispatcher" name="dispatcher" '+(obj["dispatcher"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="school" id="school" type="checkbox" '+(obj["school"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="school">Школа</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Школа</legend><input type="checkbox" id="school" name="school" '+(obj["school"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="kindergarten" id="kindergarten" type="checkbox" '+(obj["kindergarten"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="kindergarten">Детский сад</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детский сад</legend><input type="checkbox" id="kindergarten" name="kindergarten" '+(obj["kindergarten"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="clinic" id="clinic" type="checkbox" '+(obj["clinic"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="clinic">Поликлиника</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Поликлиника</legend><input type="checkbox" id="clinic" name="clinic" '+(obj["clinic"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="drugstore" id="drugstore" type="checkbox" '+(obj["drugstore"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="drugstore">Аптека</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Аптека</legend><input type="checkbox" id="drugstore" name="drugstore" '+(obj["drugstore"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="supermarket" id="supermarket" type="checkbox" '+(obj["supermarket"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="supermarket">Супермаркет</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Супермаркет</legend><input type="checkbox" id="supermarket" name="supermarket" '+(obj["supermarket"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="fitness" id="fitness" type="checkbox" '+(obj["fitness"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="fitness">Фитнес-Центр</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Фитнес-Центр</legend><input type="checkbox" id="fitness" name="fitness" '+(obj["fitness"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
analysis_children = obj["analysis_children"]?obj["analysis_children"]/10:"";
|
|||
|
|
analysis_infrastructure = obj["analysis_infrastructure"]?obj["analysis_infrastructure"]/10:"";
|
|||
|
|
analysis_area = obj["analysis_area"]?obj["analysis_area"]/10:"";
|
|||
|
|
analysis_security = obj["analysis_security"]?obj["analysis_security"]/10:"";
|
|||
|
|
analysis_transport = obj["analysis_transport"]?obj["analysis_transport"]/10:"";
|
|||
|
|
analysis_apartment = obj["analysis_apartment"]?obj["analysis_apartment"]/10:"";
|
|||
|
|
|
|||
|
|
$('#block_wizard_form').append('<fieldset>' +
|
|||
|
|
'<legend>Анализ ЖК</legend>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_children" name="analysis_children" class="text price medium-input money-format benefit_input" value="'+analysis_children+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_children" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Для детей <span class="benefit_val">'+analysis_children+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_infrastructure" name="analysis_infrastructure" class="text price medium-input money-format benefit_input" value="'+analysis_infrastructure+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_infrastructure" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Инфраструктура <span class="benefit_val">'+analysis_infrastructure+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_area" name="analysis_area" class="text price medium-input money-format benefit_input" value="'+analysis_area+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_area" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Район <span class="benefit_val">'+analysis_area+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_security" name="analysis_security" class="text price medium-input money-format benefit_input" value="'+analysis_security+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_security" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Безопасность <span class="benefit_val">'+analysis_security+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_transport" name="analysis_transport" class="text price medium-input money-format benefit_input" value="'+analysis_transport+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_transport" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Транспорт <span class="benefit_val">'+analysis_transport+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_apartment" name="analysis_apartment" class="text price medium-input money-format benefit_input" value="'+analysis_apartment+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_apartment" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Квартира/Дом <span class="benefit_val">'+analysis_apartment+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('.analysis_children').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_children,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_infrastructure').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_infrastructure,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_area').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_area,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_security').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_security,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_transport').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_transport,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_apartment').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_apartment,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$('#stoim_ky').val(val);
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
var steps = $("#block_wizard_form fieldset");
|
|||
|
|
var count = steps.size();
|
|||
|
|
var stepName = '';
|
|||
|
|
|
|||
|
|
function createPrevButton(i) {
|
|||
|
|
var stepName = "step" + i;
|
|||
|
|
$("#" + stepName + "commands").append("<a href='#' id='" + stepName + "Prev' class='prev'>< Назад</a>");
|
|||
|
|
$("#" + stepName + "Prev").bind("click", function(e) {
|
|||
|
|
$("#" + stepName).hide();
|
|||
|
|
$("#step" + (i - 1)).show();
|
|||
|
|
selectStep(i - 1);
|
|||
|
|
$("#block_wizard_save").hide();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function createNextButton(i) {
|
|||
|
|
var stepName = "step" + i;
|
|||
|
|
$("#" + stepName + "commands").append("<a href='#' id='" + stepName + "Next' class='next'>Далее ></a>");
|
|||
|
|
$("#" + stepName + "Next").bind("click", function(e) {
|
|||
|
|
$("#" + stepName).hide();
|
|||
|
|
$("#step" + (i + 1)).show();
|
|||
|
|
selectStep(i + 1);
|
|||
|
|
if (i + 2 == count) {
|
|||
|
|
$("#block_wizard_save").show();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function selectStep(i) {
|
|||
|
|
$("#steps li").removeClass("current");
|
|||
|
|
$("#stepDesc" + i).addClass("current");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
steps.each(function(i) {
|
|||
|
|
var name = $(this).find("legend").html();
|
|||
|
|
$("#steps").append("<li id='stepDesc" + i + "'>Step " + (i + 1) + "<span>" + name + "</span></li>");
|
|||
|
|
|
|||
|
|
$(this).wrap("<div id='step" + i + "'></div>");
|
|||
|
|
$(this).append("<p id='step" + i + "commands'></p>");
|
|||
|
|
|
|||
|
|
if (i == 0) {
|
|||
|
|
createNextButton(i);
|
|||
|
|
selectStep(i);
|
|||
|
|
} else if (i == count - 1) {
|
|||
|
|
$("#step" + i).hide();
|
|||
|
|
createPrevButton(i);
|
|||
|
|
} else {
|
|||
|
|
$("#step" + i).hide();
|
|||
|
|
createPrevButton(i);
|
|||
|
|
createNextButton(i);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#show_block_wizard_bg').show();
|
|||
|
|
$('#show_block_wizard').show();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//save block wizard data
|
|||
|
|
$('#block_wizard_save').on('click', function(e) {
|
|||
|
|
btn = $(this);
|
|||
|
|
analysis_children = $("#analysis_children~.test3 .benefit_val").html() ? $("#analysis_children~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_infrastructure = $("#analysis_infrastructure~.test3 .benefit_val").html() ? $("#analysis_infrastructure~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_area = $("#analysis_area~.test3 .benefit_val").html() ? $("#analysis_area~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_security = $("#analysis_security~.test3 .benefit_val").html() ? $("#analysis_security~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_transport = $("#analysis_transport~.test3 .benefit_val").html() ? $("#analysis_transport~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_apartment = $("#analysis_apartment~.test3 .benefit_val").html() ? $("#analysis_apartment~.test3 .benefit_val").html() : 0;
|
|||
|
|
|
|||
|
|
param = {
|
|||
|
|
"set_data": 1,
|
|||
|
|
"block_id": btn.attr('block_id'),
|
|||
|
|
"facade": $("#facade").val()?$("#facade").val():" ",
|
|||
|
|
"storerooms": $('#storerooms').prop('checked')?1:0,
|
|||
|
|
"prams": $('#prams').prop('checked')?1:0,
|
|||
|
|
"apartments_count": $("#apartments_count").val()?$("#apartments_count").val():0,
|
|||
|
|
"living_space": $("#living_space").val()?$("#living_space").val():0,
|
|||
|
|
"planned_residents_count": $("#planned_residents_count").val()?$("#planned_residents_count").val():0,
|
|||
|
|
"furniture": $('#furniture').prop('checked')?1:0,
|
|||
|
|
"smart_house": $('#smart_house').prop('checked')?1:0,
|
|||
|
|
"glass": $("#glass").val()?$("#glass").val():" ",
|
|||
|
|
"parking_count": $("#parking_count").val()?$("#parking_count").val():0,
|
|||
|
|
"paid_parking_count": $("#paid_parking_count").val()?$("#paid_parking_count").val():0,
|
|||
|
|
"parking_cost": $("#parking_cost").val()?$("#parking_cost").val():0,
|
|||
|
|
"paid_parking_type_on": $('#paid_parking_type_on').prop('checked')?1:0,
|
|||
|
|
"paid_parking_type_under": $('#paid_parking_type_under').prop('checked')?1:0,
|
|||
|
|
"yard_traffic": $('#yard_traffic').prop('checked')?1:0,
|
|||
|
|
"yard_kindergarten": $('#yard_kindergarten').prop('checked')?1:0,
|
|||
|
|
"yard_school": $('#yard_school').prop('checked')?1:0,
|
|||
|
|
"children_objects": $('#children_objects').prop('checked')?1:0,
|
|||
|
|
"playground": $('#playground').prop('checked')?1:0,
|
|||
|
|
"trade_service": $('#trade_service').prop('checked')?1:0,
|
|||
|
|
"medical": $('#medical').prop('checked')?1:0,
|
|||
|
|
"walk_place": $('#walk_place').prop('checked')?1:0,
|
|||
|
|
"yard_close": $('#yard_close').prop('checked')?1:0,
|
|||
|
|
"security": $('#security').prop('checked')?1:0,
|
|||
|
|
"without_cars": $('#without_cars').prop('checked')?1:0,
|
|||
|
|
"video": $('#video').prop('checked')?1:0,
|
|||
|
|
"dispatcher": $('#dispatcher').prop('checked')?1:0,
|
|||
|
|
"school": $('#school').prop('checked')?1:0,
|
|||
|
|
"kindergarten": $('#kindergarten').prop('checked')?1:0,
|
|||
|
|
"clinic": $('#clinic').prop('checked')?1:0,
|
|||
|
|
"drugstore": $('#drugstore').prop('checked')?1:0,
|
|||
|
|
"supermarket": $('#supermarket').prop('checked')?1:0,
|
|||
|
|
"fitness": $('#fitness').prop('checked')?1:0,
|
|||
|
|
|
|||
|
|
"analysis_children": analysis_children*10,
|
|||
|
|
"analysis_infrastructure": analysis_infrastructure*10,
|
|||
|
|
"analysis_area": analysis_area*10,
|
|||
|
|
"analysis_security": analysis_security*10,
|
|||
|
|
"analysis_transport": analysis_transport*10,
|
|||
|
|
"analysis_apartment": analysis_apartment*10,
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockWizardData.php', param, function (data) {
|
|||
|
|
// $("#show_block_wizard_bg").hide();
|
|||
|
|
$('#block_wizard_save').after('<div class="wizard_success" style="display:none;margin-top:20px;color:#43a047;">Сохранено!</div>');
|
|||
|
|
$('.wizard_success').show(300);
|
|||
|
|
setTimeout(function() {
|
|||
|
|
$('.wizard_success').remove()
|
|||
|
|
}, 5000);
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!--no wizard-->
|
|||
|
|
<style>
|
|||
|
|
#block_nowizard_form fieldset {
|
|||
|
|
border: none;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
border-bottom: 1px solid #f2f2f2;
|
|||
|
|
padding-bottom: 5px;
|
|||
|
|
}
|
|||
|
|
#block_nowizard_form textarea {
|
|||
|
|
width: 100%;
|
|||
|
|
}
|
|||
|
|
#block_nowizard_save {
|
|||
|
|
display: block;
|
|||
|
|
color: #43a047;
|
|||
|
|
border: 1px solid #43a047;
|
|||
|
|
padding: 15px;
|
|||
|
|
margin-top: 30px;
|
|||
|
|
border-radius: 5px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 15px;
|
|||
|
|
background-color: white;
|
|||
|
|
}
|
|||
|
|
#block_nowizard_save:hover {
|
|||
|
|
background-color: #43a047;
|
|||
|
|
color: white;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script>
|
|||
|
|
$('body .show_block_nowizard_btn').on('click', function(e) {
|
|||
|
|
btn = $(this);
|
|||
|
|
block_id = btn.attr('block_id');
|
|||
|
|
param = {
|
|||
|
|
"block_id": block_id,
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockWizardData.php', param, function (data) {
|
|||
|
|
if (data) {
|
|||
|
|
let obj = JSON.parse(data);
|
|||
|
|
$('#block_nowizard_form').empty();
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Облицовка фасада</legend><textarea id="facade" name="facade">'+(obj["facade"]?obj["facade"]:"")+'</textarea></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="storerooms" id="storerooms" type="checkbox" '+(obj["storerooms"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="storerooms">Кладовые</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="prams" id="prams" type="checkbox" '+(obj["prams"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="prams">Колясочные</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Количество квартир</legend><input class="text" type="number" id="apartments_count" name="apartments_count" value="'+(obj["apartments_count"]?obj["apartments_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Жилая площадь</legend><input class="text" type="number" id="living_space" name="living_space" value="'+(obj["living_space"]?obj["living_space"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Планируемое число жителей</legend><input class="text" type="number" id="planned_residents_count" name="planned_residents_count" value="'+(obj["planned_residents_count"]?obj["planned_residents_count"]:"")+'"></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="furniture" id="furniture" type="checkbox" '+(obj["furniture"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="furniture">Квартира с мебелью</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Квартира с мебелью</legend><input type="checkbox" id="furniture" name="furniture" '+(obj["furniture"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="smart_house" id="smart_house" type="checkbox" '+(obj["smart_house"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="smart_house">Элементы системы Умный Дом</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Элементы системы Умный Дом</legend><input type="checkbox" id="smart_house" name="smart_house" '+(obj["smart_house"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Остекление Окон</legend><textarea id="glass" name="glass">'+(obj["glass"]?obj["glass"]:"")+'</textarea></fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Остекление Окон</legend><input type="text" id="glass" name="glass" value="'+(obj["glass"]?obj["glass"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Количество машиномест</legend><input class="text" type="number" id="parking_count" name="parking_count" value="'+(obj["parking_count"]?obj["parking_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>В том числе платных</legend><input class="text" type="number" id="paid_parking_count" name="paid_parking_count" value="'+(obj["paid_parking_count"]?obj["paid_parking_count"]:"")+'"></fieldset>');
|
|||
|
|
$('#block_nowizard_form').append('<fieldset><legend>Стоимость машиномест</legend><input class="text" type="number" id="parking_cost" name="parking_cost" value="'+(obj["parking_cost"]?obj["parking_cost"]:"")+'"></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<legend>Тип платной парковки</legend>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="paid_parking_type_on" id="paid_parking_type_on" type="checkbox" '+(obj["paid_parking_type_on"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="paid_parking_type_on">Наземная</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="paid_parking_type_under" id="paid_parking_type_under" type="checkbox" '+(obj["paid_parking_type_under"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="paid_parking_type_under">Подземная</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Тип платной парковки</legend><input type="checkbox" id="paid_parking_type" name="paid_parking_type" '+(obj["paid_parking_type"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_traffic" id="yard_traffic" type="checkbox" '+(obj["yard_traffic"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_traffic">Продумано движение во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Продумано движение во дворе</legend><input type="checkbox" id="yard_traffic" name="yard_traffic" '+(obj["yard_traffic"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_kindergarten" id="yard_kindergarten" type="checkbox" '+(obj["yard_kindergarten"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_kindergarten">Детский сад во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детский сад во дворе</legend><input type="checkbox" id="yard_kindergarten" name="yard_kindergarten" '+(obj["yard_kindergarten"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_school" id="yard_school" type="checkbox" '+(obj["yard_school"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_school">Школа во дворе</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Школа во дворе</legend><input type="checkbox" id="yard_school" name="yard_school" '+(obj["yard_school"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="children_objects" id="children_objects" type="checkbox" '+(obj["children_objects"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="children_objects">Другие объекты для детей</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Другие объекты для детей</legend><input type="checkbox" id="children_objects" name="children_objects" '+(obj["children_objects"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="playground" id="playground" type="checkbox" '+(obj["playground"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="playground">Детская площадка</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детская площадка</legend><input type="checkbox" id="playground" name="playground" '+(obj["playground"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="trade_service" id="trade_service" type="checkbox" '+(obj["trade_service"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="trade_service">Торговля и сервис</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Торговля и сервис</legend><input type="checkbox" id="trade_service" name="trade_service" '+(obj["trade_service"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="medical" id="medical" type="checkbox" '+(obj["medical"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="medical">Медицинские учреждения</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Медицинские учреждения</legend><input type="checkbox" id="medical" name="medical" '+(obj["medical"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="walk_place" id="walk_place" type="checkbox" '+(obj["walk_place"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="walk_place">Благоустроенное место для прогулок</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Благоустроенное место для прогулок</legend><input type="checkbox" id="walk_place" name="walk_place" '+(obj["walk_place"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="yard_close" id="yard_close" type="checkbox" '+(obj["yard_close"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="yard_close">Закрытый двор</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Закрытый двор</legend><input type="checkbox" id="yard_close" name="yard_close" '+(obj["yard_close"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="security" id="security" type="checkbox" '+(obj["security"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="security">Охрана территории</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Охрана территории</legend><input type="checkbox" id="security" name="security" '+(obj["security"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="without_cars" id="without_cars" type="checkbox" '+(obj["without_cars"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="without_cars">Двор без машин</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Двор без машин</legend><input type="checkbox" id="without_cars" name="without_cars" '+(obj["without_cars"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="video" id="video" type="checkbox" '+(obj["video"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="video">Видеонаблюдение</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Видеонаблюдение</legend><input type="checkbox" id="video" name="video" '+(obj["video"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="dispatcher" id="dispatcher" type="checkbox" '+(obj["dispatcher"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="dispatcher">Помещение для консьержа-диспетчера</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Помещение для консьержа-диспетчера</legend><input type="checkbox" id="dispatcher" name="dispatcher" '+(obj["dispatcher"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="school" id="school" type="checkbox" '+(obj["school"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="school">Школа</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Школа</legend><input type="checkbox" id="school" name="school" '+(obj["school"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="kindergarten" id="kindergarten" type="checkbox" '+(obj["kindergarten"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="kindergarten">Детский сад</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Детский сад</legend><input type="checkbox" id="kindergarten" name="kindergarten" '+(obj["kindergarten"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="clinic" id="clinic" type="checkbox" '+(obj["clinic"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="clinic">Поликлиника</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Поликлиника</legend><input type="checkbox" id="clinic" name="clinic" '+(obj["clinic"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="drugstore" id="drugstore" type="checkbox" '+(obj["drugstore"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="drugstore">Аптека</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Аптека</legend><input type="checkbox" id="drugstore" name="drugstore" '+(obj["drugstore"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="supermarket" id="supermarket" type="checkbox" '+(obj["supermarket"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="supermarket">Супермаркет</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Супермаркет</legend><input type="checkbox" id="supermarket" name="supermarket" '+(obj["supermarket"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<div class="checkbox">' +
|
|||
|
|
'<input name="fitness" id="fitness" type="checkbox" '+(obj["fitness"]==1?"checked":"")+'>' +
|
|||
|
|
'<label for="fitness">Фитнес-Центр</label>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</fieldset>');
|
|||
|
|
// $('#block_wizard_form').append('<fieldset><legend>Фитнес-Центр</legend><input type="checkbox" id="fitness" name="fitness" '+(obj["fitness"]==1?"checked":"")+'></fieldset>');
|
|||
|
|
|
|||
|
|
analysis_children = obj["analysis_children"]?obj["analysis_children"]/10:"";
|
|||
|
|
analysis_infrastructure = obj["analysis_infrastructure"]?obj["analysis_infrastructure"]/10:"";
|
|||
|
|
analysis_area = obj["analysis_area"]?obj["analysis_area"]/10:"";
|
|||
|
|
analysis_security = obj["analysis_security"]?obj["analysis_security"]/10:"";
|
|||
|
|
analysis_transport = obj["analysis_transport"]?obj["analysis_transport"]/10:"";
|
|||
|
|
analysis_apartment = obj["analysis_apartment"]?obj["analysis_apartment"]/10:"";
|
|||
|
|
|
|||
|
|
$('#block_nowizard_form').append('<fieldset>' +
|
|||
|
|
'<legend>Анализ ЖК</legend>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_children" name="analysis_children" class="text price medium-input money-format benefit_input" value="'+analysis_children+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_children" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Для детей <span class="benefit_val">'+analysis_children+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_infrastructure" name="analysis_infrastructure" class="text price medium-input money-format benefit_input" value="'+analysis_infrastructure+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_infrastructure" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Инфраструктура <span class="benefit_val">'+analysis_infrastructure+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_area" name="analysis_area" class="text price medium-input money-format benefit_input" value="'+analysis_area+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_area" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Район <span class="benefit_val">'+analysis_area+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_security" name="analysis_security" class="text price medium-input money-format benefit_input" value="'+analysis_security+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_security" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Безопасность <span class="benefit_val">'+analysis_security+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_transport" name="analysis_transport" class="text price medium-input money-format benefit_input" value="'+analysis_transport+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_transport" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Транспорт <span class="benefit_val">'+analysis_transport+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'<div class="fr-input fr-price benefit_wrap">' +
|
|||
|
|
'<input type="text" id="analysis_apartment" name="analysis_apartment" class="text price medium-input money-format benefit_input" value="'+analysis_apartment+'">' +
|
|||
|
|
'<div class="fr-ui-slider test3 analysis_apartment" id="e-form-slider">' +
|
|||
|
|
'<div class="benefit_val_wrap">Квартира/Дом <span class="benefit_val">'+analysis_apartment+'</span></div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'</div>' +
|
|||
|
|
'<div class="clear"></div>' +
|
|||
|
|
|
|||
|
|
'</fieldset>');
|
|||
|
|
|
|||
|
|
$('.analysis_children').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_children,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_infrastructure').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_infrastructure,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_area').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_area,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_security').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_security,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_transport').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_transport,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('.analysis_apartment').slider({
|
|||
|
|
orientation: "horizontal",
|
|||
|
|
range: "min",
|
|||
|
|
max: 10,
|
|||
|
|
animate: true,
|
|||
|
|
value: analysis_apartment,
|
|||
|
|
min: 1,
|
|||
|
|
step: 0.1,
|
|||
|
|
slide: function( event, ui ) {
|
|||
|
|
var maxVal = "10";
|
|||
|
|
var val = '';
|
|||
|
|
if (ui.value >= 10) {
|
|||
|
|
val = maxVal;
|
|||
|
|
} else {
|
|||
|
|
val = ui.value;
|
|||
|
|
}
|
|||
|
|
$('#stoim_ky').val(val);
|
|||
|
|
$(this).children('.benefit_val_wrap').find('.benefit_val').html(val);
|
|||
|
|
},
|
|||
|
|
change: function(event, ui) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#show_block_nowizard_bg').show();
|
|||
|
|
$('#show_block_nowizard').show();
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
<script>
|
|||
|
|
//save block wizard data
|
|||
|
|
$('#block_nowizard_save').on('click', function(e) {
|
|||
|
|
btn = $(this);
|
|||
|
|
analysis_children = $("#analysis_children~.test3 .benefit_val").html() ? $("#analysis_children~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_infrastructure = $("#analysis_infrastructure~.test3 .benefit_val").html() ? $("#analysis_infrastructure~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_area = $("#analysis_area~.test3 .benefit_val").html() ? $("#analysis_area~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_security = $("#analysis_security~.test3 .benefit_val").html() ? $("#analysis_security~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_transport = $("#analysis_transport~.test3 .benefit_val").html() ? $("#analysis_transport~.test3 .benefit_val").html() : 0;
|
|||
|
|
analysis_apartment = $("#analysis_apartment~.test3 .benefit_val").html() ? $("#analysis_apartment~.test3 .benefit_val").html() : 0;
|
|||
|
|
|
|||
|
|
param = {
|
|||
|
|
"set_data": 1,
|
|||
|
|
"block_id": btn.attr('block_id'),
|
|||
|
|
"facade": $("#facade").val()?$("#facade").val():" ",
|
|||
|
|
"storerooms": $('#storerooms').prop('checked')?1:0,
|
|||
|
|
"prams": $('#prams').prop('checked')?1:0,
|
|||
|
|
"apartments_count": $("#apartments_count").val()?$("#apartments_count").val():0,
|
|||
|
|
"living_space": $("#living_space").val()?$("#living_space").val():0,
|
|||
|
|
"planned_residents_count": $("#planned_residents_count").val()?$("#planned_residents_count").val():0,
|
|||
|
|
"furniture": $('#furniture').prop('checked')?1:0,
|
|||
|
|
"smart_house": $('#smart_house').prop('checked')?1:0,
|
|||
|
|
"glass": $("#glass").val()?$("#glass").val():" ",
|
|||
|
|
"parking_count": $("#parking_count").val()?$("#parking_count").val():0,
|
|||
|
|
"paid_parking_count": $("#paid_parking_count").val()?$("#paid_parking_count").val():0,
|
|||
|
|
"parking_cost": $("#parking_cost").val()?$("#parking_cost").val():0,
|
|||
|
|
"paid_parking_type_on": $('#paid_parking_type_on').prop('checked')?1:0,
|
|||
|
|
"paid_parking_type_under": $('#paid_parking_type_under').prop('checked')?1:0,
|
|||
|
|
"yard_traffic": $('#yard_traffic').prop('checked')?1:0,
|
|||
|
|
"yard_kindergarten": $('#yard_kindergarten').prop('checked')?1:0,
|
|||
|
|
"yard_school": $('#yard_school').prop('checked')?1:0,
|
|||
|
|
"children_objects": $('#children_objects').prop('checked')?1:0,
|
|||
|
|
"playground": $('#playground').prop('checked')?1:0,
|
|||
|
|
"trade_service": $('#trade_service').prop('checked')?1:0,
|
|||
|
|
"medical": $('#medical').prop('checked')?1:0,
|
|||
|
|
"walk_place": $('#walk_place').prop('checked')?1:0,
|
|||
|
|
"yard_close": $('#yard_close').prop('checked')?1:0,
|
|||
|
|
"security": $('#security').prop('checked')?1:0,
|
|||
|
|
"without_cars": $('#without_cars').prop('checked')?1:0,
|
|||
|
|
"video": $('#video').prop('checked')?1:0,
|
|||
|
|
"dispatcher": $('#dispatcher').prop('checked')?1:0,
|
|||
|
|
"school": $('#school').prop('checked')?1:0,
|
|||
|
|
"kindergarten": $('#kindergarten').prop('checked')?1:0,
|
|||
|
|
"clinic": $('#clinic').prop('checked')?1:0,
|
|||
|
|
"drugstore": $('#drugstore').prop('checked')?1:0,
|
|||
|
|
"supermarket": $('#supermarket').prop('checked')?1:0,
|
|||
|
|
"fitness": $('#fitness').prop('checked')?1:0,
|
|||
|
|
|
|||
|
|
"analysis_children": analysis_children*10,
|
|||
|
|
"analysis_infrastructure": analysis_infrastructure*10,
|
|||
|
|
"analysis_area": analysis_area*10,
|
|||
|
|
"analysis_security": analysis_security*10,
|
|||
|
|
"analysis_transport": analysis_transport*10,
|
|||
|
|
"analysis_apartment": analysis_apartment*10,
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockWizardData.php', param, function (data) {
|
|||
|
|
// $("#show_block_nowizard_bg").hide();
|
|||
|
|
$('#block_nowizard_save').after('<div class="wizard_success" style="display:none;margin-top:10px;color:#43a047;">Сохранено!</div>');
|
|||
|
|
$('.wizard_success').show(300);
|
|||
|
|
setTimeout(function() {
|
|||
|
|
$('.wizard_success').remove()
|
|||
|
|
}, 5000);
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!--benefits-->
|
|||
|
|
<script>
|
|||
|
|
$(document).ready(function () {
|
|||
|
|
//open modal benefit for add new
|
|||
|
|
$('.show_add_benefit_btn').on('click', function () {
|
|||
|
|
$('.block_benefit_action_btn').removeClass('active');
|
|||
|
|
$('#block_benefit_save').addClass('active');
|
|||
|
|
|
|||
|
|
$('#show_add_benefit_bg').show();
|
|||
|
|
$('#show_add_benefit').show();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#show_add_benefit_bg .closer').on('click', function(){
|
|||
|
|
$("#show_add_benefit_bg").toggle(10);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// add new benefit
|
|||
|
|
$('#block_benefit_save').on('click', function(){
|
|||
|
|
param = {
|
|||
|
|
"block_id": $(this).attr('block_id'),
|
|||
|
|
"benefit_icon": $('input[name="block_benefit_icon"]:checked').val(),
|
|||
|
|
"benefit_name": $('#block_benefit_name').val(),
|
|||
|
|
"benefit_description": $('#block_benefit_description').val()
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockBenefit.php', param, function (data) {
|
|||
|
|
$('#benefits_list').empty();
|
|||
|
|
$('#benefits_list').append(data);
|
|||
|
|
$('#show_add_benefit_bg').hide();
|
|||
|
|
$('#block_benefit_name').val('');
|
|||
|
|
$('#block_benefit_description').val('');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//select icon
|
|||
|
|
$('.block_benefit_icon_label input').on('click', function(){
|
|||
|
|
$('.block_benefit_icon_label').removeClass('active');
|
|||
|
|
$(this).parent().addClass('active');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//open modal benefit for edit
|
|||
|
|
$('#benefits_list').on('click', '.benefit_edit', function(){
|
|||
|
|
benefit_id = $(this).attr('benefit_id');
|
|||
|
|
$('.block_benefit_action_btn').removeClass('active');
|
|||
|
|
$('#block_benefit_update').addClass('active');
|
|||
|
|
$('#block_benefit_update').attr('benefit_id', benefit_id);
|
|||
|
|
|
|||
|
|
param = {
|
|||
|
|
"benefit_id": $(this).attr('benefit_id'),
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/getBlockBenefit.php', param, function (data) {
|
|||
|
|
data = JSON.parse(data);
|
|||
|
|
|
|||
|
|
$('#block_benefit_name').val(data.benefit_name);
|
|||
|
|
$('#block_benefit_description').val(data.benefit_description);
|
|||
|
|
|
|||
|
|
$('.block_benefit_icon_label').removeClass('active');
|
|||
|
|
cur_icon = $('.block_benefit_icon_label[icon="'+data.benefit_icon+'"]');
|
|||
|
|
cur_icon.addClass('active');
|
|||
|
|
cur_icon.children('input').attr('checked', true);
|
|||
|
|
|
|||
|
|
$('#show_add_benefit_bg').show();
|
|||
|
|
$('#show_add_benefit').show();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//update benefit
|
|||
|
|
$('#block_benefit_update').on('click', function(){
|
|||
|
|
param = {
|
|||
|
|
"block_id": $(this).attr('block_id'),
|
|||
|
|
"benefit_id": $(this).attr('benefit_id'),
|
|||
|
|
"benefit_icon": $('input[name="block_benefit_icon"]:checked').val(),
|
|||
|
|
"benefit_name": $('#block_benefit_name').val(),
|
|||
|
|
"benefit_description": $('#block_benefit_description').val()
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/updateBlockBenefit.php', param, function (data) {
|
|||
|
|
$('#benefits_list').empty();
|
|||
|
|
$('#benefits_list').append(data);
|
|||
|
|
$('#show_add_benefit_bg').hide();
|
|||
|
|
$('#block_benefit_name').val('');
|
|||
|
|
$('#block_benefit_description').val('');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//delete benefit
|
|||
|
|
$('#benefits_list').on('click', '.benefit_del', function(){
|
|||
|
|
param = {
|
|||
|
|
"block_id": $(this).attr('block_id'),
|
|||
|
|
"benefit_id": $(this).attr('benefit_id')
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/deleteBlockBenefit.php', param, function (data) {
|
|||
|
|
$('#benefits_list').empty();
|
|||
|
|
$('#benefits_list').append(data);
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!-- Ожидание-реальность -->
|
|||
|
|
<script src="../js/datepicker.min.js"></script>
|
|||
|
|
<script>
|
|||
|
|
var startDate;
|
|||
|
|
var changed = false;
|
|||
|
|
dp = $('#month_date').datepicker({
|
|||
|
|
autoClose: 'true',
|
|||
|
|
format: 'dd-m-yyyy',
|
|||
|
|
selectMonths: true,
|
|||
|
|
|
|||
|
|
onSelect: function(dateText) {
|
|||
|
|
mon = dateText.substr(3, 2);
|
|||
|
|
year = dateText.substr(6, 4);
|
|||
|
|
mon_date = mon+'-'+year ;
|
|||
|
|
$('#mdate').val(mon_date);
|
|||
|
|
// console.log(dateText);
|
|||
|
|
// console.log($('#mdate').val());
|
|||
|
|
// param = {
|
|||
|
|
// 'id': 1
|
|||
|
|
// };
|
|||
|
|
// $.post('/admin/ajax/addBlockRealImageDate.php', param, function (data) {
|
|||
|
|
//
|
|||
|
|
// });
|
|||
|
|
}
|
|||
|
|
}).data('datepicker');
|
|||
|
|
dp.selectDate(new Date());
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!--Reviews data table-->
|
|||
|
|
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
|
|||
|
|
<script>
|
|||
|
|
$(document).ready(function () {
|
|||
|
|
rtable = $('#reviews_table_id').DataTable({
|
|||
|
|
"oLanguage": {
|
|||
|
|
"sLengthMenu": "Отобразить _MENU_ записей на странице",
|
|||
|
|
"sZeroRecords": "Ничего не найдено",
|
|||
|
|
"sInfo": "Показано с _START_ по _END_ из _TOTAL_ записей",
|
|||
|
|
"sInfoEmpty": "Показано с 0 по 0 из 0 записей",
|
|||
|
|
"sInfoFiltered": "(Отфильтровано из _MAX_ записей)",
|
|||
|
|
"sSearch": "Найти",
|
|||
|
|
"oPaginate": {
|
|||
|
|
"sFirst": "Первая",
|
|||
|
|
"sLast": "Последняя",
|
|||
|
|
"sNext": "Следующая",
|
|||
|
|
"sPrevious": "Предыдущая"
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
plus = $('#plus_table_id').DataTable({
|
|||
|
|
"oLanguage": {
|
|||
|
|
"sLengthMenu": "Отобразить _MENU_ записей на странице",
|
|||
|
|
"sZeroRecords": "Ничего не найдено",
|
|||
|
|
"sInfo": "Показано с _START_ по _END_ из _TOTAL_ записей",
|
|||
|
|
"sInfoEmpty": "Показано с 0 по 0 из 0 записей",
|
|||
|
|
"sInfoFiltered": "(Отфильтровано из _MAX_ записей)",
|
|||
|
|
"sSearch": "Найти",
|
|||
|
|
"oPaginate": {
|
|||
|
|
"sFirst": "Первая",
|
|||
|
|
"sLast": "Последняя",
|
|||
|
|
"sNext": "Следующая",
|
|||
|
|
"sPrevious": "Предыдущая"
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
minus = $('#minus_table_id').DataTable({
|
|||
|
|
"oLanguage": {
|
|||
|
|
"sLengthMenu": "Отобразить _MENU_ записей на странице",
|
|||
|
|
"sZeroRecords": "Ничего не найдено",
|
|||
|
|
"sInfo": "Показано с _START_ по _END_ из _TOTAL_ записей",
|
|||
|
|
"sInfoEmpty": "Показано с 0 по 0 из 0 записей",
|
|||
|
|
"sInfoFiltered": "(Отфильтровано из _MAX_ записей)",
|
|||
|
|
"sSearch": "Найти",
|
|||
|
|
"oPaginate": {
|
|||
|
|
"sFirst": "Первая",
|
|||
|
|
"sLast": "Последняя",
|
|||
|
|
"sNext": "Следующая",
|
|||
|
|
"sPrevious": "Предыдущая"
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('.show_add_review_btn').on('click', function () {
|
|||
|
|
$('#show_add_review_bg').show();
|
|||
|
|
$('#show_add_review').show();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#show_add_review_bg .closer').on('click', function(){
|
|||
|
|
$("#show_add_review_bg").toggle(10);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('.show_add_plus_minus_btn').on('click', function () {
|
|||
|
|
var plus = $(this).data("plus");
|
|||
|
|
$('#block_plus_minus_plusminus option[value=' + plus + ']').prop('selected', true);
|
|||
|
|
$('#show_add_plus_minus_bg').show();
|
|||
|
|
$('#show_add_plus_minus').show();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#show_add_plus_minus_bg .closer').on('click', function(){
|
|||
|
|
$("#show_add_plus_minus_bg").toggle(10);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#block_review_save').on('click', function(){
|
|||
|
|
block_id = $(this).attr('block_id');
|
|||
|
|
review = $('#block_review_text').val();
|
|||
|
|
name = $('#block_review_name').val();
|
|||
|
|
param = {
|
|||
|
|
"block_id": block_id,
|
|||
|
|
"review": review,
|
|||
|
|
"name": name,
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/addBlockReview.php', param, function (data) {
|
|||
|
|
data = JSON.parse(data);
|
|||
|
|
id = data.id;
|
|||
|
|
review = data.review;
|
|||
|
|
name = data.name;
|
|||
|
|
date = data.date;
|
|||
|
|
del_btn = "<span id='"+id+"' class='review_del_btn'>Удалить</span>";
|
|||
|
|
|
|||
|
|
rtable.row.add([
|
|||
|
|
id,
|
|||
|
|
name,
|
|||
|
|
review,
|
|||
|
|
date,
|
|||
|
|
del_btn
|
|||
|
|
]).draw();
|
|||
|
|
|
|||
|
|
$('#show_add_review_bg').hide();
|
|||
|
|
$('#block_review_text').val('');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#block_plus_minus_save').on('click',function(){
|
|||
|
|
var block_id = $(this).attr('block_id');
|
|||
|
|
var text = $('#block_plus_minus_text').val();
|
|||
|
|
var plus_minus = $('#block_plus_minus_plusminus').val();
|
|||
|
|
|
|||
|
|
param = {
|
|||
|
|
"block_id": block_id,
|
|||
|
|
"text": text,
|
|||
|
|
"plus_minus": plus_minus,
|
|||
|
|
};
|
|||
|
|
//console.log(param);
|
|||
|
|
$.post('/admin/ajax/addBlockPlusMinus.php', param, function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
data = JSON.parse(data);
|
|||
|
|
id = data.id;
|
|||
|
|
text = data.text;
|
|||
|
|
|
|||
|
|
date = data.date_create;
|
|||
|
|
del_btn = "<span id='"+id+"' class='plus_minus_del_btn'>Удалить</span>";
|
|||
|
|
if(plus_minus == 1){
|
|||
|
|
plus.row.add([
|
|||
|
|
id,
|
|||
|
|
text,
|
|||
|
|
date,
|
|||
|
|
del_btn
|
|||
|
|
]).draw();
|
|||
|
|
} else {
|
|||
|
|
minus.row.add([
|
|||
|
|
id,
|
|||
|
|
text,
|
|||
|
|
date,
|
|||
|
|
del_btn
|
|||
|
|
]).draw();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$('#show_add_plus_minus_bg').hide();
|
|||
|
|
$('#block_plus_minus_text').val('');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('.review_del_btn').click(function(){
|
|||
|
|
review_id = $(this).attr('id');
|
|||
|
|
param = {
|
|||
|
|
"review_id": review_id
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/deleteBlockReview.php', param, function (data) { });
|
|||
|
|
rtable.row( $(this).parents('tr') ).remove().draw();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('body').on('click', '.plus_minus_del_btn',function(){
|
|||
|
|
var plus_minus_id = $(this).attr('id');
|
|||
|
|
param = {
|
|||
|
|
"plus_minus_id": plus_minus_id
|
|||
|
|
};
|
|||
|
|
$.post('/admin/ajax/deleteBlockPlusMinus.php', param, function (data) { });
|
|||
|
|
if($(this).closest('#plus_table_id').length > 0){
|
|||
|
|
plus.row( $(this).parents('tr') ).remove().draw();
|
|||
|
|
}
|
|||
|
|
if($(this).closest('#minus_table_id').length > 0){
|
|||
|
|
minus.row( $(this).parents('tr') ).remove().draw();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|