Example #1
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
global $USER;
$NEWS_ID = $arParams["NEWS_ID"];
$club = new Club($CLUB_ID);
$news = News::getInfoStatic($NEWS_ID)->GetNext();
$arResult['news'] = $news;
$club = new Club($news['PROPERTY_CLUB_ID_VALUE']);
$arResult['club'] = $club->getInfo(array("arSelect" => array("NAME", "ID", "PROPERTY_TYPE_FACILITY")));
$APPLICATION->SetTitle($arResult['club']['NAME'] . ": " . $news['NAME']);
$this->IncludeComponentTemplate();
Example #2
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
$clubID = (int) $arParams['CLUB_ID'];
global $USER;
$club = new Club($clubID);
$arFields = $club->getInfo(array("arSelect" => array("ID", "PROPERTY_RATING")), true);
$arResult["RATING"] = $arFields['PROPERTY_RATING_VALUE'];
$this->IncludeComponentTemplate();
Example #3
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
global $USER;
$CLUB_ID = $arParams["CLUB_ID"];
$club = new Club($CLUB_ID);
$array = array("stocks" => array("name" => "Действующие акции", "list" => array(), "show" => false), "event" => array("name" => "Предстоящие события", "list" => array(), "show" => false));
$stokRes = $club->stock();
$eventRes = $club->event();
$countSock = $stokRes->getCount();
$countEvent = $eventRes->getCount();
if ($countSock[$CLUB_ID] > 0) {
    $array["stocks"]["list"] = $stokRes->getListArray(array(">=DATE_ACTIVE_TO" => date("d.m.Y")));
    $array["stocks"]["show"] = true;
    $arResult["LIST"]["stocks"] = $array["stocks"];
}
if ($countEvent[$CLUB_ID] > 0) {
    $array["event"]["list"] = $eventRes->getListArray(array(">=DATE_ACTIVE_TO" => date("d.m.Y")));
    $array["event"]["show"] = true;
    $arResult["LIST"]["event"] = $array["event"];
}
$arResult["CLUB_ID"] = $CLUB_ID;
$arResult["CLUB"] = $club->getInfo(array("arSelect" => array("NAME", "PREVIEW_PICTURE")));
$this->IncludeComponentTemplate();
Example #4
0
<?php

/**
 *
 * User: Tabota Oleg (sForge.ru)
 * Date: 20.12.12 18:54
 * File name: getinfo.php
 */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule("iblock");
CModule::IncludeModule("mytb");
$club_id = intval($_POST["club_id"]);
$clubRes = new Club($club_id);
$clubInfo = $clubRes->getInfo(array("arSelect" => array("NAME", "PREVIEW_PICTURE", "PROPERTY_SITE", "PROPERTY_EMAIL_MANAGER", "PROPERTY_AVERAGE_CHECK", "PROPERTY_TIME_WORKING", "PROPERTY_KIND_CLUB", "PROPERTY_MUSIC", "PROPERTY_DESCR")), true);
$arFile = CFile::GetFileArray($clubInfo["PREVIEW_PICTURE"]);
$clubInfo["PREVIEW_PICTURE"] = $arFile["SRC"];
die(json_encode(array("status" => "ok", "result" => array("ID" => $clubInfo['ID'], "NAME" => $clubInfo['NAME'], "PREVIEW_PICTURE" => $clubInfo['PREVIEW_PICTURE'], "SITE" => $clubInfo['PROPERTY_SITE_VALUE'], "EMAIL_MANAGER" => $clubInfo['PROPERTY_EMAIL_MANAGER_VALUE'], "AVERAGE_CHECK" => $clubInfo['PROPERTY_AVERAGE_CHECK_VALUE'], "TIME_WORKING" => $clubInfo['PROPERTY_TIME_WORKING_VALUE'], "KIND_CLUB" => (array) $clubInfo['PROPERTY_KIND_CLUB_VALUE'], "MUSIC" => (array) $clubInfo['PROPERTY_MUSIC_VALUE'], "DESCR" => $clubInfo['PROPERTY_DESCR_VALUE'], "ADDRESS" => $clubRes->getAddress()))));
Example #5
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
global $USER;
$CLUB_ID = $arParams["CLUB_ID"];
$club = new Club($CLUB_ID);
$resStockList = $club->getListNews();
while ($ar = $resStockList->Fetch()) {
    $arStockList[] = $ar;
}
$arResult['stockList'] = $arStockList;
$arResult['club'] = $club->getInfo(array("arSelect" => array("NAME")));
$this->IncludeComponentTemplate();
Example #6
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
CModule::IncludeModule("iblock");
CModule::IncludeModule("mytb");
global $USER;
$userRes = new User($USER::GetID());
$userInfo = $userRes->getInfo();
$user_props = $userRes->getProps(array("PROPERTY_CLUB"));
$clubID = intval($user_props['PROPERTY_CLUB_VALUE']);
$club = new Club($clubID);
$arFields = $club->getInfo(array("arSelect" => array("ID", "DETAIL_TEXT", "NAME", "DATE_ACTIVE_FROM", "PROPERTY_ADDRESS", "PROPERTY_TIME_WORKING", "PROPERTY_PRICE_COCKTAIL", "PROPERTY_PHONE", "PROPERTY_RATING", "PROPERTY_MUSIC", "PROPERTY_FACE", "PROPERTY_DRESS_CODE", "PROPERTY_SITE", "PROPERTY_METRO", "PROPERTY_PLAN", "PROPERTY_EMAIL_MANAGER", "PROPERTY_PRICE_COCKTAIL", "PROPERTY_AVERAGE_CHECK", "PREVIEW_PICTURE", "PROPERTY_TYPE_FACILITY")), true);
$arFile = CFile::GetFileArray($arFields["PREVIEW_PICTURE"]);
$arFields["PREVIEW_PICTURE"] = imgurl($arFile["SRC"], array("w" => 200));
$arResult['arFields'] = $arFields;
$arResult['subs']['stock'] = $club->getCountSubStocks();
$arResult['subs']['event'] = $club->getCountSubEvent();
$arResult['userInfo'] = $userInfo;
$arResult['ADDRESS'] = $club->getAddress();
$property_enums = CIBlockPropertyEnum::GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => IB_CLUB_ID, "CODE" => "TYPE_FACILITY"));
while ($enum_fields = $property_enums->GetNext()) {
    $arResult["KIND_CLUB_LIST"][] = $enum_fields;
}
$property_enums = CIBlockPropertyEnum::GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => IB_CLUB_ID, "CODE" => "MUSIC"));
while ($enum_fields = $property_enums->GetNext()) {
    $arResult["MUSIC_LIST"][] = $enum_fields;
}
$this->IncludeComponentTemplate();
Example #7
0
 * Created by JetBrains PhpStorm.
 * User: oleg
 * Date: 12.09.12
 * Time: 21:15
 * To change this template use File | Settings | File Templates.
 */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule("iblock");
