335 lines
13 KiB
PHP
335 lines
13 KiB
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT']."/config.php");
|
|||
|
|
|
|||
|
|
$get=clearInputData($_GET);
|
|||
|
|
|
|||
|
|
if ($_GET['ok_auth']) {
|
|||
|
|
$user = new User;
|
|||
|
|
$msg = $user->auth($get);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($get['msg'])
|
|||
|
|
$msg = $get['msg'];
|
|||
|
|
|
|||
|
|
if ($_POST['ok_auth2']) {
|
|||
|
|
$post=clearInputData($_POST);
|
|||
|
|
$user = new User;
|
|||
|
|
$msg2 = $user->check_sms($post);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($_POST['ok_auth3']) {
|
|||
|
|
$post=clearInputData($_POST);
|
|||
|
|
$user = new User;
|
|||
|
|
$msg2 = $user->check_sms($post,1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
require($_SERVER['DOCUMENT_ROOT']."/templates/new-header.php");
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
window.authUser = <?php echo json_encode([ 'id' => $user->id, 'first_name' => $user->first_name, 'last_name' => $user->last_name, 'middle_name' => $user->middle_name, 'email' => $user->email ])?>;
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<div class="content-right">
|
|||
|
|
<div class="inner">
|
|||
|
|
<?php
|
|||
|
|
if ($_SESSION['id']) {
|
|||
|
|
$user = new User;
|
|||
|
|
$user->get($_SESSION['id']);
|
|||
|
|
?>
|
|||
|
|
<div class="main-title">
|
|||
|
|
<h1>Поиск объектов</h1>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
// $sqlForAd = "SELECT id FROM `users` WHERE id = 4 or id = 93 or id = 117 or id = 3455 or id in (SELECT id FROM `users` WHERE newbuildings_access = 1) or id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1) or id_manager in (select id from users where id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1)) or id_manager in (select id from users where id_manager in (select id from users where id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1)))";
|
|||
|
|
// $rezForAd = mysql_query($sqlForAd);
|
|||
|
|
|
|||
|
|
// $sqlForNeedNb = "SELECT id FROM `users` WHERE id = 920 or id_manager = 920 or id_manager in (select id from users where id_manager = 290)";
|
|||
|
|
$sqlForNeedNb = "SELECT COUNT(blocks.id) as count
|
|||
|
|
FROM `blocks`
|
|||
|
|
INNER JOIN regions r on r.id = blocks.region_id
|
|||
|
|
INNER JOIN rf_regions rr on rr.id = r.rf_region_id
|
|||
|
|
WHERE rr.id = $user->region_rf_id
|
|||
|
|
";
|
|||
|
|
$rezForNeedNb = mysql_query($sqlForNeedNb);
|
|||
|
|
|
|||
|
|
// $needNewbuildings = false;
|
|||
|
|
$showNewbuildings = false;
|
|||
|
|
// while($userId=mysql_fetch_assoc($rezForAd)) {
|
|||
|
|
// if ($userId['id'] == $_SESSION['id']) {
|
|||
|
|
// $needNewbuildings = true;
|
|||
|
|
// break;
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
$countResult = mysql_fetch_assoc($rezForNeedNb);
|
|||
|
|
|
|||
|
|
if ($countResult['count'] != '0') {
|
|||
|
|
$showNewbuildings = true;
|
|||
|
|
}
|
|||
|
|
// while($userId=mysql_fetch_assoc($rezForNeedNb)) {
|
|||
|
|
// if ($userId['id'] == $_SESSION['id']) {
|
|||
|
|
// $showNewbuildings = false;
|
|||
|
|
// break;
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
$_GET['operation_type'] = 0;
|
|||
|
|
|
|||
|
|
$agenciesHaveAccessToNewComplexes = [4,12028,12061, 17328, 11325, 13735, 19093, 16378, 19467, 20197, 19909];
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<div class="new">
|
|||
|
|
<!-- WARNING TEXT -->
|
|||
|
|
<!-- <style>
|
|||
|
|
|
|||
|
|
.alert-warning {
|
|||
|
|
color: #8a6d3b;
|
|||
|
|
background-color: #fcf8e3;
|
|||
|
|
border-color: #faebcc;
|
|||
|
|
}
|
|||
|
|
.alert {
|
|||
|
|
padding: 15px;
|
|||
|
|
margin: 10px 0;
|
|||
|
|
border: 1px solid transparent;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
text-align: center;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<div class="alert alert-warning" role="alert">По техническим причинам раздел <b>Новостройки</b> может работать некорректно. <br/> Просим прощения за неудобства.</div> -->
|
|||
|
|
<!-- WARNING TEXT END -->
|
|||
|
|
|
|||
|
|
<div class="jw__page__tabs type__tabs">
|
|||
|
|
<a href="/sale.php" class="tab">
|
|||
|
|
<span>Продажа</span>
|
|||
|
|
</a>
|
|||
|
|
<a href="/main.php" class="tab active">
|
|||
|
|
<span>Аренда</span>
|
|||
|
|
</a>
|
|||
|
|
<!-- <?php //if($user->region_rf_id == 2 || $user->region_rf_id == 1):?> -->
|
|||
|
|
<?php if ($showNewbuildings) { ?>
|
|||
|
|
<a href="/newbuildings.php" class="tab"> <!--добавлял класс <?php // if (!$needNewbuildings) { echo "show-newbuildings-modal"; } ?> -->
|
|||
|
|
<span>Новостройки</span>
|
|||
|
|
</a>
|
|||
|
|
<?php }?>
|
|||
|
|
<?php // endif ?>
|
|||
|
|
<?php if (!$hasRestrictedAccess) {
|
|||
|
|
if (in_array($_SESSION['agency_id'] , $agenciesHaveAccessToNewComplexes) ) {
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<a href="/complexes/#/view" class="tab"> <span>Новостройки компании</span> </a>
|
|||
|
|
<a href="/add-object.php" class="tab tab__new-object" style="padding-left: 35px;">
|
|||
|
|
<i class="ti-plus"></i><span>Новый объект</span>
|
|||
|
|
</a>
|
|||
|
|
<?
|
|||
|
|
}
|
|||
|
|
} else { ?>
|
|||
|
|
<?php if (in_array($_SESSION['agency_id'] , $agenciesHaveAccessToNewComplexes) ) {?>
|
|||
|
|
<span class="tab tooltip tooltip-effect" style="background-color: rgb(235, 235, 228);">
|
|||
|
|
<span class='tooltip-item' style="color: darkgray;border-bottom: none;">Новостройки компании</span>
|
|||
|
|
<em style="font-style: normal;" class="tooltip-content tt-pdf clear"><b class="tooltip-text">Доступно в платной версии</b></em>
|
|||
|
|
</span>
|
|||
|
|
<? }
|
|||
|
|
$db_sphinx = new MysqlPdo(hstsph2, null, null, null, true, '9306');
|
|||
|
|
$sql_count = "SELECT id
|
|||
|
|
FROM objects
|
|||
|
|
WHERE del=0 AND id_add_user = {$user->id}
|
|||
|
|
LIMIT 10 OPTION max_matches=10";
|
|||
|
|
$vsego = $db_sphinx->num_rows($db_sphinx->query($sql_count, true));
|
|||
|
|
if($vsego >= 3){
|
|||
|
|
?>
|
|||
|
|
<a href="javascript:{}" class="tab tab__new-object" onclick="trialperiod.modalObj();" style="padding-left: 35px;">
|
|||
|
|
<i class="ti-plus"></i><span>Новый объект</span>
|
|||
|
|
</a>
|
|||
|
|
<?php
|
|||
|
|
} else {
|
|||
|
|
?>
|
|||
|
|
<a href="/add-object.php" class="tab tab__new-object" style="padding-left: 35px;">
|
|||
|
|
<i class="ti-plus"></i><span>Новый объект</span>
|
|||
|
|
</a>
|
|||
|
|
<?php
|
|||
|
|
}?>
|
|||
|
|
|
|||
|
|
<?} ?>
|
|||
|
|
<a href="/find-objects.php?<?= http_build_query(clearInputData($_GET)) ?>" class="tab">
|
|||
|
|
<span>Поиск на карте</span>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="selector-button button-left operation_type selected" style="display: none;">
|
|||
|
|
<label for="field_op0" class="label-overlay"> </label>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
$isSearch = true;
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT']."/templates/search_form.php");
|
|||
|
|
|
|||
|
|
} else
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<div class="login-reg">
|
|||
|
|
|
|||
|
|
<div class="login-reg_inner">
|
|||
|
|
|
|||
|
|
<div class="main-title">
|
|||
|
|
|
|||
|
|
<h1>Вход</h1>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
if($_GET['phone'] and !$msg)
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<form method="post">
|
|||
|
|
|
|||
|
|
<div class="control-group control-line">
|
|||
|
|
|
|||
|
|
<div class="form-search__main-label">Пароль в смс:</div>
|
|||
|
|
|
|||
|
|
<div class="control-inputs">
|
|||
|
|
|
|||
|
|
<div class="inputs-group">
|
|||
|
|
|
|||
|
|
<input type="text" name="sms" class="text" autofocus style="float:left;">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="phone" value="<?php echo $get['phone']; ?>">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="ok_auth2" value="1">
|
|||
|
|
|
|||
|
|
<button type="submit" class="fr-btn button-fl-left big-button">Вход</button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
} elseif($_GET['phone2'] and !$msg)
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<form method="post">
|
|||
|
|
|
|||
|
|
<div class="control-group control-line" style="margin-bottom: 25px">
|
|||
|
|
|
|||
|
|
<div class="form-search__main-label">Пароль:</div>
|
|||
|
|
|
|||
|
|
<div class="control-inputs">
|
|||
|
|
|
|||
|
|
<div class="inputs-group">
|
|||
|
|
|
|||
|
|
<input type="password" name="pwd" class="text" autofocus style="float:left;">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="phone" value="<?php echo $get['phone2']; ?>">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="ok_auth3" value="1">
|
|||
|
|
|
|||
|
|
<button type="submit" class="fr-btn button-fl-right medium-button">Вход</button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<!--<a href="remind_pass.php">Забыли пароль?</a>-->
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
} else
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<form>
|
|||
|
|
|
|||
|
|
<div class="control-group control-line" style="margin-bottom: 25px">
|
|||
|
|
|
|||
|
|
<div class="form-search__main-label">Телефон:</div>
|
|||
|
|
|
|||
|
|
<div class="control-inputs">
|
|||
|
|
|
|||
|
|
<div class="inputs-group">
|
|||
|
|
|
|||
|
|
<input type="text" name="phone" placeholder="Телефон:" class="text phoneMask" autofocus value="<?php echo $post['phone']; ?>" style="float:left;">
|
|||
|
|
|
|||
|
|
<input type="hidden" name="ok_auth" value="1">
|
|||
|
|
|
|||
|
|
<button type="submit" class="fr-btn button-fl-right medium-button">Далее</button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<a href="reg.php">Регистрация</a>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if($msg or $msg2) echo '<div class="error_msg">'.$msg.$msg2.'</div>';
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="full_modal-bg" id="newbuildings_adv_modal__bg" style="display: none">
|
|||
|
|
<span class="pseudo-link closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="full_modal jw__tele2-modal" id="newbuildings_adv_modal" style="display: none;">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h3 style="color: black;">Доступ к разделу «Новостройки» предоставляется бесплатно.</h3>
|
|||
|
|
<div class="feature" style="margin: auto; width: 80%;">
|
|||
|
|
<ul class="check-list">
|
|||
|
|
<li>Более 70 застройщиков on-line</li>
|
|||
|
|
<li>Фиксированное комиссионное вознаграждение</li>
|
|||
|
|
<li>Мгновенное бронирование квартир у застройщика</li>
|
|||
|
|
<li>Полное информирование по всем акциям строительных компаний</li>
|
|||
|
|
<li>Бесплатный доступ</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div class="tele2-manager">
|
|||
|
|
<h3>Для того, чтобы активировать данный раздел, оставьте заявку по тел. +7 812 765-08-01</h3>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php require($_SERVER['DOCUMENT_ROOT']."/templates/footer.php"); ?>
|