295 lines
10 KiB
PHP
295 lines
10 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
$bd_usl_addUsers = " AND (" . implode(" OR ", $arrIdAddUsers) . ")";
|
||
|
|
$bd_usl_whoWork = " AND (" . implode(" OR ", $arrIdWhoWork) . ")";
|
||
|
|
|
||
|
|
$bd_piriod .= " AND `date_add` > '1970-01-01 00:00:00'";
|
||
|
|
$startDate = date('Y') . "-01-01 00:00:00";
|
||
|
|
$endDate = date('Y') . "-12-31 23:59:59";
|
||
|
|
$whereTasks = " and DATE_FORMAT(schedule_date, '%Y-%m-%d %H:%i:%s') between '".date('Y')."-01-01 00:00:00' AND '".date('Y')."-12-31 23:59:59'";
|
||
|
|
|
||
|
|
$tableId = $_SESSION['myObjectsView'] ? 8 : 1;
|
||
|
|
|
||
|
|
function getTableColumns($tableId) {
|
||
|
|
$sql = 'SELECT item_list FROM `reclame_table` WHERE id_user='.$_SESSION['id']. ' AND id_table=' . $tableId;
|
||
|
|
$reSql = mysql_query($sql);
|
||
|
|
$res = mysql_fetch_assoc($reSql);
|
||
|
|
return $res['item_list'];
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
$schema = [
|
||
|
|
'id' => [
|
||
|
|
'data-type' => 'numeric',
|
||
|
|
'data-identifier' => "true",
|
||
|
|
'label' => 'ID объекта',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'preview' => [
|
||
|
|
'data-formatter' => "previewFormatter",
|
||
|
|
'label' => 'Превью',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'type' => [
|
||
|
|
'label' => 'Тип рынка',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'objType' => [
|
||
|
|
'label' => 'Тип квартиры/помещения',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'metro' => [
|
||
|
|
'label' => 'Район/Метро',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'address' => [
|
||
|
|
'label' => 'Адрес',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'allArea' => [
|
||
|
|
'label' => 'Метраж общий',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'liveArea' => [
|
||
|
|
'data-type' => 'numeric',
|
||
|
|
'label' => 'Метраж жилой',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'kitchenArea' => [
|
||
|
|
'data-type' => 'numeric',
|
||
|
|
'label' => 'Метраж кухни',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'floor' => [
|
||
|
|
'label' => 'Этаж/Этажность',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'floorSorter'
|
||
|
|
],
|
||
|
|
'price' => [
|
||
|
|
'label' => 'Цена',
|
||
|
|
'data-width' => '150',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => "priceSorter"
|
||
|
|
],
|
||
|
|
'prep_price' => [
|
||
|
|
'label' => 'Предварительная цена',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'start_price' => [
|
||
|
|
'label' => 'Начальная цена',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'fact_price' => [
|
||
|
|
'label' => 'Фактическая цена',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'manager' => [
|
||
|
|
'label' => 'Ответственный менеджер',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'agent' => [
|
||
|
|
'label' => 'Ответственный агент',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'client' => [
|
||
|
|
'data-formatter' => 'clientsFormatter',
|
||
|
|
'label' => 'Клиент - собственник',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'clientPhone' => [
|
||
|
|
'data-formatter' => 'clientsPhoneFormatter',
|
||
|
|
'label' => 'Телефон собственника',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'phoneSorter'
|
||
|
|
],
|
||
|
|
'createDate' => [
|
||
|
|
'label' => 'Дата создания',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'dateSorter'
|
||
|
|
],
|
||
|
|
'updateDate' => [
|
||
|
|
'label' => 'Дата последнего изменения',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'dateSorter'
|
||
|
|
],
|
||
|
|
'requests' => [
|
||
|
|
'data-formatter' => "requestFormatter",
|
||
|
|
'label' => 'Заявки по объекту',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'presentations' => [
|
||
|
|
'label' => 'Кол-во отправленных презентаций',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'meets' => [
|
||
|
|
'label' => 'Встречи на объекте',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'advPacks' => [
|
||
|
|
'label' => 'Реклама',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'advStart' => [
|
||
|
|
'label' => 'Дата начала рекламы',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'dateSorter'
|
||
|
|
],
|
||
|
|
'advEnd' => [
|
||
|
|
'label' => 'Дата окончания рекламы',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => 'dateSorter'
|
||
|
|
],
|
||
|
|
'daysCount' => [
|
||
|
|
'label' => 'Кол-во дней в рекламе',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'adv_price' => [
|
||
|
|
'data-formatter' => 'advPriceFormatter',
|
||
|
|
'label' => 'Потрачено на рекламу',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
'data-sorter' => "priceSorter"
|
||
|
|
],
|
||
|
|
'contract_type' => [
|
||
|
|
'label' => 'Тип договора',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'contract_number' => [
|
||
|
|
'label' => 'Номер договора',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'contract_date' => [
|
||
|
|
'label' => 'Дата договора',
|
||
|
|
'data-sortable' => 'true'
|
||
|
|
],
|
||
|
|
'cadastral_number' => [
|
||
|
|
'label' => 'Кадастровый номер',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
|
||
|
|
],
|
||
|
|
'tags' => [
|
||
|
|
'label' => 'Теги',
|
||
|
|
'data-sortable' => 'true',
|
||
|
|
|
||
|
|
],
|
||
|
|
|
||
|
|
];
|
||
|
|
|
||
|
|
$orderColumns = getTableColumns($tableId);
|
||
|
|
$orderMap = explode(',', $orderColumns );
|
||
|
|
if (is_null($orderColumns)) {
|
||
|
|
$orderMap = [];
|
||
|
|
}
|
||
|
|
|
||
|
|
foreach ($schema as $column => $value) {
|
||
|
|
if (is_null($orderColumns)) {
|
||
|
|
$orderMap[] = $column;
|
||
|
|
$schema[$column]['data-visible'] = true;
|
||
|
|
$value['data-visible'] = 'true';
|
||
|
|
}else {
|
||
|
|
if (!in_array($column, $orderMap)) {
|
||
|
|
$orderMap[] = $column;
|
||
|
|
$schema[$column]['data-visible'] = false;
|
||
|
|
$value['data-visible'] = 'false';
|
||
|
|
} else {
|
||
|
|
$schema[$column]['data-visible'] = true;
|
||
|
|
$value['data-visible'] = 'true';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
?>
|
||
|
|
<style>
|
||
|
|
.grid_table{
|
||
|
|
overflow: auto;
|
||
|
|
}
|
||
|
|
/* .grid_table table{
|
||
|
|
width: 2800px;
|
||
|
|
display: unset;
|
||
|
|
}*/
|
||
|
|
#object_list_table td.select-cell .select-box {
|
||
|
|
display: none;
|
||
|
|
}
|
||
|
|
.row-selected, .row-selected td {
|
||
|
|
background-color: #bae1bc !important;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
<div class="object-content__preloader__agency"><img src="../images/rocket-spinner.svg" width="96px"></div>
|
||
|
|
<div class="crm__table" style="margin-bottom: 40px;">
|
||
|
|
|
||
|
|
<div class="grid_table" id="objects-table" style="">
|
||
|
|
<?php if (stripos($_SERVER['SCRIPT_NAME'], "getAgencyObjects.php")) : ?>
|
||
|
|
<div id="export_objects" data-state="ready" data-section="agency_objects" style="margin-left:20px;margin-top:3px;width: max-content;">
|
||
|
|
<a href="javascript:{}" class="jw__g-button exportExcel" style="top: 16px;">Экспорт в Excel</a> <span id="export_objects_loader" class="widget-number" style="margin-right: 22px;display: none;"><img src="/images/rocket-spinner.svg" width="50px"></span>
|
||
|
|
</div>
|
||
|
|
<?php elseif (stripos($_SERVER['SCRIPT_NAME'], "getObjectsView.php")) : ?>
|
||
|
|
<div id="export_objects" data-state="ready" data-section="my_objects" style="margin-left:20px;margin-top:3px;width: max-content;">
|
||
|
|
<a href="javascript:{}" class="jw__g-button exportExcel" style="top: 16px;">Экспорт в Excel</a> <span id="export_objects_loader" class="widget-number" style="margin-right: 22px;display: none;"><img src="/images/rocket-spinner.svg" width="50px"></span>
|
||
|
|
</div>
|
||
|
|
<?php endif; ?>
|
||
|
|
<table
|
||
|
|
id="<?=(isset($_POST['find_object'])) ? 'object_list_table_find' : 'object_list_table'?>"
|
||
|
|
class="table table-condensed table-hover table-striped sar-table"
|
||
|
|
data-toolbar=".toolbar"
|
||
|
|
data-show-columns="true"
|
||
|
|
data-reorderable-columns="true"
|
||
|
|
<?=($post['view'] == 'table' || $_SESSION['adv_table_view']) ?
|
||
|
|
'data-locale="ru-RU"
|
||
|
|
data-pagination="true"
|
||
|
|
data-pagination-h-align="left"
|
||
|
|
data-pagination-detail-h-align="right"
|
||
|
|
data-page-size="10"' : ''?>
|
||
|
|
>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<?php if(!isset($_POST['find_object'])){ ?>
|
||
|
|
<th data-checkbox="true" data-switchable="false" data-visible-in-selection="false"></th>
|
||
|
|
<th data-field="edit" data-width="50" data-formatter="editFormatter" data-visible-in-selection="false" data-switchable="false"> </th>
|
||
|
|
<th data-field="archive" data-width="50" data-formatter="archiveFormatter" data-visible-in-selection="false" data-switchable="false"> </th>
|
||
|
|
<th data-field="links" data-width="50" data-css-class="object-edit-cell" data-formatter="linksFormatter" data-visible-in-selection="false" data-switchable="false"> </th>
|
||
|
|
<?php } else {
|
||
|
|
?>
|
||
|
|
<th data-field="home" data-width="100" data-formatter="home" data-visible-in-selection="false" data-switchable="false">Выбрать</th>
|
||
|
|
<?php
|
||
|
|
|
||
|
|
} foreach ($orderMap as $column) {
|
||
|
|
$value = $schema[$column];
|
||
|
|
$html = '<th class="drag-accept"';
|
||
|
|
$html .= 'data-field="'. $column . '" ';
|
||
|
|
if (isset($value['data-type'])) {
|
||
|
|
$html .= 'data-type="'. $value['data-type'] . '" ';
|
||
|
|
}
|
||
|
|
|
||
|
|
if (isset($value['data-width'])) {
|
||
|
|
$html .= 'data-width="'. $value['data-width'] . '" ';
|
||
|
|
}
|
||
|
|
|
||
|
|
if (isset($value['style'])) {
|
||
|
|
$html .= 'style="'. $value['style'] . '" ';
|
||
|
|
}
|
||
|
|
if (isset($value['data-formatter'])) {
|
||
|
|
$html .= 'data-formatter="'. $value['data-formatter'] . '" ';
|
||
|
|
}
|
||
|
|
if (isset($value['data-identifier'])) {
|
||
|
|
$html .= 'data-identifier="'. $value['data-identifier'] . '" ';
|
||
|
|
}
|
||
|
|
if (isset($value['data-sortable'])) {
|
||
|
|
$html .= 'data-sortable="'. $value['data-sortable'] . '" ';
|
||
|
|
}
|
||
|
|
if (isset($value['data-sorter'])) {
|
||
|
|
$html .= 'data-sorter="'. $value['data-sorter'] . '" ';
|
||
|
|
}
|
||
|
|
if (isset($value['data-visible'])) {
|
||
|
|
$html .= 'data-visible="'. $value['data-visible'] . '" ';
|
||
|
|
}
|
||
|
|
|
||
|
|
$html .= '>' . $value['label'] . '</th>
|
||
|
|
';
|
||
|
|
|
||
|
|
echo $html; }?>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|