Joywork/templates/newbuildings_object.php

216 lines
12 KiB
PHP
Raw Permalink Normal View History

2026-05-22 20:21:54 +02:00
<div class="jw__object item" id="">
<?php
$images = Block::getAllImagesUrl($obj['id']);
if ($images || $obj['image']) {
?>
<div class="object-images" id="">
<div class="fotorama" data-height="328px" data-width="100%" data-allowfullscreen="native" data-fit="cover" data-nav="false">
<!--
<?php // if ($obj['image']) { ?>
<img src="<?php // echo $obj['image']; ?>">
-->
<?php // } https://img.dmclk.ru/vitrina/94/77/94774e2376a9f9278fc3794f0ad90f61de7a1635.jpg
// https://img.dmclk.ru/s1200x800q80/vitrina/owner/60/fa/60fa3ff3cb5c46ceafc17a807d09af0d.jpg
if ($images) {
foreach ($images as $image) {
$smallUrl = str_replace('https://img.dmclk.ru/', 'https://img.dmclk.ru/s600x400q100/' ,$image);
// die($fullUrl);
?>
<img src="<?= $smallUrl ?>" data-full="<?= $image ?>" >
<?php }
}
?>
</div>
</div>
<?php } ?>
<div class="object-content">
<!--
<div class="object-content__top">
<div class="top-info">
<span>Квартир: <?php echo $obj['apartments_count']; ?></span>
</div>
<div class="clear"></div>
</div>
-->
<div class="object-content__name">
<div class="name"><h2><a href="/blockApartments.php?hide_form=1&blockId=<?php echo $obj['id'];
if (isset($get['type']) && $get['type']) {
foreach($get['type'] as $type) {
echo "&obj_type[]=" . $type;
}
}
if (isset($get['decoration']) && count($get['decoration']) == 1) { echo "&dec_type=" . $get['decoration'][0]; }
if (isset($get['sq_all_ot']) && $get['sq_all_ot']) { echo "&sq_all_ot=" . $get['sq_all_ot']; }
if (isset($get['sq_all_do']) && $get['sq_all_do']) { echo "&sq_all_do=" . $get['sq_all_do']; }
if (isset($get['flat_floor_ot']) && $get['flat_floor_ot']) { echo "&flat_floor_ot=" . $get['flat_floor_ot']; }
if (isset($get['flat_floor_do']) && $get['flat_floor_do']) { echo "&flat_floor_do=" . $get['flat_floor_do']; }
if (isset($get['stoim_do']) && $get['stoim_do']) { echo "&stoim_do=" . $get['stoim_do']; }
if (isset($get['stoim_ot']) && $get['stoim_ot']) { echo "&stoim_ot=" . $get['stoim_ot']; }
if (isset($get['period']) && $get['period'] > 0) { echo "&period=" . $get['period']; } ?>&hide_form=1">&laquo;<?php echo $obj['name']; ?>&raquo;</a></h2></div>
<div class="builder">
<?php if (isset($obj['builder_logo']) && $obj['builder_logo']) {?>
<img src="<?php echo stripos($obj['builder_logo'], 'http') == false ? $obj['builder_logo'] : "/photos/builder/" . $obj['builder_logo']; ?>">
<?php } ?>
<span><?php echo $obj['builder_name']; ?></span>
</div>
<div class="clear"></div>
<div class="preloader"></div>
</div>
<div class="object-content__info-row">
<table>
<tbody>
<tr>
<td class="place">
<div class="inner">
<div style="overflow: auto;">
<?php
$subways = BlockSubway::createStringsForBlock($obj['id']);
if ($subways && count($subways)) {
foreach ($subways as $subway) {
?>
<div class="subway">
<span class="subway__logo"><img src="/images/metro4.png" height="13" width="17"></span>
<span><?php echo $subway; ?></span>
</div>
<?php
}
}
?>
</div>
<div>
<div class="district">
<span><?php echo "{$obj['parent_region_name']} ({$obj['region_name']})"; ?></span>
</div>
<div class="address">
<span><?php echo $obj['address']; ?></span>
</div>
<div class="on-map-btn"
data-id="<?=$obj['id']?>"
data-longitude="<?= $obj['longitude'] ?> "
data-latitude="<?= $obj['latitude'] ?> "
data-name="<?= htmlspecialchars($obj['name'], ENT_QUOTES, 'UTF-8') ?>
">
<img src="/images/pointer-map.svg" alt="" class="on-map-icon">
На карте
</div>
<div id="newBmapModal" class="nbld_map_modal" style="display: none;">
<div class="nbld_map_modal-content">
<div class="ti-close new-map-modal" id="nwbd-closer"></div>
<div id="nbld_map_modal_map-container">
<div class="NB__map">
<div id="map_canvas" style="width: 100%; height: 350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
<td class="info">
<div class="inner">
<?php if (isset($obj['type']) && $obj['type']) { ?>
<div class="rules">
<span><?php echo Block::$types[$obj['type']]; ?></span>
</div>
<?php } ?>
<?php
$decorationTypes = DecorationType::getNamesForBlock($obj['id']);
if ($decorationTypes && count($decorationTypes)) {
?>
<div class="decoration">
<span><?php echo implode(", ", $decorationTypes); ?></span>
</div>
<?php
}
$payments = Block::getAllPayments($obj['id']);
if ($payments && count($payments)) {
?>
<div class="payment">
<span><?php echo implode(", ", $payments); ?></span>
</div>
<?php
}
?>
<button class="action-button actionJW show_chart" chart_id="<?php echo $obj['id']?>">Статистика ЖК</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="object-content__price">
<div class="inner">
<div class="main-price">
<a href="/blockApartments.php?hide_form=1&blockId=<?php echo $obj['id'];
if (isset($get['type']) && $get['type']) {
foreach($get['type'] as $type) {
echo "&obj_type[]=" . $type;
}
}
if (isset($get['decoration']) && count($get['decoration']) == 1) { echo "&dec_type=" . $get['decoration'][0]; }
if (isset($get['sq_all_ot']) && $get['sq_all_ot']) { echo "&sq_all_ot=" . $get['sq_all_ot']; }
if (isset($get['sq_all_do']) && $get['sq_all_do']) { echo "&sq_all_do=" . $get['sq_all_do']; }
if (isset($get['flat_floor_ot']) && $get['flat_floor_ot']) { echo "&flat_floor_ot=" . $get['flat_floor_ot']; }
if (isset($get['flat_floor_do']) && $get['flat_floor_do']) { echo "&flat_floor_do=" . $get['flat_floor_do']; }
if (isset($get['stoim_do']) && $get['stoim_do']) { echo "&stoim_do=" . $get['stoim_do']; }
if (isset($get['stoim_ot']) && $get['stoim_ot']) { echo "&stoim_ot=" . $get['stoim_ot']; }
if (isset($get['period']) && $get['period'] > 0) { echo "&period=" . $get['period']; } ?>">
<button class="action-button actionJW"><?php echo $obj['apartments_count'] . " " . padezh3($obj['apartments_count'], 'квартир'); ?></button>
</a>
</div>
<div class="flat-variant">
<?php
$jsondata = json_encode($obj);
echo("<script>console.log($jsondata)</script>");
$roomTypes = Block::getRoomTypesWithPrices($obj['id'], $get['period'], $str_usl_bd);
if ($roomTypes && count($roomTypes)) {
foreach ($roomTypes as $id => $namePrice) {
if (isset($get['type'])) {
$found = false;
foreach($get['type'] as $type) {
if ($type == $id) {
$found = true;
}
}
if (!$found) {
continue;
}
}
if (isset($get['period']) && $get['period'] && $get['period'] > 0) {
if ($get['period'] < strtotime($namePrice['deadline'])) {
continue;
}
}
?>
<div class="studio">
<span><?php echo $namePrice['name']; ?></span>&nbsp;<a href="/blockApartments.php?hide_form=1&blockId=<?php echo $obj['id']; ?>&obj_type[]=<?php echo $id;
if (isset($get['decoration']) && count($get['decoration']) == 1) { echo "&dec_type=" . $get['decoration'][0]; }
if (isset($get['sq_all_ot']) && $get['sq_all_ot']) { echo "&sq_all_ot=" . $get['sq_all_ot']; }
if (isset($get['sq_all_do']) && $get['sq_all_do']) { echo "&sq_all_do=" . $get['sq_all_do']; }
if (isset($get['flat_floor_ot']) && $get['flat_floor_ot']) { echo "&flat_floor_ot=" . $get['flat_floor_ot']; }
if (isset($get['flat_floor_do']) && $get['flat_floor_do']) { echo "&flat_floor_do=" . $get['flat_floor_do']; }
if (isset($get['stoim_do']) && $get['stoim_do']) { echo "&stoim_do=" . $get['stoim_do']; }
if (isset($get['stoim_ot']) && $get['stoim_ot']) { echo "&stoim_ot=" . $get['stoim_ot']; }
if (isset($get['period']) && $get['period'] > 0) { echo "&period=" . $get['period']; } ?>">от <?php echo number_format($namePrice['price'], 0, ',', ' ')?><span
class="rub">p</span></a>
</div>
<?php
}
}
?>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>