1161 lines
85 KiB
PHP
1161 lines
85 KiB
PHP
|
|
<?php
|
|||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|||
|
|
if (isset($_GET['quit'])) {
|
|||
|
|
$user = new User;
|
|||
|
|
$user->quit();
|
|||
|
|
exit;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (isset($_GET['upd-sess'])) {
|
|||
|
|
$user = new User;
|
|||
|
|
$user->get($_SESSION['id']);
|
|||
|
|
$user->checkPermissions();
|
|||
|
|
|
|||
|
|
return 'session updated';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
setOnline();
|
|||
|
|
$user = new User;
|
|||
|
|
$user->get($_SESSION['id']);
|
|||
|
|
$user->checkPermissions();
|
|||
|
|
|
|||
|
|
if ($_SESSION['individual'] == 1) {
|
|||
|
|
/* if($_SESSION['pay'] && ($_SERVER['SCRIPT_NAME'] != '/settings.php' && $_SERVER['SCRIPT_NAME'] != '/help.php')) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
$hasRestrictedAccess = $_SESSION['pay'];
|
|||
|
|
} else {
|
|||
|
|
// даем пользоваться системой
|
|||
|
|
// если мы дошли до этого места и стоит флаг, что нужно оплатить - значит мы агентство или менеджер или агент от агентства
|
|||
|
|
// формируем флаг частичного доступа пока по $_SESSION['pay'] - в будущем могут быть другие условия
|
|||
|
|
$hasRestrictedAccess = $_SESSION['pay'];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$hasDeveloper = (bool)$user->role_developer;
|
|||
|
|
|
|||
|
|
//если у нас не оплачено и было оплачено до этого - не даем пользоваться системой..
|
|||
|
|
if ($_SESSION['pay'] && $_SESSION['paidEnded']) {
|
|||
|
|
if($_SERVER['SCRIPT_NAME'] != '/settings.php' && $_SERVER['SCRIPT_NAME'] != '/help.php') {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$menuPermissions = $user->checkMenuPermissions();
|
|||
|
|
if (!empty($menuPermissions)) {
|
|||
|
|
switch ($_SERVER['SCRIPT_NAME']) {
|
|||
|
|
case '/charts.php':
|
|||
|
|
if ($menuPermissions['menu_office'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/my-objects.php':
|
|||
|
|
if ($menuPermissions['menu_objects'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/agency-objects.php':
|
|||
|
|
if ($menuPermissions['menu_ads'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/clients.php':
|
|||
|
|
if ($menuPermissions['menu_clients'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/requisitions.php':
|
|||
|
|
if ($menuPermissions['menu_submissions'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/docs.php':
|
|||
|
|
if ($menuPermissions['menu_docs'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/settings.php':
|
|||
|
|
if ($menuPermissions['menu_settings'] == 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
case '/sale.php':
|
|||
|
|
if ($menuPermissions['menu_search'] == 0) {
|
|||
|
|
if ($menuPermissions['menu_office'] == 1) {
|
|||
|
|
header("location:/charts.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
} elseif ($menuPermissions['menu_objects'] == 1) {
|
|||
|
|
|
|||
|
|
header("location:/my-objects.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
} elseif ($menuPermissions['menu_submissions'] == 1) {
|
|||
|
|
|
|||
|
|
header("location:/requisitions.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
} elseif ($menuPermissions['menu_docs'] == 1) {
|
|||
|
|
|
|||
|
|
header("location:/docs.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
} elseif ($menuPermissions['menu_settings'] == 1) {
|
|||
|
|
|
|||
|
|
header("location:/settings.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
} else {
|
|||
|
|
|
|||
|
|
header("location:/help.php");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
} elseif ($_SERVER['SCRIPT_NAME'] === '/agency-objects.php' && $_SESSION['agency'] === 0 && $_SESSION['users_admin'] === 0) {
|
|||
|
|
header("location:/");
|
|||
|
|
die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/add-object.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/clients.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/agency-objects.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/my-objects.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/partners.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/calendar.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/main.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*if ($_SERVER['SCRIPT_NAME'] == '/sale.php' && isset($hasRestrictedAccess) && $hasRestrictedAccess) {
|
|||
|
|
if($_SESSION['id'] == 5238) {
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
header("location:/settings.php"); die("Доступ запрещён!");
|
|||
|
|
}
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
if (!$_SESSION['checked']) {
|
|||
|
|
$_SESSION['checked'] = array();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// сбрасываем сортировку, если пользователь ушел из раздела Клиенты
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "clients.php") == false) {
|
|||
|
|
unset($_SESSION['clients_sort_order']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<!DOCTYPE HTML>
|
|||
|
|
<html>
|
|||
|
|
|
|||
|
|
<head>
|
|||
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|||
|
|
<title>JoyWork.ru</title>
|
|||
|
|
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.png" />
|
|||
|
|
<link rel="stylesheet" media="screen" type="text/css" href="<?= asset('/css/base.css') ?>">
|
|||
|
|
<link rel="stylesheet" media="screen" type="text/css" title="style" href="<?= asset('/css/crm.css') ?>">
|
|||
|
|
<link rel="stylesheet" media="screen" type="text/css" title="style" href="<?= asset('/css/style.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="/css/select2.min.css" type="text/css" />
|
|||
|
|
<link rel="stylesheet" href="/css/select2-bootstrap.min.css" type="text/css" />
|
|||
|
|
<link rel="stylesheet" title="style" href="<?= asset('/css/viewer.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/fastselect.css') ?>">
|
|||
|
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
|||
|
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
window.userPermissions = <?= json_encode($menuPermissions ?: new stdClass(), JSON_UNESCAPED_UNICODE) ?>;
|
|||
|
|
</script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/contacts_visibility.js') ?>"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/f_main.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/jquery.maskedinput.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/formstyler.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/select2.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/slimscroll.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/ru.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/datepicker.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/main.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/viewer.min.js') ?>"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
(window.Image ? (new Image()) : document.createElement('img')).src = 'https://vk.com/rtrg?p=VK-RTRG-209838-5sAIl';
|
|||
|
|
</script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
(window.Image ? (new Image()) : document.createElement('img')).src = 'https://vk.com/rtrg?p=VK-RTRG-211261-1Yrhf';
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/jquery.overscroll.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/fastselect.standalone.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/crm.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/fotorama.js') ?>"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/axios.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/vue.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/vue-multiselect.min.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/vue-select.js') ?>"></script>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/v-mask.min.js') ?>"></script>
|
|||
|
|
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/vue-select.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/funnel.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/all.min.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/chat/style.min.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/analytics/local.css') ?>">
|
|||
|
|
<link rel="stylesheet" href="<?= asset('/css/analytics/styles.min.css') ?>">
|
|||
|
|
<script type="text/javascript" src="/js/detector.js"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
let isNotifyShow = window.sessionStorage.getItem('is_notify_show', 0);
|
|||
|
|
if (!parseInt(isNotifyShow) && (isMobile() && !isStandalone())) {
|
|||
|
|
if (confirm('Для Вас доступна мобильная версия CRM. Перейти на https://m.joywork.ru/?')) {
|
|||
|
|
window.location.href = "https://m.joywork.ru/";
|
|||
|
|
} else {
|
|||
|
|
window.sessionStorage.setItem('is_notify_show', 1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
<?php if (stripos($_SERVER['SCRIPT_NAME'], "requisitions.php") === false) {
|
|||
|
|
echo "localStorage.removeItem('view_req');";
|
|||
|
|
} ?>
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
setInterval(setOnline, 60000);
|
|||
|
|
|
|||
|
|
let warning_modal_opened = false;
|
|||
|
|
let interval, div, mainContainer;
|
|||
|
|
let timer = 30;
|
|||
|
|
|
|||
|
|
function update_session() {
|
|||
|
|
timer = 30;
|
|||
|
|
warning_modal_opened = false;
|
|||
|
|
clearInterval(interval)
|
|||
|
|
mainContainer.style.overflow = 'auto'
|
|||
|
|
div.remove()
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function manage_session() {
|
|||
|
|
const cookies = document.cookie.split(';');
|
|||
|
|
const expiration_cookie = cookies.find((cookie) => cookie.includes('PHPSESSID_EXPIRATION'))
|
|||
|
|
|
|||
|
|
if (!expiration_cookie) return;
|
|||
|
|
|
|||
|
|
let expiration_date = expiration_cookie.split('=')[1]
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (!expiration_date) return;
|
|||
|
|
|
|||
|
|
const current_date = Date.now().toString().slice(0, 10);
|
|||
|
|
|
|||
|
|
//-180 - это смещение москвы
|
|||
|
|
const offset = new Date().getTimezoneOffset();
|
|||
|
|
|
|||
|
|
//если мы не в Москве
|
|||
|
|
if (offset !== -180) {
|
|||
|
|
//убираем смещение Москвы и меняем знак
|
|||
|
|
const diff = -(offset + 180);
|
|||
|
|
expiration_date = expiration_date + diff * 60;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (+expiration_date - +current_date <= 30) {
|
|||
|
|
if (!warning_modal_opened) {
|
|||
|
|
const html = `<div class="modal-form">
|
|||
|
|
<div class="timer-content">
|
|||
|
|
<p>Ваша сессия прервется через <span class="timer">30</span> секунд</p>
|
|||
|
|
<button style="margin-top: 20px" class="top-line__button button-fl-left">Продолжить сессию</button>
|
|||
|
|
</div>
|
|||
|
|
</div>`;
|
|||
|
|
|
|||
|
|
mainContainer = document.getElementById('main')
|
|||
|
|
mainContainer.style.overflow = 'hidden'
|
|||
|
|
div = document.createElement('div')
|
|||
|
|
div.classList.add('modal-session')
|
|||
|
|
div.innerHTML = html;
|
|||
|
|
|
|||
|
|
mainContainer.appendChild(div)
|
|||
|
|
|
|||
|
|
interval = setInterval(() => {
|
|||
|
|
if (timer == 0) {
|
|||
|
|
location.href += location.search ? '&quit=true' : '?quit=true'
|
|||
|
|
div.remove()
|
|||
|
|
}
|
|||
|
|
timer--;
|
|||
|
|
mainContainer.querySelector('.timer').innerHTML = `00:${timer.toString().length > 1 ? timer : `0${timer}`}`
|
|||
|
|
}, 1000)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
warning_modal_opened = true;
|
|||
|
|
|
|||
|
|
div.querySelector('.top-line__button').addEventListener('click', () => {
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/templates/new-header.php?upd-sess=true',
|
|||
|
|
success: update_session,
|
|||
|
|
});
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
if (interval) update_session()
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
setInterval(() => {
|
|||
|
|
manage_session()
|
|||
|
|
}, 1000);
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<?php if (stripos($_SERVER['SCRIPT_NAME'], "charts.php") !== false) { ?>
|
|||
|
|
<script type="text/javascript" src="<?= asset('/js/charts.js') ?>"></script>
|
|||
|
|
<?php } ?>
|
|||
|
|
<link rel="preconnect" href="//api-maps.yandex.ru">
|
|||
|
|
<link rel="dns-prefetch" href="//api-maps.yandex.ru">
|
|||
|
|
|
|||
|
|
</head>
|
|||
|
|
|
|||
|
|
<body id="main" <?php
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "clients.php") === false) {
|
|||
|
|
unset($_SESSION['clients_list_view']);
|
|||
|
|
unset($_SESSION['clients_table_view']);
|
|||
|
|
unset($_SESSION['kanban']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "new-main.php") !== false)
|
|||
|
|
echo 'class="jw-main"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "calendar.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-calendar"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "help.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-help"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "settings.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-settings"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "users.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-users"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "clients.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-clients"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "requisitions.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-requisitions"';
|
|||
|
|
|
|||
|
|
if (stripos($_SERVER['SCRIPT_NAME'], "agency-objects.php") !== false)
|
|||
|
|
echo 'class="jw-main jw-agency-objects"';
|
|||
|
|
|
|||
|
|
?>>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<input type="hidden" value="<?= $_SESSION['id']; ?>" id="session_user_id" />
|
|||
|
|
<input type="hidden" value="<?= $_SESSION['paidEnded']; ?>" id="user_pay_ended" />
|
|||
|
|
<input type="hidden" value="<?= $user->agencyId; ?>" id="session_agency_id" />
|
|||
|
|
<input type="hidden" value="<?= $user->agency || $user->users_admin; ?>" id="session_admin_rights" />
|
|||
|
|
<input type="hidden" value="<?= ($_SESSION['use_advert_budget']); ?>" id="session_use_advert_budget" />
|
|||
|
|
<input type="hidden" value="<?= $hasDeveloper; ?>" id="has_developer" />
|
|||
|
|
<input type="hidden" value="<?= $hasRestrictedAccess; ?>" id="has_restricted_access" />
|
|||
|
|
<input type="hidden" value="<?= ((isset($_SESSION['user_can'])) ? htmlspecialchars(json_encode($_SESSION['user_can'])) : '[]'); ?>" id="session_user_can" />
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
if ($_SESSION['individual'] == 0) {
|
|||
|
|
$agencySettings = RocketChat::getAgencyChatSettings($user->agencyId);
|
|||
|
|
|
|||
|
|
$userSettings = RocketChat::getUserChatSettings();
|
|||
|
|
|
|||
|
|
if ($agencySettings && $agencySettings['general_channel_id']) {
|
|||
|
|
|
|||
|
|
if (!$userSettings || !$userSettings['chat_login']) {
|
|||
|
|
|
|||
|
|
//создаем пользователя
|
|||
|
|
$result = RocketChat::createChatUser($user);
|
|||
|
|
|
|||
|
|
if ($result['success']) {
|
|||
|
|
$userSettings = $result['user'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (!$userSettings['chat_token'] && $userSettings['chat_login']) {
|
|||
|
|
//логиним для получения ИД пользователя в чате
|
|||
|
|
$result = RocketChat::loginUser($_SESSION['id']);
|
|||
|
|
if ($result['success']) {
|
|||
|
|
$userSettings = $result['user'];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($userSettings['chat_token']) {
|
|||
|
|
if ($userSettings['add_to_general'] == 0 && !RocketChat::checkUserInChannel($user, $agencySettings['general_channel_id'])) {
|
|||
|
|
//добавляем в канал агентства
|
|||
|
|
RocketChat::addUserToChannel($user, $agencySettings['general_channel_id']);
|
|||
|
|
$userSettings['add_to_general'] = 1;
|
|||
|
|
$sqlChatSetUpd = "UPDATE `chat_settings_user` SET add_to_general = 1 WHERE user_id = $user->id";
|
|||
|
|
mysql_query($sqlChatSetUpd);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<input type="hidden" value="<?= $agencySettings['general_channel_id']; ?>" id="session_agency_channel_id" />
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
if ($userSettings && $userSettings['chat_token']) {
|
|||
|
|
|
|||
|
|
$result = RocketChat::loginUser($_SESSION['id']);
|
|||
|
|
$userSettings = $result['user'];
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<input type="hidden" value="<?= $userSettings['chat_login']; ?>" id="session_user_chat_username" />
|
|||
|
|
<input type="hidden" value="<?= $userSettings['chat_token']; ?>" id="session_user_chat_token" />
|
|||
|
|
<input type="hidden" value="<?= $userSettings['chat_user_id']; ?>" id="session_user_chat_user_id" />
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/* if($_SESSION['pay'] && $_SESSION['individual'] == 1 && $_SERVER['SCRIPT_NAME'] != '/help.php') {
|
|||
|
|
if($user->id_manager) {
|
|||
|
|
$msg_pay = "Чтобы продолжать пользоваться сервисом,<br/>попросите руководителя внести оплату";
|
|||
|
|
} else {
|
|||
|
|
$msg_pay = "Чтобы продолжать пользоваться сервисом,<br/>необходимо внести оплату.";
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<div class="f__modal-bg" id="pay_bg" style="display: none;">
|
|||
|
|
<div class="f__modal sign" id="pay" style="display: none;">
|
|||
|
|
<span class="pseudo-link closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="f-col">
|
|||
|
|
<div class="f-col-3">
|
|||
|
|
<h2 style="text-align: center;font-size: 190%;">Внимание!</h2>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="f-col">
|
|||
|
|
<div class="f-col-3"> </div>
|
|||
|
|
<div class="f-col-6">
|
|||
|
|
<div class="bg-danger" style="font-size:1.2em; border-radius:5px; text-align:center;"><?php echo $msg_pay; ?></div>
|
|||
|
|
<div style="width:137px; margin:20px auto;"><a onclick='$("#pay_bg").hide(10);$("#pay").hide(10);$("body").removeClass("lock");' class="fr-btn medium-button">ОПЛАТИТЬ</a></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="f-col-3"> </div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<script>show_pay();</script>
|
|||
|
|
<?php
|
|||
|
|
}*/
|
|||
|
|
?>
|
|||
|
|
<div class="jw__layout">
|
|||
|
|
<div class="jw__layout-content">
|
|||
|
|
<div class="main-block">
|
|||
|
|
<?php
|
|||
|
|
if ($_SESSION['id']) {
|
|||
|
|
$agenciesHaveAccessToNewComplexes = [4,12028,12061, 17328, 11325, 16700, 19172, 13735, 19093, 16378, 19467, 20197, 19909, 19646];
|
|||
|
|
$_SESSION['ahatnc'] = base64_encode(serialize($agenciesHaveAccessToNewComplexes));
|
|||
|
|
$show_tariff_badge = false;
|
|||
|
|
if ($user->agency || $user->users_admin || $_SESSION['individual']) {
|
|||
|
|
$show_tariff_badge = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$showZipalBalance = false;
|
|||
|
|
$showEgrnRequests = false;
|
|||
|
|
$showAntiznakRequest = false;
|
|||
|
|
|
|||
|
|
if (($_SESSION['individual'] == 1 && !empty($user->zipal_login) && !empty($user->zipal_password)) ||
|
|||
|
|
($_SESSION['agency'] == 1 && !empty($user->zipal_login) && !empty($user->zipal_password)) ||
|
|||
|
|
(((!empty($user->zipal_login) && !empty($user->zipal_password)) ||
|
|||
|
|
(!empty($user->agencyZipalLogin) && !empty($user->agencyZipalPassword))))
|
|||
|
|
) {
|
|||
|
|
$showZipalBalance = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($user->egrn_request_count > 0 || (isset($user->agencyEgrnRequestCount) && $user->agencyEgrnRequestCount > 0)) {
|
|||
|
|
$showEgrnRequests = true;
|
|||
|
|
}
|
|||
|
|
if ($user->antiznak_request_count > 0 || (isset($user->agencyAntiznakRequestCount) && $user->agencyAntiznakRequestCount > 0)) {
|
|||
|
|
$showAntiznakRequest = true;
|
|||
|
|
} ?>
|
|||
|
|
<div class="content-top">
|
|||
|
|
<div class="inner">
|
|||
|
|
<div class="top__user">
|
|||
|
|
<?php if ($user->user_logo) { ?>
|
|||
|
|
<div class="user-pic" onclick="location.replace('/settings.php');">
|
|||
|
|
<img src="/photos/agency/<?php echo $user->user_logo; ?>?t=<?php echo time(); ?>">
|
|||
|
|
</div>
|
|||
|
|
<?php } else { ?>
|
|||
|
|
<div class="no-user-pic" onclick="location.replace('/settings.php');">
|
|||
|
|
<img src="/images/user-pic.svg">
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<div class="user-name" onclick="location.replace('/settings.php');">
|
|||
|
|
<span><?php echo $_SESSION['fio']; ?></span>
|
|||
|
|
</div>
|
|||
|
|
<?php if ($_SESSION['pay']) { ?>
|
|||
|
|
<?php if ($show_tariff_badge) { ?>
|
|||
|
|
<div class="user-tarif" onclick="location.replace('/settings.php');">
|
|||
|
|
<span>Тариф не оплачен</span>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php } else {
|
|||
|
|
$tarif = new Tarif;
|
|||
|
|
if ($user->id_manager) {
|
|||
|
|
$agency = new User;
|
|||
|
|
$agency->get($user->agencyId);
|
|||
|
|
$id_tarif = $agency->id_tarif;
|
|||
|
|
$date_tarif = $agency->date_tarif;
|
|||
|
|
} else {
|
|||
|
|
$id_tarif = $user->id_tarif;
|
|||
|
|
$date_tarif = $user->date_tarif;
|
|||
|
|
}
|
|||
|
|
$tarif->get($id_tarif);
|
|||
|
|
$date_tarif = strtotime($date_tarif);
|
|||
|
|
$date_end = $date_tarif + $tarif->period * 3600 * 24;
|
|||
|
|
$date_end_f = date("d.m.Y H:i", $date_end);
|
|||
|
|
$dney = ceil(($date_end - time()) / 24 / 3600);
|
|||
|
|
if ($dney < 0) {
|
|||
|
|
$dney = 0;
|
|||
|
|
$color = "color:red;";
|
|||
|
|
}
|
|||
|
|
if ($dney == -0) {
|
|||
|
|
$dney = 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<table>
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<?php if ($show_tariff_badge) { ?>
|
|||
|
|
<div class="user-tarif">
|
|||
|
|
<span class="tarif-active">Осталось: <?php echo $dney . " " . padezh_day($dney); ?></span>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php if ($showZipalBalance) { ?>
|
|||
|
|
<div class="user-tarif">
|
|||
|
|
<span class="tarif-zipal">Zipal: <?php if (!empty($user->zipal_balance)) {
|
|||
|
|
echo $user->zipal_balance;
|
|||
|
|
} else {
|
|||
|
|
echo $user->agencyZipalBalance;
|
|||
|
|
} ?> руб.
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php if ($showEgrnRequests) { ?>
|
|||
|
|
<div class="user-tarif">
|
|||
|
|
<span class="tarif-egrn">ЕГРН: <?php if (!empty($user->egrn_request_count)) {
|
|||
|
|
echo $user->egrn_request_count;
|
|||
|
|
} else {
|
|||
|
|
echo $user->agencyEgrnRequestCount;
|
|||
|
|
} ?>
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php if ($showAntiznakRequest) { ?>
|
|||
|
|
<div class="user-tarif">
|
|||
|
|
<span class="tarif-antiznak">Очистка фото: <?php if (!empty($user->antiznak_request_count)) {
|
|||
|
|
echo $user->antiznak_request_count;
|
|||
|
|
} else {
|
|||
|
|
echo $user->agencyAntiznakRequestCount;
|
|||
|
|
} ?>
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<?php if ($_SESSION['individual'] == 0) { ?>
|
|||
|
|
<button title="Чат" type="button" <?= (!$show_tariff_badge) ? ' style="margin-left:0px;" ' : '' ?> class="open-chat" onclick="openChat(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img src="/images/chat/chat-show.svg" alt="img">
|
|||
|
|
<span class="quantity-message" style="display: none;"></span>
|
|||
|
|
</button>
|
|||
|
|
<?php } ?>
|
|||
|
|
</td>
|
|||
|
|
<?php
|
|||
|
|
$chat = new ChatsCianAvito();
|
|||
|
|
$can_chat_cian = $chat->can_chat($user, 2);
|
|||
|
|
$can_chat_avito = $chat->can_chat($user, 1);
|
|||
|
|
?>
|
|||
|
|
<td>
|
|||
|
|
<?php if ($can_chat_cian) { ?>
|
|||
|
|
<button title="Чат Циан" type="button" <?= (!$show_tariff_badge) ? ' style="margin-left:0px;" ' : '' ?> class="open-chat" onclick="open_chat_cian(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/cian_chat.png" alt="img">
|
|||
|
|
<span class="quantity-message-cian" style="display: none;"></span>
|
|||
|
|
</button>
|
|||
|
|
<?php } else { ?>
|
|||
|
|
<button title="Чат Циан" type="button" <?= (!$show_tariff_badge) ? ' style="margin-left:0px;" ' : '' ?> class="open-chat" onclick="open_error(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/cian_chat.png" alt="img">
|
|||
|
|
<span class="quantity-message-cian" style="display: none;"></span>
|
|||
|
|
</button>
|
|||
|
|
<?php } ?>
|
|||
|
|
</td>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
if ($can_chat_avito) {
|
|||
|
|
?>
|
|||
|
|
<td>
|
|||
|
|
<button title="Чат Авито" type="button" <?= (!$show_tariff_badge) ? ' style="margin-left:0px;" ' : '' ?> class="open-chat" onclick="open_chat_avito(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/avito_chat.png" alt="img">
|
|||
|
|
<span class="quantity-message-avito" style="display:none"></span>
|
|||
|
|
</button>
|
|||
|
|
</td>
|
|||
|
|
<?php } else { ?>
|
|||
|
|
<td>
|
|||
|
|
<button title="Чат Авито" type="button" <?= (!$show_tariff_badge) ? ' style="margin-left:0px;" ' : '' ?> class="open-chat" onclick="open_error(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/avito_chat.png" alt="img">
|
|||
|
|
<span class="quantity-message-avito" style="display:none"></span>
|
|||
|
|
</button>
|
|||
|
|
</td>
|
|||
|
|
<?php }
|
|||
|
|
if ($user->agencyEnableWazzap && $user->added_to_wazzap) {
|
|||
|
|
?>
|
|||
|
|
<td>
|
|||
|
|
<button title="Wazzup" type="button" class="open-chat" onclick="window.location.href = '/wazzap.php'; event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/wazzap_icon.png" alt="img">
|
|||
|
|
<span id="wazzapCounterHeader" style="display:none"></span>
|
|||
|
|
</button>
|
|||
|
|
</td>
|
|||
|
|
<?php
|
|||
|
|
} else {
|
|||
|
|
if (!$_SESSION['individual']) {
|
|||
|
|
?>
|
|||
|
|
<td>
|
|||
|
|
<button title="Wazzup" type="button" class="open-chat" onclick="openWazzapModal(); event.preventDefault(); event.stopPropagation(); return false;">
|
|||
|
|
<img width="30px;" src="/images/wazzap_icon.png" alt="img">
|
|||
|
|
</button>
|
|||
|
|
</td>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
<?php } ?>
|
|||
|
|
</div>
|
|||
|
|
<?php if ($_SESSION['use_advert_budget']) {
|
|||
|
|
|
|||
|
|
$budgets = [];
|
|||
|
|
$use_advert_budget = true;
|
|||
|
|
$advert_budgets = new AdvertBudgets();
|
|||
|
|
|
|||
|
|
if ($user->agency || $user->users_admin) {
|
|||
|
|
//$budgets = $advert_budgets->getAdvertBudgets(null, true);
|
|||
|
|
echo '<script type="text/javascript">$(window).load(function () {objectAdvertUpdate()})</script>';
|
|||
|
|
} else {
|
|||
|
|
$budgets = $advert_budgets->getAdvertBudgets($user->id);
|
|||
|
|
$budgets = $budgets[$user->id];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<div class="top__advert-budget" data-user-id="<?= $user->id; ?>" data-role-id="<?= $user->role_id; ?>">
|
|||
|
|
<h3>
|
|||
|
|
<img src="/images/coins.svg" alt="coins" style="vertical-align:bottom;margin-right:3px;height:19px;" />
|
|||
|
|
Рекламный бюджет
|
|||
|
|
</h3>
|
|||
|
|
<?php if ($user->agency || $user->users_admin) { ?>
|
|||
|
|
<div style="text-align:center;">
|
|||
|
|
<img src="../images/rocket-spinner.svg" width="40px">
|
|||
|
|
</div>
|
|||
|
|
<? } else { ?>
|
|||
|
|
<p>Всего: <span><?= (isset($budgets['total'])) ? number_format($budgets['total'], 0, ',', ' ') : 0 ?> руб.</span></p>
|
|||
|
|
<p>Доступно: <span class="<?= (isset($budgets['balance']) && (int)$budgets['balance'] > 0) ? 'is_hight' : 'is_lower' ?>"><?= (isset($budgets['balance'])) ? number_format($budgets['balance'], 0, ',', ' ') : 0 ?> руб.</span></p>
|
|||
|
|
<div class="jw__popup advert_budget_details" style="min-width: 420px;"></div>
|
|||
|
|
<? } ?>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<div class="top__date-time">
|
|||
|
|
<div class="top__date" id="date"></div>
|
|||
|
|
<div class="top__time">
|
|||
|
|
<span id="hours"> </span>
|
|||
|
|
<span id="point">:</span>
|
|||
|
|
<span id="min"> </span>
|
|||
|
|
</div>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var minutes = new Date().getMinutes();
|
|||
|
|
$("#min").html((minutes < 10 ? "0" : "") + minutes);
|
|||
|
|
var hours = new Date().getHours();
|
|||
|
|
$("#hours").html((hours < 10 ? "0" : "") + hours);
|
|||
|
|
$(document).ready(function() {
|
|||
|
|
setInterval(function() {
|
|||
|
|
var minutes = new Date().getMinutes();
|
|||
|
|
$("#min").html((minutes < 10 ? "0" : "") + minutes);
|
|||
|
|
var hours = new Date().getHours();
|
|||
|
|
$("#hours").html((hours < 10 ? "0" : "") + hours);
|
|||
|
|
}, 1000);
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
</div>
|
|||
|
|
<div class="top__quit" onclick="location.replace('/main.php?quit=1');">
|
|||
|
|
<span><i class="ti-power-off"></i></span>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Общее окно добавления -->
|
|||
|
|
<div class="jw__add-popup">
|
|||
|
|
<div class="popup-inner">
|
|||
|
|
<ul>
|
|||
|
|
<li><a href="javascript:{}" class="jw__add-task"><span>Добавить задачу</span></a></li>
|
|||
|
|
<?php if ($menuPermissions['cannot_create_req_manually'] == 0) { ?>
|
|||
|
|
<li><a href="javascript:{}" class="add_req_new"><span>Добавить заявку</span></a></li>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php
|
|||
|
|
/* if($user->agencyId == 13154) {
|
|||
|
|
if($user->id == 13154) { ?>
|
|||
|
|
<li><a href="javascript:{}" class="add_client_new"><span>Добавить клиента</span></a></li>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
} else { */ ?>
|
|||
|
|
<li><a href="javascript:{}" class="add_client_new"><span>Добавить клиента</span></a></li>
|
|||
|
|
<?php // }
|
|||
|
|
?>
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
if (!$hasRestrictedAccess) {
|
|||
|
|
?>
|
|||
|
|
<li><a href="javascript:{}" class="jw__add-object"><span>Добавить объект</span></a></li>
|
|||
|
|
<?php } 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) { ?>
|
|||
|
|
<li><a href="javascript:{}" onclick="trialperiod.modalObj();"><span>Добавить объект</span></a></li>
|
|||
|
|
<?php } else { ?>
|
|||
|
|
<li><a href="javascript:{}" class="jw__add-object"><span>Добавить объект</span></a></li>
|
|||
|
|
<?php }
|
|||
|
|
} ?>
|
|||
|
|
<?php if (($_SESSION['agency'] or $user->manager) && $_SESSION['id'] != 5839) { ?>
|
|||
|
|
<li><a href="/users.php" class="jw__add-employee"><span>Добавить сотрудника</span></a></li>
|
|||
|
|
<?php } ?>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
$selected_page_sql =
|
|||
|
|
"SELECT jp.page_url FROM users
|
|||
|
|
JOIN jw_pages jp ON users.jw_page_id = jp.id
|
|||
|
|
WHERE users.id = " . $_SESSION['id'];
|
|||
|
|
$selected_page_res = mysql_query($selected_page_sql);
|
|||
|
|
$selected_page = mysql_fetch_assoc($selected_page_res);
|
|||
|
|
$user_first_page = (!empty($selected_page['page_url'])) ? $selected_page['page_url'] : '/sale.php';
|
|||
|
|
?>
|
|||
|
|
<div class="content-left">
|
|||
|
|
<div class="header__logo" style="text-align: center;">
|
|||
|
|
<?php if ($_SESSION['photo']) { ?>
|
|||
|
|
<a href="<?= $user->role_developer ? '/' : "$user_first_page" ?>" class="logo-link no-border">
|
|||
|
|
<img style="height: 74px;" src="/photos/agency/<?php echo $_SESSION['photo']; ?>?t=<?php echo time(); ?>">
|
|||
|
|
</a>
|
|||
|
|
<?php } else { ?>
|
|||
|
|
<a href="<?= $user->role_developer ? '/' : "$user_first_page" ?>" class="logo-link no-border">
|
|||
|
|
<div class="text-logo"><span><span class="logo-green">J</span>W</span></div>
|
|||
|
|
</a>
|
|||
|
|
<?php } ?>
|
|||
|
|
</div>
|
|||
|
|
<div class="big-add-button">
|
|||
|
|
<button class="medium-button"><i class="ti-plus"></i></button>
|
|||
|
|
</div>
|
|||
|
|
<div class="left-menu">
|
|||
|
|
|
|||
|
|
<div class="system-menu">
|
|||
|
|
<?php if ((empty($menuPermissions)) || ($menuPermissions['menu_office'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/charts.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "charts.php") !== false) echo 'active'; ?>">
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;width: 45px;height: 50px;" xml:space="preserve" width="44px" height="44px">
|
|||
|
|
<g>
|
|||
|
|
<path d="M192.144,249.328c4.418,0,8-3.582,8-8v-57.59c0-5.404,6.203-15.738,15.928-15.738h12.727 c3.988,3.971,12.606,12.61,19.273,19.304V240c0,4.418,3.582,8,8,8s8-3.582,8-8v-52.676c2.297-2.288,5.97-5.947,9.65-9.618 c3.005-2.998,6.009-5.999,8.263-8.258c0.523-0.524,1.002-1.004,1.441-1.448h12.646c9.725,0,15.928,10.334,15.928,15.738v57.624 c0,4.418,3.582,8,8,8s8-3.582,8-8v-57.624c0-6.964-3.244-14.758-8.678-20.847c-6.268-7.023-14.524-10.891-23.25-10.891h-16 c-2.378,0-4.513,1.038-5.979,2.684c-1.216,1.264-10.147,10.18-17.999,18.003c-1.903-1.91-4.107-4.12-6.313-6.33 c-2.997-3.003-5.997-6.007-8.256-8.261c-5.271-5.26-5.587-5.575-8.178-5.993c-0.422-0.068-0.848-0.102-1.275-0.102h-16 c-8.726,0-16.982,3.868-23.25,10.891c-5.434,6.089-8.678,13.883-8.678,20.847v57.59 C184.144,245.746,187.725,249.328,192.144,249.328z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M256.072,152c26.467,0,48-21.533,48-48v-7.927c0-0.006,0-0.012,0-0.018V56c0-4.418-3.582-8-8-8h-64 c-13.234,0-24,10.766-24,24v32C208.072,130.467,229.604,152,256.072,152z M256.072,136c-17.645,0-32-14.355-32-32v-7.951l64,7.111 V104C288.072,121.645,273.717,136,256.072,136z M232.072,64h56v23.062l-63.117-7.013c-0.297-0.033-0.591-0.046-0.883-0.046V72 C224.072,67.589,227.661,64,232.072,64z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M504,264h-63.567l15.157-45.47c0.72-2.159,0.486-4.523-0.644-6.499l-31.506-55.135c-0.025-0.063-0.052-0.125-0.079-0.188 c-2.227-5.103-7.181-5.173-12.426-5.247c-2.767-0.038-6.556-0.011-11.261,0.084c-7.926,0.159-15.896,0.457-15.975,0.46 c-4.298,0.162-7.7,3.693-7.7,7.994v9.013c-13.786,3.561-24,16.104-24,30.987c0,4.418,3.582,8,8,8h48c4.418,0,8-3.582,8-8 c0-14.883-10.214-27.426-24-30.987v-1.274c7.51-0.219,14.866-0.343,19.048-0.28l28.231,49.405l-14.869,44.607 c-0.28,0.839-0.406,1.691-0.406,2.53H8c-4.418,0-8,3.582-8,8s3.582,8,8,8h8v176c0,4.418,3.582,8,8,8h464c4.418,0,8-3.582,8-8V280h8 c4.418,0,8-3.582,8-8S508.418,264,504,264z M397.853,192h-27.705c2.77-4.779,7.942-8,13.853-8S395.083,187.221,397.853,192z M480,448H32V280h448V448z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M192,312h128c4.418,0,8-3.582,8-8s-3.582-8-8-8H192c-4.418,0-8,3.582-8,8S187.582,312,192,312z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M280,328h-48c-4.418,0-8,3.582-8,8s3.582,8,8,8h48c4.418,0,8-3.582,8-8S284.418,328,280,328z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M64,256h72c4.418,0,8-3.582,8-8s-3.582-8-8-8H64c-4.418,0-8,3.582-8,8S59.582,256,64,256z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M64,232h72c4.418,0,8-3.582,8-8s-3.582-8-8-8H64c-4.418,0-8,3.582-8,8S59.582,232,64,232z" fill="#FFFFFF"></path>
|
|||
|
|
<path d="M80,208h56c4.418,0,8-3.582,8-8s-3.582-8-8-8H80c-4.418,0-8,3.582-8,8S75.582,208,80,208z" fill="#FFFFFF"></path>
|
|||
|
|
</g>
|
|||
|
|
</svg>
|
|||
|
|
<span>Кабинет</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php }
|
|||
|
|
if (!$user->role_developer && (empty($menuPermissions)) || ($menuPermissions['menu_search'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/sale.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "sale.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-search"></i>
|
|||
|
|
<span>Поиск</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php }
|
|||
|
|
else if (($user->role_developer)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/complexes/#/view">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "newbuildings.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-search"></i>
|
|||
|
|
<span>Поиск</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php }
|
|||
|
|
if ((empty($menuPermissions)) || ($menuPermissions['menu_objects'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/my-objects.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "my-objects.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-objects"></i>
|
|||
|
|
<span>Объекты</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php }
|
|||
|
|
|
|||
|
|
if ($_SESSION['agency'] == 1 || $menuPermissions['menu_ads'] == 1 || ($_SESSION['users_admin'] == 1 && empty($menuPermissions))) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/agency-objects.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "agency-objects.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-tasks"></i>
|
|||
|
|
<span>Реклама</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php if (
|
|||
|
|
(
|
|||
|
|
!empty($menuPermissions) && $menuPermissions['menu_complexes'] == 1
|
|||
|
|
)
|
|||
|
|
||
|
|||
|
|
(
|
|||
|
|
(
|
|||
|
|
$_SESSION['agency'] || $_SESSION['users_admin'] || (!empty($menuPermissions) && $menuPermissions['menu_complexes'] == 1)
|
|||
|
|
)
|
|||
|
|
&& (
|
|||
|
|
in_array($_SESSION['agency_id'] , $agenciesHaveAccessToNewComplexes)
|
|||
|
|
)
|
|||
|
|
)
|
|||
|
|
) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/complexes/#/">
|
|||
|
|
<div id="vue-page" class="menu-group-title "><!-- active -->
|
|||
|
|
<svg width="40" height="40" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|||
|
|
<g clip-path="url(#clip0_276_128)">
|
|||
|
|
<path d="M29.4548 2.34375H36.4859V0H27.1111V14.0625H29.4548V2.34375Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 25.7812H52.8923V0H38.8297V2.34375H50.5486V25.7812Z" fill="white"/>
|
|||
|
|
<path d="M45.8611 28.125V37.4998H48.2048V30.4688H68.283V75.3125H70.6267V28.125H59.4158V16.0155H57.072V28.125H45.8611Z" fill="white"/>
|
|||
|
|
<path d="M45.8611 39.8436H48.2048V75.3125H45.8611V39.8436Z" fill="white"/>
|
|||
|
|
<path d="M34.1423 32.8122H31.7986V35.1559H22.9314V37.4997H31.7986V44.5308H11.7205V37.4997H20.5876V35.1559H11.7205V28.1247H31.7986V30.4684H34.1423V16.4062H20.3142V12.5H22.658V10.1562H9.37671V12.5H11.7205V16.4062H9.37671V77.6562H2.34546V61.2498H0.00170898V80H20.5876V77.6562H11.7205V65.6244H31.7986V77.6562H22.9314V80H57.072V77.6562H34.1423V32.8122ZM31.7986 25.7811H11.7205V18.75H31.7986V25.7811ZM14.0642 12.5H17.9705V16.4062H14.0642V12.5ZM11.7205 63.2806V56.2495H20.5876V53.9058H11.7205V46.8745H31.7986V53.9058H22.9314V56.2495H31.7986V63.2806H11.7205Z" fill="white"/>
|
|||
|
|
<path d="M2.34546 51.875H7.03296V49.5312H0.00170898V58.9061H2.34546V51.875Z" fill="white"/>
|
|||
|
|
<path d="M77.658 77.6562H59.4158V80H80.0017V70.625H77.658V77.6562Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 44.8438V47.1875H77.658V68.2812H80.0017V44.8438H72.9705Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 28.125H43.5172V31.6406H41.1734V28.125Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 22.2656H43.5172V25.7812H41.1734V22.2656Z" fill="white"/>
|
|||
|
|
<path d="M45.8609 10.5469H48.2047V14.0625H45.8609V10.5469Z" fill="white"/>
|
|||
|
|
<path d="M45.8609 16.4062H48.2047V19.9219H45.8609V16.4062Z" fill="white"/>
|
|||
|
|
<path d="M45.8609 22.2656H48.2047V25.7812H45.8609V22.2656Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 63.2809H43.5172V66.7966H41.1734V63.2809Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 33.9844H43.5172V37.5H41.1734V33.9844Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 39.8436H43.5172V43.3592H41.1734V39.8436Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 57.4217H43.5172V60.9373H41.1734V57.4217Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 51.5623H43.5172V55.078H41.1734V51.5623Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 37.4998H61.7595V39.8436H50.5486V37.4998Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 69.1403H43.5172V72.6559H41.1734V69.1403Z" fill="white"/>
|
|||
|
|
<path d="M64.1033 65.6244H66.447V67.9681H64.1033V65.6244Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 51.5622H61.7595V53.9059H50.5486V51.5622Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 54.2188H75.3142V56.5625H72.9705V54.2188Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 42.1872H52.8923V44.5309H50.5486V42.1872Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 65.6244H61.7595V67.9681H50.5486V65.6244Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 68.2812H75.3142V70.625H72.9705V68.2812Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 56.2495H52.8923V58.5933H50.5486V56.2495Z" fill="white"/>
|
|||
|
|
<path d="M64.1033 37.4998H66.447V39.8436H64.1033V37.4998Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 63.5938H75.3142V65.9375H72.9705V63.5938Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 10.5469H43.5172V14.0625H41.1734V10.5469Z" fill="white"/>
|
|||
|
|
<path d="M64.1033 51.5622H66.447V53.9059H64.1033V51.5622Z" fill="white"/>
|
|||
|
|
<path d="M55.2361 42.1872H66.447V44.5309H55.2361V42.1872Z" fill="white"/>
|
|||
|
|
<path d="M55.2361 56.2495H66.447V58.5933H55.2361V56.2495Z" fill="white"/>
|
|||
|
|
<path d="M31.7986 4.6875H34.1423V8.20312H31.7986V4.6875Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 10.5469H38.8297V14.0625H36.4859V10.5469Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 16.4062H38.8297V19.9219H36.4859V16.4062Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 22.2656H38.8297V25.7812H36.4859V22.2656Z" fill="white"/>
|
|||
|
|
<path d="M31.7986 10.5469H34.1423V14.0625H31.7986V10.5469Z" fill="white"/>
|
|||
|
|
<path d="M4.68921 58.9062H7.03296V61.25H4.68921V58.9062Z" fill="white"/>
|
|||
|
|
<path d="M14.0642 30.4686H16.408V32.8123H14.0642V30.4686Z" fill="white"/>
|
|||
|
|
<path d="M14.0642 49.2183H16.408V51.562H14.0642V49.2183Z" fill="white"/>
|
|||
|
|
<path d="M4.68921 68.2812H7.03296V70.625H4.68921V68.2812Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 28.1248H38.8297V31.6405H36.4859V28.1248Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 45.703H38.8297V49.2186H36.4859V45.703Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 63.2809H38.8297V66.7966H36.4859V63.2809Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 51.5623H38.8297V55.078H36.4859V51.5623Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 4.6875H43.5172V8.20312H41.1734V4.6875Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 39.8436H38.8297V43.3592H36.4859V39.8436Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 70.3119H52.8923V72.6556H50.5486V70.3119Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 46.8747H61.7595V49.2184H50.5486V46.8747Z" fill="white"/>
|
|||
|
|
<path d="M27.1111 58.5931H29.4548V60.9369H27.1111V58.5931Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 32.8123H61.7595V35.1561H50.5486V32.8123Z" fill="white"/>
|
|||
|
|
<path d="M15.9001 21.0936H22.9314V23.4373H15.9001V21.0936Z" fill="white"/>
|
|||
|
|
<path d="M27.1111 39.8434H29.4548V42.1872H27.1111V39.8434Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 58.9062H75.3142V61.25H72.9705V58.9062Z" fill="white"/>
|
|||
|
|
<path d="M25.2751 21.0936H27.6189V23.4373H25.2751V21.0936Z" fill="white"/>
|
|||
|
|
<path d="M20.5876 72.6555H27.6189V74.9992H20.5876V72.6555Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 49.5312H75.3142V51.875H72.9705V49.5312Z" fill="white"/>
|
|||
|
|
<path d="M72.9705 72.9688H75.3142V75.3125H72.9705V72.9688Z" fill="white"/>
|
|||
|
|
<path d="M15.9001 72.6555H18.2439V74.9992H15.9001V72.6555Z" fill="white"/>
|
|||
|
|
<path d="M4.68921 63.5938H7.03296V65.9375H4.68921V63.5938Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 45.703H43.5172V49.2186H41.1734V45.703Z" fill="white"/>
|
|||
|
|
<path d="M4.68921 54.2188H7.03296V56.5625H4.68921V54.2188Z" fill="white"/>
|
|||
|
|
<path d="M64.1033 32.8123H66.447V35.1561H64.1033V32.8123Z" fill="white"/>
|
|||
|
|
<path d="M45.8609 4.6875H48.2047V8.20312H45.8609V4.6875Z" fill="white"/>
|
|||
|
|
<path d="M41.1734 16.4062H43.5172V19.9219H41.1734V16.4062Z" fill="white"/>
|
|||
|
|
<path d="M64.1033 46.8747H66.447V49.2184H64.1033V46.8747Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 4.6875H38.8297V8.20312H36.4859V4.6875Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 57.4217H38.8297V60.9373H36.4859V57.4217Z" fill="white"/>
|
|||
|
|
<path d="M55.2361 70.3119H66.447V72.6556H55.2361V70.3119Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 69.1403H38.8297V72.6559H36.4859V69.1403Z" fill="white"/>
|
|||
|
|
<path d="M50.5486 60.937H61.7595V63.2808H50.5486V60.937Z" fill="white"/>
|
|||
|
|
<path d="M36.4859 33.9844H38.8297V37.5H36.4859V33.9844Z" fill="white"/>
|
|||
|
|
<pvuieth d="M64.1033 60.937H66.447V63.2808H64.1033V60.937Z" fill="white"/>
|
|||
|
|
<path d="M4.68921 72.9688H7.03296V75.3125H4.68921V72.9688Z" fill="white"/>
|
|||
|
|
</g>
|
|||
|
|
<defs>
|
|||
|
|
<clipPath id="clip0_276_128">
|
|||
|
|
<rect width="80" height="80" fill="white" transform="translate(0.00170898)"/>
|
|||
|
|
</clipPath>
|
|||
|
|
</defs>
|
|||
|
|
</svg>
|
|||
|
|
<div>Жилые комплексы</div>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/*$sqlForAd = "SELECT id FROM `users` WHERE id = 4 or id = 93 or id = 117 or id = 3455 or id in (SELECT id FROM `users` WHERE newbuildings_access = 1) or id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1) or id_manager in (select id from users where id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1)) or id_manager in (select id from users where id_manager in (select id from users where id_manager in (SELECT id FROM `users` WHERE newbuildings_access = 1)))";
|
|||
|
|
$rezForAd = mysql_query($sqlForAd);
|
|||
|
|
|
|||
|
|
$needNewbuildings = false;
|
|||
|
|
while($userId=mysql_fetch_assoc($rezForAd)) {
|
|||
|
|
if ($userId['id'] == $_SESSION['id']) {
|
|||
|
|
$needNewbuildings = true;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($needNewbuildings) {
|
|||
|
|
|
|||
|
|
*/ ?><!--
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/my-reservations.php">
|
|||
|
|
<div class="menu-group-title <?php /*if(stripos($_SERVER['SCRIPT_NAME'],"my-reservations.php") !== false) echo 'active'; */ ?>">
|
|||
|
|
<i class="jw-icon-check-mark"></i>
|
|||
|
|
<span>Брони</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
--><?php
|
|||
|
|
/* }*/
|
|||
|
|
|
|||
|
|
|
|||
|
|
$cl_count = new Clients;
|
|||
|
|
if ($user->agencyId == 11082/* || $user->agencyId == 13154*/) {
|
|||
|
|
if ($user->id == 11258 || $user->id == 12429/* || $user->id == 13154*/) {
|
|||
|
|
?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/clients.php">
|
|||
|
|
<div id="menu_clients" class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "clients.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-clients"></i>
|
|||
|
|
<span>Клиенты</span>
|
|||
|
|
<?php echo $cl_count->getCountNewClients($_SESSION['id']); ?>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
?>
|
|||
|
|
<?php if ((empty($menuPermissions)) || ($menuPermissions['menu_clients'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/clients.php">
|
|||
|
|
<div id="menu_clients" class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "clients.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-clients"></i>
|
|||
|
|
<span>Клиенты</span>
|
|||
|
|
<?php echo $cl_count->getCountNewClients($_SESSION['id']); ?>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
|
|||
|
|
<?php }
|
|||
|
|
if ((empty($menuPermissions)) || ($menuPermissions['menu_submissions'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/requisitions.php">
|
|||
|
|
<div id="menu_clients" class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "requisitions.php") !== false) echo 'active'; ?>">
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="40pt" height="35pt" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
|
|||
|
|
<g transform="translate(60.000000, 0.000000)" fill="#FFFFFF" stroke="none">
|
|||
|
|
<path d="M178.2,192h150a6,6,0,0,0,0-12h-150a6,6,0,0,0,0,12Z" />
|
|||
|
|
<path d="M117.614,184.889l-13.331,12.745-5.407-5.407a6,6,0,1,0-8.484,8.485l9.555,9.556a6,6,0,0,0,8.389.094l17.571-16.8a6,6,0,1,0-8.293-8.673Z" />
|
|||
|
|
<path d="M108.2,156.9a40.722,40.722,0,1,0,40.722,40.721A40.767,40.767,0,0,0,108.2,156.9Zm0,69.443a28.722,28.722,0,1,1,28.722-28.722A28.754,28.754,0,0,1,108.2,226.347Z" />
|
|||
|
|
<path d="M178.2,292h150a6,6,0,0,0,0-12h-150a6,6,0,0,0,0,12Z" />
|
|||
|
|
<path d="M117.614,284.889l-13.331,12.745-5.407-5.407a6,6,0,1,0-8.484,8.485l9.555,9.556a6,6,0,0,0,8.389.094l17.571-16.8a6,6,0,1,0-8.293-8.673Z" />
|
|||
|
|
<path d="M108.2,256.9a40.722,40.722,0,1,0,40.722,40.721A40.767,40.767,0,0,0,108.2,256.9Zm0,69.443a28.722,28.722,0,1,1,28.722-28.722A28.754,28.754,0,0,1,108.2,326.347Z" />
|
|||
|
|
<path d="M117.614,384.889l-13.331,12.745-5.407-5.407a6,6,0,1,0-8.484,8.485l9.555,9.556a6,6,0,0,0,8.389.094l17.571-16.8a6,6,0,1,0-8.293-8.673Z" />
|
|||
|
|
<path d="M108.2,356.9a40.722,40.722,0,1,0,40.722,40.721A40.767,40.767,0,0,0,108.2,356.9Zm0,69.443a28.722,28.722,0,1,1,28.722-28.722A28.754,28.754,0,0,1,108.2,426.347Z" />
|
|||
|
|
<path d="M178.2,212h80a6,6,0,0,0,0-12h-80a6,6,0,0,0,0,12Z" />
|
|||
|
|
<path d="M178.2,312h80a6,6,0,0,0,0-12h-80a6,6,0,0,0,0,12Z" />
|
|||
|
|
<path d="M457.271,267.7A31.02,31.02,0,0,0,433.8,272.18L372,312.766V87.625C372,67.775,355.687,52,335.836,52H298V33.375a6,6,0,0,0-12,0V52H235V33.375a6,6,0,0,0-12,0V52H173V33.375a6,6,0,0,0-12,0V52H110V33.375a6,6,0,0,0-12,0V52H65.836A35.582,35.582,0,0,0,30,87.625v361C30,468.476,45.985,485,65.836,485h270C355.687,485,372,468.476,372,448.625V387.46l96.086-63.1A31.217,31.217,0,0,0,457.271,267.7ZM291.661,89.574a10.61,10.61,0,1,1-10.61,10.61A10.621,10.621,0,0,1,291.661,89.574Zm-62.523,0a10.61,10.61,0,1,1-10.611,10.61A10.622,10.622,0,0,1,229.138,89.574Zm-62.525,0A10.61,10.61,0,1,1,156,100.184,10.622,10.622,0,0,1,166.613,89.574Zm-62.523,0a10.61,10.61,0,1,1-10.611,10.61A10.622,10.622,0,0,1,104.09,89.574ZM360,448.625A24.491,24.491,0,0,1,335.836,473h-270C52.6,473,42,461.859,42,448.625v-361A23.57,23.57,0,0,1,65.836,64H98V78.388c-9,2.636-16.565,11.406-16.565,21.8a22.605,22.605,0,1,0,45.21,0A22.185,22.185,0,0,0,110,78.388V64h51V78.388a22.324,22.324,0,0,0-16.8,21.8,22.634,22.634,0,0,0,45.268,0A23.2,23.2,0,0,0,173,78.388V64h50V78.388c-9,2.636-16.541,11.406-16.541,21.8a22.6,22.6,0,1,0,45.2,0A22.2,22.2,0,0,0,235,78.388V64h51V78.388a22.3,22.3,0,0,0-16.779,21.8,22.631,22.631,0,0,0,45.262,0c0-10.39-7.483-19.16-16.483-21.8V64h37.836C349.069,64,360,74.392,360,87.625V320.646l-22.537,14.8a6,6,0,0,0-1.439,8.7h0a6,6,0,0,0,8.026,1.327l89.218-58.589,7.257,11.046L289.368,397.2l-7.259-11.047,28.4-18.647a6,6,0,0,0-6.587-10.031L270.533,379.4c-.061.041-.117.092-.179.135-.152.108-.3.216-.446.338-.048.04-.09.086-.135.128H178.2a6,6,0,0,0,0,12h84.81l-4.249,8.028c-.185-.017-.371-.028-.561-.028h-80a6,6,0,0,0,0,12h74.225l-6.937,13.105a6,6,0,0,0,5.3,8.807c.053,0,.106,0,.158,0l50.707-1.329c.123,0,.244-.024.366-.034s.261-.017.391-.037c.159-.024.313-.065.467-.1.114-.027.229-.046.343-.08a5.949,5.949,0,0,0,.767-.289c.061-.027.118-.065.178-.1a6,6,0,0,0,.566-.314c.02-.013.041-.02.059-.033L360,395.341Zm-69.439-27.757-29.667.777,13.462-25.438Zm12.655-2.593-.461-.7-6.8-10.344,151.157-99.265,7.258,11.045Zm161.013-106.12-20.756-31.589a19.363,19.363,0,0,1,16.073.484,17.179,17.179,0,0,1,3.973,2.649A19.275,19.275,0,0,1,464.229,312.155Z" />
|
|||
|
|
</g>
|
|||
|
|
</svg>
|
|||
|
|
<span>Заявки</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php }
|
|||
|
|
|
|||
|
|
// считаем события объектов
|
|||
|
|
$sql = "SELECT count(id) FROM user_object_events WHERE user_id = $_SESSION[id] and calendar_view = 0 and object_id>0
|
|||
|
|
and schedule_date is not null and `type` <> 'comment' AND DATE_FORMAT(e.schedule_date, '%Y-%m-%d %H:%i:%s') <= '" . date("Y-m-d H:i:s") . "'";
|
|||
|
|
$rez = mysql_query($sql);
|
|||
|
|
|
|||
|
|
$objectEventCount = mysql_result($rez, 0);
|
|||
|
|
|
|||
|
|
// считаем события клиентов
|
|||
|
|
$sql = "SELECT count(id) FROM user_client_events WHERE user_id = $_SESSION[id] and cancel=0 and calendar_view = 0
|
|||
|
|
and schedule_date is not null AND DATE_FORMAT(e.schedule_date, '%Y-%m-%d %H:%i:%s') <= '" . date("Y-m-d H:i:s") . "'";
|
|||
|
|
$rez = mysql_query($sql);
|
|||
|
|
$clientEventCount = mysql_result($rez, 0);
|
|||
|
|
|
|||
|
|
// суммарное количество событий по объектам и пользователям
|
|||
|
|
$sumCount = intval($objectEventCount) + intval($clientEventCount);
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/calendar.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "calendar.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-calendar-with-clock"></i>
|
|||
|
|
<span>Календарь</span>
|
|||
|
|
<?php if ($sumCount > 0) { ?><b class="jw__counter all" id="calendarCounter"><?php echo $sumCount; ?></b><?php } ?>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
if ($_SESSION['agency'] || $user->manager || $user->users_admin) : ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/users.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "users.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-employe"></i>
|
|||
|
|
<span>Сотрудники</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php endif;
|
|||
|
|
|
|||
|
|
if (($_SESSION['agency'] || $_SESSION['manager'] || $user->users_admin) && ($user->agencyId != 8407 || $_SESSION['id'] == 8407) && $user->agencyId != 11442) : ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/partners.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "partners.php") !== false) echo 'active'; ?>">
|
|||
|
|
<svg viewBox="-20 0 640 640" width="35pt" height="35pt" xmlns="http://www.w3.org/2000/svg">
|
|||
|
|
<g fill="#FFFFFF" stroke="none">
|
|||
|
|
<path d="M356,358.75 C356,326.721757 330.028243,300.75 298,300.75 C265.971757,300.75 240,326.721757 240,358.75 C240,390.780426 265.969814,416.749426 297.998939,416.75 C330.020539,416.715442 355.966016,390.769612 356,358.75 Z M298,316.75 C321.194413,316.75 340,335.555587 340,358.75 C340,381.944413 321.194413,400.75 298,400.75 C274.805587,400.75 256,381.944413 256,358.75 C256,335.555587 274.805587,316.75 298,316.75 Z M176,58.75 C175.966016,90.7696123 150.020539,116.715442 117.998939,116.75 C85.9698143,116.749426 60,90.7804263 60,58.75 C60,26.7217575 85.9717575,0.75 118,0.75 C150.028243,0.75 176,26.7217575 176,58.75 Z M118,16.75 C94.8055865,16.75 76,35.5555865 76,58.75 C76,81.9444135 94.8055865,100.75 118,100.75 C141.194413,100.75 160,81.9444135 160,58.75 C160,35.5555865 141.194413,16.75 118,16.75 Z M536,58.75 C535.966016,90.7696123 510.020539,116.715442 477.998939,116.75 C445.969814,116.749426 420,90.7804263 420,58.75 C420,26.7217575 445.971757,0.75 478,0.75 C510.028243,0.75 536,26.7217575 536,58.75 Z M478,16.75 C454.805587,16.75 436,35.5555865 436,58.75 C436,81.9444135 454.805587,100.75 478,100.75 C501.194413,100.75 520,81.9444135 520,58.75 C520,35.5555865 501.194413,16.75 478,16.75 Z M161.037254,458.287101 L152.079284,471.561526 C88.421048,428.144601 47.6352706,358.41226 40.9979513,281.641709 L56.9528737,280.360314 C63.2141568,352.279355 101.419435,417.590086 161.037254,458.287101 Z M554.93634,282.229108 C547.561281,360.547109 505.054558,431.300247 439.370925,474.592503 L430.699829,461.156209 C492.22065,420.5682 532.038759,354.286653 538.984735,280.9071 L554.93634,282.229108 Z M390.362091,35.0026179 C330.32442,10.3025133 262.88844,10.6857577 203.132391,36.0641361 L196.727531,21.3945366 C260.507492,-5.73457599 332.509479,-6.14140745 396.593634,20.264425 L390.362091,35.0026179 Z M68.002224,120.749999 L167.99888,120.75 C205.536165,120.792338 235.958259,151.214799 236.000001,188.752224 L236,234.353355 L209.597381,243.960396 C150.418626,265.440465 85.5813744,265.440465 26.4011283,243.959855 L0,234.353355 L0,188.75 C0.0417412019,151.214431 30.4644311,120.791741 68.002224,120.749999 Z M204.120406,228.922767 L218.683358,223.629634 L220,223.151079 L220,188.75 C219.963438,160.043311 196.706689,136.786562 168.002547,136.750002 L68,136.75 C39.2933111,136.786562 16.036562,160.043311 16.0000016,188.747453 L16,221.75 L16,223.151079 L31.8792972,228.922659 C35.8702523,230.381721 39.2758009,231.439607 46.6647544,233.592533 C47.0526215,233.705529 47.0526215,233.705529 47.4402226,233.818503 L50,234.564783 L50,170.75 L66,170.75 L66,238.45369 L67.6004527,238.779996 C100.856294,245.560314 135.143706,245.560314 168.399547,238.779996 L170,238.45369 L170,170.75 L186,170.75 L186,234.564783 C187.820151,234.034136 188.787059,233.752246 188.900724,233.719114 C189.327006,233.594859 189.327006,233.594859 189.753569,233.470468 C196.526839,231.494832 200.102539,230.382406 204.120406,228.922767 Z M428.002224,120.749999 L527.99888,120.75 C565.536165,120.792338 595.958259,151.214799 596.000001,188.752224 L596,234.353355 L569.597381,243.960396 C510.418626,265.440465 445.581374,265.440465 386.401128,243.959855 L360,234.353355 L360,188.75 C360.041741,151.214431 390.464431,120.791741 428.002224,120.749999 Z M564.120406,228.922767 L578.684447,223.629238 L580,223.151079 L580,188.75 C579.963438,160.043311 556.706689,136.786562 528.002547,136.750002 L428,136.75 C399.293311,136.786562 376.036562,160.043311 376.000002,188.747453 L376,221.75 L376,223.151079 L391.879297,228.922659 C395.870252,230.381721 399.275801,231.439607 406.664754,233.592533 C407.052622,233.705529 407.052622,233.705529 407.440223,233.818503 L410,234.564783 L410,170.75 L426,170.75 L426,238.45369 L427.600453,238.779996 C460.856294,245.560314 495.143706,245.560314 528.399547,238.779996 L530,238.45369 L530,170.75 L546,170.75 L546,234.564783 C547.820151,234.034136 548.787059,233.752246 548.900724,233.719114 C549.327006,233.594859 549.327006,233.594859 549.753569,233.470468 C556.526839,231.494832 560.102539,230.382406 564.120406,228.922767 Z M248.
|
|||
|
|
</g>
|
|||
|
|
</svg>
|
|||
|
|
<span>Партнёры</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php endif;
|
|||
|
|
|
|||
|
|
if ($_SESSION['superadmin']) : ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/admin/index.php">
|
|||
|
|
<div class="menu-group-title">
|
|||
|
|
<svg viewBox="0 0 409.6 409.6" width="35pt" height="35pt" xmlns="http://www.w3.org/2000/svg">
|
|||
|
|
<g fill="#FFFFFF" stroke="none">
|
|||
|
|
<path d="M382.321,81.92H27.279C12.24,81.92,0,94.17,0,109.227s12.24,27.307,27.279,27.307h355.041
|
|||
|
|
c15.039,0,27.279-12.25,27.279-27.307S397.36,81.92,382.321,81.92z M382.321,122.88H27.279c-7.513,0-13.626-6.124-13.626-13.653
|
|||
|
|
c0-7.53,6.113-13.653,13.626-13.653h355.041c7.513,0,13.626,6.124,13.626,13.653C395.947,116.756,389.833,122.88,382.321,122.88z" />
|
|||
|
|
<path d="M382.321,177.493H27.279C12.24,177.493,0,189.744,0,204.8s12.24,27.307,27.279,27.307h355.041
|
|||
|
|
c15.039,0,27.279-12.25,27.279-27.307S397.36,177.493,382.321,177.493z M382.321,218.453H27.279
|
|||
|
|
c-7.513,0-13.626-6.123-13.626-13.653c0-7.53,6.113-13.653,13.626-13.653h355.041c7.513,0,13.626,6.124,13.626,13.653
|
|||
|
|
C395.947,212.33,389.833,218.453,382.321,218.453z" />
|
|||
|
|
<path d="M382.321,273.067H27.279C12.24,273.067,0,285.317,0,300.373c0,15.056,12.24,27.307,27.279,27.307h355.041
|
|||
|
|
c15.039,0,27.279-12.25,27.279-27.307C409.6,285.317,397.36,273.067,382.321,273.067z M382.321,314.027H27.279
|
|||
|
|
c-7.513,0-13.626-6.124-13.626-13.653c0-7.53,6.113-13.653,13.626-13.653h355.041c7.513,0,13.626,6.124,13.626,13.653
|
|||
|
|
C395.947,307.903,389.833,314.027,382.321,314.027z" />
|
|||
|
|
</g>
|
|||
|
|
</svg>
|
|||
|
|
<span>Админка</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php endif;
|
|||
|
|
if ($_SESSION['id']) : ?>
|
|||
|
|
<?php if ((empty($menuPermissions)) || ($menuPermissions['menu_docs'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/docs.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "docs.php") !== false) echo 'active'; ?>">
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 294.843 294.843" style="enable-background:new 0 0 294.843 294.843;" xml:space="preserve" width="38px">
|
|||
|
|
<g>
|
|||
|
|
<path d="M6,40.77c3.313,0,6-2.686,6-6c0-9.256,7.53-16.786,16.786-16.786h53.675l42.243,46.147 c1.137,1.242,2.743,1.949,4.426,1.949h136.928c9.256,0,16.786,7.53,16.786,16.786c0,3.314,2.687,6,6,6s6-2.686,6-6 c0-15.873-12.913-28.786-28.786-28.786H131.771L89.529,7.933c-1.137-1.242-2.743-1.949-4.426-1.949H28.786 C12.913,5.984,0,18.897,0,34.77C0,38.083,2.687,40.77,6,40.77z" style="fill: rgb(255, 255, 255);"></path>
|
|||
|
|
<path d="M266.057,94.104H131.771L89.529,47.957c-1.137-1.242-2.743-1.949-4.426-1.949H28.786C12.913,46.008,0,58.921,0,74.793 v118.628c0,3.313,2.687,6,6,6s6-2.687,6-6V74.793c0-9.256,7.53-16.786,16.786-16.786h53.675l42.243,46.147 c1.137,1.242,2.743,1.949,4.426,1.949h136.928c9.256,0,16.786,7.53,16.786,16.786v137.184c0,9.255-7.53,16.786-16.786,16.786 H28.786c-9.256,0-16.786-7.53-16.786-16.786c0-3.313-2.687-6-6-6s-6,2.687-6,6c0,15.873,12.913,28.786,28.786,28.786h237.271 c15.873,0,28.786-12.913,28.786-28.786V122.89C294.843,107.017,281.93,94.104,266.057,94.104z" style="fill: rgb(255, 255, 255);"></path>
|
|||
|
|
</g>
|
|||
|
|
</svg>
|
|||
|
|
|
|||
|
|
<span>Документы</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php endif; ?>
|
|||
|
|
<?php if ((empty($menuPermissions)) || ($menuPermissions['menu_settings'] == 1)) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/settings.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "settings.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-settings"></i>
|
|||
|
|
<span>Настройки</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
<?php if ($user->agencyId != 5530 || $_SESSION['id'] == 5530) { ?>
|
|||
|
|
<div class="menu-group">
|
|||
|
|
<a href="/help.php">
|
|||
|
|
<div class="menu-group-title <?php if (stripos($_SERVER['SCRIPT_NAME'], "help.php") !== false) echo 'active'; ?>">
|
|||
|
|
<i class="jw-icon-help"></i>
|
|||
|
|
<span>Обучение</span>
|
|||
|
|
</div>
|
|||
|
|
</a>
|
|||
|
|
</div>
|
|||
|
|
<?php } ?>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|