232 lines
15 KiB
PHP
232 lines
15 KiB
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
$sqlPhotoInfoCon = "SELECT oop.sort_order, p.photo FROM objects_object_photo oop, object_photo p WHERE p.id = oop.object_photo_id AND oop.object_id = $concurrentObject[id] ORDER BY oop.sort_order";
|
|||
|
|
$rezPhotoInfoCon = mysql_query($sqlPhotoInfoCon);
|
|||
|
|
|
|||
|
|
if (mysql_num_rows($rezPhotoInfoCon) > 0) {
|
|||
|
|
while ($photoInfoCon = mysql_fetch_assoc($rezPhotoInfoCon)) {
|
|||
|
|
$concurrentObject['photo' . $photoInfoCon['sort_order']] = $photoInfoCon['photo'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<li>
|
|||
|
|
<div class="object-card">
|
|||
|
|
<div class="swiper-container object-card-slider">
|
|||
|
|
<div class="swiper-wrapper">
|
|||
|
|
<?php
|
|||
|
|
$hasImage = false;
|
|||
|
|
for ($num = 1; $num <= 40; $num++) {
|
|||
|
|
if ($concurrentObject['photo' . $num]) {
|
|||
|
|
$hasImage = true;
|
|||
|
|
if (stripos($concurrentObject['photo' . $num], "http") === false && stripos($concurrentObject['photo' . $num], "https://") === false) {
|
|||
|
|
$concurrentObject['photo' . $num] = "/photos/" . $concurrentObject['photo' . $num];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
echo '<div class="swiper-slide"><a href="' . $concurrentObject['photo' . $num] . '" target="_blank"><img src="' . $concurrentObject['photo' . $num] . '" alt="фото объекта" width="220" height="200"></a></div>';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (!$hasImage) {
|
|||
|
|
getNoImage();
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div class="swiper-button-prev object-card-slider-button-prev"> </div>
|
|||
|
|
<div class="swiper-button-next object-card-slider-button-next"> </div>
|
|||
|
|
</div>
|
|||
|
|
<div class="object-card__container">
|
|||
|
|
<div class="object-card__header">
|
|||
|
|
<div class="object-card__header-top"><table style="width: 100%;"><tr><td style="width: 60%;"><span class="cmn__text cmn__text--small cmn__gray"><?php
|
|||
|
|
$date_add_temp = explode(" ", date("d.m.Y H:i",strtotime($concurrentObject['date_add'])));
|
|||
|
|
if(isset($concurrentObject['date'])) $date_add_temp = explode(" ", date("d.m.Y H:i",strtotime($concurrentObject['date'])));
|
|||
|
|
list($dateAdd, $timeAdd) = $date_add_temp;
|
|||
|
|
list($d, $m, $y) = explode(".", $dateAdd);
|
|||
|
|
|
|||
|
|
$date_add = $d." ".getRusMonth($m)." ".$y;
|
|||
|
|
$date = $date_add." ".$timeAdd;
|
|||
|
|
echo $date;
|
|||
|
|
?></span><span class="cmn__text cmn__text--small cmn__gray"><?php
|
|||
|
|
if ($concurrentObject['operation_type'] == 0) {
|
|||
|
|
echo "Сдается" . $SROK_ARENDY["$concurrentObject[srok]"];
|
|||
|
|
if ($concurrentObject['prim_srok']) echo " (".$concurrentObject['prim_srok'].")";
|
|||
|
|
} else {
|
|||
|
|
if ($concurrentObject['operation_type'] == 1) {
|
|||
|
|
echo "Продается";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?></span><span class="cmn__text cmn__text--small cmn__gray">ID <?php echo $concurrentObject['id']; ?></span></td><td style="width: 40%;text-align: right;">
|
|||
|
|
<?php
|
|||
|
|
if (isset($cabinetEdit) && $cabinetEdit) {
|
|||
|
|
echo '<a href="#" onclick="deleteConcurrentObject(this);" data-id="' . $concurrentObject['id'] . '" class="cmn__text cmn__text--small cmn__gray">Убрать объект из списка</a>';
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</td></tr></table></div>
|
|||
|
|
<h3 class="cmn__text cmn__main cmn__f-semi"><?php echo Filter::name($concurrentObject['nazv']); ?></h3>
|
|||
|
|
</div>
|
|||
|
|
<div class="object-card__content">
|
|||
|
|
<div class="object-card__content-field"><span class="cmn__text cmn__text--small cmn__gray"><?php if ($concurrentObject['rayon']) {
|
|||
|
|
echo str_replace([' район', 'район', ' р-н', 'р-н'], '', $concurrentObject['rayon']) . ' район';
|
|||
|
|
}?></span><span class="cmn__text cmn__text--small cmn__main"><?php
|
|||
|
|
$sqlLocationInfo = "SELECT * FROM object_location WHERE object_id=".$concurrentObject['id'];
|
|||
|
|
$rezLocationInfo = mysql_query($sqlLocationInfo);
|
|||
|
|
|
|||
|
|
if (mysql_num_rows($rezLocationInfo) > 0) {
|
|||
|
|
$objLocationInfo = mysql_fetch_assoc($rezLocationInfo);
|
|||
|
|
echo $objLocationInfo['address'];
|
|||
|
|
} else {
|
|||
|
|
$sql = "SELECT * FROM rayon WHERE id in (select rayon from objects where id = $concurrentObject[id])";
|
|||
|
|
$result = mysql_query($sql);
|
|||
|
|
if ($result) {
|
|||
|
|
$rayon = mysql_fetch_assoc($result);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($concurrentObject['id_rf_region'] == 50) {
|
|||
|
|
if(is_bool(strpos($concurrentObject['adres'], "Ленинградская область"))){
|
|||
|
|
echo "Ленинградская область,";
|
|||
|
|
}
|
|||
|
|
}else if($concurrentObject['id_rf_region'] == 81){
|
|||
|
|
echo "Санкт Петербург,";
|
|||
|
|
} else if($concurrentObject['id_rf_region'] == 77) {
|
|||
|
|
$sqlRegion = "SELECT parent.name as parent,rf_regions.name FROM rf_regions as parent
|
|||
|
|
LEFT JOIN rf_regions on rf_regions.parent = parent.id
|
|||
|
|
LEFT JOIN rf_region_rayons ON rf_region_rayons.rf_region_id = rf_regions.id
|
|||
|
|
WHERE rayon_id in (select rayon from objects where id = $concurrentObject[id])";
|
|||
|
|
$rezRegion = mysql_query($sqlRegion);
|
|||
|
|
if($rezRegion){
|
|||
|
|
$region = mysql_fetch_assoc($rezRegion);
|
|||
|
|
echo $region['parent'].','.$region['name'].' округ,';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
if($concurrentObject['rayon'] && $concurrentObject['id_rf_region'] == 81){
|
|||
|
|
if (strpos($concurrentObject['rayon'], "район") or strpos($obj['adres'], "район") or strpos($concurrentObject['adres'], "р-н")) {
|
|||
|
|
echo $concurrentObject['rayon'].',';
|
|||
|
|
} else {
|
|||
|
|
echo $concurrentObject['rayon'] . " район,";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
echo str_replace('г. Санкт-Петербург, ', '', $obj['adres']);
|
|||
|
|
if ($concurrentObject['dom']) {
|
|||
|
|
echo ", " . $concurrentObject['dom'];
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['korpus']) {
|
|||
|
|
echo ", корпус " . $concurrentObject['korpus'];
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['litera']) {
|
|||
|
|
echo ", литера " . $concurrentObject['litera'];
|
|||
|
|
}
|
|||
|
|
} ?></span><?php if ($concurrentObject['ads_url']) {?><span class="cmn__text cmn__text--small cmn__gray">Ссылка на источник:<a class="cmn__text cmn__text--small cmn__main cmn__underline object-card__content-ref" href="<?php echo $concurrentObject['ads_url'] ;?>"><?php
|
|||
|
|
if ($concurrentObject['ads_source'] == 3) {
|
|||
|
|
echo "Яндекс";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 1) {
|
|||
|
|
echo "Авито";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 4) {
|
|||
|
|
echo "Циан";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 6) {
|
|||
|
|
echo "Юла";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 2) {
|
|||
|
|
echo "Из рук в руки";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 5) {
|
|||
|
|
echo "SOB.RU";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 7) {
|
|||
|
|
echo "N1.RU";
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['ads_source'] == 10) {
|
|||
|
|
echo "Моя реклама";
|
|||
|
|
}
|
|||
|
|
?></a></span><?php } ?></div>
|
|||
|
|
<div class="object-card__content-field">
|
|||
|
|
<?php
|
|||
|
|
if ($concurrentObject['type'] == 7) {
|
|||
|
|
if ($concurrentObject['land_area'] * 1 != 0) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $concurrentObject['land_area'] * 1 . ' cоток</span>';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['land_usage_name']) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $concurrentObject['land_usage_name'] . '</span>';
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if ($concurrentObject['type'] == 3 || $concurrentObject['type'] == 5) {
|
|||
|
|
if ($concurrentObject['ploshad'] * 1 != 0) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $concurrentObject['ploshad'] * 1 . ' кв. м</span>';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['land_area']) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">Участка: ' . $concurrentObject['land_area'] * 1 . ' cоток</span>';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['house_category']) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">Вид объекта: ';
|
|||
|
|
if ($concurrentObject['house_category'] == 1) {
|
|||
|
|
echo 'Дача';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['house_category'] == 2) {
|
|||
|
|
echo 'Коттедж';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['house_category'] == 3) {
|
|||
|
|
echo 'Таунхаус';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['house_category'] == 4) {
|
|||
|
|
echo 'Дом';
|
|||
|
|
}
|
|||
|
|
echo '</span>';
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if ($concurrentObject['ploshad'] * 1 != 0) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $concurrentObject['ploshad'] * 1 . ' кв. м</span>';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($concurrentObject['ploshad_komn']) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__gray">Жилая: ' . $concurrentObject['ploshad_komn'] . ' кв. м</span>';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($concurrentObject['ploshad_k'] * 1 != 0) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">Кухни: ' . $concurrentObject['ploshad_k'] * 1 . ' кв. м</span>';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($concurrentObject['land_usage_name']) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $concurrentObject['land_usage_name'] . '</span>';
|
|||
|
|
}
|
|||
|
|
if ($concurrentObject['type_category'] == 6) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">Всего этажей: ';
|
|||
|
|
if ($concurrentObject['etazh_iz'] * 1 != 0) {
|
|||
|
|
echo " " . $concurrentObject['etazh_iz'];
|
|||
|
|
}
|
|||
|
|
echo '</span></div>';
|
|||
|
|
} else {
|
|||
|
|
if ($concurrentObject['etazh'] * 1 != 0) {
|
|||
|
|
if ($concurrentObject['type'] == 3) {
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">';
|
|||
|
|
if ($concurrentObject['etazh_iz'] * 1 != 0) {
|
|||
|
|
echo $concurrentObject['etazh_iz'] . " этажей";
|
|||
|
|
}
|
|||
|
|
echo '</span>';
|
|||
|
|
} else {
|
|||
|
|
$etaz = $concurrentObject['etazh'] . ' этаж';
|
|||
|
|
if ((int)$concurrentObject['etazh'] == 1 && !empty($concurrentObject['etaz_first_type'])) {
|
|||
|
|
$etaz = $etaz_first_types[$concurrentObject['etaz_first_type']];
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
echo '<span class="cmn__text cmn__text--small cmn__main">' . $etaz;
|
|||
|
|
if ($concurrentObject['etazh_iz'] * 1 != 0) {
|
|||
|
|
echo " из " . $concurrentObject['etazh_iz'];
|
|||
|
|
}
|
|||
|
|
echo '</span>';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="object-card__footer"><span class="cmn__text cmn__text--med"><?php echo number_format($concurrentObject['stoim'], 0, ',', ' '); ?> р.</span>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</li>
|