1460 lines
71 KiB
PHP
1460 lines
71 KiB
PHP
|
|
<?php
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|||
|
|
|
|||
|
|
if (!$_SESSION['id']) {
|
|||
|
|
header("location:index.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
$db_sphinx = new MysqlPdo(hstsph2, null, null, null, true, '9306');
|
|||
|
|
if (!isset($_SESSION['adv_list_view']) && !isset($_SESSION['adv_table_view'])) {
|
|||
|
|
$_SESSION['adv_list_view'] = 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unset($_SESSION['filter_partner']);
|
|||
|
|
unset($_SESSION['order']);
|
|||
|
|
unset($_SESSION['of_objects']);
|
|||
|
|
unset($_SESSION['isPartner']);
|
|||
|
|
unset($_SESSION['todayTasks']);
|
|||
|
|
unset($_SESSION['overTasks']);
|
|||
|
|
unset($_SESSION['filter_stage_work']);
|
|||
|
|
unset($_SESSION['filter_stage_hot']);
|
|||
|
|
unset($_SESSION['filter_stage_close']);
|
|||
|
|
unset($_SESSION['filter_stage_hit']);
|
|||
|
|
unset($_SESSION['filter_confirm']);
|
|||
|
|
unset($_SESSION['filter_stage_send']);
|
|||
|
|
unset($_SESSION['filter_work_ahency']);
|
|||
|
|
unset($_SESSION['filter_emp']);
|
|||
|
|
unset($_SESSION['checked']);
|
|||
|
|
|
|||
|
|
$currentUserId = $_SESSION['id'];
|
|||
|
|
|
|||
|
|
$user_view = new User;
|
|||
|
|
$user_view->get($currentUserId);
|
|||
|
|
|
|||
|
|
// if ($user_view->show_all_objects_page == 0) {
|
|||
|
|
// header("location:main.php");
|
|||
|
|
// die("Доступ запрещён!");
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
if (!isset($user_view->agencyId)) {
|
|||
|
|
$user_view->agencyId = $currentUserId;
|
|||
|
|
$user_view->agencyName = $user_view->agency_name;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
require($_SERVER['DOCUMENT_ROOT'] . "/templates/new-header.php");
|
|||
|
|
$users_sp = [];
|
|||
|
|
$depClass = new Department();
|
|||
|
|
//if($_SESSION['id'] == 11632){
|
|||
|
|
$adminDep = false;
|
|||
|
|
$searchUserId = $_SESSION['id'];
|
|||
|
|
$r_check_permissions = $user->checkMenuPermissions();
|
|||
|
|
if ($_SESSION['agency'] || $_SESSION['manager'] || $_SESSION['users_admin'] || $user->agencyId==13154 || $r_check_permissions['menu_ads'] == 1) {
|
|||
|
|
$agentIds = [];
|
|||
|
|
if ($_SESSION['users_admin'] || $_SESSION['agency'] || $user->agencyId==13154) {
|
|||
|
|
$user = new User;
|
|||
|
|
$user->checkPermissions();
|
|||
|
|
$searchUserId = $user->agencyId;
|
|||
|
|
$agentIds[] = $user->agencyId;
|
|||
|
|
} else {
|
|||
|
|
$user = new User;
|
|||
|
|
$user->get((int)$_SESSION['id']);
|
|||
|
|
$dep_user = $depClass->getDepartment((int)$_SESSION['id']);
|
|||
|
|
if ($dep_user['role'] == 'manager_office') {
|
|||
|
|
$searchUserId = $dep_user['admin'];
|
|||
|
|
$adminDep = true;
|
|||
|
|
} else if ($dep_user['role'] == 'manager_office_menager') {
|
|||
|
|
$searchUserId = $user->id_manager;
|
|||
|
|
$adminDep = true;
|
|||
|
|
} else if($dep_user['role'] == 'admin_department'){
|
|||
|
|
$adminDep = true;
|
|||
|
|
} else if($r_check_permissions['menu_ads'] == 1){
|
|||
|
|
$searchUserId = $user->agencyId;
|
|||
|
|
$adminDep = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$agentIds[] = $searchUserId;
|
|||
|
|
$agentsOfAgency = User::getAllAgents($searchUserId);
|
|||
|
|
|
|||
|
|
foreach ($agentsOfAgency as $agent) {
|
|||
|
|
if (!in_array($agent['id'], $agentIds)) {
|
|||
|
|
$agentIds[] = $agent['id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($_SESSION['agency'] || $_SESSION['users_admin'] || $adminDep) {
|
|||
|
|
$agentsOfManager = User::getAllManagers($searchUserId);
|
|||
|
|
foreach ($agentsOfManager as $agent) {
|
|||
|
|
if (!in_array($agent['id'], $agentIds)) {
|
|||
|
|
$agentIds[] = $agent['id'];
|
|||
|
|
}
|
|||
|
|
if((int)$agent['role_id'] > 0 && (int)$agent['department_id'] > 0){
|
|||
|
|
$role_user = $depClass->getRole((int)$agent['role_id']);
|
|||
|
|
if($role_user['role'] == 'admin_department'){
|
|||
|
|
$menagerDep = User::getDepManagers($role_user['department_id']);
|
|||
|
|
foreach($menagerDep as $md){
|
|||
|
|
if(!in_array($md['id'], $agentIds)){
|
|||
|
|
$agentIds[] = $md['id'];
|
|||
|
|
|
|||
|
|
$thisAgents = User::getAgentsOfAgency($md['id'], true);
|
|||
|
|
|
|||
|
|
foreach($thisAgents as $da){
|
|||
|
|
if (!in_array($da['id'], $agentIds)) {
|
|||
|
|
$agentIds[] = $da['id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
$agentIds = isset($user_view) ? [$user_view->id] : [$searchUserId];
|
|||
|
|
$agentIds = array_merge($agentIds, $agentIds);
|
|||
|
|
}
|
|||
|
|
$users_sp = $agentIds;
|
|||
|
|
|
|||
|
|
/*} else {
|
|||
|
|
$agentsOfAgency = User::getAllAgents($user_view->agencyId);
|
|||
|
|
foreach ($agentsOfAgency as $agent) {
|
|||
|
|
if (!in_array($agent['id'], $agentIds)) {
|
|||
|
|
$users_sp[] = $agent['id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$sqlUsers = "SELECT id, role_id, department_id FROM `users`
|
|||
|
|
WHERE id = $user_view->agencyId OR
|
|||
|
|
id_manager = $user_view->agencyId OR
|
|||
|
|
id_manager IN (
|
|||
|
|
SELECT id FROM users
|
|||
|
|
WHERE id_manager = $user_view->agencyId
|
|||
|
|
)";
|
|||
|
|
|
|||
|
|
$rezUsers = mysql_query($sqlUsers);
|
|||
|
|
$rowsUsers = mysql_num_rows($rezUsers);
|
|||
|
|
if ($rowsUsers > 0){
|
|||
|
|
while($row = mysql_fetch_assoc($rezUsers)) {
|
|||
|
|
if(!in_array($row['id'], $users_sp)){
|
|||
|
|
$users_sp[] = $row['id'];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if((int)$row['role_id'] > 0 && (int)$row['department_id'] > 0){
|
|||
|
|
$role_user = $depClass->getRole((int)$row['role_id']);
|
|||
|
|
if($role_user['role'] == 'admin_department'){
|
|||
|
|
$menagerDep = User::getDepManagers($role_user['department_id']);
|
|||
|
|
|
|||
|
|
foreach($menagerDep as $md){
|
|||
|
|
if(!in_array($md['id'], $users_sp)){
|
|||
|
|
$users_sp[] = $md['id'];
|
|||
|
|
}
|
|||
|
|
$thisAgents = User::getAgentsOfAgency($md['id'], true);
|
|||
|
|
|
|||
|
|
foreach($thisAgents as $da){
|
|||
|
|
if (!in_array($da['id'], $users_sp)) {
|
|||
|
|
$users_sp[] = $da['id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}*/
|
|||
|
|
if (empty($users_sp)) {
|
|||
|
|
$users_sp[] = $user_view->agencyId;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//$sql = "SELECT count(id) FROM objects WHERE archive <> 1 and use_in_advert = 0 and id_add_user = $currentUserId";
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 and archive <> 1 and use_in_advert = 1 and id_add_user in (" .implode(',', $users_sp).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_not_archive = $db_sphinx->num_rows($rez);
|
|||
|
|
|
|||
|
|
//$sql = "SELECT count(id) FROM objects WHERE archive = 1 and use_in_advert = 0 and id_add_user = $currentUserId";
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 and archive = 1 and use_in_advert = 1 and id_add_user in (" .implode(',', $users_sp).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_archive = $db_sphinx->num_rows($rez);
|
|||
|
|
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 and operation_type = 1 and use_in_advert = 1 and id_add_user in (" .implode(',', $users_sp).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_sale =$db_sphinx->num_rows($rez);
|
|||
|
|
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 and operation_type = 0 and use_in_advert = 1 and id_add_user in (" .implode(',', $users_sp).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_rent = $db_sphinx->num_rows($rez);
|
|||
|
|
|
|||
|
|
$is_advert_moderation = false;
|
|||
|
|
$can_moderation_user = true;
|
|||
|
|
$object_moderation = array();
|
|||
|
|
$objectsIsModertion = array();
|
|||
|
|
$objectsNoIsModeration = array();
|
|||
|
|
|
|||
|
|
//Предмодерация рекламы по объектам.
|
|||
|
|
$sql_moderation = "SELECT * FROM advert_moderation_agency WHERE agency_id = {$user_view->agencyId}";
|
|||
|
|
|
|||
|
|
|
|||
|
|
$q_moderation = mysql_query($sql_moderation);
|
|||
|
|
if(mysql_num_rows($q_moderation) > 0){
|
|||
|
|
$is_advert_moderation = true;
|
|||
|
|
$moderationClass = new ModerationAdvert();
|
|||
|
|
$object_moderation = $moderationClass->get_object_moderation([], $users_sp, true);
|
|||
|
|
|
|||
|
|
foreach($object_moderation as $om){
|
|||
|
|
if($om['is_moderation'] > 0){
|
|||
|
|
$objectsIsModertion[] = (int)$om['object_id'];
|
|||
|
|
} else {
|
|||
|
|
$objectsNoIsModeration[] = (int)$om['object_id'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// if($user_view->show_all_objects_page == 0){
|
|||
|
|
// $can_moderation_user = false;
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
if(!empty($objectsIsModertion)){
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 AND archive <> 1 and use_in_advert=1 and id_add_user in (" .implode(',', $users_sp).") AND id in (".implode(',', $objectsIsModertion).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_moderation = $db_sphinx->num_rows($rez);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(!empty($objectsNoIsModeration)) {
|
|||
|
|
$sql = "SELECT id FROM objects WHERE del=0 AND archive <> 1 and use_in_advert=1 and id_add_user in (" .implode(',', $users_sp).") AND id in (".implode(',', $objectsNoIsModeration).") LIMIT 1000000 OPTION max_matches=1000000";
|
|||
|
|
|
|||
|
|
$rez = $db_sphinx->query($sql);
|
|||
|
|
$kol_my_obj_no_moderation = $db_sphinx->num_rows($rez);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<style>
|
|||
|
|
|
|||
|
|
.pagination {
|
|||
|
|
display: -ms-flexbox;
|
|||
|
|
display: flex;
|
|||
|
|
padding-left: 0;
|
|||
|
|
list-style: none;
|
|||
|
|
border-radius: .25rem;
|
|||
|
|
}
|
|||
|
|
.page-link {
|
|||
|
|
position: relative;
|
|||
|
|
display: block;
|
|||
|
|
padding: .5rem .75rem;
|
|||
|
|
margin-left: -1px;
|
|||
|
|
line-height: 1.25;
|
|||
|
|
color: rgb(67,160,71);
|
|||
|
|
background-color: #fff;
|
|||
|
|
border: 1px solid #dee2e6 !important;
|
|||
|
|
}
|
|||
|
|
.page-link:hover {
|
|||
|
|
z-index: 2;
|
|||
|
|
|
|||
|
|
text-decoration: underline !important;
|
|||
|
|
color: #4CAF50 !important;
|
|||
|
|
border: 1px solid #4CAF50 !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.page-item.active .page-link {
|
|||
|
|
z-index: 3;
|
|||
|
|
color: #fff;
|
|||
|
|
background-color: #4CAF50;
|
|||
|
|
border-color: #4CAF50;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
.page-item:first-child .page-link {
|
|||
|
|
margin-left: 0;
|
|||
|
|
border-top-left-radius: .25rem;
|
|||
|
|
border-bottom-left-radius: .25rem;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.page-item:last-child .page-link {
|
|||
|
|
border-top-right-radius: .25rem;
|
|||
|
|
border-bottom-right-radius: .25rem;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
.page-item.disabled .page-link {
|
|||
|
|
color: #4CAF50;
|
|||
|
|
pointer-events: none;
|
|||
|
|
|
|||
|
|
cursor: auto;
|
|||
|
|
background-color: #fff;
|
|||
|
|
border-color: #4CAF50;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.fixed-table-pagination{
|
|||
|
|
padding: 7px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<link rel="stylesheet" href="/css/custom-select.css">
|
|||
|
|
<link rel="stylesheet" href="/css/main_cart_object.css">
|
|||
|
|
<div class="content-right">
|
|||
|
|
<div class="inner">
|
|||
|
|
<div class="main-title">
|
|||
|
|
<h1><?php
|
|||
|
|
if (isset($user_view)) {
|
|||
|
|
echo "Объекты " . $user_view->agencyName;
|
|||
|
|
} else {
|
|||
|
|
echo "Объекты";
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</h1>
|
|||
|
|
</div>
|
|||
|
|
<script type="text/javascript" src="/js/vue-multiselect.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/vue-simple-progress.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/vuejs-datepicker.min.js"></script>
|
|||
|
|
<script src="/js/locale/translations/ru.js"></script>
|
|||
|
|
<link rel="stylesheet" href="/css/vue-multiselect.min.css">
|
|||
|
|
<link rel="stylesheet" href="/css/funnel.css?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/css/funnel.css')?>">
|
|||
|
|
<link rel="stylesheet" href="/css/all.min.css">
|
|||
|
|
<script type="text/javascript" src="/js/vue-select.js?v=21"></script>
|
|||
|
|
<link rel="stylesheet" href="/css/vue-select.css?v=21">
|
|||
|
|
|
|||
|
|
|
|||
|
|
<script type="text/javascript" src="/js/ajax-form.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/core.js?t=3"></script>
|
|||
|
|
<script type="text/javascript" src="/js/popup.js?t=4"></script>
|
|||
|
|
<script type="text/javascript" src="/js/fotorama.js"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
setTimeout(function(){
|
|||
|
|
var elem = document.createElement('script');
|
|||
|
|
elem.type = 'text/javascript';
|
|||
|
|
elem.src = 'https://api-maps.yandex.ru/2.1/?load=package.standard&apikey=692f0a05-cb88-4158-88b9-06bc0dc93004&lang=ru_RU';
|
|||
|
|
document.getElementsByTagName('body')[0].appendChild(elem);
|
|||
|
|
}, 1000);
|
|||
|
|
</script>
|
|||
|
|
<div class="crm new">
|
|||
|
|
<div class="crm__filters">
|
|||
|
|
<div class="crm__filters-inner">
|
|||
|
|
<style>#__CLEAR_FILT:before {content:"\e646";}</style>
|
|||
|
|
<div id="__COUNT_FILT_CONT" style="display:none;margin:10px 0 0 35px;">
|
|||
|
|
<div style="display:inline-block;position:relative;min-width:65px;border:1px solid rgb(67,160,71);
|
|||
|
|
color:rgb(67,160,71);cursor:pointer;padding:3px 28px 5px 15px;margin-right:10px;border-radius:3px;font-size:16px;font-weight:500;">
|
|||
|
|
<span id="__COUNT_FILT">1 опция</span>
|
|||
|
|
<i id="__CLEAR_FILT" style="font-size:13px;position:absolute;right:8px;top:8px;font-family: 'themify';speak:none;font-style:normal;
|
|||
|
|
font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;"></i>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="search-filter" style="margin-left: 79px;">
|
|||
|
|
<?php
|
|||
|
|
$search = "";
|
|||
|
|
?>
|
|||
|
|
<input type="text" tabindex="1" value="<?= $search ?>" name="search" placeholder="Фильтр и поиск" class="search-filter__filter" id="search_filter_input" autocomplete="off">
|
|||
|
|
<div class="search-filter__icons">
|
|||
|
|
<i class="ti-search2" title="Искать"></i>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="search-filter jw__page__tabs" style="margin-left: 10px; border-bottom: none;">
|
|||
|
|
<a href="/agency-objects.php" class="tab active-ag <?php if(!$_GET['archive']) echo 'selected'; ?>">
|
|||
|
|
<span>В работе</span>
|
|||
|
|
<?php if ($kol_my_obj_not_archive > 0) { ?>
|
|||
|
|
<i class="jw__tab__counter" id="activeObj"><?php echo $kol_my_obj_not_archive;?></i>
|
|||
|
|
<?php } ?>
|
|||
|
|
</a>
|
|||
|
|
<!--a href="/agency-objects.php?archive=1" class="tab archive-ag <?php if($_GET['archive']) echo 'selected'; ?>">
|
|||
|
|
<span>Архив</span>
|
|||
|
|
<?php /*if ($kol_my_obj_archive > 0) { ?>
|
|||
|
|
<i class="jw__tab__counter" id="archiveObj"><?php echo $kol_my_obj_archive;?></i>
|
|||
|
|
<?php }*/ ?>
|
|||
|
|
</a-->
|
|||
|
|
<?php
|
|||
|
|
if($is_advert_moderation){ ?>
|
|||
|
|
<a href="javascript:{}" class="tab active-ag" id="obj_my_obj_moderation">
|
|||
|
|
<span>Подтверждено</span>
|
|||
|
|
<?php if ($kol_my_obj_moderation > 0) { ?>
|
|||
|
|
<i class="jw__tab__counter"><?php echo $kol_my_obj_moderation;?></i>
|
|||
|
|
<?php } ?>
|
|||
|
|
</a>
|
|||
|
|
<a href="javascript:{}" class="tab active-ag" id="obj_my_obj_no_moderation">
|
|||
|
|
<span>На Модерации</span>
|
|||
|
|
<?php if ($kol_my_obj_no_moderation > 0) { ?>
|
|||
|
|
<i class="jw__tab__counter"><?php echo $kol_my_obj_no_moderation;?></i>
|
|||
|
|
<?php } ?>
|
|||
|
|
</a>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</div>
|
|||
|
|
<div class="view-changer">
|
|||
|
|
<div class="view-adv-list <?=(isset($_SESSION['adv_list_view'])) ? 'active' : ''?>">
|
|||
|
|
<a href="javascript:{}">
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M0,74.672V224h512V74.672H0z M496,208H16V90.672h480V208z" fill="#757575"/></g></g><g><g><path d="M0,288v149.328h512V288H0z M496,421.328H16V304h480V421.328z" fill="#757575"/></g></g></svg>
|
|||
|
|
<span>Список</span>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<div class="view-adv-table <?=(isset($_SESSION['adv_table_view'])) ? 'active' : ''?>">
|
|||
|
|
<a href="javascript:{}">
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M0,74.672V224h512V74.672H0z M496,208H16V90.672h480V208z" fill="#757575"/></g></g><g><g><path d="M0,288v128h128V288H0z M112,400H16v-96h96V400z" fill="#757575"/></g></g><g><g><path d="M192,288v128h128V288H192z M304,400h-96v-96h96V400z" fill="#757575"/></g></g><g><g><path d="M384,288v128h128V288H384z M496,400h-96v-96h96V400z" fill="#757575"/></g></g></svg>
|
|||
|
|
<span>Таблица</span>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="crm__filter-popup" style="width: fit-content;">
|
|||
|
|
<span class="pseudo-link closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="filter-popup-items">
|
|||
|
|
<div class="filter-popup__left">
|
|||
|
|
<div class="filter-popup-type<?= isset($_GET['sale']) ? ' active' : '' ?>" data-id="sale">
|
|||
|
|
<a href="javascript:{};">
|
|||
|
|
<span>Продажа</span>
|
|||
|
|
</a>
|
|||
|
|
<i class="filter_counter" <?= (!$kol_my_obj_sale) ? 'style="display: none"' : ''; ?>><?php echo $kol_my_obj_sale;?></i>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-type<?= isset($_GET['rent']) ? ' active' : '' ?>" data-id="rent">
|
|||
|
|
<a href="javascript:{};">
|
|||
|
|
<span>Аренда</span>
|
|||
|
|
</a>
|
|||
|
|
<i class="filter_counter" <?= (!$kol_my_obj_rent) ? 'style="display: none"' : ''; ?>><?php echo $kol_my_obj_rent;?></i>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup__right">
|
|||
|
|
<div class="filter-popup-header-inputs">
|
|||
|
|
<h3 style="display:inline-flex;">Параметры</h3>
|
|||
|
|
<button class="top-line__button button-fl-right" id="agency-objects_filter_apply" type="button" style="margin-right: 50px;font-size: 14px;font-weight: normal;padding: 5px 13px;margin-top: -3px;">Применить</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<input type="number" id="objects_filter_cena_ot" step="0.01" min="0" max="100" name="objects_filter_cena_ot" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Цена от">
|
|||
|
|
<input type="number" id="objects_filter_cena_do" step="0.01" min="0" max="100" name="objects_filter_cena_do" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Цена до">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
if(isset($_SESSION['filter_emp'])){
|
|||
|
|
$filter_emp = $_SESSION['filter_emp'];
|
|||
|
|
}
|
|||
|
|
$id_select = 'filter_emp';
|
|||
|
|
$id_select_input = 'crm_filter_emp';
|
|||
|
|
|
|||
|
|
$showBlocked = true;
|
|||
|
|
require($_SERVER['DOCUMENT_ROOT']."/templates/filter_emp.php");
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<?php
|
|||
|
|
$arr_type = array();
|
|||
|
|
if (isset($_GET['id_agent']))
|
|||
|
|
unset($_SESSION['filter_client_objects_type']);
|
|||
|
|
if (isset($_SESSION['filter_client_objects_type'])) {
|
|||
|
|
$arr_type = json_decode(html_entity_decode($_SESSION['filter_client_objects_type']), ENT_QUOTES);
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<select id="filter-ads-objects-type" multiple>
|
|||
|
|
<option data-op="1" value="Квартиры" <?= in_array('Квартиры', $arr_type) ? 'selected' : '' ?>>Квартиры</option>
|
|||
|
|
<option data-op="16" value="Студия" <?= in_array('Студия', $arr_type) ? 'selected' : '' ?>>Студия</option>
|
|||
|
|
<option data-op="11" value="Комната" <?= in_array('Комната', $arr_type) ? 'selected' : '' ?>>Комната</option>
|
|||
|
|
<option data-op="12" value="Дом" <?= in_array('Дом', $arr_type) ? 'selected' : '' ?>>Дом</option>
|
|||
|
|
<option data-op="13" value="Помещение" <?= in_array('Помещение', $arr_type) ? 'selected' : '' ?>>Помещение</option>
|
|||
|
|
<option data-op="14" value="Часть__дома" <?= in_array('Часть__дома', $arr_type) ? 'selected' : '' ?>>Часть дома</option>
|
|||
|
|
<option data-op="15" value="Комплекс__домов" <?= in_array('Комплекс__домов', $arr_type) ? 'selected' : '' ?>>Комплекс домов</option>
|
|||
|
|
<option data-op="16" value="Участок" <?= in_array('Участок', $arr_type) ? 'selected' : '' ?>>Участок</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<select id="filter-object-activities" multiple="">
|
|||
|
|
<?php
|
|||
|
|
$arr_activities = array();
|
|||
|
|
if (isset($_GET['id_agent']))
|
|||
|
|
unset($_SESSION['filter_activities']);
|
|||
|
|
|
|||
|
|
if (isset($_SESSION['filter_activities'])) {
|
|||
|
|
$arr_activities = json_decode(html_entity_decode($_SESSION['filter_activities']), ENT_QUOTES);
|
|||
|
|
}
|
|||
|
|
$sql_adv = "SELECT * FROM `activities` WHERE `user_id` = '".$user->id."' OR `manager_id` = '".$user->id."'";
|
|||
|
|
if ($user->id_manager)
|
|||
|
|
$sql_adv .= " OR `manager_id` = '".$user->id_manager."' OR `user_id` = '".$user->id_manager."'";
|
|||
|
|
|
|||
|
|
if ($user->agencyId)
|
|||
|
|
$sql_adv .= " OR `manager_id` = '".$user->agencyId."' OR `user_id` = '".$user->agencyId."'";
|
|||
|
|
|
|||
|
|
$sql_adv .= ' ORDER BY `name`';
|
|||
|
|
$q_adv = mysql_query($sql_adv);
|
|||
|
|
$rows_adv = mysql_num_rows($q_adv);
|
|||
|
|
if ($rows_adv > 0) {
|
|||
|
|
while ($r_adv = mysql_fetch_assoc($q_adv)) { ?>
|
|||
|
|
<option value="<?= $r_adv['id']; ?>"<?= in_array($r_adv['id'], $arr_activities) ? ' selected' : ''; ?>>
|
|||
|
|
<?= $r_adv['name']; ?>
|
|||
|
|
</option>
|
|||
|
|
<?php }
|
|||
|
|
} ?>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-input" id="filter-object-deal-type-container" style="display: none;">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<select id="filter-object-deal-type" multiple="">
|
|||
|
|
<?php
|
|||
|
|
$sql="SELECT * FROM deal_type ORDER BY name";
|
|||
|
|
$rez=mysql_query($sql);
|
|||
|
|
while($dealType=mysql_fetch_assoc($rez))
|
|||
|
|
{
|
|||
|
|
if((isset($post) && $post['deal_type'] == $dealType['id']) || (isset($obj) && $obj['deal_type'] == $dealType['id'])) $sl = "selected"; else $sl = "";
|
|||
|
|
echo "<option value='$dealType[id]' $sl>$dealType[name]</option>";
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<input type="number" id="objects_filter_commission" step="0.01" min="0" max="100" name="objects_filter_commission" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Комиссия от">
|
|||
|
|
<input type="number" id="objects_filter_commission_to" step="0.01" min="0" max="100" name="objects_filter_commission_to" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Комиссия до">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-input filter-ads-komnat">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<input type="number" id="objects_filter_komnat_from" step="1" min="0" max="100" name="objects_filter_komnat_from" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Комнат от">
|
|||
|
|
<input type="number" id="objects_filter_komnat_to" step="1" min="0" max="100" name="objects_filter_komnat_to" style="width: 179px; height: 18px; font-size: 18px; padding: 9px;" class="text medium-input no-mrg-left" placeholder="Комнат до">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="client_fields_filtr" class="hidden">
|
|||
|
|
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
|
|||
|
|
<div class="checkbox">
|
|||
|
|
<input @change="checkFields" name="is_contract" v-model="filtr.is_contract" id="is_contract" type="checkbox">
|
|||
|
|
<label for="is_contract">Договоры</label>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div v-show="filtr.is_contract">
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<v-select :components="{OpenIndicator}" @input="checkFields" :placeholder="'Тип договора'" v-model="filtr.type_contract" transition="" class="vue_select" :options="types_contract" :reduce="type => type.code" multiple label="type" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<input @change="checkFields" type="text" style="width: 382px; height: 18px; font-size: 18px; padding: 9px;" v-model.trim="filtr.numder_contract" class="text medium-input no-mrg-left" placeholder="Номер договора">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="filter-popup-type" style="padding: 0px;">
|
|||
|
|
<p>Период окончания договора</p>
|
|||
|
|
<div id="dates_contract_client" style="padding: 10px 5px 10px;">
|
|||
|
|
От <input style="width:100px" type="text" id="contractClientOnDate" class="text datepicker-filter" value="">
|
|||
|
|
по <input style="width:100px" type="text" id="contractClientOffDate" class="text datepicker-filter" value="">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="filter-popup-input">
|
|||
|
|
<div class="crm__filter-input">
|
|||
|
|
<?php
|
|||
|
|
$arr_state = array();
|
|||
|
|
if (isset($_SESSION['filter_ads_state'])) {
|
|||
|
|
$arr_state = json_decode(html_entity_decode($_SESSION['filter_ads_state']), ENT_QUOTES);
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<select id="filter-ads-status" multiple>
|
|||
|
|
<option data-op="1" value="1" <?= in_array('1', $arr_state) ? 'selected' : '' ?>>Не размещается</option>
|
|||
|
|
<option data-op="2" value="2" <?= in_array('2', $arr_state) ? 'selected' : '' ?>>Отправлен</option>
|
|||
|
|
<option data-op="3" value="3" <?= in_array('3', $arr_state) ? 'selected' : '' ?>>С ошибками</option>
|
|||
|
|
<option data-op="4" value="4" <?= in_array('4', $arr_state) ? 'selected' : '' ?>>Размещается</option>
|
|||
|
|
<option data-op="5" value="5" <?= in_array('5', $arr_state) ? 'selected' : '' ?>>Снято с размещения</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div style="display:flex;margin-bottom:10px;">
|
|||
|
|
<div id="___b" class="___1" data-active="0">
|
|||
|
|
<p>С отчетами</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="___1" id="filter_is_promotion" onclick="showSearchPromotionModal(1);">
|
|||
|
|
<p>Продвижение</p>
|
|||
|
|
</div>
|
|||
|
|
<div id="___c" class="___1" data-active="0">
|
|||
|
|
<p>Бесплатные</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="object-content__sub-actions jw__object" style="box-shadow: none;margin-bottom: 10px;">
|
|||
|
|
<table>
|
|||
|
|
<tbody>
|
|||
|
|
<tr>
|
|||
|
|
<td style="padding-bottom: 10px;">
|
|||
|
|
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
|
|||
|
|
<div class="action-button actionJW actionAdvButton addToAvito " id="addToAvitoFilter1">
|
|||
|
|
<img class="bBnru" src="/images/avito.svg">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td style="padding-bottom: 10px;">
|
|||
|
|
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
|
|||
|
|
<div class="action-button actionJW actionAdvButton addToCian" id="addToCianFilter1">
|
|||
|
|
<img class="bRealCian" src="/images/cian.png">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td style="padding-bottom: 10px;">
|
|||
|
|
<div id="___d" class="___1" data-active="0">
|
|||
|
|
<p>Пакеты</p>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
|
|||
|
|
<div class="action-button actionJW actionAdvButton addToDomClick" id="addToDomClickFilter1">
|
|||
|
|
<img class="bBnru" style="top: 5px;" src="/images/domcl.jpg" data-id="1633381">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
|
|||
|
|
<div class="action-button actionJW actionAdvButton addToEMLS" id="addToEMLSFilter1">
|
|||
|
|
<img class="bCian" src="/images/jcat.png">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<div class="jw__action-button with-check" style="width: 112px; text-align: center;">
|
|||
|
|
<div class="action-button actionJW actionAdvButton addToBn" id="addToYandexFilter1">
|
|||
|
|
<img class="bBnru" src="/images/yandex.png">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
<!--<div id="___a" class="___1" data-active="0">
|
|||
|
|
<p>Не рекламируется</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="___1" id="filter-ads-errors" data-active="0" style="margin-top:10px;">
|
|||
|
|
<p>С ошибкой размещения</p>
|
|||
|
|
</div>-->
|
|||
|
|
<?php
|
|||
|
|
$agency_id = User::getUserAgencyID($_SESSION['id']);
|
|||
|
|
$sql_fields = "SELECT count(*) as `count` FROM `object_fields` WHERE `agency_id`='$agency_id' AND `type` IN (1, 2, 3, 4) AND `is_active`=1 AND `is_filtrable`=1";
|
|||
|
|
if ((int)mysql_fetch_assoc(mysql_query($sql_fields))['count'] > 0) : ?>
|
|||
|
|
<div>
|
|||
|
|
<div class="___1" id="filter-object-fields" data-active="<?= (isset($_SESSION['filter_object_fields'])) ? "1" : "0" ?>" style="margin-top:10px;float:left;">
|
|||
|
|
<p>Дополнительные поля</p>
|
|||
|
|
</div>
|
|||
|
|
<a href="javascript:{};" id="filter-object-fields-reset" class="fl-right no-border" style="<?= (isset($_SESSION['filter_object_fields'])) ? "display:inline-block;" : "display:none;" ?>padding:6px 8px;margin-top:11px;margin-left:5px;">
|
|||
|
|
<i class="ti-close"></i></span>
|
|||
|
|
</a>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<?php endif; ?>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="jw__objects jw__objects_for_progress-bar"></div>
|
|||
|
|
</div>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
// if(localStorage['edit_object_prev_url'] == 0){
|
|||
|
|
$('#filter-ads-objects-type').fastselect({
|
|||
|
|
placeholder: 'Тип недвижимости',
|
|||
|
|
onItemSelect: function(){
|
|||
|
|
checkType();
|
|||
|
|
},
|
|||
|
|
onItemDelete: function(){
|
|||
|
|
checkType();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
$('#filter-ads-status').fastselect({
|
|||
|
|
placeholder: 'Рекламный статус'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#filter-object-deal-type').fastselect({
|
|||
|
|
placeholder: 'Тип сделки'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function checkType() {
|
|||
|
|
if ($('#filter-ads-objects-type') && $('#filter-ads-objects-type').val()) {
|
|||
|
|
$val = $('#filter-ads-objects-type').val();
|
|||
|
|
if ($val.indexOf('Квартиры') >= 0) {
|
|||
|
|
$('.filter-ads-komnat').show();
|
|||
|
|
} else {
|
|||
|
|
$('.filter-ads-komnat').hide();
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
$('.filter-ads-komnat').hide();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
checkType();
|
|||
|
|
|
|||
|
|
$(".jw__small-popup").click(function () {
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__" + id)
|
|||
|
|
.toggleClass("show");
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var q__1 = 0;
|
|||
|
|
var q__2 = 0;
|
|||
|
|
var q__3 = 0;
|
|||
|
|
var q__002 = 0;
|
|||
|
|
var q__003 = 0;
|
|||
|
|
$('#___a').click(function () {
|
|||
|
|
if ($('#___a').attr('data-active') == 0) {
|
|||
|
|
$('#___a').attr('data-active', 1);
|
|||
|
|
q__002 = 1;
|
|||
|
|
} else {
|
|||
|
|
$('#___a').attr('data-active', 0);
|
|||
|
|
q__002 = 0;
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#addToAvitoFilter1').click(function () {
|
|||
|
|
if ($('#addToAvitoFilter1').hasClass('active')) {
|
|||
|
|
$('#addToAvitoFilter1').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('#addToAvitoFilter1').addClass('active');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('#addToCianFilter1').click(function () {
|
|||
|
|
if ($('#addToCianFilter1').hasClass('active')) {
|
|||
|
|
$('#addToCianFilter1').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('#addToCianFilter1').addClass('active');
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#addToDomClickFilter1').click(function () {
|
|||
|
|
if ($('#addToDomClickFilter1').hasClass('active')) {
|
|||
|
|
$('#addToDomClickFilter1').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('#addToDomClickFilter1').addClass('active');
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#addToEMLSFilter1').click(function () {
|
|||
|
|
if ($('#addToEMLSFilter1').hasClass('active')) {
|
|||
|
|
$('#addToEMLSFilter1').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('#addToEMLSFilter1').addClass('active');
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#addToYandexFilter1').click(function () {
|
|||
|
|
if ($('#addToYandexFilter1').hasClass('active')) {
|
|||
|
|
$('#addToYandexFilter1').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('#addToYandexFilter1').addClass('active');
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#filter-ads-errors').click(function () {
|
|||
|
|
if ($('#filter-ads-errors').attr('data-active') == 0) {
|
|||
|
|
$('#filter-ads-errors').attr('data-active', 1);
|
|||
|
|
q__003 = 1;
|
|||
|
|
} else {
|
|||
|
|
$('#filter-ads-errors').attr('data-active', 0);
|
|||
|
|
q__003 = 0;
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#filter-object-fields').click(function () {
|
|||
|
|
showObjectFieldsSearchModal('agency-objects');
|
|||
|
|
});
|
|||
|
|
$('#filter-object-fields-reset').click(function () {
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/ajax/unsetObjectFieldsFilter.php',
|
|||
|
|
method: "get",
|
|||
|
|
success:function() {
|
|||
|
|
$('.crm__filters #filter-object-fields').attr('data-active', 0);
|
|||
|
|
$('.crm__filters #filter-object-fields-reset').css('display', 'none');
|
|||
|
|
q__001();
|
|||
|
|
},
|
|||
|
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
|||
|
|
console.log("eRROR: " + errorThrown + "; status:" + textStatus);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
$('#___b').click(function () {
|
|||
|
|
if ($('#___b').attr('data-active') == 0) {
|
|||
|
|
$('#___b').attr('data-active', 1);
|
|||
|
|
q__1 = 1;
|
|||
|
|
} else {
|
|||
|
|
$('#___b').attr('data-active', 0);
|
|||
|
|
q__1 = 0;
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#___c').click(function () {
|
|||
|
|
if ($('#___c').attr('data-active') == 0) {
|
|||
|
|
$('#___c').attr('data-active', 1);
|
|||
|
|
q__2 = 1;
|
|||
|
|
} else {
|
|||
|
|
$('#___c').attr('data-active', 0);
|
|||
|
|
q__2 = 0;
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
$('#___d').click(function () {
|
|||
|
|
if ($('#___d').attr('data-active') == 0) {
|
|||
|
|
$('#___d').attr('data-active', 1);
|
|||
|
|
q__3 = 1;
|
|||
|
|
} else {
|
|||
|
|
$('#___d').attr('data-active', 0);
|
|||
|
|
q__3 = 0;
|
|||
|
|
}
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#__CLEAR_FILT').click(function () {
|
|||
|
|
q__1 = 0;
|
|||
|
|
q__2 = 0;
|
|||
|
|
q__002 = 0;
|
|||
|
|
q__003 = 0;
|
|||
|
|
$('#___a').attr('data-active', 0);
|
|||
|
|
$('#filter-ads-errors').attr('data-active', 0);
|
|||
|
|
$('#___b').attr('data-active', 0);
|
|||
|
|
$('#___c').attr('data-active', 0);
|
|||
|
|
$('#___d').attr('data-active', 0);
|
|||
|
|
$('#objects_filter_cena_ot').val('');
|
|||
|
|
$('#objects_filter_cena_do').val('');
|
|||
|
|
$('#objects_filter_commission').val('');
|
|||
|
|
$('#objects_filter_commission_to').val('');
|
|||
|
|
$('#objects_filter_komnat_from').val('');
|
|||
|
|
$('#objects_filter_komnat_to').val('');
|
|||
|
|
$('.filter-obj-komnat').hide();
|
|||
|
|
|
|||
|
|
if ($('#filter-object-fields').attr('data-active') == 1) {
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/ajax/unsetObjectFieldsFilter.php',
|
|||
|
|
method: "get",
|
|||
|
|
success:function() {
|
|||
|
|
$('.crm__filters #filter-object-fields').attr('data-active', 0);
|
|||
|
|
$('.crm__filters #filter-object-fields-reset').css('display', 'none');
|
|||
|
|
},
|
|||
|
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
|||
|
|
console.log("eRROR: " + errorThrown + "; status:" + textStatus);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[0]) {
|
|||
|
|
var __a = $('.crm__filter-popup .filter-popup-input .fstControls')[0].children.length - 1;
|
|||
|
|
for (var i = 0; i < __a; i++) {
|
|||
|
|
$('.crm__filter-popup .filter-popup-input .fstControls ')[0].children[0].children[0].click();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[1]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[1].children.length - 1;
|
|||
|
|
for (var i = 0; i < __b; i++) {
|
|||
|
|
$('.crm__filter-popup .filter-popup-input .fstControls ')[1].children[0].children[0].click();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[2]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[2].children.length - 1;
|
|||
|
|
for (var i = 0; i < __b; i++) {
|
|||
|
|
$('.crm__filter-popup .filter-popup-input .fstControls ')[2].children[0].children[0].click();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[3]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[3].children.length - 1;
|
|||
|
|
for (var i = 0; i < __b; i++) {
|
|||
|
|
$('.crm__filter-popup .filter-popup-input .fstControls ')[3].children[0].children[0].click();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[4]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[4].children.length - 1;
|
|||
|
|
for (var i = 0; i < __b; i++) {
|
|||
|
|
$('.crm__filter-popup .filter-popup-input .fstControls ')[4].children[0].children[0].click();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .object-content__sub-actions td > div > div')) {
|
|||
|
|
var __e = $('.crm__filter-popup .object-content__sub-actions td > div > div');
|
|||
|
|
for (var i = 0; i < __e.length; i++) {
|
|||
|
|
__e[i].classList.remove("active");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('.search-filter .ti-search2').click(function () {
|
|||
|
|
q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function checkDealType() {
|
|||
|
|
$('.crm__filters .crm__filter-popup .filter-popup__left .filter-popup-type').each(function() {
|
|||
|
|
if($(this).attr("data-id") == 'sale') {
|
|||
|
|
if ($(this).hasClass('active')) {
|
|||
|
|
$('#filter-object-deal-type-container').show();
|
|||
|
|
} else {
|
|||
|
|
$('#filter-object-deal-type-container').hide();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$('.crm__filters .crm__filter-popup .filter-popup__left .filter-popup-type a').click(function () {
|
|||
|
|
|
|||
|
|
if ($(this).parent('.filter-popup-type').hasClass('active')) {
|
|||
|
|
$(this).parent('.filter-popup-type').removeClass('active');
|
|||
|
|
} else {
|
|||
|
|
$('.crm__filters .crm__filter-popup .filter-popup__left .filter-popup-type').removeClass('active');
|
|||
|
|
$(this).parent('.filter-popup-type').addClass('active');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
checkDealType();
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// $("body").keypress(function (e) {
|
|||
|
|
// if (e.keyCode === 13) {
|
|||
|
|
// q__001();
|
|||
|
|
// if ($('.crm__filters .crm__filter-popup .ti-close')) {
|
|||
|
|
// $('.crm__filters .crm__filter-popup .ti-close').click();
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// });
|
|||
|
|
$("body").on("click", "#agency-objects_filter_apply", function() {
|
|||
|
|
q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on("click", ".view-adv-list", function() {
|
|||
|
|
$(this).addClass('active');
|
|||
|
|
$('.view-adv-table').removeClass('active');
|
|||
|
|
q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("body").on("click", ".view-adv-table", function() {
|
|||
|
|
$(this).addClass('active');
|
|||
|
|
$('.view-adv-list').removeClass('active');
|
|||
|
|
q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', 'select[name=adv_objects_sort_order]', function(){
|
|||
|
|
let page = $('table .pagination li.active').text();
|
|||
|
|
q__001(page);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_commission', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_cena_ot', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_cena_do', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_commission_to', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_komnat_from', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("body").on('change', '#objects_filter_komnat_to', function(){
|
|||
|
|
// q__001();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
checkDealType();
|
|||
|
|
q__001();
|
|||
|
|
|
|||
|
|
function getParamsStorage(){
|
|||
|
|
//console.log(localStorage['agency_objects_params']);
|
|||
|
|
|
|||
|
|
var paramsLocal = JSON.parse(localStorage['agency_objects_params']);
|
|||
|
|
//console.log(JSON.parse(paramsLocal.filter_employee));
|
|||
|
|
//var filter_employee = JSON.parse(paramsLocal.filter_employee);
|
|||
|
|
if(!isEmpty(paramsLocal.filter_employee)){
|
|||
|
|
$('#filter_emp').fastselect().data('fastselect').destroy();
|
|||
|
|
$('#filter_emp').val(JSON.parse(paramsLocal.filter_employee));
|
|||
|
|
$('#filter_emp').fastselect({
|
|||
|
|
placeholder: 'Ответственный',
|
|||
|
|
onItemCreate: function(item, model) {
|
|||
|
|
if ($('#filter_emp').find('option[value=' + model.value + ']').hasClass('bolt')) {
|
|||
|
|
$(item).addClass('bolt');
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
onItemSelect: function() {
|
|||
|
|
show_options_search();
|
|||
|
|
page_kanban = 1;
|
|||
|
|
add_knban = true;
|
|||
|
|
//get_list();
|
|||
|
|
},
|
|||
|
|
onItemDelete: function() {
|
|||
|
|
show_options_search();
|
|||
|
|
page_kanban = 1;
|
|||
|
|
add_knban = true;
|
|||
|
|
//get_list();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
$('#objects_filter_cena_ot').val(paramsLocal.filter_cena_ot);
|
|||
|
|
$('#objects_filter_cena_do').val(paramsLocal.filter_cena_do);
|
|||
|
|
if(!isEmpty(paramsLocal.filter_type)){
|
|||
|
|
$("#filter-ads-objects-type").fastselect().data('fastselect').destroy();
|
|||
|
|
$("#filter-ads-objects-type").val(JSON.parse(paramsLocal.filter_type));
|
|||
|
|
$('#filter-ads-objects-type').fastselect({
|
|||
|
|
placeholder: 'Тип недвижимости',
|
|||
|
|
onItemSelect: function(){
|
|||
|
|
checkType();
|
|||
|
|
},
|
|||
|
|
onItemDelete: function(){
|
|||
|
|
checkType();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(!isEmpty(paramsLocal.filter_activities)){
|
|||
|
|
$("#filter-object-activities").fastselect().data('fastselect').destroy();
|
|||
|
|
$("#filter-object-activities").val(JSON.parse(paramsLocal.filter_activities));
|
|||
|
|
$('#filter-object-activities').fastselect({
|
|||
|
|
placeholder: 'Теги',
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$('#objects_filter_commission').val(paramsLocal.filter_commission);
|
|||
|
|
$('#objects_filter_commission_to').val(paramsLocal.filter_commission_to);
|
|||
|
|
|
|||
|
|
if(!isEmpty(paramsLocal.param6)){
|
|||
|
|
$("#filter-ads-status").fastselect().data('fastselect').destroy();
|
|||
|
|
$("#filter-ads-status").val(JSON.parse(paramsLocal.param6));
|
|||
|
|
$('#filter-ads-status').fastselect({
|
|||
|
|
placeholder: 'Рекламный статус'
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(paramsLocal.param3){
|
|||
|
|
$('#___b').attr('data-active', paramsLocal.param3);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(paramsLocal.param4){
|
|||
|
|
$('#___c').attr('data-active', paramsLocal.param4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(paramsLocal.param7) {
|
|||
|
|
$('#___d').attr('data-active', paramsLocal.param7);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(paramsLocal.avito > 0) ($('#addToAvitoFilter1').addClass('active'));
|
|||
|
|
if(paramsLocal.cian > 0) ($('#addToCianFilter1').addClass('active'));
|
|||
|
|
if(paramsLocal.domclick > 0) ($('#addToDomClickFilter1').addClass('active'));
|
|||
|
|
if(paramsLocal.emls > 0) ($('#addToEMLSFilter1').addClass('active'));
|
|||
|
|
if(paramsLocal.yandex > 0) ($('#addToYandexFilter1').addClass('active'));
|
|||
|
|
|
|||
|
|
checkType();
|
|||
|
|
localStorage['edit_object_prev_url'] = 0;
|
|||
|
|
show_options_search();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
function q__001(page) {
|
|||
|
|
|
|||
|
|
if(localStorage['edit_object_prev_url'] == 'add-object'){
|
|||
|
|
getParamsStorage();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var sort = getSort();
|
|||
|
|
|
|||
|
|
$('.content-right .inner .jw__objects').html('<div class="object-content__preloader"><img src="../images/rocket-spinner.svg" width="96px"></div>');
|
|||
|
|
$('.content-right .inner .jw__objects .object-content__preloader').css({
|
|||
|
|
"position": "absolute",
|
|||
|
|
"text-align": "center",
|
|||
|
|
"top": "50%",
|
|||
|
|
"left": "50%",
|
|||
|
|
"margin-top": "-48px",
|
|||
|
|
"margin-left": "-48px"
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var param8 = 1;
|
|||
|
|
var param9 = 0;
|
|||
|
|
|
|||
|
|
if($('.view-adv-table.active').length > 0){
|
|||
|
|
param8 = 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if($('.archive-ag.selected').length > 0){
|
|||
|
|
param9 = 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var filter_employee = '';
|
|||
|
|
var param2 = '';
|
|||
|
|
var param5 = 0;
|
|||
|
|
var filter_type = '';
|
|||
|
|
|
|||
|
|
if ($('#filter_emp').val() !== null && $('#filter_emp').val() != '')
|
|||
|
|
filter_employee = JSON.stringify($('#filter_emp').val());
|
|||
|
|
|
|||
|
|
if ($('#filter-ads-objects-type').val() !== null && $('#filter-ads-objects-type').val() != '')
|
|||
|
|
filter_type = JSON.stringify($('#filter-ads-objects-type').val());
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[1]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[1].children;
|
|||
|
|
for (var i = 0; i < __b.length - 1; i++) {
|
|||
|
|
param2 += __b[i].dataset.value + '-';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .object-content__sub-actions td > div > div')) {
|
|||
|
|
var __e = $('.crm__filter-popup .object-content__sub-actions td > div > div');
|
|||
|
|
for (var i = 0; i < __e.length; i++) {
|
|||
|
|
for (var j = 0; j < __e[i].classList.length; j++) {
|
|||
|
|
if (__e[i].classList[j] === 'active') {
|
|||
|
|
param5 += Math.pow(2, i);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var param3 = q__1;
|
|||
|
|
var param4 = q__2;
|
|||
|
|
var param7 = q__3;
|
|||
|
|
var param6 = q__002;
|
|||
|
|
var param11 = q__003;
|
|||
|
|
|
|||
|
|
var param10 = '';
|
|||
|
|
$('.crm__filters .crm__filter-popup .filter-popup__left .filter-popup-type').each(function() {
|
|||
|
|
if($(this).hasClass('active')) {
|
|||
|
|
param10 = $(this).attr('data-id');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var activities = '';
|
|||
|
|
if ($('#filter-object-activities').val() !== null && $('#filter-object-activities').val() != '') {
|
|||
|
|
activities = JSON.stringify($('#filter-object-activities').val());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var dealTypes = '';
|
|||
|
|
if (param10 && param10 == 'sale') {
|
|||
|
|
if ($('#filter-object-deal-type').val() !== null && $('#filter-object-deal-type').val() != '') {
|
|||
|
|
dealTypes = JSON.stringify($('#filter-object-deal-type').val());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var commission = '';
|
|||
|
|
if ($('#objects_filter_commission').val() !== null && $('#objects_filter_commission').val() != '') {
|
|||
|
|
commission = $('#objects_filter_commission').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var cena_ot = '';
|
|||
|
|
if ($('#objects_filter_cena_ot').val() !== null && $('#objects_filter_cena_ot').val() != '') {
|
|||
|
|
cena_ot = $('#objects_filter_cena_ot').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var cena_do = '';
|
|||
|
|
if ($('#objects_filter_cena_do').val() !== null && $('#objects_filter_cena_do').val() != '') {
|
|||
|
|
cena_do = $('#objects_filter_cena_do').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var commissionTo = '';
|
|||
|
|
if ($('#objects_filter_commission_to').val() !== null && $('#objects_filter_commission_to').val() != '') {
|
|||
|
|
commissionTo = $('#objects_filter_commission_to').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var komnatFrom = '';
|
|||
|
|
if ($('#objects_filter_komnat_from').val() !== null && $('#objects_filter_komnat_from').val() != '') {
|
|||
|
|
komnatFrom = $('#objects_filter_komnat_from').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var komnatTo = '';
|
|||
|
|
if ($('#objects_filter_komnat_to').val() !== null && $('#objects_filter_komnat_to').val() != '') {
|
|||
|
|
komnatTo = $('#objects_filter_komnat_to').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var is_moderation = 0;
|
|||
|
|
if($('#obj_my_obj_moderation').hasClass('selected')){
|
|||
|
|
is_moderation = 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if($('#obj_my_obj_no_moderation').hasClass('selected')){
|
|||
|
|
is_moderation = 2;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
console.log(filter_employee);
|
|||
|
|
|
|||
|
|
var states = [];
|
|||
|
|
if ($('#filter-ads-status').val() !== null && $('#filter-ads-status').val() != '') {
|
|||
|
|
states = $('#filter-ads-status').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var params = {
|
|||
|
|
filter_employee: filter_employee, // ответственный
|
|||
|
|
param2: param2, // тип
|
|||
|
|
filter_type: filter_type, //тип
|
|||
|
|
param3: param3, // с отчётами
|
|||
|
|
param4: param4, // Бесплатные
|
|||
|
|
param5: param5, // кнопки
|
|||
|
|
avito: ($('#addToAvitoFilter1').hasClass('active')) ? 1 : 0,
|
|||
|
|
cian: ($('#addToCianFilter1').hasClass('active')) ? 1 : 0,
|
|||
|
|
domclick: ($('#addToDomClickFilter1').hasClass('active')) ? 1 : 0,
|
|||
|
|
emls: ($('#addToEMLSFilter1').hasClass('active')) ? 1 : 0,
|
|||
|
|
yandex: ($('#addToYandexFilter1').hasClass('active')) ? 1 : 0,
|
|||
|
|
|
|||
|
|
param6: states.includes('1') ? 1 : 0, // не рекламируется
|
|||
|
|
param7: param7, // пакеты
|
|||
|
|
param8: param8, // 1 - список, 0 - таблица
|
|||
|
|
param9: param9, // 1 - архивные, 0 - активные
|
|||
|
|
param10: param10, // 'sale' - продажа, 'rent' - аренда
|
|||
|
|
param11: states.includes('3') ? 1 : 0, // с ошибкой размещения
|
|||
|
|
param12: states.includes('2') ? 1 : 0, // отправлен
|
|||
|
|
param13: states.includes('4') ? 1 : 0, // размещается
|
|||
|
|
param14: states.includes('5') ? 1 : 0, // снято с размещения
|
|||
|
|
filter_activities: activities, // теги объекта
|
|||
|
|
filter_commission: commission, // комиссия от
|
|||
|
|
filter_commission_to: commissionTo, // комиссия до
|
|||
|
|
filter_komnat_from: komnatFrom, // комиссия от
|
|||
|
|
filter_komnat_to: komnatTo, // комиссия до
|
|||
|
|
filter_deal_type: dealTypes, // типы сделок
|
|||
|
|
filter_cena_ot: cena_ot, // цена от
|
|||
|
|
filter_cena_do: cena_do, // цена до
|
|||
|
|
filter_ads_state: JSON.stringify(states),
|
|||
|
|
search: $('#search_filter_input').val(),
|
|||
|
|
is_moderation: is_moderation,
|
|||
|
|
page: page ? Number(page) : 1,
|
|||
|
|
sort_order: sort
|
|||
|
|
}
|
|||
|
|
//console.log(client_fields_filtr.filtr);
|
|||
|
|
if(typeof client_fields_filtr != "undefined" && client_fields_filtr.filtr) {
|
|||
|
|
params.is_contract = client_fields_filtr.filtr.is_contract;
|
|||
|
|
params.type_contract = client_fields_filtr.filtr.type_contract;
|
|||
|
|
params.numder_contract = client_fields_filtr.filtr.numder_contract;
|
|||
|
|
params.onDateContract = $('#contractClientOnDate').val();
|
|||
|
|
params.offDateContract = $('#contractClientOffDate').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if($('#filter_is_promotion').attr('data-active') > 0){
|
|||
|
|
let form = $('#searchPromotionForm');
|
|||
|
|
|
|||
|
|
params.avito_highlight = (form.find('[name="avito_highlight"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_xl = (form.find('[name="avito_xl"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x2_1 = (form.find('[name="avito_x2_1"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x2_7 = (form.find('[name="avito_x2_7"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x5_1 = (form.find('[name="avito_x5_1"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x5_7 = (form.find('[name="avito_x5_7"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x10_1 = (form.find('[name="avito_x10_1"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.avito_x10_7 = (form.find('[name="avito_x10_7"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_highlight = (form.find('[name="cian_highlight"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_standard = (form.find('[name="cian_standard"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_paid = (form.find('[name="cian_paid"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_premium = (form.find('[name="cian_premium"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_top3 = (form.find('[name="cian_top3"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.cian_bet = form.find('[name="cian_bet"]').val();
|
|||
|
|
params.cian_ignore_pkg = (form.find('[name="cian_ignore_pkg"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.yandex_premium = (form.find('[name="yandex_premium"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.yandex_raise = (form.find('[name="yandex_raise"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.yandex_promotion = (form.find('[name="yandex_promotion"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.domclick_express = (form.find('[name="domclick_express"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.domclick_premium = (form.find('[name="domclick_premium"]').prop('checked')) ? 1 : 0;
|
|||
|
|
params.domclick_top = (form.find('[name="domclick_top"]').prop('checked')) ? 1 : 0;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
console.log(params);
|
|||
|
|
localStorage['agency_objects_params'] = JSON.stringify(params);
|
|||
|
|
$.post("/ajax/getAgencyObjects.php",
|
|||
|
|
params,
|
|||
|
|
function (a) {
|
|||
|
|
$('.content-right .inner .jw__objects').html(a);
|
|||
|
|
$('.___a1').click(function (e) {
|
|||
|
|
var n = Number(e.target.innerHTML);
|
|||
|
|
if (n) {
|
|||
|
|
|
|||
|
|
q__001(n);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
setTimeout(function(){
|
|||
|
|
get_bar_obj();
|
|||
|
|
}, 2000);
|
|||
|
|
|
|||
|
|
getReSearchObjectsCounts();
|
|||
|
|
getClientsForObjects();
|
|||
|
|
getTaskCountersForObjects();
|
|||
|
|
$('.fotorama').fotorama();
|
|||
|
|
|
|||
|
|
customSelect(".card-advert-all select");
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getSort() {
|
|||
|
|
let sort_order = 0;
|
|||
|
|
|
|||
|
|
if ($('select[name=adv_objects_sort_order]').length > 0) {
|
|||
|
|
sort_order = $('select[name=adv_objects_sort_order]').val();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return sort_order;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function goToObjectsAdvPage(event, input) {
|
|||
|
|
if (event.keyCode === 13) {
|
|||
|
|
var pageNum = $(input).val();
|
|||
|
|
|
|||
|
|
if (pageNum) {
|
|||
|
|
q__001(pageNum);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
setInterval(function () {
|
|||
|
|
|
|||
|
|
|
|||
|
|
var count = 0;
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[0]) {
|
|||
|
|
var __a = $('.crm__filter-popup .filter-popup-input .fstControls')[0].children;
|
|||
|
|
if (__a.length - 1 > 0) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[1]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[1].children;
|
|||
|
|
if (__b.length - 1 > 0) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[2]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[2].children;
|
|||
|
|
if (__b.length - 1 > 0) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[3]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[3].children;
|
|||
|
|
if (__b.length - 1 > 0) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .filter-popup-input .fstControls')[4]) {
|
|||
|
|
var __b = $('.crm__filter-popup .filter-popup-input .fstControls')[4].children;
|
|||
|
|
if (__b.length - 1 > 0) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('#filter-object-activities').val() !== null && $('#filter-object-activities').val() != '') {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('#objects_filter_commission').val() !== null && $('#objects_filter_commission').val() != '') {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('#objects_filter_commission_to').val() !== null && $('#objects_filter_commission_to').val() != '') {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('#objects_filter_cena_ot').val() !== null && $('#objects_filter_cena_ot').val() != '') {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('#objects_filter_cena_do').val() !== null && $('#objects_filter_cena_do').val() != '') {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($('.crm__filter-popup .object-content__sub-actions td > div > div')) {
|
|||
|
|
var __e = $('.crm__filter-popup .object-content__sub-actions td > div > div');
|
|||
|
|
for (var i = 0; i < __e.length; i++) {
|
|||
|
|
for (var j = 0; j < __e[i].classList.length; j++) {
|
|||
|
|
if (__e[i].classList[j] === 'active') {
|
|||
|
|
count++;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (q__1) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
if (q__2) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
if (q__3) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
if (q__002) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
if (q__003) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
if ($('.crm__filters #filter-object-fields').attr('data-active') == 1) {
|
|||
|
|
count++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (count === 0) {
|
|||
|
|
$('#__COUNT_FILT_CONT').css('display', 'none');
|
|||
|
|
} else {
|
|||
|
|
$('#__COUNT_FILT_CONT').css('display', 'inline-block');
|
|||
|
|
if (count === 1) {
|
|||
|
|
$('#__COUNT_FILT').html(count + ' опция');
|
|||
|
|
} else if (count < 5) {
|
|||
|
|
$('#__COUNT_FILT').html(count + ' опции');
|
|||
|
|
} else {
|
|||
|
|
$('#__COUNT_FILT').html(count + ' опций');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}, 500);
|
|||
|
|
</script>
|
|||
|
|
</div>
|
|||
|
|
<?php require($_SERVER['DOCUMENT_ROOT'] . "/templates/footer.php"); ?>
|
|||
|
|
<script type="text/javascript" src="/js/crm_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/crm_vue.js')?>"></script>
|
|||
|
|
<script type="text/javascript" src="/js/clients_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/clients_vue.js')?>"></script>
|
|||
|
|
<script type="text/javascript" src="/js/requisitions_obj_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/requisitions_obj_vue.js')?>"></script>
|
|||
|
|
<link href="/css/bootstrap-table.min.css" rel="stylesheet">
|
|||
|
|
<link href="/css/jquery.treegrid.css" rel="stylesheet">
|
|||
|
|
<link rel="stylesheet" href="/css/bootstrap.css?v=3" type="text/css">
|
|||
|
|
<!-- <link rel="stylesheet" href="/css/jquery.bootgrid.css" type="text/css"> -->
|
|||
|
|
<link rel="stylesheet" href="/css/jquery.dragtable.css" type="text/css">
|
|||
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
|
|||
|
|
<script type="text/javascript" src="/js/crm_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/crm_vue.js')?>"></script>
|
|||
|
|
<script type="text/javascript" src="/js/clients_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/clients_vue.js')?>"></script>
|
|||
|
|
<script type="text/javascript" src="/js/requisitions_obj_vue.js?v=<?=filemtime($_SERVER['DOCUMENT_ROOT'].'/js/requisitions_obj_vue.js')?>"></script>
|
|||
|
|
<!-- <script type="text/javascript" src="/js/bootstrap_5.js"></script> -->
|
|||
|
|
<script type="text/javascript" src="/js/bootstrap.bundle.min.js"></script>
|
|||
|
|
<!--<script type="text/javascript" src="/js/jquery-ui.js"></script>-->
|
|||
|
|
|
|||
|
|
<script type="text/javascript" src="/js/bootstrap-table.min.js"></script>
|
|||
|
|
<!-- <script type="text/javascript" src="/js/jquery.bootgrid.js"></script> -->
|
|||
|
|
<script type="text/javascript" src="/js/jquery.dragtable.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/reorder-table.min.js"></script>
|
|||
|
|
<!-- <script type="text/javascript" src="/js/jquery.tablednd.js"></script> -->
|
|||
|
|
<script src="/js/jquery.treegrid.min.js"></script>
|
|||
|
|
<script src="/js/bootstrap-table-treegrid.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/libs/js-xlsx/xlsx.core.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/libs/FileSaver/FileSaver.min.js"></script>
|
|||
|
|
<script src="/js/tableExport.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/dragscroll.min.js"></script>
|
|||
|
|
<script src="/js/bootstrap-table-locale-all.min.js"></script>
|