<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } global $APPLICATION; $arResult = array(); $arResult["URL"] = $APPLICATION->GetCurDir(); $arResult["GEO"] = \Hawkart\Megatv\CityTable::getGeoCity(); $arResult["ITEMS"] = array(); $arResult["CUR_CITY"] = array(); $arFilter = array("=UF_COUNTRY_ID" => $arResult["GEO"]["UF_COUNTRY_ID"], "=UF_ACTIVE" => 1); $arSelect = array("ID", "UF_TITLE"); $obCache = new \CPHPCache(); if ($obCache->InitCache(86400, serialize($arFilter) . serialize($arSelect), "/cityList/")) { $arResult["ITEMS"] = $obCache->GetVars(); } elseif ($obCache->StartDataCache()) { $result = \Hawkart\Megatv\CityTable::getList(array('filter' => $arFilter, 'select' => $arSelect, 'order' => array("UF_TITLE" => "ASC"))); while ($arCity = $result->fetch()) { $arResult["ITEMS"][] = $arCity; } $obCache->EndDataCache($arResult["ITEMS"]); } foreach ($arResult["ITEMS"] as $arCity) { if ($arResult["GEO"]["ID"] == $arCity["ID"]) { $arResult["CUR_CITY"] = $arCity; } } $this->IncludeComponentTemplate();
public static function getArDateTimeOffset($date = false, $offset = 0) { if (!$offset) { $arCity = \Hawkart\Megatv\CityTable::getGeoCity(); $offset = intval($arCity["UF_TIMEZONE"]) - intval(self::$defaultTimezone) / 100; } if (!$date) { $date = self::getCurDate(); } $date = substr($date, 0, 10) . date(" 00:00:00"); $next_date = date('d.m.Y 00:00:00', strtotime("+1 day", strtotime($date))); $arDate = array("DATE_FROM" => self::dateOffset($date, $offset), "DATE_TO" => self::dateOffset($next_date, $offset), "OFFSET" => $offset); return $arDate; }
<?php require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"; $APPLICATION->SetTitle("Персональные данные"); global $USER; ?> <div class="flex-row user-profile-top-row"> <?php $APPLICATION->IncludeComponent("hawkart:user.profile", "", array("CITY_GEO" => \Hawkart\Megatv\CityTable::getGeoCity()), false); ?> <section class="user-info-subscriptions" data-module="user-info-subscriptions"> <script type="text/x-config"> { "url": "/server/" } </script> <div class="block-header"> <h3 class="block-title">УПРАВЛЕНИЕ АНОНСАМИ И РЕКОМЕНДАЦИЯМИ</h3> </div> <div class="block-body"> <ul class="user-info-subscriptions-list"> <li class="status-active" data-type="info-subscription-item" data-subscription-id="01"> <a href="#">Рекомендации МЕГА ТВ <span data-icon="icon-round-checkbox-mark"></span></a> </li> <li class="status-active" data-type="info-subscription-item" data-subscription-id="02"> <a href="#">Рекомендации Ваших друзей <span data-icon="icon-round-checkbox-mark"></span></a> </li> <li data-type="info-subscription-item" data-subscription-id="03">
$arGeo = \Hawkart\Megatv\CityTable::setGeoCity(intval($_POST["city-id"])); header("Location: " . $APPLICATION->GetCurPage()); } else { if (isset($_POST["lang-id"]) && intval($_POST["lang-id"]) > 0 && check_bitrix_sessid()) { $arGeo = \Hawkart\Megatv\CountryTable::setCountry(intval($_POST["lang-id"])); if (strtoupper($arGeo["COUNTRY_ISO"]) == LANGUAGE_DEFAULT) { $redirect_url = "http://" . $site; } else { $redirect_url = "http://" . strtolower($arGeo["COUNTRY_ISO"]) . "." . $site; } if (strtolower(LANGUAGE_ID) != strtolower($arGeo["COUNTRY_ISO"])) { LocalRedirect($redirect_url . $APPLICATION->GetCurPage()); die; } } else { $arGeo = \Hawkart\Megatv\CityTable::getGeoCity(); if (strtolower(LANGUAGE_ID) != strtolower($arGeo["COUNTRY_ISO"])) { \Hawkart\Megatv\CountryTable::setCountryByIso(LANGUAGE_ID); } } } if ($USER->IsAuthorized()) { /** * Get records statuses by user */ $arRecordStatus = \Hawkart\Megatv\RecordTable::getListStatusesByUser(); /** * User subscribe channel list. Add global property */ $selectedChannels = array(); $result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("UF_ACTIVE" => 1, "=UF_USER_ID" => $USER->GetID(), ">UF_CHANNEL_ID" => 0), 'select' => array("UF_CHANNEL_ID")));