global $USER;
$clubID = intval($_POST['club_id']);
if ($clubID <= 0) {
    die;
}
$filename = translate(basename($_FILES['myfile']['name']));
if (!preg_match("#^.*\\.(jpg|png|gif)\$#i", $filename)) {
    die;
}
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . "upload/club/" . $clubID . "/";
if (!file_exists($uploaddir)) {
    @mkdir($uploaddir, "0777");
}
$uploadfile = $uploaddir . $filename;
move_uploaded_file($_FILES['myfile']['tmp_name'], $uploadfile);
$BX_image = CFile::MakeFileArray($uploadfile);
$el = new CIBlockElement();
$arLoadProductArray = array("MODIFIED_BY" => $USER->GetID(), "PREVIEW_PICTURE" => $BX_image);
$res = $el->Update($clubID, $arLoadProductArray);
$club = new Club($clubID);
$pic = $club->getInfo(array("arSelect" => array("PREVIEW_PICTURE")));
$arFile = CFile::GetFileArray($pic["PREVIEW_PICTURE"]);
echo imgurl($arFile["SRC"], array("w" => intval($_POST["w"]), "h" => intval($_POST["h"])));
Example #8
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
$APPLICATION->AddHeadScript("/jslibs/jquery/jquery-1.7.2.min.js");
$APPLICATION->AddHeadScript("/jslibs/jqueryui/js/jquery-ui-1.8.21.custom.min.js");
global $USER;
$clubID = (int) $arParams['ID'];
$club = new Club($clubID);
$arResult['arFields'] = $club->getInfo(array("arSelect" => array("ID", "NAME")), TRUE);
if (isset($_POST["clubID"]) && intval($_POST["clubID"]) > 0) {
    $user = new User($USER::GetID());
    $_POST["subsrcibe"]["stok"];
    $_POST["subsrcibe"]["event"];
    $_POST["subsrcibe"]["news"];
    $user->setSubscribe();
}
$this->IncludeComponentTemplate();
Example #9
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$clubID = intval($arParams["CLUB_ID"]);
$club = new Club($clubID);
$arFields = $club->getInfo(array("arSelect" => array("ID", "PREVIEW_PICTURE")), true);
$arFile = CFile::GetFileArray($arFields["PREVIEW_PICTURE"]);
$arResult["PREVIEW_PICTURE"] = imgurl($arFile["SRC"], array("w" => 200));
$this->IncludeComponentTemplate();
Example #10
0
<?php

require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php";
if (intval($_GET['ID']) != 0) {
    if (empty($_GET['URL'])) {
        $club = new Club(intval($_GET['ID']));
        $arFields = $club->getInfo(array("arSelect" => array("ID", "NAME", "PROPERTY_TYPE_FACILITY")), true);
        $url = formUrl($arFields['ID'], implode("-", $arFields['PROPERTY_TYPE_FACILITY_VALUE']) . " " . $arFields['NAME']);
        header('HTTP/1.1 301 Moved Permanently');
        header("Location: /club/{$url}/");
        die;
    }
    $APPLICATION->IncludeComponent("mytb:club", "detail", array("ID" => $_GET['ID'], "AUTH" => $USER->IsAuthorized(), "CACHE_TIME" => 600), false);
} else {
    $APPLICATION->SetTitle("Список клубов, боров ресторанов");
    $APPLICATION->IncludeComponent("mytb:club.list", "home", array("CACHE_TIME" => 600), false);
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php";