Joywork/templates/system_object_can.php
2026-05-22 21:21:54 +03:00

1437 lines
97 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="jw__object item item-can marketplace compact" <?=(isset($_POST['find_object'])) ? ' data-user="'.$obj['id_add_user'].'"' : ''; ?> id="item<?php echo $obj['id'];?>">
<div class="object-images" id="photos<?php echo $obj['id'];?>">
<?php
$showAds = User::isCurrentUserShowAdvertButton();
if($obj['id_add_user']) {
echo '<div class="arrow_box">Агент</div>';
} else {
echo '<div class="arrow_box">Собственник</div>';
}
//Доп обработка
if(!$obj['etazh']) {
$obj['etazh'] = Filter::getFloorFromName($obj['nazv'],true);
} else {
Filter::getFloorFromName($obj['nazv'],true);
}
if(!$obj['etazh_iz']) {
$obj['etazh_iz']=Filter::getMaxFloorFromName($obj['nazv'],true);
} else {
Filter::getMaxFloorFromName($obj['nazv'],true);
}
Filter::getSpaceFromName($obj['nazv'],true);
$obj['nazv']=Filter::name($obj['nazv']);
$obj['sobstv'] = Filter::replaceSobstv($obj['sobstv']);
$obj['opis'] = cleanHtml($obj['opis']);
$photo = "";
for($num=1;$num<=20;$num++) {
if($obj['photo'.$num]) {
$photo = $obj['photo'.$num];
break;
}
}
if(empty($photo)) {
?>
<div class="no-image">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="130px" height="130px" viewBox="0 0 217.267 217.267" style="enable-background:new 0 0 217.267 217.267;" xml:space="preserve">
<g>
<path d="M163.627,138.057c1.94,0,3.505-1.564,3.505-3.505V83.749c0-1.937-1.564-3.504-3.505-3.504 c-1.937,0-3.504,1.567-3.504,3.504v50.803C160.123,136.493,161.69,138.057,163.627,138.057z" fill="#506979"/>
<path d="M108.633,0C48.73,0,0,48.732,0,108.633c0,29.931,12.167,57.071,31.816,76.738c0.014,0.014,0.017,0.034,0.031,0.048 s0.032,0.018,0.046,0.031c19.666,19.646,46.807,31.815,76.74,31.815c59.901,0,108.634-48.731,108.634-108.633S168.531,0,108.633,0 z M108.633,7.009c26.758,0,51.12,10.416,69.285,27.379l-26.936,26.938H52.564c-9.661,0-17.521,7.861-17.521,17.521v59.573 c0,9.661,7.861,17.521,17.521,17.521h3.805l-21.979,21.978C17.42,159.753,7.009,135.394,7.009,108.633 C7.009,52.599,52.595,7.009,108.633,7.009z M86.196,108.63c0-12.363,10.056-22.42,22.417-22.42c4.921,0,9.466,1.615,13.172,4.313 l-1.875,1.875c-3.207-2.24-7.094-3.564-11.297-3.564c-10.913,0-19.789,8.879-19.789,19.792c0,4.195,1.321,8.09,3.559,11.3 l-1.874,1.868C87.811,118.095,86.196,113.554,86.196,108.63z M131.034,108.63c0,12.364-10.054,22.418-22.418,22.418 c-4.915,0-9.449-1.608-13.145-4.298l1.874-1.876c3.203,2.231,7.082,3.546,11.274,3.546c10.91,0,19.794-8.877,19.794-19.791 c0-4.187-1.321-8.071-3.549-11.272l1.875-1.875C129.433,99.181,131.034,103.717,131.034,108.63z M95.833,108.63 c0-7.051,5.735-12.784,12.78-12.784c2.257,0,4.347,0.639,6.184,1.668l-17.304,17.306C96.469,112.972,95.833,110.885,95.833,108.63 z M121.397,108.63c0,7.049-5.735,12.782-12.781,12.782c-2.244,0-4.322-0.633-6.158-1.652l17.29-17.289 C120.769,104.31,121.397,106.383,121.397,108.63z M90.467,131.753c5.005,3.936,11.298,6.311,18.146,6.311 c16.229,0,29.431-13.206,29.431-29.431c0-6.848-2.375-13.141-6.311-18.149l22.148-22.146h10.814 c5.797,0,10.513,4.717,10.513,10.513v59.573c0,5.797-4.716,10.513-10.513,10.513H73.289L90.467,131.753z M126.784,85.523 c-5.007-3.948-11.311-6.326-18.168-6.326c-16.23,0-29.426,13.204-29.426,29.429c0,6.858,2.375,13.158,6.321,18.172l-22.136,22.135 H52.561c-5.797,0-10.513-4.716-10.513-10.514V78.847c0-5.795,4.716-10.513,10.513-10.513h91.413L126.784,85.523z M108.633,210.257 c-26.759,0-51.12-10.417-69.287-27.377l26.934-26.939h98.422c9.66,0,17.521-7.86,17.521-17.521V78.847 c0-9.661-7.861-17.521-17.521-17.521h-3.806l21.977-21.979c16.968,18.17,27.381,42.529,27.381,69.287 C210.258,164.667,164.667,210.257,108.633,210.257z" fill="#506979"/>
<path d="M53.002,54.317h23.654c1.937,0,3.504-1.567,3.504-3.504s-1.567-3.504-3.504-3.504H53.002 c-1.938,0-3.504,1.567-3.504,3.504S51.064,54.317,53.002,54.317z" fill="#506979"/>
</g>
</svg>
</div>
<?php
} else {
?>
<div class="fotorama" data-fit="cover" data-nav="false" data-allowfullscreen="true" data-width="100%" data-height="343px">
<?php
for($num=1;$num<=50;$num++)
if(isset($obj['photo'.$num]) && $obj['photo'.$num]) {
if(stripos($obj['photo'.$num],"http://") === false && stripos($obj['photo'.$num],"https://") === false ) {
$obj['photo'.$num] = "/photos/".$obj['photo'.$num];
}
if($obj['photo'.$num]) {
echo '<img src="'.$obj['photo'.$num].'">';
}
}
?>
</div>
<?php
}
?>
</div>
<div class="object-content">
<div class="object-content__actions">
<div class="date">
<?php
$canEdit = false;
$r_check_permissions = $user->checkMenuPermissions();
$depClassPerm = new Department();
$dep_user = $depClassPerm->getDepartment($user->id);
$sql_check_manager = "SELECT `id_manager`, `department_id` FROM `users` WHERE `id` = ".$obj['id_add_user'];
$result_check_manager = mysql_query($sql_check_manager);
$obj_id_manager = mysql_fetch_assoc($result_check_manager);
$user_allow_edit = 0;
if ($user->agency == 1 || $user->users_admin == 1 || $r_check_permissions['menu_all_objects_edit'] == 1 || $_SESSION['id'] == $obj['id_add_user']) {
$user_allow_edit = 1;
} elseif (($dep_user['role'] == 'admin_department' || $dep_user['role'] == 'manager_office') && $obj_id_manager['department_id'] == $user->department_id) {
$user_allow_edit = 1;
} elseif ($dep_user['role'] == 'manager' && ($user->id == $obj_id_manager['id_manager'])) {
$user_allow_edit = true;
} elseif ($dep_user['role'] == 'manager_office_menager' && ($user->id == $obj_id_manager['id_manager'] || $_SESSION['id_manager'] === $obj_id_manager['id_manager'] || $_SESSION['id_manager'] === $obj['id_add_user'])) {
$user_allow_edit = true;
} elseif (!($dep_user['role']) && ($user->manager && ($user->id == $obj_id_manager['id_manager']))) {
$user_allow_edit = true;
}
$dateAddForTitle = date("d.m.Y H:i",strtotime($time_zone, strtotime($obj['date_add'])));
$dateRealAddForTitle = date("d.m.Y H:i",strtotime($time_zone, strtotime($obj['date_really_add'])));
list($dateAdd, $timeAdd) = explode(" ", $dateAddForTitle);
list($d, $m, $y) = explode(".", $dateAdd);
$date_add = $d." ".getRusMonth($m)." ".$y;
$date = $date_add."&nbsp;в&nbsp;".$timeAdd;
echo '<span title="Дата добавления '.$dateRealAddForTitle.' Дата последнего изменения ' . $dateAddForTitle . '">'.$date.'</span>';
?>
<span>
<?php
if ($obj['operation_type'] == 0) {
echo "Сдается " . $SROK_ARENDY[$obj['srok']];
if($obj['prim_srok']) {
echo "($obj[prim_srok])";
}
} else {
echo "Продается";
}
?>
</span>
<span class="jw-id">ID&nbsp;<?php echo $obj['id']; ?></span>
</div>
<?php if (stripos($_SERVER['SCRIPT_NAME'], "getAgencyObjects.php") !== false) {
$tags = [];
if ($obj['activities']) {
foreach ($arrActivities as $key => $activity) {
if (in_array($key, $obj['activities'])) {
$tags[$key] = $activity;
}
}
}
$contracts = array();
$contract_name = '';
if (!isset($objContractsArray)) {
$objContractsArray = [];
$sql_c = "SELECT * FROM contracts_object WHERE object_id = {$obj['id']}";
$q_c = mysql_query($sql_c);
while ($r_c = mysql_fetch_assoc($q_c)) {
$objContractsArray[] = $r_c;
}
}
foreach ($objContractsArray as $r_c) {
if ($r_c["object_id"] == $obj["id"]) {
$expired = false;
$diff_date = ($r_c['date_end'] - time()) / 86400;
if ($diff_date < (int)$r_c['days']) {
$expired = true;
}
$name = $typesContracs[$r_c['type']]['type'] . " №" . $r_c['number'] . " от " . date('d.m.Y', $r_c['date_start']) . " по " . date('d.m.Y', $r_c['date_end']);
$contracts[] = array('id' => $r_c['id'], 'name' => $name, 'expired' => $expired);
if ($contract_name != '') $contract_name .= ", ";
$contract_name .= $name;
}
}
?>
<div class="addTag contract_req" style="padding-right: 0;">
<a href="javascript:{};" data-id="<?= $obj['id']; ?>" class="jw__small-popup_contract_tag" title="Добавить тег или договор">
<i class="ti-plus"></i>
</a>
<div class="jw__popup actions-tags" id="popup__contract_tag_<?= $obj['id']; ?>" data-id="<?= $obj['id']; ?>" data-for="object">
<div class="actions-menu__inner">
<div class="inputs">
<div class="inputs-group">
<select multiple="" name="popup-activities" id="popup__contract_tag_select<?= $obj['id']; ?>">
<option value="1">
Добавить тег
</option>
<option value="2">
Добавить договор
</option>
</select>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="jw__popup actions-tags" id="popup__tags_<?= $obj['id']; ?>" data-id="<?= $obj['id']; ?>" data-for="objects">
<div class="actions-menu__inner">
<div class="inputs">
<div class="inputs-group">
<select multiple="" name="popup-activities" id="popup__activities_<?= $obj['id']; ?>">
<?php foreach ($arrActivities as $key => $activity) { ?>
<option value="<?= $key; ?>"<?= in_array($key, array_keys($tags)) ? ' selected' : ''; ?>>
<?= $activity['name']; ?>
</option>
<?php } ?>
</select>
<button class="small-button" type="button">Сохранить</button>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
<div class="tags <?= empty($tags) ? 'hidden' : ''?>">
<div class="tags-title" data-id="<?= $obj['id'] ?>">
<?php
$tag_key = 1;
$tags_visible = 0;
foreach($tags as $key => $tag) {
if($tags_visible < 3){ ?>
<div class="tag-block" style="z-index: <?= $tag_key ?>; border: solid 1px <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>">
<div class="tag-img" style="background-color: <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>">
<img src="/images/tag.svg"/>
</div>
<div class="tag-name"><span style="color: <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>" data-id="<?= $key ?>"><?= $tag['name'] ?></span></div>
</div>
<?php
$tags_visible++;
}
$tag_key++;
}
if($tags_visible < count($tags)){
$rest_tags = count($tags) - $tags_visible;
?>
<div style="margin-left: 0px; border:none" class="tag-block">
<div style="margin-top: 7px;" class="tag-name"><span style="color: #757575;">и ещё <?= $rest_tags ?> шт.</span></div>
</div>
<?php
}
?>
</div>
<div class="jw__popup actions-tags lists" id="popup__tags_list_<?= $obj['id']; ?>" data-id="<?= $obj['id']; ?>" data-for="objects">
<div class="actions-menu__inner">
<div class="inputs">
<?php
foreach($tags as $key => $tag) { ?>
<div class="tag-block list-tags" style="border: solid 1px <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>">
<div class="tag-img" style="background-color: <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>">
<img src="/images/tag.svg"/>
</div>
<div class="tag-name"><span style="color: <?= !empty($tag['color']) ? $tag['color'] : '#5C9C5F;' ?>" data-id="<?= $key ?>"><?= $tag['name'] ?></span></div>
</div>
<?php
} ?>
</div>
</div>
</div>
</div>
<div id="actions_contract_<?=$obj['id']?>" class="contracts" title="Договоры" style="<?= (empty($contracts)) ? "display: none;" : "" ?>">
<i class="ti-file"></i>
<span>
<span class="jw__small-popup contract_href" onclick="open_modal_contract('<?=$obj['id']?>')">Договоры
</span>
</span>
<div class="jw__popup actions-menu contract" id="popup__actions_contract_<?=$obj['id']?>">
<div class="actions-menu__inner">
<?php
foreach ($contracts as $key => $contract) {
?>
<div class="contract_div" id="contract_elem_object<?=$contract['id']?>" style="padding: 4px 18px 6px; overflow: hidden; width: 300px; text-overflow: ellipsis; white-space: nowrap;">
<div title="<?=trim($contract['name'])?>" style="width: 250px; overflow: hidden; text-overflow: ellipsis; float: left; white-space: nowrap;" class="contract_href<?=($contract['expired']) ? ' expired' : ''?>" onclick="open_form_contract('<?=$obj['id']?>', '<?=$contract['id']?>', 'object')"><?=trim($contract['name'])?>
</div>
<a href="javascript:{};" onclick="deleteContractObject('<?=$obj['id']?>', '<?=$contract['id']?>', 'object')" title="Удалить" style="padding: 0 5px;border: none;float: left;margin-top: -2px;"><i class="ti-trash"></i></a>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php } ?>
<?php
if(!isset($post['find_object'])) { ?>
<div class="actions-menu__icons">
<span class="jw__small-popup jw-action-icon-more" data-id="actions_<?php echo $obj['id'];?>"></span>
<div class="jw__popup actions-menu" id="popup__actions_<?php echo $obj['id'];?>">
<div class="actions-menu__inner">
<?php
$sqlAdvCostStat = "SELECT id from object_publish_statistic where on_moderation = 0 AND object_id = $obj[id]";
$rezAdvCostStat = mysql_query($sqlAdvCostStat);
$advCostStatCount = mysql_num_rows($rezAdvCostStat);
if($advCostStatCount > 0) {
?>
<a href="javascript:{}" class="advertisingCosts" data-id="<?php echo $obj['id']; ?>"><span>Затраты на рекламу</span></a>
<?php }?>
<a target="_blank" href="/cabinet-edit.php?id=<?php echo $obj['id']; ?>"><span>Кабинет клиента</span></a>
<!-- <a href="/add-object.php?can=1&id=--><?php //echo $obj['id'];?><!--" data-id="--><?php //echo $obj['id'];?><!--"><span>Редактировать</span></a>-->
<!--<a href="javascript:{}" class="add_client_new" data-adduser="<?=$obj['id_add_user']?>" data-object="<?php echo $obj['id'];?>"><span>Создать заявку</span></a>-->
<a href="javascript:{};" onclick="req_form.openFormObj('<?=$obj['id']?>', '<?=$obj['id_add_user']?>');" data-object="<?=$obj['id']?>"><span>Создать заявку</span></a>
<?php
$sqlStat = "SELECT id from object_feed_stat where object_id = $obj[id] and deleted = 0";
$rezStat = mysql_query($sqlStat);
$kolStat = mysql_num_rows($rezStat);
if($kolStat || $obj['use_in_advert']) {
?>
<a href="#" class="ad-report" data-id="<?php echo $obj['id'];?>"><span>Отчет по рекламе</span></a>
<?php }?>
<?php if ($obj['add_to_zipal'] == 1) {?>
<?php
$sqlStat = "SELECT id from zipal_objects_posting where object_id = $obj[id] and deleted = 0";
$rezStat = mysql_query($sqlStat);
$kolStat = mysql_num_rows($rezStat);
if($kolStat) {
?>
<a href="javascript:void();" class="publish-report" data-id="<?php echo $obj['id']; ?>"><span>Отчет о публикации</span></a>
<?php }?>
<?php }
$filesTotal = 0;
if (isset($objClFilesArray)) {
foreach ($objClFilesArray as $clFile) {
if ($clFile["object_id"] == $obj["id"]) {
$filesTotal++;
}
}
} else {
$sql_f = "SELECT * FROM clients_files WHERE object_id = {$obj['id']} AND event_id > 0";
$q_f = mysql_query($sql_f);
$filesTotal += mysql_num_rows($q_f);
}
?>
<a href="javascript:{}" onclick="fileslist.open(<?=$obj['id']?>, 'object')" class="showDoc <?=($filesTotal==0) ? 'hidden' : ''?>"><span>Документы</span></a>
</div>
</div>
</div>
<div class="blockEditMyObject" style="float: right; padding-top: 5px;">
<a style="border: none; padding-top: 3px;" href="javascript:{}" class="editMyObject" data-id="<?php echo $obj['id']; ?>" data-page="<?php echo $obj['id'];?>" title="Редактировать"><span class="simple-button settings"><i style="font-size: 20px; margin-top: 0" class="jw-action-icon-settings"></i></span></a>
</div>
<?php
if (intval($obj['archive']) != 1) {
include($_SERVER['DOCUMENT_ROOT'] . "/templates/object-content__advert.php");
include($_SERVER['DOCUMENT_ROOT'] . "/templates/object-content_remove_advert.php");
}
}
?>
<div class="clear"></div>
</div>
<div class="object-content__name">
<h2>
<?php if ($obj['use_in_advert'] == 1) { ?>
<div class="jw__group-action-button" onClick="to_check_new(<? echo $obj['id']; ?>)">
<input type="checkbox" id="checked<? echo $obj['id']; ?>" class="" data-id="">
<div class="group-action-button item-for-check <?php if(in_array($obj['id'],$_SESSION['checked'])) { echo " active"; } ?>" id="checked-eye<? echo $obj['id']; ?>" data-id="<?php echo $obj['id']; ?>">
<span class="check-button-box"></span>
<span class="check"></span>
</div>
</div>
<?php } ?>
<a href="javascript:{}" onclick="openObjectModal(<?=$obj['id']?>)" class="edit-link" title="<?php echo $obj['nazv']; ?>">
<?php echo get_nazv_object($obj); ?>
</a>
<?php
if(stripos($_SERVER['SCRIPT_NAME'],"getAgencyObjects.php") !== false ) {
$req = null;
if (isset($objReqFunnelArray)) {
foreach ($objReqFunnelArray as $objReqFunnel) {
if ($objReqFunnel["object_id"] == $obj["id"]) {
$req = $objReqFunnel;
break;
}
}
} else {
$sql_req = "SELECT id, funnel_id, stage FROM requisitions WHERE object_id = $obj[id] AND (type_id = 2 or type_id in (SELECT id FROM requisitions_type WHERE heir = 2 AND agency_id = {$user->agencyId})) AND deleted = 0 AND cancel = 0 LIMIT 1";
$q_req = mysql_query($sql_req);
if(mysql_num_rows($q_req) > 0){
$req = mysql_fetch_assoc($q_req);
}
}?>
<div id="object_req_stagebar<?=$obj['id']?>" style="margin-bottom: 0px; float: left;">
<?php
if($req != null){ ?>
<div class="label-view clients" style="margin-bottom: 0px; float: left;">
<div class="additional-info" style="padding: 15px 0px 5px">
<div style="display: none; display: flex; justify-content: flex-start; flex-wrap: nowrap; flex-direction: row; min-width: 350px;" data-req="<?=$req['id']?>" data-funnel="<?=$req['funnel_id']?>" data-stage="<?=$req['stage']?>" id="stagebar__<?=$req['id']?>" class="stagebar">
<!--<v-select :clearable="true" :components="{OpenIndicator}" multiple class="vue_select" style="border: none;" :options="funnels" :reduce="name => name.code" label="name" v-model="selectFunnel"/>-->
<div v-if="funnelId == 0" class="crm__small-stagebar" style="width: 80%; margin-right: 5px;">
<table>
<tbody>
<tr>
<td v-for="(step, id) in steps.bar" class="stage" :class="[{ active: step.id <= steps.stageId }, step.classF]" :title="step.title">
<div :data-stage="step.id" :data-req="<?=$req['id']?>" class="crm__small-stage"></div>
<span class="next-stage" v-html="step.name"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div v-else-if="funnelId > 0" class="crm__small-stagebar" style="width: 80%; margin-right: 5px;">
<table>
<tbody>
<tr>
<td v-for="(step, id) in steps.bar" :class="'stage stage-funnel'+step.classF+' stageFunnel__'+step.id"
:title="step.name">
<div :data-stage="step.id"
:data-req="reqId"
:data-main="step.main"
class="crm__small-step">
</div>
<span class="next-stage">{{ step.name }}</span>
</td>
</tr>
<tr>
<td :colspan="bars">
<span class="stepError" :id="'step_funnel_error'+reqId"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="action-button" title="Изменить воронку" @click="is_edit_funnel = !is_edit_funnel">
<i class="fa fa-pencil" style="font-size: 14px; color: gray; position: absolute; margin-top: -4px;"></i>
</div>
<div v-if="is_edit_funnel" class="editFunnelObject hidden" style="width: 450px; position: absolute; background: white; z-index: 110; border: 1px solid rgb(67, 160, 71);display: flex ; flex-direction: column; top: 0px; left: 130px; box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;" >
<div style="display: flex; justify-content: space-between;">
<h2 style="padding: 20px; width: unset;">
Изменить воронку
</h2>
<span class="pseudo-link closer" @click="closeEdit"><i class="ti-close"></i></span>
</div>
<div class="form-block funnel-client-block" style="width: 390px; display: flex; flex-direction: column; align-items: center; padding: 20px; margin: 0">
<div class="form-block">
<div class="line price" style="display: flex; justify-content: space-between; width: unset; border-right: unset;">
<div class="label">
<span>Воронка: <span class="star" style="color: red; font-size: 20px;">*</span></span>
</div>
<div class="inputs" style="display: flex; width: 280px;">
<v-select :clearable="true" :components="{OpenIndicator}" class="vue_select" style="border: none; width: 250px;" :options="funnels" :reduce="name => name.id" label="name" v-model="selectFunnel"/>
</div>
</div>
</div>
</div>
<button @click="saveFunnel" class="big-button" type="submit">Сохранить</button>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php } ?>
<div class="preloader"></div>
</h2>
<div class="clear"></div>
</div>
<div class="object-content__info-row">
<table>
<tr>
<td class="place">
<div class="inner">
<div class="subway"><?php
$mtr = array();
if (isset($objMetroArray)) {
foreach ($objMetroArray as $objMetro) {
if ($objMetro["id_obj"] == $obj["id"]) {
$mtr[] = $objMetro['metro'];
}
}
} else {
$sql = "SELECT metro.metro FROM metro, sp_metro WHERE sp_metro.id_metro = metro.id AND sp_metro.id_obj = $obj[id]";
$result = mysql_query($sql);
while($m = mysql_fetch_row($result)) {
$mtr[] = $m[0];
}
}
if (count($mtr) > 0) {
?>
<div class="subway-station">
<span class="subway-logo"></span>
<span><?php echo $mtr[0]; ?></span>
</div>
<?php if (count($mtr) > 1) { ?>
<div class="all-stations">
<span class="jw__small-popup ti-more-alt"
data-id="<?php echo $obj['id']; ?>"></span>
<div class="jw__popup subway-stations"
id="popup__<?php echo $obj['id']; ?>">
<div class="subway-stations__inner">
<?php
$k = 0;
foreach ($mtr as $metro_res) {
if ($k == 0) {
$k++;
} else {
?>
<div class="subway-station">
<span><?php echo $metro_res ?></span>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<?php
}
}
?></div>
<?php if ($obj['rayon']) {
echo '<div class="district"><span>' . $obj['rayon'] . ' район</span></div>';
}
if($obj['peshkom'] || $obj['transport']) {
if($obj['peshkom']) {
echo '<div class="time"><span>' . $obj['peshkom']." минут пешком" . '</span></div>';
}
if($obj['transport']) {
echo '<div class="time"><span>' . $obj['transport']." минут на транспорте" . '</span></div>';
}
}
$objCoordinates = [];
if (isset($objCoordinatesArray)) {
foreach ($objCoordinatesArray as $objCoords) {
if ($objCoords['object_id'] == $obj['id']) {
$objCoordinates = $objCoords;
$obj['latitude'] = $objCoordinates['latitude'];
$obj['longitude'] = $objCoordinates['longitude'];
break;
}
}
} else {
$sql_coordinates = "SELECT address, latitude, longitude FROM object_location WHERE object_id=".$obj['id'];
$rezCoordinates = mysql_query($sql_coordinates);
if (mysql_num_rows($rezCoordinates) > 0) {
$objCoordinates = mysql_fetch_assoc($rezCoordinates);
$obj['latitude'] = $objCoordinates['latitude'];
$obj['longitude'] = $objCoordinates['longitude'];
}
}
if ($objCoordinates && isset($objCoordinates['address'])) {
?>
<div class="address">
<span><?php echo $objCoordinates['address']; if(stripos($_SERVER['SCRIPT_NAME'],"getObjectsView.php") !== false && $obj['flat_number']) {echo ", кв. " . $obj['flat_number'];}?></span>
</div>
<?php } else{ ?>
<div class="address">
<span><?php echo $obj['adres']; if ($obj['dom']) {echo ", " . $obj['dom'];} if ($obj['korpus']) {echo ", корпус " . $obj['korpus'];} if ($obj['litera']) {echo ", литера " . $obj['litera'];} ?></span>
</div>
<?php } ?>
</div>
</td>
<td class="room">
<div class="inner">
<?php
if ($obj['type'] == 7) {
if ($obj['land_area'] * 1 != 0) {
echo '<div class="square"><span>' . $obj['land_area'] * 1 . ' cоток</span></div>';
}
if ($obj['land_usage_name']) {
echo '<div class="square"><span>' . $obj['land_usage_name'] . '</span></div>';
}
} else {
if ($obj['type'] == 3 || $obj['type'] == 5) {
if ($obj['ploshad'] * 1 != 0) {
echo '<div class="square"><span>' . $obj['ploshad'] * 1 . ' кв. м</span></div>';
}
if ($obj['land_area']) {
echo '<div class="live-square"><span>Участка: ' . $obj['land_area'] * 1 . ' cоток</span></div>';
}
if ($obj['house_category']) {
echo '<div class="live-square"><span>Вид объекта: ';
if ($obj['house_category'] == 1) {
echo 'Дача';
}
if ($obj['house_category'] == 2) {
echo 'Коттедж';
}
if ($obj['house_category'] == 3) {
echo 'Таунхаус';
}
if ($obj['house_category'] == 4) {
echo 'Дом';
}
echo '</span></div>';
}
} else {
if ($obj['ploshad'] * 1 != 0) {
echo '<div class="square"><span>' . $obj['ploshad'] * 1 . ' кв. м</span></div>';
}
if ($obj['type'] != 4) {
if ($obj['ploshad_komn']) {
echo '<div class="live-square"><span>Жилая: ' . $obj['ploshad_komn'] . ' кв. м</span></div>';
}
}
if ($obj['ploshad_k'] * 1 != 0) {
echo '<div class="kitchen-square"><span>Кухни: ' . $obj['ploshad_k'] * 1 . ' кв. м</span></div>';
}
if ($obj['type'] == 4) {
if ($obj['commerc_land_category_name']) {
echo '<div class="square"><span>' . $obj['commerc_land_category_name'] . '</span></div>';
}
} else {
if ($obj['land_usage_name']) {
echo '<div class="square"><span>' . $obj['land_usage_name'] . '</span></div>';
}
}
if ($obj['type_category'] == 6) {
echo '<div class="floor"><span>Всего этажей: ';
if ($obj['etazh_iz'] * 1 != 0) {
echo "&nbsp;" . $obj['etazh_iz'];
}
echo '</span></div>';
} else {
if ($obj['etazh'] * 1 != 0) {
echo '<div class="floor"><span>' . $obj['etazh'] . ' этаж';
if ($obj['etazh_iz'] * 1 != 0) {
echo "&nbsp;из&nbsp;" . $obj['etazh_iz'];
}
echo '</span></div>';
}
}
}
}
?>
</div>
</td>
<?php if ($obj['holod'] || $obj['stirka'] || $obj['tv'] || $obj['mebel']) { ?>
<td class="features">
<div class="icons">
<?php
if($obj['holod']) echo ' <span class="jw-icon-object-technology"></span>';
if($obj['stirka']) echo '<span class="jw-icon-object-dryer"></span>';
if($obj['tv']) echo '<span class="jw-icon-object-technology-1"></span>';
if($obj['mebel']) echo '<span class="jw-icon-object-armchair"></span>';
?>
</div>
</td>
<?php } if($obj['id_add_user'] > 0){
echo '<td class="object_clients" data-allow-edit="'.$user_allow_edit.'" data-oid="' . $obj['id'] . '" style="text-align:right;">';
echo '</td>';
}
?>
</tr>
</table>
</div>
<div class="object-content__main-actions">
<div class="jw__action-button">
<input type="checkbox" class="form-control to_send_input" id="to_send<?php echo $obj['id']; ?>">
<div class="action-button sendPDF to_send <?php if(@in_array($obj['id'],$_SESSION['to_send'])) echo "active"; ?>" id="to_send_button<?php echo $obj['id']; ?>" data-id="<?php echo $obj['id']; ?>">
<span class="get_pdf" title="К отправке">pdf</span>
</div>
</div>
<?php if(!empty($user->vk_token)) { ?>
<div class="jw__action-button">
<div class="action-button addVkPost" data-id="<?php echo $obj['id']; ?>" title="Пост в Вконтакте">
<img src="/images/vk-small-logo.png">
</div>
</div>
<?php } ?>
<?php
if(!isset($post['find_object'])){ ?>
<div class="jw__action-button">
<div class="action-button actionJW download-photo" data-id="<?php echo $obj['id']; ?>" title="Загрузить архив">
<i class="ti-download"></i>
</div>
</div>
<?php
$canAntiznak = true;
// }
if($canAntiznak){
$availableRequestsAntiznak = $user->antiznak_request_count;
if (empty($availableRequestsAntiznak) || $availableRequestsAntiznak <= 0) {
$availableRequestsAntiznak = $user->agencyAntiznakRequestCount;
}
$classAntiznak = "antiznakRequestPay";
$styleAntiznak = "padding:0 2px";
if ($availableRequestsAntiznak > 0) {
$classAntiznak = "antiznakRequest";
}
?>
<div class="jw__action-button">
<div style="<?=$styleAntiznak?>" title="Удаление водяных знаков" class="action-button actionJW <?=$classAntiznak?>" data-id="<?=$obj['id']?>">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" fill="none">
<g clip-path="url(#clip0_9_63)">
<path d="M24.3751 13.75C24.0299 13.75 23.7501 14.0299 23.7501 14.375V19.2908L20.4346 15.9754C19.2167 14.7609 17.2468 14.757 16.0242 15.9668L14.8683 17.1131L11.4893 13.7304C10.2655 12.5177 8.29271 12.5189 7.07033 13.7329L3.75 17.0533V8.12501C3.75115 7.08993 4.58993 6.25115 5.62501 6.25001H14.375C14.7202 6.25001 15 5.97016 15 5.625C15 5.27985 14.7202 5 14.375 5H5.62501C3.89977 5.0016 2.5016 6.39977 2.5 8.12501V24.3751C2.5016 26.1003 3.89977 27.4985 5.62501 27.5001H21.8751C23.6003 27.4985 24.9985 26.1003 25.0001 24.3751V14.375C25.0001 14.0299 24.7202 13.75 24.3751 13.75ZM21.8751 26.2501H5.62501C4.58993 26.2489 3.75115 25.4102 3.75 24.3751V18.8209L7.95412 14.6167C8.68853 13.8895 9.87154 13.8889 10.6067 14.6155L22.1959 26.2174C22.0911 26.2357 21.9849 26.2499 21.8751 26.2501ZM23.7501 24.3751C23.7495 24.8298 23.5808 25.241 23.3115 25.5656L15.7528 17.9986L16.9056 16.8543C17.6394 16.13 18.8197 16.1321 19.5508 16.8592L23.7501 21.0584V24.3751Z" fill="#656565"/>
<path d="M25.6923 3.85346C25.7722 3.93337 25.874 3.98781 25.9848 4.00989C26.0956 4.03197 26.2105 4.0207 26.3148 3.97751C26.4192 3.93431 26.5084 3.86113 26.5711 3.76722C26.6338 3.67331 26.6673 3.56288 26.6672 3.44991C26.6672 3.33694 26.6337 3.22649 26.5709 3.13253C26.5081 3.03858 26.4188 2.96533 26.3144 2.92206C26.2101 2.87879 26.0952 2.86744 25.9844 2.88944C25.8736 2.91144 25.7719 2.9658 25.692 3.04566C25.5849 3.15274 25.5248 3.29801 25.5248 3.4495C25.5249 3.60099 25.5851 3.7463 25.6923 3.85346ZM16.4041 8.29306L21.2527 13.1416C21.3599 13.2488 21.5052 13.309 21.6567 13.3091C21.8081 13.3091 21.9534 13.249 22.0605 13.1419L25.6943 9.50808C26.0156 9.18683 26.1959 8.75104 26.1958 8.29656C26.1956 7.84208 26.0149 7.40615 25.6934 7.08467L25.2894 6.68063L26.2463 5.72372C26.6851 5.69635 27.1067 5.54292 27.4603 5.28185C27.8139 5.02078 28.0846 4.66316 28.2399 4.25191C28.3952 3.84066 28.4286 3.39324 28.3359 2.96335C28.2432 2.53346 28.0285 2.13935 27.7174 1.82832C27.4064 1.51729 27.0123 1.30255 26.5824 1.20987C26.1525 1.11718 25.7051 1.1505 25.2938 1.30581C24.8826 1.46112 24.525 1.73184 24.2639 2.08547C24.0028 2.43909 23.8494 2.86061 23.822 3.29945L22.8651 4.25635L22.4611 3.85231C22.1396 3.53083 21.7037 3.35013 21.2492 3.34997C20.7947 3.34981 20.3589 3.53019 20.0377 3.85144L16.4039 7.48525C16.2968 7.59234 16.2366 7.7376 16.2367 7.88909C16.2367 8.04059 16.297 8.1859 16.4041 8.29306ZM26.9036 2.64219C27.0649 2.80601 27.1731 3.01465 27.2141 3.24086C27.255 3.46706 27.2268 3.70031 27.1331 3.91012C27.0393 4.11993 26.8845 4.29655 26.6887 4.41689C26.493 4.53723 26.2655 4.59569 26.0359 4.58465C25.9563 4.58054 25.8767 4.59314 25.8023 4.62163C25.7278 4.65013 25.6602 4.69388 25.6037 4.75009L24.4813 5.87254L23.6732 5.06444L24.7957 3.942C24.8519 3.88552 24.8956 3.8179 24.9241 3.74348C24.9526 3.66906 24.9652 3.58949 24.9611 3.50988C24.9501 3.28029 25.0085 3.05275 25.1289 2.857C25.2492 2.66125 25.4258 2.5064 25.6356 2.41268C25.8454 2.31896 26.0787 2.29072 26.3049 2.33167C26.5311 2.37262 26.7397 2.48084 26.9036 2.64219ZM20.8458 4.65953C20.9528 4.55245 21.0981 4.49232 21.2496 4.49237C21.4011 4.49243 21.5464 4.55266 21.6536 4.65982L24.8859 7.89219C24.9931 7.99935 25.0533 8.14466 25.0534 8.29615C25.0534 8.44764 24.9933 8.59291 24.8862 8.69999L24.4825 9.10375L20.442 5.06329L20.8458 4.65953ZM19.6345 5.8708L23.6749 9.91126L21.6562 11.93L17.6157 7.88959L19.6345 5.8708Z" fill="#656565"/>
</g>
<defs>
<clipPath id="clip0_9_63">
<rect width="30" height="30" fill="white"/>
</clipPath>
</defs>
</svg>
</div>
</div>
<?php
}
?>
<div class="jw__action-button">
<div class="action-button actionJW tasks add-event" data-id="<?php echo $obj['id']; ?>">
Задачи
</div>
</div>
<?php if ($hasSearchLayout || !$hasAutoSearchLayout) { ?>
<div class="jw__action-button">
<div class="action-button actionJW fltr-req-list"
title="Заявки типа «Подбор объекта»"
data-id="<?php echo $obj['id']; ?>">
Автопоиск
</div>
</div>
<?php } ?>
<?php
if (isset($objCntNotesArray)) {
$obj['notes'] = 0;
foreach ($objCntNotesArray as $objCntNote) {
if ($objCntNote["object_id"] == $obj["id"]) {
$obj['notes']++;
}
}
} else {
if (empty($notes_bd_usl))
$notes_bd_usl = ' true';
$sql_count_notes = "SELECT COUNT(*) FROM object_notes WHERE object_id = $obj[id] AND $notes_bd_usl";
$obj['notes'] = mysql_result(mysql_query($sql_count_notes),0);
}
?>
<div class="jw__action-button">
<div class="action-button actionJW addEditNote<?= (($obj['notes']) ? ' haveNotes' : ''); ?>" data-id="<?php echo $obj['id']; ?>" title="Примечания по объекту">
<i class="ti-pencil-alt"></i>
</div>
</div>
<?php if (intval($obj['archive']) != 1) { ?>
<div class="jw__action-button">
<div title="Поместить в архив" class="action-button actionJW addToArchive archiveMyObject"
data-id="<?php echo $obj['id']; ?>">
<i class="ti-folder"></i>
</div>
</div>
<?php
} else {
?>
<div class="jw__action-button">
<div title="Восстановить" class="action-button actionJW returnObject unArchiveMyObject"
data-id="<?php echo $obj['id']; ?>">
<i class="ti-back-right"></i>
</div>
</div>
<?php
}
if ($_SESSION['individual'] == 0) {
include($_SERVER['DOCUMENT_ROOT'] . "/templates/object-content__send-buttons.php");
}
if (!empty($iframe_enabled['iframe_enabled']) &&
$iframe_enabled['iframe_enabled'] == 1 &&
$obj['archive'] == 0) {
if ($obj['site_published'] == 0) { ?>
<div class='jw__action-button add-object-iframe' id="object_id_<?php echo $obj['id']; ?>">
<svg xmlns="http://www.w3.org/2000/svg"
version="1.0"
width="16"
height="16"
class="add-object-to-iframe"
style="overflow: unset;background:transparent;"
data-id="<?php echo $obj['id']; ?>"
viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#757575" stroke="none">
<path d="M842 4899 c-210 -27 -406 -123 -555 -271 -126 -125 -215 -282 -259 -454 l-23 -89 0 -1525 0 -1525 23 -89 c88 -346 347 -607 698 -704 l99 -27 1735 0 1735 0 97 27 c354 98 612 357 700 704 l23 89 0 1525 0 1525 -23 89 c-88 347 -346 607 -700 704 l-97 27 -1695 1 c-932 1 -1723 -2 -1758 -7z m3481 -225 c94 -21 236 -90 313 -153 113 -92 201 -231 246 -386 21 -76 22 -97 23 -400 l0 -320 -2345 0 -2345 0 -3 260 c-2 143 2 302 8 352 35 314 260 569 565 644 65 16 194 18 1768 18 1514 1 1706 -1 1770 -15z m585 -2546 l-4 -1073 -22 -75 c-68 -221 -201 -380 -397 -475 -167 -80 -28 -75 -1925 -75 -1519 0 -1698 2 -1763 16 -82 18 -194 67 -261 114 -168 115 -290 316 -316 521 -6 53 -10 455 -10 1101 l0 1018 2350 0 2351 0 -3 -1072z"></path> <path d="M802 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M1442 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M2082 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M824 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path> <path d="M2104 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path> <path d="M3384 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path>
</g>
</svg>
<div class="objects-iframe-title top-max">Опубликовать на сайте компании</div>
</div>
<?php } else { ?>
<div class='jw__action-button add-object-iframe' data-attr="test" id="object_id_<?php echo $obj['id']; ?>">
<svg xmlns="http://www.w3.org/2000/svg"
version="1.0"
width="16"
height="16"
class="add-object-to-iframe"
style="overflow: unset;background:#4CAF50;"
data-id="<?php echo $obj['id']; ?>"
viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#ffffff" stroke="none">
<path d="M842 4899 c-210 -27 -406 -123 -555 -271 -126 -125 -215 -282 -259 -454 l-23 -89 0 -1525 0 -1525 23 -89 c88 -346 347 -607 698 -704 l99 -27 1735 0 1735 0 97 27 c354 98 612 357 700 704 l23 89 0 1525 0 1525 -23 89 c-88 347 -346 607 -700 704 l-97 27 -1695 1 c-932 1 -1723 -2 -1758 -7z m3481 -225 c94 -21 236 -90 313 -153 113 -92 201 -231 246 -386 21 -76 22 -97 23 -400 l0 -320 -2345 0 -2345 0 -3 260 c-2 143 2 302 8 352 35 314 260 569 565 644 65 16 194 18 1768 18 1514 1 1706 -1 1770 -15z m585 -2546 l-4 -1073 -22 -75 c-68 -221 -201 -380 -397 -475 -167 -80 -28 -75 -1925 -75 -1519 0 -1698 2 -1763 16 -82 18 -194 67 -261 114 -168 115 -290 316 -316 521 -6 53 -10 455 -10 1101 l0 1018 2350 0 2351 0 -3 -1072z"></path> <path d="M802 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M1442 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M2082 4260 c-84 -20 -162 -116 -162 -198 0 -123 99 -222 222 -222 51 0 135 46 165 91 60 92 51 192 -26 269 -60 60 -121 79 -199 60z"></path> <path d="M824 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path> <path d="M2104 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path> <path d="M3384 2336 c-46 -20 -64 -52 -64 -111 1 -105 69 -824 80 -847 43 -82 123 -118 189 -83 45 23 70 60 161 238 47 92 87 167 90 167 3 0 43 -75 90 -167 91 -178 116 -215 161 -238 66 -35 146 1 189 83 11 23 79 742 80 847 0 60 -19 91 -66 111 -42 18 -80 10 -116 -24 -34 -31 -33 -27 -59 -357 -11 -148 -21 -271 -23 -272 -1 -1 -39 69 -84 156 -45 87 -91 166 -103 177 -29 26 -109 26 -138 0 -12 -11 -58 -91 -104 -179 -50 -98 -83 -152 -85 -140 -2 11 -13 147 -26 302 l-22 282 -30 29 c-36 35 -79 44 -120 26z"></path>
</g>
</svg>
<div class="objects-iframe-title top-min">Снять с сайта компании</div>
</div>
<?php }
}
/*$sqlRequest = "SELECT id FROM clients WHERE of_objects = $obj[id]";
$qRequest = mysql_query($sqlRequest);
$requestsCount = mysql_num_rows($qRequest);
if ($requestsCount > 0) {
?>
<div class="jw__action-button">
<a style="border-bottom: none;" target="_blank" href="/clients.php?funnelId=all&of_objects=<?php echo $obj['id']; ?>">
<div title="Заявки по объекту" class="action-button actionJW">
<?php echo $requestsCount; ?>
</div>
</a>
</div>
<?php
}*/
$requestsCount = 0;
if (isset($objRequisitionsArray)) {
foreach ($objRequisitionsArray as $objRequisition) {
if ($objRequisition["object_id"] == $obj["id"]) {
$requestsCount = $objRequisition["cnt"];
break;
}
}
} else {
$sqlRequest = "SELECT id FROM requisitions WHERE type_id=4 and object_id = $obj[id] and cancel = 0";
$qRequest = mysql_query($sqlRequest);
$requestsCount = mysql_num_rows($qRequest);
}
if ($requestsCount > 0) {
?>
<div class="jw__action-button">
<a style="border-bottom: none;" target="_blank" data-id="<?=$obj['id']?>" class="openListReq">
<div title="Заявки по объекту" class="action-button actionJW">
<?php echo $requestsCount; ?>
</div>
</a>
</div>
<?php
}
if(!isset($isModal)) {
?>
<div class="jw__action-button">
<div title="Аналитика по конкурентам" class="action-button actionJW otherObjectsAnalysis" data-id="<?php echo $obj['id']; ?>">
<i class="ti-layers-alt"></i>
</div>
</div>
<?php
}
$availableRequests = $user->egrn_request_count;
if (empty($availableRequests) || $availableRequests == 0) {
$availableRequests = $user->agencyEgrnRequestCount;
}
$class = "egrnRequestPay";
$style = "color: #237ef7 !important;border-color: #3a8efa !important;";
if ($availableRequests > 0) {
$class = "egrnRequestList";
$hasNotDone = false;
$reqCount = 0;
if (isset($objDischRequestArray)) {
foreach ($objDischRequestArray as $objDischRequest) {
if($objDischRequest["object_id"] == $obj['id']) {
$reqCount = 1;
if ($objDischRequest['state'] != 'done') {
$hasNotDone = true;
}
}
}
} else {
$sqlCount = "SELECT DISTINCT state FROM discharge_object_request where object_id = " . $obj['id'];
$rezCount = mysql_query($sqlCount);
if (mysql_num_rows($rezCount) > 0) {
$reqCount = 1;
while ($request = mysql_fetch_assoc($rezCount)) {
if ($request['state'] != 'done') {
$hasNotDone = true;
}
}
}
}
if ($reqCount > 0) {
if ($hasNotDone) {
$style = "color: orange !important;border-color: orange !important;";
} else {
$style = "color: green !important;border-color: green !important;";
}
} else {
$class = "egrnRequest";
}
}
?>
<div class="jw__action-button">
<div title="Заказать выписку из ЕГРН" data-object-id="<?php echo $obj['id']; ?>" class="action-button actionJW <?php echo $class; ?>"
style="<?php echo $style; ?>">
Выписка
</div>
</div>
<?php
$disableAdvSw = false;
if ($_SESSION['agency_id'] == 11086 && $_SESSION['id'] != 11086) {
$disableAdvSw = true;
}
if ($_SESSION['agency_id'] == 19750 && !in_array($_SESSION['id'], [19750, 22195, 22196]) && $obj['use_in_advert']) {
$disableAdvSw = true;
}
?>
<?php if ($showAds && intval($obj['archive']) != 1 && $can_moderation_user) : ?>
<div class="jw__action-button">
<div class="action-button actionJW advertisingBtn" title="Рекламировать" data-id="<?= $obj['id']; ?>" data-archive="<?= $obj['archive']; ?>">
Реклама
</div>
</div>
<div id="advertisings__<?= $obj['id']; ?>" class="object-content__sub-actions actionAdv" style="display:none; z-index:9999">
<div class="closer"><a href="#" onclick="return false;"><img src="/images/close_modal.svg"></a></div>
<table>
<tbody>
<tr>
<td style="padding-bottom: 10px">
<?php if ((!empty($user->zipal_login) && !empty($user->zipal_password)) || (!empty($user->agencyZipalLogin) && !empty($user->agencyZipalPassword))) {
$showZipalErr = false;
$zipalObjFound = [];
if (isset($zipalObjectsWithError)) {
foreach ($zipalObjectsWithError as $zipalObj) {
if ($zipalObj['object_id'] == $obj['id']) {
$showZipalErr = true;
$zipalObjFound = $zipalObj;
}
}
} ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToZipal <?php if($obj['add_to_zipal'] && $obj['zipal_active']) echo "active"; ?>"
onclick="showZipalVariants(this)" data-id="<?php echo $obj['id']; ?>" <?php if ($showZipalErr) { echo 'style="border: 1px solid red;"';}?>>
С отчетами
</div>
</div>
<?php if ($showZipalErr) { ?>
<div class="source-how">
<div class="source-how__button" style="color: red;">
<i class="ti-info-alt" title=""></i>
</div>
<div class="jw__popup source-how__popup" style="word-break: break-all;width: 350px;left: -357px;">
<?php if ($zipalObjFound['sended'] == 0) { ?>
<p>Ошибка отправки объекта:</p>
<?php } else { ?>
<?php if ($zipalObjFound['published'] == 0) { ?>
<p>Ошибка публикации объекта:</p>
<?php }
} ?>
<p>
<?php
echo $zipalObjFound['error_text'];
?>
</p>
</div>
</div>
<?php } ?>
<?php } else { ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToZipalInfo" onclick="showWithReportsInfo();">
С отчетами
</div>
</div>
<?php } ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addPromotion"
onclick="showPromotionModal(this);"
data-id="<?php echo $obj['id']; ?>"
title="Выбрать пакет продвижения">Продвижение</div>
</div>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<?php
$add_to_yandex_feed = $obj['add_to_yandex_feed'];
if(!empty($object_moderation)){
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_yandex_feed'] > 0)
$add_to_yandex_feed = $object_moderation[$obj['id']]['add_to_yandex_feed'];
}
?>
<div <?=(isset($objPablichDays[$obj['id']]['FREE_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['FREE_JW_FEED'].'"' : ''?> class="action-button actionJW actionAdvButton addToFreeAdv <?php if($add_to_yandex_feed) echo "active"; ?>"
onclick="switchCanAd(this);" data-id="<?php echo $obj['id']; ?>" title="">Бесплатные</div>
</div>
<div class="source-list">
<div class="source-list__button">
<i class="ti-help-alt"></i>
</div>
<div class="jw__popup source-list__popup">
<ul>
<li>Egent.ru</li>
<li>Chastnik.ru</li>
<li>QP.ru</li>
<li>Realtymag.ru</li>
<li>Rentzilla.ru</li>
<li>Kvmeter.ru</li>
<li>Rucountry.ru</li>
<li>Bestru.ru</li>
<li>Gde.ru</li>
<li>G-N.ru</li>
<li>Nedvrf.ru</li>
<li>Квартиры-домики.рф</li>
<li>baza.estate</li>
<li>Restate.ru</li>
<li>Akula.com</li>
</ul>
</div>
</div>
</td>
</tr>
<tr>
<td style="padding-bottom: 10px">
<?php
$add_to_avito_feed = $obj['add_to_avito_feed'];
$add_to_cian_feed = $obj['add_to_cian_feed'];
if(!empty($object_moderation)){
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_avito_feed'] > 0)
$add_to_avito_feed = $object_moderation[$obj['id']]['add_to_avito_feed'];
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_cian_feed'] > 0)
$add_to_cian_feed = $object_moderation[$obj['id']]['add_to_cian_feed'];
}
?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div <?=(isset($objPablichDays[$obj['id']]['AVITO_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['AVITO_JW_FEED'].'"' : ''?> class="action-button actionJW actionAdvButton addToAvito <?php if($add_to_avito_feed) echo "active"; ?>" onclick="switchCanAvitoAd(this);" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>">
<img class="bBnru" src="/images/avito.svg" data-id="<?php echo $obj['id']; ?>">
</div>
</div>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToCian <?php if ($add_to_cian_feed) echo "active"; ?>"
onclick="switchCanCianAd(this)" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>"
<?=(isset($objPablichDays[$obj['id']]['CIAN_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['CIAN_JW_FEED'].'"' : ' '?>
>
<img class="bRealCian" src="/images/cian.png">
</div>
</div>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div style="padding-left: 8px;" class="action-button actionJW actionAdvButton advPack"
onclick="showPackagesWindow(this)" data-id="<?php echo $obj['id']; ?>"
title="Рекламные пакеты">
Пакеты
</div>
</div>
</td>
</tr>
<tr>
<td>
<?php
$add_to_domclick_feed = $obj['add_to_domclick_feed'];
$add_to_emls_feed = $obj['add_to_emls_feed'];
$add_to_bn_feed =$obj['add_to_bn_feed'];
if(!empty($object_moderation)){
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_domclick_feed'] > 0)
$add_to_domclick_feed = $object_moderation[$obj['id']]['add_to_domclick_feed'];
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_emls_feed'] > 0)
$add_to_emls_feed = $object_moderation[$obj['id']]['add_to_emls_feed'];
if(isset($object_moderation[$obj['id']]) && $object_moderation[$obj['id']]['add_to_bn_feed'] > 0)
$add_to_bn_feed = $object_moderation[$obj['id']]['add_to_bn_feed'];
}
?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToDomClick <?php if($add_to_domclick_feed) echo "active"; ?>" onclick="switchDomAd(this);" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>" <?=(isset($objPablichDays[$obj['id']]['DOMCLICK_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['DOMCLICK_JW_FEED'].'"' : ''?>>
<img class="bBnru" style="top: 5px;" src="/images/domcl.jpg" data-id="<?php echo $obj['id']; ?>">
</div>
</div>
<?php if ($_SESSION['agency_id'] != 12482 && $_SESSION['agency_id'] != 13154) { ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToEMLS <?php if($add_to_emls_feed) echo "active"; ?>" onclick="switchCanEmlsAd(this)" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>" <?=(isset($objPablichDays[$obj['id']]['EMLS_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['EMLS_JW_FEED'].'"' : ''?>>
<img class="bCian" src="/images/jcat.png">
</div>
</div>
<?php } ?>
<?php if ($_SESSION['agency_id'] == 13154) { ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToEMLS <?php if($add_to_emls_feed) echo "active"; ?>" onclick="switchCanEmlsAd(this)" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>" <?=(isset($objPablichDays[$obj['id']]['EMLS_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['EMLS_JW_FEED'].'"' : ''?>>
ЦДЖ
</div>
</div>
<?php } ?>
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
<div class="action-button actionJW actionAdvButton addToBn <?php if($add_to_bn_feed) echo "active"; ?>" onclick="switchBnAd(this);" data-id="<?php echo $obj['id']; ?>" data-budget="<?= (int)$use_advert_budget ?>" <?=(isset($objPablichDays[$obj['id']]['YANDEX_JW_FEED'])) ? 'title="Выбран период '.$objPablichDays[$obj['id']]['YANDEX_JW_FEED'].'"' : ''?>>
<img class="bBnru" src="/images/yandex.png"/>
</div>
</div>
<div class="source-how" style="padding-top: 10px;">
<div class="source-how__button">
<i class="ti-info-alt" title=""></i>
</div>
<div class="jw__popup source-how__popup">
<p>Для подключения ДомКлик, Avito, Domofond, EMLS, ЦИАН и BN свяжитесь с нами по телефону +7 812 765-08-01</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="clear"></div>
<?php
if(isset($object_moderation[$obj['id']])) { ?>
<button type="button" onclick="confirm_moderation('<?=$obj['id']?>')" style="margin-bottom: 7px; margin-top: 10px; display: inline-block;" class="green_button send_moderaion">
Подтвердить
</button>
<div class="green_button done_send_moderation" style="display:none; width: 382px;margin-bottom: 7px; margin-top: 10px; text-align:center; height: 22px; background: linear-gradient(to bottom, #d0d0d0 0%,#757575 100%);">
Модерация подтверждена
</div>
<?php
}
?>
</div>
<div class="checkbox small">
<input name="use_in_advert" <?php if ($disableAdvSw) { echo 'disabled'; }?> id="addToAdvertSwitcher__<?= $obj['id']; ?>" onchange="advertsSwitch(this);" type="checkbox" value="1" data-id="<?= $obj['id']; ?>" <?= ($obj['use_in_advert']) ? " checked" : ""; ?>>
<label for="addToAdvertSwitcher__<?= $obj['id']; ?>">В рекламу</label>
</div>
<?php endif; ?>
<?php if (!$showAds && intval($obj['archive']) != 1) : ?>
<div class="checkbox small">
<input name="use_in_advert" <?php if ($disableAdvSw) { echo 'disabled'; }?> id="addToAdvertSwitcher__<?= $obj['id']; ?>" onchange="advertsSwitch(this);" type="checkbox" value="1" data-id="<?= $obj['id']; ?>" data-archive="<?= $obj['archive']; ?>" <?= ($obj['use_in_advert']) ? " checked" : ""; ?>>
<label for="addToAdvertSwitcher__<?= $obj['id']; ?>">В рекламу</label>
</div>
<?php endif; ?>
<?php } ?>
<div class="clear"></div>
</div>
<div class="object-content__price-user-map">
<table>
<tr>
<td class="price">
<span class="n">
<span>
<?php
$price_stats = '';
$commission_stats = '';
$currency = 'p';
//var_dump((int)$obj['currency'] == 2);
if(isset($obj['currency'])){
if((int)$obj['currency'] == 1) {
$currency = '$';
}
else if((int)$obj['currency'] == 2){
$currency = '€';
}
else if((int)$obj['currency'] == 3){
$currency = '₼';
}
}
$obj_id = $obj['id'];
if (!isset($isModal)) {
if($obj['commission_agency'] > 0 && $obj['stoim'] > 0){
$commission_stats .= '<p><b>Kомиссия</b></p>';
$commission_stats .= '<table class="table_commission_history">';
if ($obj['commission_agency_type'] === 'percent') {
$pr_price = (((int)$obj['stoim'] * (float)$obj['commission_agency']) / 100);
$commission_stats .= '<tr>
<td class="price-stats">Текущая:</td>
<td class="price-stats commission--agency--' . $obj_id . '">'
. number_format($pr_price, 2, ',', ' ') .
' <span class="rub rub_small currency--' . $obj_id . '">' . $currency . '</span>
</td>
</tr>';
} else if ($obj['commission_agency_type'] === 'price') {
$commission_stats .= '<tr>
<td class="price-stats">Текущая:</td>
<td class="price-stats commission--agency--' . $obj_id . '">'
. number_format((float)$obj['commission_agency'], 2, ',', ' ') .
' <span class="rub rub_small currency--' . $obj_id . '">' . $currency . '</span>
</td>
</tr>';
}
$commission_stats .= "</table>";
}
if (intval($obj['prep_price']) > 0 || intval($obj['start_price']) > 0 || intval($obj['fact_price']) > 0) {
$price_stats .= "<table class='table_price_history table_price_history--$obj_id'>";
if (intval($obj['prep_price']) > 0)
$price_stats .= '<tr><td class="price-stats">Предварительная:</td><td class="price-stats">'. number_format($obj['prep_price'], 0, ',', ' ') .' <span class="rub rub_small">'.$currency.'</span></td></tr>';
if (intval($obj['start_price']) > 0)
$price_stats .= '<tr><td class="price-stats">Начальная:</td><td class="price-stats">'. number_format($obj['start_price'], 0, ',', ' ') .' <span class="rub rub_small">'.$currency.'</span></td></tr>';
if (intval($obj['fact_price']) > 0)
$price_stats .= '<tr><td class="price-stats">Фактическая:</td><td class="price-stats">'. number_format($obj['fact_price'], 0, ',', ' ') .' <span class="rub rub_small">'.$currency.'</span></td></tr>';
$price_stats .= "</table>";
}
$num_rows = 0;
$localObjPriceHistoryArray = [];
if (!isset($objPriceHistoryArray)) {
$objPriceHistoryArray = [];
$sqlPriceHistory="SELECT date_change_price, price, price_ku, object_id FROM objects_price_history WHERE object_id ={$obj['id']}";
$rezPriceHistory=mysql_query($sqlPriceHistory);
while($priceHist = mysql_fetch_assoc($rezPriceHistory)) {
$localObjPriceHistoryArray[] = $priceHist;
$num_rows++;
}
} else {
foreach ($objPriceHistoryArray as $objPriceHistory) {
if ($objPriceHistory['object_id'] == $obj['id']) {
$localObjPriceHistoryArray[] = $objPriceHistory;
$num_rows++;
}
}
}
if ($num_rows > 0 ) {
if (!empty($price_stats))
$price_stats .= '<p>&nbsp;</p>';
$price_stats .= '<p><b>Статистика изменения цены</b></p>';
$price_stats .= "<table class='table_price_history table_price_history--$obj_id'>";
$price_stats .= "<tr><th><p class='price-history'>Дата</p></th><th><p class='price-history'>Цена</p></th></tr>";
foreach ($localObjPriceHistoryArray as $objPriceHistory) {
$price_stats .= "<tr>";
$price_stats .= "<td nowrap>";
$price_stats .= '<p class="price-history">';
$price_stats .= date('d.m.Y', strtotime($objPriceHistory['date_change_price']));
$price_stats .= '</p>';
$price_stats .= "</td>";
$price_stats .= "<td nowrap>";
$price_stats .= '<p class="price-history">';
if ($obj['operation_type'] == 0) {
if ($objPriceHistory['final_sale_price'] == '1') {
$price_stats .= '<b>Аренда:</b> ';
}
if ($objPriceHistory['price_ku'] != 0){
$price_stats .= number_format($objPriceHistory['price'], 0, ',', ' ') . '<span class="rub rub_small">'.$currency.'</span>+ку(' . $objPriceHistory['price_ku'] . ')';
}
else {
$price_stats .= number_format($objPriceHistory['price'], 0, ',', ' ') . '<span class="rub rub_small">'.$currency.'</span>+ку';
}
}
else {
if ($objPriceHistory['final_sale_price'] == '1') {
$price_stats .= '<b>Продажа:</b> ';
}
$price_stats .= number_format($objPriceHistory['price'], 0, ',', ' ') . '<span class="rub rub_small">'.$currency.'</span>';
}
$price_stats .= '</p>';
$price_stats .= "</td>";
$price_stats .= "</tr>";
}
$price_stats .= "</table>";
}
}
if(!empty($commission_stats)){
echo '<table><tr><td rowspan="2" style="width: 25%;">';
} else {
echo '<table><tr><td id="commission_stats_td__' . $obj_id . '" rowspan="2" style="width: 12%;">';
}
if (!empty($price_stats)) {
echo '<div class="source-how" id="ti-info-alt--' . $obj_id . '">';
echo '<div class="source-how__button">';
echo '<i class="ti-info-alt" title=""></i>';
echo '</div>';
echo '<div class="jw__popup source-how__popup">';
echo $price_stats;
echo '</div>';
echo '</div>';
}
if (!empty($commission_stats)) {
echo '<div class="source-how" id="commission_stats_div__' . $obj_id . '">';
echo '<div class="source-how__button">';
echo '<i class="fa fa-percent"></i>';
echo '</div>';
echo '<div class="jw__popup source-how__popup">';
echo $commission_stats;
echo '</div>';
echo '</div>';
}
echo '</td>';
echo '<td>';
echo '<div style="display: flex; align-items: baseline; position: relative;">';
echo "<span class='stoim--$obj_id'>" . number_format($obj['stoim'], 0, ',', ' ') . '</span>';
echo "<span class='rub currency--$obj_id' style='font-size: 23px;'>" . $currency . '</span>';
$sqlP = "SELECT *
FROM `object_prices`
WHERE `object_id`='$obj_id' AND
`agency_id`='$user->agencyId' LIMIT 1";
$queryP = mysql_query($sqlP);
if (mysql_num_rows($queryP) > 0) {
$row = mysql_fetch_assoc($queryP);
$obj['prices']['prep'] = (intval($row['prep_price']) > 0) ? intval($row['prep_price']) : '';
$obj['prices']['start'] = (intval($row['start_price']) > 0) ? intval($row['start_price']) : '';
$obj['prices']['fact'] = (intval($row['fact_price']) > 0) ? intval($row['fact_price']) : '';
$obj['prices']['currency'] = (int)$row['currency'];
$obj['prices']['price_avito'] = (intval($row['price_avito']) > 0) ? intval($row['price_avito']) : '';
}
$obj['stoim_ot'] = $row['price'];
$jsonObj = json_encode($obj);
if (stripos($_SERVER['SCRIPT_NAME'], "/ajax/getAgencyObjects.php") !== false) {
echo "<div class=\"action-button open-edit-price open-edit-price--$obj_id\" data-obj='$jsonObj' title=\"Изменить цену и комиссию\" style=\"height: 16px; line-height: 10px; padding: 5px;\">
<i class=\"fa fa-pencil\" style=\"font-size: 14px; color: gray; position: absolute;\"></i>
</div>";
}
echo '</div>';
echo '</td>';
echo '<td rowspan="2">';
if ($obj['operation_type'] == 0) {
echo '<span' . ($obj['operation_type'] == 1 ? " class='prim'" : "") . '>' . $obj['stoim_prim'] . '</span>';
}
echo '</td>';
echo '</tr>';
echo '<tr><td style="font-size: 15px; padding-top: 4px;">';
echo '<div style="display: flex;">';
if ($obj['type'] == 7) {
if ($obj['land_area'] && $obj['stoim']) {
echo "<span class='land_area--$obj_id'>" . number_format($obj['stoim']/$obj['land_area'], 0, ',', ' ') . '</span>';
echo "<span class='rub currency--$obj_id' style='font-size: 15px;'>" . $currency . '</span>(сотку)';
}
} else {
if ($obj['type'] == 4 && $obj['building_area'] && $obj['stoim']) {
echo "<span class='ploshad--$obj_id'>" . number_format($obj['stoim'] / $obj['building_area'], 0, ',', ' ') . '</span>';
echo "<span class='rub currency--$obj_id' style='font-size: 15px;'>" . $currency . '</span>(м<sup>2</sup>)';
} else {
if ($obj['ploshad'] && $obj['stoim']) {
echo "<span class='ploshad--$obj_id'>" . number_format($obj['stoim'] / $obj['ploshad'], 0, ',', ' ') . '</span>';
echo "<span class='rub currency--$obj_id' style='font-size: 15px;'>" . $currency . '</span>(м<sup>2</sup>)';
}
}
}
echo '</div>';
echo '</td></tr>';
echo '</table>';
?>
</span>
</span>
</td>
<td class="desc_map">
<div class="jw__action-links">
<div class="action-link open_can_map" data-latitude="<?php echo $obj['latitude']; ?>" data-longitude="<?php echo $obj['longitude']; ?>" data-id="<?php echo $obj['id']; ?>">На карте</div>
<div class="action-link edit_opis" data-id="<?php echo $obj['id']; ?>">Описание</div>
<div class="hidden_opis test7" id="block_opis<?php echo $obj['id']; ?>" style="height: auto;">
<div id="opis<?php echo $obj['id']; ?>" style="width:100%;overflow-y:auto;max-height: 160px;"><?php echo $obj['opis']; ?></div>
<button class="fr-btn edit-btn steel save_opis" style="line-height: normal;" data-id="<?php echo $obj['id']; ?>">Закрыть</button>
</div>
</div>
</td>
<td class="user">
<div style="max-height: 40px;overflow: hidden;" title="<?php echo $obj['sobstv'];?>"><?php echo $obj['sobstv'];?></div>
</td>
<td class="phone">
<?php echo $obj['phone'];?>
<?php
if(isset($users_phone2[$obj['id_add_user']])){
echo ' '.$users_phone2[$obj['id_add_user']];
}
?>
</td>
</tr>
</table>
</div>
</div>
<div class="clear"></div>
<div class="hide-info">
<div class="map_object popup_window"></div>
</div>
</div>