2026-05-22 20:21:54 +02:00
< ? php
/* error_reporting ( E_ALL );
ini_set ( 'display_errors' , 1 );
ini_set ( 'display_startup_errors' , 1 ); */
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . " /config.php " );
if ( ! $_SESSION [ 'id' ]) { header ( " location:index.php " ); die ( " Доступ запрещён! " );}
$get = clearInputData ( $_GET );
if ( $get [ 'id_agent' ]) {
$user_view = new User ;
$user_view -> get ( $get [ 'id_agent' ]);
unset ( $_SESSION [ 'filter_emp' ]);
}
require ( $_SERVER [ 'DOCUMENT_ROOT' ] . " /templates/new-header.php " );
$_SESSION [ 'event_id_temp' ] = rand ( 10000000 , 99999999 );
$_SESSION [ 'event_id_temp' ] *= - 1 ;
unset ( $_SESSION [ 'checked' ]);
$user_now = new User ;
$user_now -> get ( $_SESSION [ 'id' ]);
//Предмодерация рекламы по объектам.
$sql_moderation = " SELECT * FROM advert_moderation_agency WHERE agency_id = { $user_now -> agencyId } " ;
$q_moderation = mysql_query ( $sql_moderation );
if ( mysql_num_rows ( $q_moderation ) > 0 ){
$is_advert_moderation = true ;
}
$can_advert_all = true ;
$showAds = User :: isCurrentUserShowAdvertButton ();
if ( $showAds === false ){
$can_advert_all = false ;
}
if ( isset ( $is_advert_moderation ) && $is_advert_moderation ){
$can_advert_all = false ;
}
if ( $_SESSION [ 'use_advert_budget' ]){
$can_advert_all = false ;
}
if ( $_SESSION [ 'id' ] == 5238 ){
$can_advert_all = true ;
}
?>
< style >
. crm__table {
margin : 0 - 35 px ! important ;
}
#object_list_table-header .dropdown.btn-group {
top : 0 ;
right : 0 ;
position : relative ;
}
. fr - system__objects . view - changer . view - adv - list svg {
width : 37 px ;
height : 37 px ;
margin - top : 2 px ;
}
. fr - system__objects . view - changer . view - adv - table svg {
width : 37 px ;
height : 37 px ;
margin - top : 2 px ;
}
. fr - system__objects . view - changer {
display : - webkit - box ;
display : - ms - flexbox ;
display : flex ;
- webkit - box - pack : start ;
- ms - flex - pack : start ;
justify - content : flex - end ;
- webkit - box - align : center ;
- ms - flex - align : center ;
align - items : center ;
padding : 0 35 px 0 0 ;
margin : 0 0 0 auto ;
}
. fr - system__objects . view - changer div svg {
display : inline - block ;
}
. fr - system__objects . view - changer svg path {
fill : #757575;
}
. fr - system__objects . view - changer div {
height : 40 px ;
margin - left : 25 px ;
cursor : pointer ;
position : relative ;
- webkit - transition : all . 35 s linear ;
transition : all . 35 s linear ;
}
. fr - system__objects . view - changer a {
border - bottom : 0 ;
}
. fr - system__objects . view - changer div span {
display : inline - block ;
vertical - align : top ;
font - size : 16 px ;
margin : 10 px 0 0 9 px ;
color : #757575;
border - bottom : 1 px solid #dedede;
}
. fr - system__objects . view - changer div : hover svg path {
fill : #237ef7;
}
. fr - system__objects . view - changer div : hover span {
color : #237ef7 !important;
border - color : #3a8efa !important;
}
. fr - system__objects . view - changer . active span , . crm . view - changer . active : hover span {
color : rgb ( 67 , 160 , 71 ) ! important ;
font - weight : 600 ;
border - bottom : 0 ;
}
. object - content__advert {
float : right ! important ;
padding : 3 px 10 px ;
}
. object - content__advert . advert__status - active ,
. object - content__advert . advert__status - outdate {
font - size : 16 px ;
text - decoration : none ;
border - bottom : none ;
}
. object - content__advert . advert__status - active {
color : rgb ( 67 , 160 , 71 );
border - bottom : 1 px dashed rgba ( 67 , 160 , 71 , 0.8 );
}
. object - content__advert . advert__status - outdate {
color : rgb ( 226 , 87 , 76 );
border - bottom : 1 px dashed rgba ( 226 , 87 , 76 , 0.8 );
}
. note__text {
position : relative ;
}
. note__text . note__text - ok {
color : #757575;
}
. note__text . note__text - ok : after {
content : " " ;
background : url ( '../images/check.svg' );
background - size : 12 px 12 px ;
width : 12 px ;
height : 12 px ;
display : inline - block ;
margin - left : 8 px ;
}
. note__text . note__text - deny {
color : rgb ( 226 , 87 , 76 );
}
. advert__popup ul {
margin - top : 8 px ;
margin - left : 20 px ;
list - style : none ;
}
. advert__popup ul . columns - 2 {
- moz - column - count : 2 ;
- moz - column - gap : 10 px ;
- webkit - column - count : 2 ;
- webkit - column - gap : 10 px ;
column - count : 2 ;
column - gap : 10 px ;
}
. advert__popup ul . columns - 3 {
- moz - column - count : 3 ;
- moz - column - gap : 10 px ;
- webkit - column - count : 3 ;
- webkit - column - gap : 10 px ;
column - count : 3 ;
column - gap : 10 px ;
}
. advert__popup ul . columns - 4 {
- moz - column - count : 4 ;
- moz - column - gap : 10 px ;
- webkit - column - count : 4 ;
- webkit - column - gap : 10 px ;
column - count : 4 ;
column - gap : 10 px ;
}
. advert__popup . note__text {
display : inline - block ;
margin - left : 20 px ;
}
. advert__popup h4 {
margin - bottom : 5 px ;
}
. advert__popup ul + h4 ,
. advert__popup . note__text + h4 {
margin - top : 15 px ;
}
. advert__popup ul li {
object - fit : contain ;
margin - bottom : 5 px ;
}
. advert__popup ul li > img {
height : 24 px ;
line - height : 24 px ;
}
. advert__popup ul li > . note__text {
display : inline ;
margin - left : auto ;
}
. pagination {
display : - ms - flexbox ;
display : flex ;
padding - left : 0 ;
list - style : none ;
border - radius : . 25 rem ;
}
. page - link {
position : relative ;
display : block ;
padding : . 5 rem . 75 rem ;
margin - left : - 1 px ;
line - height : 1.25 ;
color : rgb ( 67 , 160 , 71 );
background - color : #fff;
border : 1 px solid #dee2e6 !important;
}
. page - link : hover {
z - index : 2 ;
text - decoration : underline ! important ;
color : #4CAF50 !important;
border : 1 px 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 : . 25 rem ;
border - bottom - left - radius : . 25 rem ;
}
. page - item : last - child . page - link {
border - top - right - radius : . 25 rem ;
border - bottom - right - radius : . 25 rem ;
}
. page - item . disabled . page - link {
color : #4CAF50;
pointer - events : none ;
cursor : auto ;
background - color : #fff;
border - color : #4CAF50;
}
. fixed - table - pagination {
padding : 7 px ;
}
</ style >
< link rel = " stylesheet " href = " /css/custom-select.css " >
< link rel = " stylesheet " href = " /css/main_cart_object.css " >
< 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 " >
< 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 " >
< div class = " content-right " >
< div class = " inner " >
< div class = " main-title <?php if (isset( $user_view )) { echo " two - line " ;}?> " >
< h1 < ? php if ( isset ( $user_view )) { echo " style='font-size:24px;line-height: 1.2;' " ; } ?> >
< ? php if ( isset ( $user_view )) { echo " Объекты пользователя <br/> " . $user_view -> fio ;} else { echo " Объекты " ; } ?>
</ h1 >
< span style = " margin-left: 20px; font-size: 20px; " >< a href = " /complex_list.php " > Комплексы </ a ></ span >
</ div >
< script type = " text/javascript " src = " /js/ajax-form.js " ></ script >
< script type = " text/javascript " src = " /js/core.js?t=6 " ></ script >
< script type = " text/javascript " src = " /js/popup.js " ></ 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=898fc684-cdf6-4af8-af57-15e2781d68d1&lang=ru_RU' ;
document . getElementsByTagName ( 'body' )[ 0 ] . appendChild ( elem );
}, 1000 );
</ script >
< ? php
$db_sphinx = new MysqlPdo ( hstsph2 , null , null , null , true , '9306' );
$depClass = new Department ();
$searchUserId = $_SESSION [ 'id' ];
$adminDep = false ;
$sql_check_permissions = " SELECT `menu_all_objects`, `menu_all_objects_edit` FROM user_permissions WHERE user_id = $searchUserId " ;
$q_check_permissions = mysql_query ( $sql_check_permissions );
$r_check_permissions = mysql_fetch_assoc ( $q_check_permissions );
if ( $_SESSION [ 'agency' ] || $_SESSION [ 'manager' ] || $_SESSION [ 'users_admin' ] || $r_check_permissions [ 'menu_all_objects' ] == 1 && ! isset ( $user_view )) {
$agentIds = [];
if ( $_SESSION [ 'users_admin' ] || $_SESSION [ 'agency' ] || $r_check_permissions [ 'menu_all_objects' ] == 1 ) {
$user = new User ;
$user -> get (( int ) $_SESSION [ 'id' ]);
$user -> checkPermissions ();
$searchUserId = $user -> agencyId ;
$agentIds [] = $user -> agencyId ;
$adminDep = true ;
} 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 ;
}
}
$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_unique ( $agentIds );
$favor = array ();
$favorUserView = array ();
if ( ! isset ( $user_view )) {
$sql_f = " SELECT id_obj FROM favor WHERE id_user IN ( " . implode ( ',' , $agentIds ) . " ) " ;
$q_f = mysql_query ( $sql_f );
while ( $r_f = mysql_fetch_row ( $q_f )){
$favor [] = $r_f [ 0 ];
}
if ( ! empty ( $favor )){
$sql = " SELECT id FROM objects WHERE del=0 and black <> 1 AND moder <> 1 and id in ( " . implode ( ',' , $favor ) . " ) LIMIT 1000000 OPTION max_matches=1000000 " ;
$rez = $db_sphinx -> query ( $sql , true );
$kol_favor = $db_sphinx -> num_rows ( $rez );
}
} else {
$objFav = array ();
$sql_f = " SELECT id_obj FROM favor WHERE id_user IN ( " . implode ( ',' , $agentIds ) . " ) " ;
$q_f = mysql_query ( $sql_f );
while ( $r_f = mysql_fetch_row ( $q_f )){
$objFav [] = $r_f [ 0 ];
}
if ( ! empty ( $objFav )){
$sql = " SELECT id FROM objects WHERE del=0 and black <> 1 AND moder <> 1 and id in ( " . implode ( ',' , $objFav ) . " ) LIMIT 1000000 OPTION max_matches=1000000 " ;
$rez = $db_sphinx -> query ( $sql , true );
while ( $f = $db_sphinx -> fetch_assoc ( $rez )) $favorUserView [] = $f [ 'id' ];
}
if ( $favorUserView ) {
$kol_favor = count ( $favorUserView );
}
if ( isset ( $_GET [ 'favor' ])) {
$favor = $favorUserView ;
}
}
$sql = " SELECT id FROM objects WHERE del=0 and archive <> 1 and id_add_user IN ( " . implode ( ',' , $agentIds ) . " ) LIMIT 1000000 OPTION max_matches=1000000 " ;
$rez = $db_sphinx -> query ( $sql , true );
$kol_my_obj_not_archive = $db_sphinx -> num_rows ( $rez );
$sql = " SELECT id FROM objects WHERE del=0 and archive = 1 and id_add_user IN ( " . implode ( ',' , $agentIds ) . " ) 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 use_in_advert = 1 and id_add_user IN ( " . implode ( ',' , $agentIds ) . " ) LIMIT 1000000 OPTION max_matches=1000000 " ;
$rez = $db_sphinx -> query ( $sql , true );
$kol_my_obj_ad = $db_sphinx -> num_rows ( $rez );
$sql = " SELECT count(distinct p.object_id) FROM user_potential_objects p, objects o WHERE p.object_id=o.id and p.user_id IN ( " . implode ( ',' , $agentIds ) . " ) " ;
$rez = mysql_query ( $sql );
$kol_my_obj_potential = mysql_result ( $rez , 0 );
$user = new User ;
$user -> get ( $_SESSION [ 'id' ]);
$use_advert_budget = boolval ( $_SESSION [ 'use_advert_budget' ]);
$needAd = false ;
$sqlForAd = " SELECT id FROM `users` WHERE id in (4, 93, 117, 4251, 5035, 585, 4147, 5350, 5355, 177, 5524, 5530, 5839) or id_manager in (4, 117, 4251, 5035, 585, 4147, 5350, 5355, 177, 5524, 5530, 5839) or id_manager in (select id from users where id_manager in (4, 117, 4251, 5035, 585, 4147, 5350, 5355, 177, 5524, 5530, 5839)) " ;
$rezForAd = mysql_query ( $sqlForAd );
while ( $userId = mysql_fetch_assoc ( $rezForAd )) {
if ( $userId [ 'id' ] == $_SESSION [ 'id' ]) {
$needAd = true ;
break ;
}
}
$hasOwnObjects = ( stripos ( $_SERVER [ 'SCRIPT_NAME' ], " my-objects.php " ) || $obj [ 'use_in_advert' ] == 0 );
$isPotential = isset ( $_GET [ 'potential' ]);
$isArchive = isset ( $_GET [ 'archive' ]);
?>
< div class = " fr-system__objects my-objects " >
< div class = " jw__page__tabs " style = " padding-right: 0; " >
< table >
< tr >
< td style = " width: 90%; " >
< a data - id = " active " href = " javascript: { }; " class = " tab " >
< span > В работе </ span >
< i class = " jw__tab__counter <?=((int) $kol_my_obj_not_archive == 0) ? 'hidden' : '' ?> " id = " activeObj " >< ? = $kol_my_obj_not_archive ?> </i>
</ a >
< ? php if ( $hasRestrictedAccess ) { ?>
< span class = " tab_pasive tooltip tooltip-effect " >
< span class = 'tooltip-item' > Потенциальные </ span >
< em style = " font-style: normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Доступно в платной версии </ b ></ em >
</ span >
< ? php } else { ?>
< a data - id = " potential " href = " javascript: { }; " data - href = " /my-objects.php?potential=1&<?php echo $urlAdd ; if(isset( $user_view )) echo '&id_agent='. $user_view->id ; ?> " class = " tab <?php if( $_GET['potential'] ) { echo 'selected'; } ?> " >
< span > Потенциальные </ span >
< ? php if ( $kol_my_obj_potential > 0 ) { ?>
< i class = " jw__tab__counter " id = " potentialObjCounter " >< ? php echo $kol_my_obj_potential ; ?> </i>
< ? php } ?>
</ a >
< ? php } ?>
< ? php if ( $needAd ) { ?>
< a data - id = " ad " href = " javascript: { }; " data - href = " /my-objects.php?ad=1&<?php echo $urlAdd ; ?> " class = " tab <?php if( $_GET['ad'] ) echo 'selected'; ?> " >
< span > Рекламные </ span >
< ? php if ( $kol_my_obj_ad > 0 ) { ?>
< i class = " jw__tab__counter " id = " favorite " >< ? php echo $kol_my_obj_ad ; ?> </i>
< input type = " hidden " id = " kol_favor " value = " <?php echo $kol_my_obj_ad ; ?> " >
< ? php } ?>
</ a >
< ? php } ?>
< a data - id = " favor " href = " javascript: { }; " data - href = " /my-objects.php?favor=1&<?php echo $urlAdd ; if(isset( $user_view )) echo '&id_agent='. $user_view->id ; ?> " class = " tab <?php if( $_GET['favor'] ) echo 'selected'; ?> " >
< span > Избранное </ span >
< ? php if ( isset ( $kol_favor ) && $kol_favor > 0 ) { ?>
< i class = " jw__tab__counter " id = " favorite " >< ? php echo $kol_favor ; ?> </i>
< input type = " hidden " id = " kol_favor " value = " <?php echo $kol_favor ; ?> " >
< ? php } ?>
</ a >
< a data - id = " archive " href = " javascript: { }; " data - href = " /my-objects.php?archive=1&<?php echo $urlAdd ; if(isset( $user_view )) echo '&id_agent='. $user_view->id ; ?> " class = " tab <?php if( $_GET['archive'] ) echo 'selected'; ?> " >
< span > Архив </ span >
< i class = " jw__tab__counter <?=((int) $kol_my_obj_archive == 0) ? 'hidden' : ''?> " id = " archiveObj " >< ? = $kol_my_obj_archive ; ?> </i>
</ a >
< ? php if ( ! $hasRestrictedAccess ) { ?>
< a href = " /add-object.php " class = " tab tab__new-object add-new-object " style = " padding-left: 35px; " >
< i class = " ti-plus " ></ i >< span > Новый объект </ span >
</ a >
< ? } else {
$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_pasive 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 add-new-object " style = " padding-left: 35px; " >
< i class = " ti-plus " ></ i >< span > Новый объект </ span >
</ a >
< ? php
} ?>
< ? } ?>
< ? php if ( ! $hasRestrictedAccess ) { ?>
< a href = " javascript: { } " class = " tab_pasive tab__new-object add-new-complex " style = " padding-left: 35px; " >
< i class = " ti-plus " ></ i >< span > Новый комплекс </ span >
</ a >
< ? } else {
?>
< a href = " javascript: { } " class = " tab_pasive tab__new-object " onclick = " trialperiod.modalObj(); " style = " padding-left: 35px; " >
< i class = " ti-plus " ></ i >< span > Новый комплекс </ span >
</ a >
< ? php
}
?>
</ td >
< td style = " width: 300px; " >
< div class = " view-changer " style = " white-space: nowrap; " >
< div class = " view-adv-list <?=(isset( $_SESSION['list_view'] )) ? 'active' : ''?> " data - id = " list " >
< 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['table_view'] )) ? 'active' : ''?> " data - id = " table " >
< 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 >
</ td >
</ tr >
</ table >
</ div >
< ? php
/* $sql_count_sale = " SELECT COUNT(*)
FROM objects
WHERE black <> 1
AND moder <> 1
$str_usl_bd
AND operation_type = 1
GROUP BY id " ;
$vsego_sale = $db_sphinx -> num_rows ( $db_sphinx -> query ( $sql_count_sale , true ));
$sql_count_rent = " SELECT COUNT(*)
FROM objects
WHERE black <> 1
AND moder <> 1
$str_usl_bd
AND operation_type = 0
GROUP BY id " ;
$vsego_rent = $db_sphinx -> num_rows ( $db_sphinx -> query ( $sql_count_rent , true )); */
?>
< div class = " crm__filters " >
< div class = " crm__filters-inner " >
< div class = " search-query " >
< div class = " search-query-item crm_objects " >
< span > 0 опций </ span >
< i class = " ti-close " ></ i >
</ div >
</ div >
< div class = " search-filter " >
< input type = " text " tabindex = " 1 " value = " " name = " search " placeholder = " ID или адрес объекта " class = " search-filter__filter " id = " search_filter_input " autocomplete = " off " >
< div class = " search-filter__icons " >
< i class = " filtrObjects ti-search " title = " Искать " ></ i >
< i class = " filtrObjects ti-close " title = " Очистить " ></ i >
</ div >
</ div >
< div class = " search-toolbar " >
< ? php
$canDeleteOwn = false ;
if ( $user -> agencyId == 8307 || $user -> agencyId == 10041 ) {
$canDeleteOwn = false ;
if ( $_SESSION [ 'id' ] == 8307 || $_SESSION [ 'id' ] == 10041 ) {
$canDeleteOwn = true ;
}
} else {
if ( $_SESSION [ 'id' ] == 10499 ) {
$canDeleteOwn = false ;
} else {
if ( $_SESSION [ 'agency' ] || $_SESSION [ 'users_admin' ]) {
$canDeleteOwn = true ;
}
}
}
?>
< ? php if ( $hasOwnObjects || ( $needAd && isset ( $_GET [ 'ad' ]))) : ?>
< ? php
$unisender = new UnisenderClass ( null , $user -> agencyId );
$key = $unisender -> get_key ();
if ( ! empty ( $key )) { ?>
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom showDeleteMyObjectCompaign2 " onclick = " campaign__create_all(); return false; " >
< i class = " ti-layers-alt " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Создать рассылку для всех по фильтру </ b ></ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom showDeleteMyObjectCompaign " onclick = " campaign__create(); return false; " >
< i class = " ti-layers " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Создать рассылку для выбранных </ b ></ em >
</ button >
< ? php
}
?>
< ? php if ( $canDeleteOwn ) { ?>
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom showDeleteMyObjectsWindow " onclick = " showDeleteMyObjectsWindow(); return false; " style = " display:none; " >
< i class = " ti-trash " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Удалить выделенные объекты </ b ></ em >
</ button >
< ? php } ?>
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom selectedFromArchive " onclick = " selectedFromArchive(); return false; " style = " display:none; " >
< i class = " ti-back-right " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >
< b class = " tooltip-text " > Восстановить выделенные объекты из архива </ b >
</ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom showAddObjectsToArchiveWin " onclick = " showAddObjectsToArchiveWin(); return false; " >
< i class = " ti-folder " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >
< b class = " tooltip-text " > Поместить выделенные объекты в архив </ b >
</ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom selectedToOtherUser " onclick = " selectedToOtherUser(); return false; " >
< i class = " ti-new-window " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >
< b class = " tooltip-text " > Передать выделенные объекты другому сотруднику </ b >
</ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " clearAllSelected(); return false; " >
< i style = " margin-right:0;margin-left:2px; " class = " ti-eraser " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Очистить весь список выбранных вариантов </ b ></ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " deselectAll(); return false; " >
Снять
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Снять выделение у всех объектов на странице </ b ></ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " selectAll(); return false; " >
Выбрать
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Выделить все объекты на странице </ b ></ em >
</ button >
< ? php /* if ( $needAd ) : ?>
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " showLowPriceWin(); return false; " >
< i class = " ti-stats-down " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Снизить цену для всех выделенных объектов </ b ></ em >
</ button >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " showChangeObjectContactsWin(); return false; " >
< i class = " ti-id-badge " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Изменить реквизиты для всех выделенных объектов </ b ></ em >
</ button >
< ? php endif ; */ ?>
< ? php if ( $hasOwnObjects ) : ?>
< a class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " target = " _blank " href = " /print.php " >
< i class = " ti-printer " ></ i >
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Напечатать выделенные варианты </ b ></ em >
</ a >
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom " onclick = " toPdf(); return false; " >
. pdf
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Поместить выделенные варианты в презентации </ b ></ em >
</ button >
< ? php endif ; ?>
< ? php endif ; ?>
< ? php
if ( $can_advert_all ){ ?>
< button class = " fr-btn steel tooltip tooltip-effect tooltip-bottom showAdvertMyObject " < ? = ( ! isset ( $_SESSION [ 'table_view' ])) ? 'style="display:none"' : '' ?> onclick="show_advert_all(); return false;">
Реклама
< em style = " font-style:normal; " class = " tooltip-content tt-pdf clear " >< b class = " tooltip-text " > Реклама </ b ></ em >
</ button >
< div class = " card-advert-all hidden " >
< div class = " lw-apartment-card__field lw-apartment-card__field--flex-start lw-apartment-card__field-settings " >
< div class = " closer " style = " top: 0px; right: 15px " >< a href = " javascript: { } " onclick = " hide_advert_all(); " >< img src = " /images/close_modal.svg " ></ a ></ div >
< ul class = " lw-apartment-card__list lw-apartment-card__list--company " >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_cian_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_cian_feed_all " ></ label >
</ div >
< button type = " button " onclick = " switchCanCianAd(this) " data - id = " all " data - budget = " <?= $use_advert_budget ?> " title = " Необходимо наличие аккаутна на cian.ru " class = " lw-main-btn lw-apartment-card__company-btn " data - modal - id = " lw-cian-modal " >
< img class = " lw-apartment-card__list-company-image " src = " img/icon-body/с ian.svg " alt = " tick " width = " 80 " height = " 32 " >
</ button >
</ li >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_avito_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_avito_feed_all " ></ label >
</ div >
< button type = " button " class = " lw-main-btn lw-apartment-card__company-btn " data - modal - id = " lw-avito-modal " onclick = " switchCanAvitoAd(this); " data - id = " all " data - budget = " <?= $use_advert_budget ?> " title = " Необходимо наличие магазина Avito " >
< img class = " lw-apartment-card__list-company-image " src = " img/icon-body/avito.svg " alt = " tick " width = " 80 " height = " 32 " >
</ button >
</ li >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_yandex_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_yandex_feed_all " ></ label >
</ div >
< button type = " button " class = " lw-main-btn lw-apartment-card__company-btn " onclick = " switchBnAd(this); " data - id = " all " data - budget = " <?= $use_advert_budget ?> " >
< img class = " lw-apartment-card__list-company-image " src = " img/icon-body/yandex.svg " alt = " tick " width = " 80 " height = " 32 " >
</ button >
</ li >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_dom_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_dom_feed_all " ></ label >
</ div >
< button type = " button " class = " lw-main-btn lw-apartment-card__company-btn " onclick = " switchDomAd(this); " data - id = " all " data - budget =< ? = $use_advert_budget ?> " title="Размещение на Домклик">
< img class = " lw-apartment-card__list-company-image " src = " img/icon-body/domclick.svg " alt = " tick " width = " 80 " height = " 32 " >
</ button >
</ li >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_jcat_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_jcat_feed_all " ></ label >
</ div >
< button type = " button " class = " lw-main-btn lw-apartment-card__company-btn " onclick = " switchCanEmlsAd(this); " data - id = " all " data - budget =< ? = $use_advert_budget ?> " title="Размещение на Jcat">
< img class = " lw-apartment-card__list-company-image " src = " /images/jcat.png " alt = " tick " width = " 80 " height = " 32 " >
</ button >
</ li >
< li >
< div class = " switch-container " style = " display: none " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_free_feed_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_free_feed_all " ></ label >
</ div >
< button type = " button " class = " lw-main-btn lw-apartment-card__company-btn " onclick = " switchCanAd(this); " data - id = " all " >
Бесплатные
<!--< img class = " lw-apartment-card__list-company-image " src = " img/icon-body/site.svg " alt = " tick " width = " 80 " height = " 32 " >-->
</ button >
</ li >
< li >
< div class = " switch-container " >
< input class = " switch-checkbox " type = " checkbox " id = " checkdox_advert_all " data - id = " all " >
< label class = " switch-label " for = " checkdox_advert_all " ></ label >
</ div >
< div style = " margin-top: -5px; " > Снять с рекламы </ div >
</ li >
</ ul >
</ div >
</ div >
< ? php } ?>
</ div >
</ div >
< div class = " crm__filter-popup " id = " crm_objects_filters " >
< 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 " style = " display: none " ></ i >
</ div >
< div class = " filter-popup-type<?= isset( $_GET['rent'] ) ? ' active' : '' ?> " data - id = " rent " >
< a href = " javascript: { }; " >
< span > Аренда </ span >
</ a >
< i class = " filter_counter " style = " display: none " ></ 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 " onclick = " get_objects_list(); " 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
$id_select = 'filter-object-employee' ;
$id_select_input = '' ;
if ( isset ( $_SESSION [ 'filter_emp' ])){
$filter_emp = $_SESSION [ 'filter_emp' ];
}
$showBlocked = true ;
require ( $_SERVER [ 'DOCUMENT_ROOT' ] . " /templates/filter_emp.php " );
?>
< div class = " filter-popup-input " >
< div class = " crm__filter-input " >
< ? php if ( isset ( $_GET [ 'id_agent' ]))
unset ( $_SESSION [ 'filter_object_type' ]);
$arr_object_type = array ();
if ( isset ( $_SESSION [ 'filter_object_type' ])) {
$arr_object_type = json_decode ( html_entity_decode ( $_SESSION [ 'filter_object_type' ]), ENT_QUOTES );
} ?>
< select id = " filter-object-type " multiple >
< ? php foreach ( $OBJECT_TYPES as $key => $val ) {
if ( $key > 0 ) { ?>
< option data - op = " <?= $key ?> " value = " <?= $val ?> " < ? = in_array ( $val , $arr_object_type ) ? 'selected' : '' ; ?> >
< ? = $val ?>
</ option >
< ? php }
} ?>
</ select >
</ div >
</ div >
< div class = " filter-popup-input " >
< div class = " crm__filter-input " >
< select id = " filter-object-activities " multiple = " " >
< ? php
$arr_activities = array ();
echo '<option value="no_tags"' . ( in_array ( 'no_tags' , $arr_activities ) ? ' selected' : '' ) . '>Без тегов</option>' ;
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-obj-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; " >
От & nbsp ; < input style = " width:100px " type = " text " id = " contractClientOnDate " class = " text datepicker-filter " value = " " >& nbsp ;
по & nbsp ; < 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_objects' ])) {
$arr_state = json_decode ( html_entity_decode ( $_SESSION [ 'filter_ads_state' ]), ENT_QUOTES );
}
?>
< select id = " filter-ads-status-objects " 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 = " filter_is_reports " class = " ___1 " data - active = " 0 " >
< p > С отчетами </ p >
</ div >
< div class = " ___1 " id = " filter_is_promotion " onclick = " showSearchPromotionModal(0); " >
< p > Продвижение </ p >
</ div >
< div id = " filter_is_free " 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 = " addToAvitoFilter " >
< 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 = " addToCianFilter " >
< img class = " bRealCian " src = " /images/cian.png " >
</ div >
</ div >
</ td >
< td style = " padding-bottom: 10px; " >
< div id = " filter_is_package " 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 = " addToDomClickFilter " >
< 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 = " addToEMLSFilter " >
< 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 = " addToYandexFilter " >
< img class = " bBnru " src = " /images/yandex.png " >
</ div >
</ div >
</ td >
</ tr >
</ tbody >
</ table >
</ div >
<!--< div class = " fr-btn steel " id = " filter-not-advert " data - active = " 0 " >
< p > Н е рекламируется </ p >
</ div >
< div class = " fr-btn steel " 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 = " fr-btn steel " 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 id = " objects " class = " jw__objects " style = " display: none; " ></ div >
< div class = " clear " ></ div >
< div class = " object-content__preloader " style = " display: block; " >
< img src = " ../images/rocket-spinner.svg " width = " 96px " >
</ div >
</ div >
< div class = " f__modal-bg " id = " modalArch_bg " style = " display: none; " >
< div class = " f__modal login " id = " modalArch " style = " display: none; width:1170px; " >
< span class = " pseudo-link closer " > × </ span >
< h3 > Найденные соответствия в архиве </ h3 >
< div id = " objectsArch " ></ div >
< div class = " clear " ></ div >
</ div >
</ div >
</ div >
</ div >
< script >
function getSort () {
let sort_order = null ;
if ( $ ( 'select[name=my_objects_sort_order]' ) . length > 0 ) {
sort_order = $ ( 'select[name=my_objects_sort_order]' ) . val ();
}
return sort_order ;
}
2026-06-20 12:48:44 +02:00
function openObjectDealFromList ( objectId ) {
$ . ajax ({
url : '/ajax/ajax_vue_requisitions.php' ,
type : 'POST' ,
contentType : 'application/json' ,
data : JSON . stringify ({ request : 'get_deal_by_object' , object_id : objectId }),
success : function ( response ) {
var res = typeof response === 'string' ? JSON . parse ( response ) : response ;
if ( res . deals && res . deals . length > 0 ) {
window . editDeal ( 0 , res . deals [ 0 ]);
}
}
});
}
2026-05-22 20:21:54 +02:00
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 ();
}
}
})
}
$ ( document ) . ready ( function () {
var page = null ;
if ( localStorage [ 'edit_object_prev_url' ] && localStorage [ 'edit_object_prev_url' ] != 0 ){
if ( ! isNaN ( parseInt ( localStorage [ 'edit_object_page' ]))){
page = localStorage [ 'edit_object_page' ];
}
localStorage [ 'edit_object_prev_url' ] = 0 ;
} else {
localStorage [ 'param_get_object' ] = 0 ;
}
$ ( '#filter-object-deal-type' ) . fastselect ({
placeholder : 'Тип сделки' ,
onItemSelect : function (){
show_objects_options_search ();
},
onItemDelete : function (){
show_objects_options_search ();
}
});
$ ( '#filter-ads-status-objects' ) . fastselect ({
placeholder : 'Рекламный статус'
});
checkDealType ();
show_objects_options_search ();
get_objects_list ( page , getSort ());
$ ( document ) . on ( 'click' , '#objects .pagination li' , function ( e ) {
e . preventDefault ();
let page = $ ( this ) . text ();
if ( isNaN ( parseInt ( page ))){
page = parseInt ( $ ( this ) . find ( 'a' ) . attr ( 'href' ) . replace ( '?page=' , '' ));
}
get_objects_list ( page , getSort ());
});
$ ( document ) . on ( 'click' , '.filter-popup-type' , function ( e ) {
e . preventDefault ();
let id = $ ( this ) . attr ( 'data-id' );
$ ( '.filter-popup-type' ) . each ( function () {
if ( $ ( this ) . attr ( 'data-id' ) == id )
$ ( this ) . toggleClass ( 'active' );
else
$ ( this ) . removeClass ( 'active' );
});
checkDealType ();
show_objects_options_search ();
//get_objects_list();
});
$ ( document ) . on ( 'click' , '.jw__page__tabs .tab' , function ( e ) {
e . preventDefault ();
$ ( '.jw__page__tabs .tab.selected' ) . removeClass ( 'selected' );
$ ( this ) . addClass ( 'selected' );
get_objects_list ();
});
$ ( document ) . on ( 'click' , '.view-changer .view-adv-list, .view-changer .view-adv-table' , function ( e ) {
$ ( '.card-advert-all' ) . addClass ( 'hidden' );
if ( $ ( this ) . attr ( " data-id " ) == 'list' ){
$ ( '.showAdvertMyObject' ) . hide ();
}
if ( $ ( this ) . attr ( " data-id " ) == 'table' ){
$ ( '.showAdvertMyObject' ) . show ();
}
e . preventDefault ();
$ ( '.jw__page__tabs .view-changer .active' ) . removeClass ( 'active' );
$ ( this ) . addClass ( 'active' );
get_objects_list ( null , null , {
myObjects : 1
});
});
$ ( " body " ) . on ( 'change' , 'select[name=my_objects_sort_order]' , function (){
let page = $ ( 'table .pagination li.active' ) . text ();
get_objects_list ( page , this . value );
});
// $("body").on('change', '#objects_filter_commission', function(){
// get_objects_list();
// });
// $("body").on('change', '#objects_filter_cena_ot', function(){
// get_objects_list();
// });
// $("body").on('change', '#objects_filter_cena_do', function(){
// get_objects_list();
// });
// $("body").on('change', '#objects_filter_commission_to', function(){
// get_objects_list();
// });
// $("body").on('change', '#objects_filter_komnat_from', function(){
// get_objects_list();
// });
// $("body").on('change', '#objects_filter_komnat_to', function(){
// get_objects_list();
// });
});
</ script >
< ? php require ( $_SERVER [ 'DOCUMENT_ROOT' ] . " /templates/footer.php " ); ?>
2026-06-20 12:48:44 +02:00
< ? php
$allowed_users_deal = [ 18388 ];
if ( in_array (( int ) $_SESSION [ 'id' ], $allowed_users_deal )) {
echo '<script type="module" src="/deal/assets/app.js"></script>' ;
echo '<link rel="stylesheet" href="/deal/assets/app.css">' ;
}
?>
2026-05-22 20:21:54 +02:00
< 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/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 >