function fancy_output($content) { if (isTextMode()) { return sprintf('<pre>%s</pre>', htmlspecialcharsEx($content)); } return sprintf('<p>%s</e>', $content); }
function __ConverData(&$item, $key) { if (is_array($item)) { array_walk($item, "__ConverData"); } else { $item = htmlspecialcharsEx($item); } }
function mfi_format_line($arValue, $uid, $controlNameFull) { $result = ''; if (is_array($arValue) && sizeof($arValue) > 0) { ob_start(); foreach ($arValue as $arElement) { $elementID = intval($arElement['ID']); ?> <tr class="file-inline-file" id="wd-doc<?php echo $elementID; ?> "> <td class="files-name"> <span class="files-text"> <span class="f-wrap"><?php echo htmlspecialcharsEx($arElement['ORIGINAL_NAME']); ?> </span> </span> </td> <td class="files-size"><?php echo CFile::FormatSize($arElement["FILE_SIZE"]); ?> </td> <td class="files-storage"> <div class="files-storage-block"> <span class='del-but' onclick="BfileFD<?php echo $uid; ?> .agent.StopUpload(BX('wd-doc<?php echo $elementID; ?> '));"></span> <span class="files-placement"><?/*=htmlspecialcharsEx($title)*/?></span> <input id="file-doc<?php echo $elementID; ?> " type="hidden" name="<?php echo htmlspecialcharsbx($controlNameFull); ?> " value="<?php echo $elementID; ?> " /> </div> </td> </tr> <? } $result = ob_get_clean(); } return $result; }
function __forum_chapter_menu_gen() { $Dict = array("W" => array(), "T" => array()); CModule::IncludeModule("forum"); $db_res = CFilterDictionary::GetList(); while ($res = $db_res->Fetch()) { $Dict[$res["TYPE"]][] = array("text" => htmlspecialcharsEx($res["TITLE"]), "url" => "/bitrix/admin/forum_" . ($res["TYPE"] == "T" ? "letter" : "words") . ".php?DICTIONARY_ID=" . $res["ID"] . "&lang=" . LANG, "more_url" => array("/bitrix/admin/forum_" . ($res["TYPE"] == "T" ? "letter" : "words") . ".php?DICTIONARY_ID=" . $res["ID"] . "&lang=" . LANG, "/bitrix/admin/forum_dictionary_edit.php?DICTIONARY_ID=" . $res["ID"] . "&lang=" . LANG, "/bitrix/admin/forum_" . ($res["TYPE"] == "T" ? "letter" : "words") . "_edit.php?DICTIONARY_ID=" . $res["ID"] . "&lang=" . LANG), "title" => htmlspecialcharsEx($res["TITLE"])); } return $Dict; }
function __ConvertData(&$item, $key) { static $search = array("\"); static $replace = array("&#92;"); if (is_array($item)) { array_walk($item, "__ConvertData"); } else { $item = htmlspecialcharsEx($item); $item = str_replace($search, $replace, $item); } }
function OnBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu) { global $USER; if (!CModule::IncludeModule("iblock")) { return; } //When UnRegisterModuleDependences is called from module uninstall //cached EventHandlers may be called if (defined("BX_CATALOG_UNINSTALLED")) { return; } $aMenu = array("text" => GetMessage("CAT_MENU_ROOT"), "title" => "", "items_id" => "menu_catalog_list", "items" => array()); $arCatalogs = array(); $rsCatalog = CCatalog::GetList(array("sort" => "asc")); while ($ar = $rsCatalog->Fetch()) { if ($ar["PRODUCT_IBLOCK_ID"]) { $arCatalogs[$ar["PRODUCT_IBLOCK_ID"]] = 1; } else { $arCatalogs[$ar["IBLOCK_ID"]] = 1; } } $rsIBlocks = CIBlock::GetList(array("SORT" => "asc", "NAME" => "ASC"), array("MIN_PERMISSION" => "U")); while ($arIBlock = $rsIBlocks->Fetch()) { if (array_key_exists($arIBlock["ID"], $arCatalogs)) { $arItems = array(array("text" => GetMessage("CAT_MENU_PRODUCT_LIST"), "url" => "cat_product_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . urlencode($arIBlock["IBLOCK_TYPE_ID"]), "more_url" => array("cat_product_admin.php?IBLOCK_ID=" . $arIBlock["ID"], "cat_product_edit.php?IBLOCK_ID=" . $arIBlock["ID"]), "title" => "", "page_icon" => "iblock_page_icon_elements", "items_id" => "menu_catalog_goods_" . $arIBlock["ID"], "module_id" => "catalog"), array("text" => htmlspecialcharsex(CIBlock::GetArrayByID($arIBlock["ID"], "SECTIONS_NAME")), "url" => "cat_section_admin.php?lang=" . LANGUAGE_ID . "&type=" . $arIBlock["IBLOCK_TYPE_ID"] . "&IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0", "more_url" => array("cat_section_admin.php?IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0", "cat_section_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0"), "title" => "", "page_icon" => "iblock_page_icon_sections", "items_id" => "menu_catalog_category_" . $arIBlock["ID"], "module_id" => "catalog", "items" => CCatalogAdmin::get_sections_menu($arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"], 1, 0))); if (CIBlockRights::UserHasRightTo($arIBlock["ID"], $arIBlock["ID"], "iblock_edit")) { $arItems[] = array("text" => GetMessage("CAT_MENU_PRODUCT_PROPERTIES"), "url" => "iblock_property_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N", "more_url" => array("iblock_property_admin.php?IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N", "iblock_edit_property.php?IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N"), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_attributes_" . $arIBlock["ID"], "module_id" => "catalog"); } $arCatalog = false; if (CModule::IncludeModule("catalog")) { $arCatalog = CCatalog::GetSkuInfoByProductID($arIBlock["ID"]); } if (is_array($arCatalog) && CIBlockRights::UserHasRightTo($arCatalog["IBLOCK_ID"], $arCatalog["IBLOCK_ID"], "iblock_edit")) { $arItems[] = array("text" => GetMessage("CAT_MENU_SKU_PROPERTIES"), "url" => "iblock_property_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N", "more_url" => array("iblock_property_admin.php?IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N", "iblock_edit_property.php?IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N"), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_attributes_" . $arCatalog["IBLOCK_ID"], "module_id" => "catalog"); } if (CIBlockRights::UserHasRightTo($arIBlock["ID"], $arIBlock["ID"], "iblock_edit")) { $arItems[] = array("text" => GetMessage("CAT_MENU_CATALOG_SETTINGS"), "url" => "cat_catalog_edit.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"], "more_url" => array("cat_catalog_edit.php?IBLOCK_ID=" . $arIBlock["ID"]), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_edit_" . $arIBlock["ID"], "module_id" => "catalog"); } $aMenu["items"][] = array("text" => htmlspecialcharsEx($arIBlock["NAME"]), "title" => "", "page_icon" => "iblock_page_icon_sections", "items_id" => "menu_catalog_" . $arIBlock["ID"], "module_id" => "catalog", "items" => $arItems); } } if (!empty($aMenu["items"])) { if (count($aMenu["items"]) == 1) { $aMenu = $aMenu["items"][0]; } $aMenu["parent_menu"] = "global_menu_store"; $aMenu["section"] = "catalog_list"; $aMenu["sort"] = 200; $aMenu["icon"] = "iblock_menu_icon_sections"; $aMenu["page_icon"] = "iblock_page_icon_types"; $aModuleMenu[] = $aMenu; } }
static function ShowMessage($message, $error = false) { $background = $error ? '#ffcccc' : '#ccffcc'; ?> <div style='background-color:<?php echo $background; ?> ; border: 1px solid #ff8888; padding: 10px; margin: 5px 0; font-size:80%;'> <?php echo htmlspecialcharsEx($message); ?> </div> <?php }
function handleFile($hash, $file, &$package, &$upload) { global $APPLICATION; $name = $file["name"]; $pattern = defined('BX_UTF') ? "/[^\\p{L}L0-9!\\p{Z}\$&\\(\\)\\[\\]\\{\\}\\-\\.;=@\\^_\\~]/uis" : "/[^A-Za-zÀ-ߨà-ÿ¸0-9!\\s\$&\\(\\)\\[\\]\\{\\}\\-\\.;=@\\^_\\~]/is"; $name = trim(preg_replace($pattern, "", $name)); if (strlen(trim(substr($name, 0, strpos($name, '.')))) <= 0) { $name = substr(md5(uniqid(rand(), true)), 0, 8) . trim($name); } $res = CMedialibItem::Edit(array('file' => array_key_exists("files", $file) ? $file["files"]["default"] : $file, 'arFields' => array('NAME' => $name, 'DESCRIPTION' => $file['description'], 'KEYWORDS' => ''), 'arCollections' => array($package["collectionId"]))); if (!array_key_exists("redirectUrl", $upload) && $res && $res['ID'] > 0) { $upload["redirectUrlPart"] = "action=redirect&" . bitrix_sessid_get() . "&first_id=" . $res["ID"] . "&col_id=" . $package["collectionId"] . "&ml_type=" . htmlspecialcharsEx($package["ml_type"]); $upload["redirectUrl"] = $APPLICATION->GetCurPageParam($upload["redirectUrlPart"], array("action", "ml_type", "first_id", "col_id", "sessid")); } return $res; }
public static function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName) { static $cache = array(); if (CModule::IncludeModule("forum")) { $value["VALUE"] = intval($value["VALUE"]); if ($value["VALUE"] <= 0) { $value["VALUE"] = ''; $res = ''; } else { if (!array_key_exists($value["VALUE"], $cache)) { $cache[$value["VALUE"]] = CForumTopic::GetByID($value["VALUE"]); } $arTopic = $cache[$value["VALUE"]]; $res = !empty($arTopic) ? "[" . $value["VALUE"] . "] (" . htmlspecialcharsEx($arTopic["TITLE"]) . ")" : $value["VALUE"]; } return $res; } return ''; }
function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName) { global $APPLICATION; if (strLen(trim($strHTMLControlName["FORM_NAME"])) <= 0) { $strHTMLControlName["FORM_NAME"] = "form_element"; } $name = preg_replace("/[^a-zA-Z0-9_]/i", "x", htmlspecialcharsbx($strHTMLControlName["VALUE"])); if (is_array($value["VALUE"])) { $value["VALUE"] = $value["VALUE"]["VALUE"]; $value["DESCRIPTION"] = $value["DESCRIPTION"]["VALUE"]; } if ($strHTMLControlName["MODE"] == "FORM_FILL" && CModule::IncludeModule('fileman')) { return CFileInput::Show($strHTMLControlName["VALUE"], $value["VALUE"], array("PATH" => "Y", "IMAGE" => "N", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))), array('upload' => false, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => $arProperty["WITH_DESCRIPTION"] == "Y" ? array("VALUE" => $value["DESCRIPTION"], "NAME" => $strHTMLControlName["DESCRIPTION"]) : false)); } else { $return = '<input type="text" name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" id="' . $name . '" size="' . $arProperty["COL_COUNT"] . '" value="' . htmlspecialcharsEx($value["VALUE"]) . '">'; if ($arProperty["WITH_DESCRIPTION"] == "Y" && '' != trim($strHTMLControlName["DESCRIPTION"])) { $return .= ' <span title="' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_TITLE") . '">' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_LABEL") . ':<input name="' . htmlspecialcharsEx($strHTMLControlName["DESCRIPTION"]) . '" value="' . htmlspecialcharsEx($value["DESCRIPTION"]) . '" size="18" type="text"></span>'; } return $return; } }
function GetUserName($USER_ID, $nameTemplate = "") { $ar_res = false; if (IntVal($USER_ID) > 0) { $db_res = CUser::GetByID(IntVal($USER_ID)); $ar_res = $db_res->Fetch(); } if (!$ar_res) { $db_res = CUser::GetByLogin($USER_ID); $ar_res = $db_res->Fetch(); } $USER_ID = IntVal($ar_res["ID"]); $f_LOGIN = htmlspecialcharsex($ar_res["LOGIN"]); $forum_user = CForumUser::GetByUSER_ID($USER_ID); if ($forum_user["SHOW_NAME"] == "Y" && (strlen(trim($ar_res["NAME"])) > 0 || strlen(trim($ar_res["LAST_NAME"])) > 0)) { $nameTemplate = trim(empty($nameTemplate)) ? CSite::GetNameFormat() : $nameTemplate; return trim(CUser::FormatName($nameTemplate, array("NAME" => htmlspecialcharsEx($ar_res["NAME"]), "LAST_NAME" => htmlspecialcharsEx($ar_res["LAST_NAME"]), "SECOND_NAME" => htmlspecialcharsEx($ar_res["SECOND_NAME"])))); } else { return $f_LOGIN; } }
public static function getDefaultMeasure($getStub = false, $getExt = false) { $getStub = $getStub === true; $getExt = $getExt === true; if (self::$defaultMeasure === null) { $measureRes = CCatalogMeasure::getList(array(), array('IS_DEFAULT' => 'Y'), false, false, array()); if ($measure = $measureRes->GetNext(true, $getExt)) { $measure['ID'] = (int) $measure['ID']; $measure['CODE'] = (int) $measure['CODE']; self::$defaultMeasure = $measure; } } if (self::$defaultMeasure === null) { $measureRes = CCatalogMeasure::getList(array(), array('CODE' => self::DEFAULT_MEASURE_CODE), false, false, array()); if ($measure = $measureRes->GetNext(true, $getExt)) { $measure['ID'] = (int) $measure['ID']; $measure['CODE'] = (int) $measure['CODE']; self::$defaultMeasure = $measure; } } if (self::$defaultMeasure === null) { if ($getStub) { $defaultMeasureDescription = CCatalogMeasureClassifier::getMeasureInfoByCode(self::DEFAULT_MEASURE_CODE); if ($defaultMeasureDescription !== null) { self::$defaultMeasure = array('ID' => 0, 'CODE' => self::DEFAULT_MEASURE_CODE, 'MEASURE_TITLE' => htmlspecialcharsEx($defaultMeasureDescription['MEASURE_TITLE']), 'SYMBOL_RUS' => htmlspecialcharsEx($defaultMeasureDescription['SYMBOL_RUS']), 'SYMBOL_INTL' => htmlspecialcharsEx($defaultMeasureDescription['SYMBOL_INTL']), 'SYMBOL_LETTER_INTL' => htmlspecialcharsEx($defaultMeasureDescription['SYMBOL_LETTER_INTL']), 'IS_DEFAULT' => 'Y'); if ($getExt) { self::$defaultMeasure['~ID'] = '0'; self::$defaultMeasure['~CODE'] = (string) self::DEFAULT_MEASURE_CODE; self::$defaultMeasure['~MEASURE_TITLE'] = self::$defaultMeasure['MEASURE_TITLE']; self::$defaultMeasure['~SYMBOL_RUS'] = self::$defaultMeasure['SYMBOL_RUS']; self::$defaultMeasure['~SYMBOL_INTL'] = self::$defaultMeasure['SYMBOL_INTL']; self::$defaultMeasure['~SYMBOL_LETTER_INTL'] = self::$defaultMeasure['SYMBOL_LETTER_INTL']; self::$defaultMeasure['~IS_DEFAULT'] = 'Y'; } } } } return self::$defaultMeasure; }
function GetChainString($items = false, $templates = false) { $arItemLast = array(); $arItems = array(); if (!is_array($items)) { return false; } if (!is_set($templates, "T_SEPARATOR")) { $templates["T_SEPARATOR"] = "<font class=\"forum-chain-separator\"> / </font>"; } if (!is_set($templates, "T_ALL_ITEMS")) { $templates["T_ALL_ITEMS"] = "<a href=\"#LINK#\" class=\"forum-chain-item\">#TITLE#</a>"; } if (!is_set($templates, "T_LAST_ITEM")) { $templates["T_LAST_ITEM"] = "<font class=\"forum-chain-last\">#TITLE#</font>"; } $arItemLast = array_pop($items); foreach ($items as $res) { $arItems[] = str_replace(array("#LINK#", "#TITLE#"), array(htmlspecialcharsEx($res["LINK"]), htmlspecialcharsEx($res["TITLE"])), $templates["T_ALL_ITEMS"]); } $arItems[] = str_replace(array("#LINK#", "#TITLE#"), array(htmlspecialcharsEx($arItemLast["LINK"]), htmlspecialcharsEx($arItemLast["TITLE"])), $templates["T_LAST_ITEM"]); return implode($templates["T_SEPARATOR"], $arItems); }
function OnPostForm() { $wizard =& $this->GetWizard(); $templateID = $wizard->GetSiteTemplateID(); $templatePath = BX_PERSONAL_ROOT . "/templates/" . $templateID; $arReplace = array("COMPANY_NAME" => $wizard->GetVar("company_name"), "COMPANY_SLOGAN" => $wizard->GetVar("company_slogan")); CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . $templatePath . "/include_areas/company_name.php", $arReplace); $server_name = $_SERVER["HTTP_HOST"] != '' ? $_SERVER["HTTP_HOST"] : $_SERVER["SERVER_NAME"]; if ($_SERVER["SERVER_PORT"] != 80 && $_SERVER["SERVER_PORT"] != 443 && $_SERVER["SERVER_PORT"] > 0 && strpos($_SERVER["HTTP_HOST"], ":") === false) { $server_name .= ":" . $_SERVER["SERVER_PORT"]; } COption::SetOptionString("main", "server_name", $server_name); COption::SetOptionString("main", "site_name", htmlspecialcharsEx($wizard->GetVar("company_name"))); COption::SetOptionString("main", "wizard_company_slogan", $wizard->GetVar("company_slogan")); $themeVarName = $templateID . "_themeID"; $themeID = $wizard->GetVar($themeVarName); $themeID = Rel2Abs("/", $themeID); $themePath = $_SERVER["DOCUMENT_ROOT"] . DemoSiteUtil::GetTemplatesPath($wizard->GetPath()) . "/" . $templateID . "/themes/" . $themeID; CopyDirFiles($themePath, $_SERVER["DOCUMENT_ROOT"] . $templatePath, $rewrite = true, $recursive = true, $delete_after_copy = false, $exclude = "description.php"); $companyLogo = $wizard->GetVar("company_logo"); CWizardUtil::CopyFile($companyLogo, $templatePath . "/images/logo.gif", false); COption::SetOptionString("main", "wizard_site_logo", $companyLogo); }
<span id="feed-add-post-destination-item"></span> <span class="feed-add-destination-input-box" id="feed-add-post-destination-input-box"> <input type="text" value="" class="feed-add-destination-inp" id="feed-add-post-destination-input"> </span> <a href="#" class="feed-add-destination-link" id="bx-destination-tag"></a> </div> </li> <?php } if (!empty($arParams["TAGS"])) { $tags = ""; $tagsInput = ""; foreach ($arParams["TAGS"]["VALUE"] as $val) { $val = trim($val); if (strlen($val) > 0) { $tags .= '<span class="feed-add-post-tags" data-tag="' . htmlspecialcharsbx($val) . '">' . htmlspecialcharsEx($val); $tags .= '<span class="feed-add-post-del-but"></span></span>'; if ($tagsInput != "") { $tagsInput .= ","; } $tagsInput .= htmlspecialcharsbx($val); } } ?> <li id="post-tags-block-<?php echo $arParams["FORM_ID"]; ?> " class="feed-add-post-tags-block"<?php if ($tags !== "") { ?> style="display:block"<?php
if ($strVal != '') $arVal = explode(',', $strVal); $dbUserGroups = CGroup::GetList(($b="c_sort"), ($o="asc"), array("ANONYMOUS" => "N")); while ($arUserGroups = $dbUserGroups->Fetch()) { $arUserGroups["ID"] = (int)$arUserGroups["ID"]; if ($arUserGroups["ID"] == 2) continue; ?> <tr> <td width="40%"><label for="user_group_<?php echo $arUserGroups["ID"]; ?> "><?php echo htmlspecialcharsEx($arUserGroups["NAME"]); ?> </label> [<a href="group_edit.php?ID=<?php echo $arUserGroups["ID"]; ?> &lang=<?php echo LANGUAGE_ID; ?> " title="<?php echo Loc::getMessage("CO_USER_GROUP_ALT"); ?> "><?php echo $arUserGroups["ID"]; ?> </a>]:</td> <td width="60%"><input type="checkbox" id="user_group_<?php
<div class="blog-comment-fields"> <?php if (empty($arResult["User"])) { ?> <div class="blog-comment-field blog-comment-field-user"> <div class="blog-comment-field blog-comment-field-author"><div class="blog-comment-field-text"><label for="user_name"><?php echo GetMessage("B_B_MS_NAME"); ?> </label><span class="blog-required-field">*</span></div><span><input maxlength="255" size="30" tabindex="3" type="text" name="user_name" id="user_name" value="<?php echo htmlspecialcharsEx($_SESSION["blog_user_name"]); ?> "></span></div> <div class="blog-comment-field-user-sep"> </div> <div class="blog-comment-field blog-comment-field-email"><div class="blog-comment-field-text"><label for="">E-mail</label></div><span><input maxlength="255" size="30" tabindex="4" type="text" name="user_email" id="user_email" value="<?php echo htmlspecialcharsEx($_SESSION["blog_user_email"]); ?> "></span></div> <div class="blog-clear-float"></div> </div> <?php } include $_SERVER["DOCUMENT_ROOT"] . $templateFolder . "/lhe.php"; if (strlen($arResult["NoCommentReason"]) > 0) { ?> <div id="nocommentreason" style="display:none;"><?php echo $arResult["NoCommentReason"]; ?> </div> <?php }
} elseif ($val2 == $arResult[$key2]) { continue; } elseif (!is_array($arResult[$key2])) { $arResult[$key2] = array($arResult[$key2]); } $arResult[$key2] = __array_merge($arResult[$key2], $val2); } return $arResult; } } /******************************************************************** Input params ********************************************************************/ /***************** BASE ********************************************/ $q = trim($_REQUEST["q"]); $arResult["q"] = htmlspecialcharsEx($q); $arParams["FID"] = !empty($_REQUEST["FID"]) ? $_REQUEST["FID"] : $_REQUEST["FORUM_ID"]; $arParams["FID"] = !empty($arParams["FID"]) ? $arParams["FID"] : $_REQUEST["find_forum"]; $arParams["FID"] = is_array($arParams["FID"]) ? $arParams["FID"] : array($arParams["FID"]); /***************** URL *********************************************/ $URL_NAME_DEFAULT = array("index" => "", "read" => "PAGE_NAME=read&FID=#FID#&TID=#TID#", "message" => "PAGE_NAME=message&FID=#FID#&TID=#TID#&MID=#MID#"); foreach ($URL_NAME_DEFAULT as $URL => $URL_VALUE) { if (strLen(trim($arParams["URL_TEMPLATES_" . strToUpper($URL)])) <= 0) { $arParams["URL_TEMPLATES_" . strToUpper($URL)] = $APPLICATION->GetCurPage() . "?" . $URL_VALUE; } $arParams["~URL_TEMPLATES_" . strToUpper($URL)] = $arParams["URL_TEMPLATES_" . strToUpper($URL)]; $arParams["URL_TEMPLATES_" . strToUpper($URL)] = htmlspecialcharsbx($arParams["~URL_TEMPLATES_" . strToUpper($URL)]); } /***************** ADDITIONAL **************************************/ $arParams["SHOW_FORUM_ANOTHER_SITE"] = $arParams["SHOW_FORUM_ANOTHER_SITE"] == "Y" ? "Y" : "N"; $arParams["FID_RANGE"] = is_array($arParams["FID_RANGE"]) && !empty($arParams["FID_RANGE"]) ? $arParams["FID_RANGE"] : array();
$arResult['FIELDS']['tab_params'][] = array('id' => 'CITY_NAME', 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arLoc['CITY_NAME_ORIG']), 'required' => true, 'type' => 'text'); $arResult['FIELDS']['tab_params'][] = array('id' => 'CITY_SHORT_NAME', 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arLoc['CITY_SHORT_NAME']), 'type' => 'text'); for ($i = 0; $i < $countLang; $i++) { $arCity = CSaleLocation::GetCityLangByID($arLoc['CITY_ID'], $arSysLangs[$i]); /* $arResult['FIELDS']['tab_params'][] = array( 'id' => 'CI_LANG_'.$arSysLangs[$i], 'value' => '<b>['.$arSysLangs[$i].'] '.$arSysLangNames[$i].'</b>', 'colspan' => true, 'type' => 'label' ); */ $arResult['FIELDS']['tab_params'][] = array('id' => 'CITY_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arCity["NAME"]), 'required' => true, 'type' => 'text'); $arResult['FIELDS']['tab_params'][] = array('id' => 'CITY_SHORT_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arCity["SHORT_NAME"]), 'type' => 'text'); } /*ZIP TAB*/ $arResult['FIELDS']['tab_zip'][] = array('id' => 'loc_zip', 'name' => GetMessage('CRM_LOC_SECTION_ZIP'), 'type' => 'section'); $zipHtml = '<div id="zip_list">'; $arZipList = array(); $rsZipList = CSaleLocation::GetLocationZIP($locID); while ($arZip = $rsZipList->Fetch()) { $arZipList[] = $arZip; } foreach ($arZipList as $key => $zip) { $zipHtml .= '<input type="text" name="ZIP[]" value="' . htmlspecialcharsEx($zip["ZIP"]) . '" size="10" /><span class="bx-crm-location-zip-delete" onclick="BX.crmLocationZip.delete(this);">' . GetMessage("CRM_DEL_ZIP") . '</span><br />'; } $zipHtml .= '<input type="text" name="ZIP[]" value="" size="10" /><br /> </div> <button onClick="return BX.crmLocationZip.add();">' . GetMessage("CRM_ADD_ZIP") . '</button>'; $arResult['FIELDS']['tab_zip'][] = array('id' => 'ZIP_INPUTS', 'name' => GetMessage('CRM_LOC_FIELD_LOC_ZIP'), 'value' => $zipHtml, 'type' => 'custom'); $this->IncludeComponentTemplate();
/** * Function implements all the life cycle of the component * @return void */ public function executeComponent() { try { $this->checkRequiredModules(); $this->checkAuthorized(); $this->loadOptions(); $this->processRequest(); $this->obtainData(); $this->formatResult(); $this->setTitle(); } catch (Exception $e) { $this->errorsFatal[htmlspecialcharsEx($e->getCode())] = htmlspecialcharsEx($e->getMessage()); } $this->formatResultErrors(); $this->includeComponentTemplate(); }
if(!$bInitVars) $arResult = $arUserProps; else { foreach($_POST as $k => $v) { $arResult[$k] = htmlspecialcharsbx($v); $arResult['~'.$k] = $v; } } $arResult["ERROR_MESSAGE"] = $errorMessage; $arResult["TITLE"] = str_replace("#ID#", $arUserProps["ID"], GetMessage("SPPD_PROFILE_NO")); $arResult["PERSON_TYPE"] = CSalePersonType::GetByID($arUserProps["PERSON_TYPE_ID"]); $arResult["PERSON_TYPE"]["NAME"] = htmlspecialcharsEx($arResult["PERSON_TYPE"]["NAME"]); // get prop description $arrayTmp = Array(); $propsOfTypeLocation = array(); $dbOrderPropsGroup = CSaleOrderPropsGroup::GetList( array("SORT" => "ASC", "NAME" => "ASC"), array("PERSON_TYPE_ID" => $arUserProps["PERSON_TYPE_ID"]), false, false, array("ID", "PERSON_TYPE_ID", "NAME", "SORT") ); while ($arOrderPropsGroup = $dbOrderPropsGroup->GetNext()) { $arrayTmp[$arOrderPropsGroup["ID"]] = $arOrderPropsGroup; $dbOrderProps = CSaleOrderProps::GetList(
<? } else { ?><?php echo GetMessage("F_EDIT_FORM"); ?> <?php echo GetMessage("F_IN_TOPIC"); ?> : <a href="<?php echo $arResult["URL"]["READ"]; ?> "><?php echo htmlspecialcharsEx($arResult["TOPIC_FILTER"]["TITLE"]); ?> </a>, <?php echo GetMessage("F_IN_FORUM"); ?> : <a href="<?php echo $arResult["URL"]["LIST"]; ?> "><?php echo $arResult["FORUM"]["NAME"]; ?> </a><? }; ?></span></div> </div>
/** * Helper function for component parameters safe html escaping. * * @param array[string]mixed &$arParams * @return void * */ final protected function __prepareComponentParams(&$arParams) { if(!is_array($arParams)) return; $p = $arParams; //this avoids endless loop foreach($p as $k=>$v) { $arParams["~".$k] = $v; if (is_array($v)) $arParams[$k] = htmlspecialcharsEx($v); elseif (is_object($v)); elseif (preg_match("/[;&<>\"]/", $v)) $arParams[$k] = htmlspecialcharsEx($v); } }
function GetLayout() { $wizard = $this->GetWizard(); $formName = htmlspecialcharsbx($wizard->GetFormName()); CUtil::InitJSCore(array("ajax")); $adminScript = CAdminPage::ShowScript(); $charset = LANG_CHARSET; $wizardName = htmlspecialcharsEx($wizard->GetWizardName()); $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID()); $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID()); $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID()); $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID()); IncludeAJAX(); $ajaxScripts = $GLOBALS["APPLICATION"]->GetHeadStrings(); $ajaxScripts .= $GLOBALS["APPLICATION"]->GetHeadScripts(); $obStep = $wizard->GetCurrentStep(); $arErrors = $obStep->GetErrors(); $strError = $strJsError = ""; if (count($arErrors) > 0) { foreach ($arErrors as $arError) { $strError .= $arError[0] . "<br />"; if ($arError[1] !== false) { $strJsError .= ($strJsError != "" ? ", " : "") . "{'name':'" . CUtil::addslashes($wizard->GetRealName($arError[1])) . "', 'title':'" . CUtil::addslashes(htmlspecialcharsback($arError[0])) . "'}"; } } if (strlen($strError) > 0) { $strError = '<div id="step_error">' . $strError . "</div>"; } $strJsError = ' <script type="text/javascript"> ShowWarnings([' . $strJsError . ']); </script>'; } $stepTitle = $obStep->GetTitle(); $stepSubTitle = $obStep->GetSubTitle(); $autoSubmit = ""; if ($obStep->IsAutoSubmit()) { $autoSubmit = 'setTimeout("AutoSubmit();", 500);'; } $alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL"); $loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT"); $package = $wizard->GetPackage(); return <<<HTML <!DOCTYPE html> <html id="bx-admin-prefix"> <head> \t<head> \t\t<title>{$wizardName}</title> \t\t<meta http-equiv="X-UA-Compatible" content="IE=edge"> \t\t<meta http-equiv="Content-Type" content="text/html; charset={$charset}"> \t\t{$ajaxScripts} \t\t<style type="text/css"> \t\t\tbody \t\t\t{ \t\t\t\tmargin:0; \t\t\t\tpadding:0; \t\t\t\tfont-size: 13px; \t\t\t\tfont-family: "Helvetica Neue",Helvetica,Arial,sans-serif; \t\t\t} \t\t\ttable {font-size:100%;} \t\t\tform {margin:0; padding:0; } \t\t\ta { \t\t\t\tcolor: #2675D7; \t\t\t\ttext-decoration: underline; \t\t\t} \t\t\t.step-content { \t\t\t\tborder: solid 1px #DCE7ED; \t\t\t\tbackground-color: #F5F9F9; \t\t\t\theight: 347px; \t\t\t\toverflow: auto; \t\t\t} \t\t\t.step-header { \t\t\t\tborder-bottom: 1px solid #DCE7ED; \t\t\t\tfont-size: 12px; \t\t\t\tpadding: 6px 30px 9px 9px; \t\t\t\tmargin-bottom: 12px; \t\t\t} \t\t\t.step-title { font-size: 16px; } \t\t\t.step-subtitle { font-size: 13px; } \t\t\t.step-body { \t\t\t\tpadding: 0 10px; \t\t\t} \t\t\t.step-buttons \t\t\t{ \t\t\t\tpadding-top: 12px; \t\t\t\tpadding-left: 2px; \t\t\t} \t\t\t.step-buttons input { \t\t\t\t-webkit-border-radius: 4px; \t\t\t\tborder-radius: 4px; \t\t\t\tborder:none; \t\t\t\tborder-top:1px solid #fff; \t\t\t\t-webkit-box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5); \t\t\t\tbox-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5); \t\t\t\tbackground-image: -webkit-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -moz-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -ms-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: -o-linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tbackground-image: linear-gradient(bottom, #d7e3e7, #fff)!important; \t\t\t\tcolor:#3f4b54; \t\t\t\tcursor:pointer; \t\t\t\tdisplay:inline-block; \t\t\t\tfont-family:"Helvetica Neue",Helvetica,Arial,sans-serif; \t\t\t\tfont-weight:bold; \t\t\t\tfont-size:13px; \t\t\t\theight: 29px; \t\t\t\ttext-shadow:0 1px rgba(255,255,255,0.7); \t\t\t\ttext-decoration:none; \t\t\t\tposition:relative; \t\t\t\tvertical-align:middle; \t\t\t\t-webkit-font-smoothing: antialiased; \t\t\t\tpadding: 0 13px 2px; \t\t\t\tmargin-right: 3px; \t\t\t} \t\t\t.step-buttons input:hover { \t\t\t\ttext-decoration: none; \t\t\t\tbackground:#f3f6f7!important; \t\t\t\tbackground-image: -webkit-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -moz-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -ms-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: -o-linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t\tbackground-image: linear-gradient(top, #f8f8f9, #f2f6f8)!important; \t\t\t} \t\t\t.step-buttons input:active { \t\t\t\t-webkit-border-radius: 4px; \t\t\t\tborder-radius: 4px; \t\t\t\tbackground-color: #b7c4c9!important; \t\t\t\t-webkit-box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78); \t\t\t\tbox-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78); \t\t\t\tbackground-image: -webkit-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -moz-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -ms-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: -o-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tbackground-image: linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important; \t\t\t\tborder-top:transparent; \t\t\t\theight: 29px; \t\t\t\toutline:none; \t\t\t\tpadding:2px 13px 1px; \t\t\t} \t\t\t.bx-ie8 .step-buttons input, \t\t\t.bx-ie9 .step-buttons input { \t\t\t\tborder-radius:4px; \t\t\t\tbackground:url("/bitrix/panel/main/images/bx-admin-sprite-small-1.png") repeat-x 0 -3554px; \t\t\t\tbox-shadow:0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 #FFFFFF inset, 0 0 1px rgba(255, 255, 255, 0.5) inset !important; \t\t\t\tline-height:16px; \t\t\t\theight:31px!important; \t\t\t\tpadding-top:6px!important; \t\t\t\tpadding-bottom:6px!important; \t\t\t\tmargin-right: 3px !important; \t\t\t} \t\t\t.bx-ie8 .step-buttons input {border:1px solid #959c9d !important;} \t\t\t#step_error \t\t\t{ \t\t\t\tcolor:red; \t\t\t\tpadding:0 0 12px 0; \t\t\t} \t\t\t#hidden-layer \t\t\t{ \t\t\t\tbackground:#F8F9FC none repeat scroll 0%; \t\t\t\theight:100%; \t\t\t\tleft:0pt; \t\t\t\topacity:0.01; \t\t\t\tfilter:alpha(opacity=1); \t\t\t\t-moz-opacity:0.01; \t\t\t\tposition:absolute; \t\t\t\ttop:0pt; \t\t\t\twidth:100%; \t\t\t\tz-index:10001; \t\t\t} \t\t\t/*Data table*/ \t\t\ttable.wizard-data-table { border:1px solid #B2C4DD; border-collapse:collapse;} \t\t\ttable.wizard-data-table td { border:1px solid #B2C4DD; background-color:#FFFFFF; padding:3px 5px; } \t\t\ttable.wizard-data-table thead td, table.wizard-data-table th { \t\t\t\tbackground-color:#E4EDF5; \t\t\t\tfont-weight:normal; \t\t\t\tbackground-image:none; \t\t\t\tborder:1px solid #B2C4DD; \t\t\t\tpadding:4px; \t\t\t} \t\t\ttable.wizard-data-table tbody td { background-color:#FFF; background-image:none; } \t\t\ttable.wizard-data-table tfoot td { background-color:#F2F5F9; padding:4px; } \t\t\t.wizard-note-box { background:#FEFDEA; padding:7px; border:1px solid #D7D6BA; } \t\t\t.wizard-required { color:red; } \t\t\t.bx-session-message { display: none !important;} \t\t</style> \t\t{$adminScript} \t\t<script type="text/javascript"> \t\t\ttop.BX.message({"ADMIN_WIZARD_EXIT_ALERT" : "{$alertText}"}); \t\t\tfunction OnLoad() \t\t\t{ \t\t\t\tvar dialog = top.BX.WindowManager.Get(); \t\t\t\tif (dialog) \t\t\t\t\tdialog.SetTitle('{$wizardName}'); \t\t\t\tvar form = document.forms["{$formName}"]; \t\t\t\tif (form) \t\t\t\t\tform.onsubmit = OnFormSubmit; \t\t\t\tvar cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"]; \t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"]; \t\t\t\tvar finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"]; \t\t\t\tif (cancelButton && !nextButton && !prevButton && !finishButton) \t\t\t\t{ \t\t\t\t\ttop.WizardWindow.isClosed = true; \t\t\t\t\tcancelButton.onclick = CloseWindow; \t\t\t\t} \t\t\t\telse if(cancelButton) \t\t\t\t{ \t\t\t\t\tcancelButton.onclick = ConfirmCancel; \t\t\t\t} \t\t\t\t{$autoSubmit} \t\t\t} \t\t\tfunction OnFormSubmit() \t\t\t{ \t\t\t\tvar div = document.body.appendChild(document.createElement("DIV")); \t\t\t\tdiv.id = "hidden-layer"; \t\t\t} \t\t\tfunction AutoSubmit() \t\t\t{ \t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\tif (nextButton) \t\t\t\t{ \t\t\t\t\tvar wizard = top.WizardWindow; \t\t\t\t\tif (wizard) \t\t\t\t\t{ \t\t\t\t\t\twizard.messLoading = "{$loadingText}"; \t\t\t\t\t\twizard.ShowWaitWindow(); \t\t\t\t\t} \t\t\t\t\tnextButton.click(); \t\t\t\t\tnextButton.disabled=true; \t\t\t\t} \t\t\t} \t\t\tfunction ConfirmCancel() \t\t\t{ \t\t\t\treturn (confirm("{$alertText}")); \t\t\t} \t\t\tfunction ShowWarnings(warnings) \t\t\t{ \t\t\t\tvar form = document.forms["{$formName}"]; \t\t\t\tif(!form) \t\t\t\t\treturn; \t\t\t\tfor(var i in warnings) \t\t\t\t{ \t\t\t\t\tvar e = form.elements[warnings[i]["name"]]; \t\t\t\t\tif(!e) \t\t\t\t\t\tcontinue; \t\t\t\t\tvar type = (e.type? e.type.toLowerCase():""); \t\t\t\t\tvar bBefore = false; \t\t\t\t\tif(e.length > 1 && type != "select-one" && type != "select-multiple") \t\t\t\t\t{ \t\t\t\t\t\te = e[0]; \t\t\t\t\t\tbBefore = true; \t\t\t\t\t} \t\t\t\t\tif(type == "textarea" || type == "select-multiple") \t\t\t\t\t\tbBefore = true; \t\t\t\t\tvar td = e.parentNode; \t\t\t\t\tvar img; \t\t\t\t\tif(bBefore) \t\t\t\t\t{ \t\t\t\t\t\timg = td.insertBefore(new Image(), e); \t\t\t\t\t\ttd.insertBefore(document.createElement("BR"), e); \t\t\t\t\t} \t\t\t\t\telse \t\t\t\t\t{ \t\t\t\t\t\timg = td.insertBefore(new Image(), e.nextSibling); \t\t\t\t\t\timg.hspace = 2; \t\t\t\t\t\timg.vspace = 2; \t\t\t\t\t\timg.style.verticalAlign = "bottom"; \t\t\t\t\t} \t\t\t\t\timg.src = "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/icon_warn.gif"; \t\t\t\t\timg.title = warnings[i]["title"]; \t\t\t\t} \t\t\t} \t\t\tdocument.onkeydown = EnterKeyPress; \t\t\tfunction EnterKeyPress(event) \t\t\t{ \t\t\t\tevent = event || window.event; \t\t\t\tif (!event.ctrlKey) \t\t\t\t\treturn; \t\t\t\tvar key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) ); \t\t\t\tif (!key) \t\t\t\t\treturn; \t\t\t\tif (key == 13 || key == 39) \t\t\t\t{ \t\t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"]; \t\t\t\t\tif (nextButton) \t\t\t\t\t\tnextButton.click(); \t\t\t\t} \t\t\t\telse if (key == 37) \t\t\t\t{ \t\t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"]; \t\t\t\t\tif (prevButton) \t\t\t\t\t\tprevButton.click(); \t\t\t\t} \t\t\t} \t\t\tfunction CloseWindow() \t\t\t{ \t\t\t\tif (self.parent.window.WizardWindow) \t\t\t\t\tself.parent.window.WizardWindow.Close(); \t\t\t} \t\t</script> \t</head> \t<body onload="OnLoad();"> \t\t{#FORM_START#} \t\t<div class="step-content"> \t\t\t<div class="step-header"> \t\t\t\t<div class="step-title">{$stepTitle}</div> \t\t\t\t<div class="step-subtitle">{$stepSubTitle}</div> \t\t\t</div> \t\t\t<div class="step-body"> \t\t\t\t{$strError} \t\t\t\t{#CONTENT#} \t\t\t</div> \t\t</div> \t\t<div class="step-buttons">{#BUTTONS#}</div> \t\t{#FORM_END#} \t\t{$strJsError} \t</body> </html> HTML; }
function GetBoardFromSite($queryParameters) { global $APPLICATION; $result = array(); $ob = new CHTTP(); $ob->http_timeout = 60; $ob->Query("GET", "www.rossiya-airlines.com", 80, "/ru/passenger/about_flight/" . $queryParameters . '?ts=' . mktime(), false, "", "N"); $result["ERROR"]["CODE"] = $ob->errno; $result["ERROR"]["MESSAGE"] = $ob->errstr; if (intval($result["ERROR"]["CODE"]) == 0) { $res = $ob->result; $res = str_replace('<table border="0" cellpadding="0" cellspacing="0" class="table" id="tblData">', "++++<table>", $res); $res = str_replace('$(document).ready(function()', "++++", $res); $explode = explode("++++", $res); $res = $explode[1]; $res = substr($res, 0, strlen($res) - 22); $res = str_replace("<br>", " ", $res); $res = str_replace("<nobr>", "", $res); $res = str_replace("</nobr>", "", $res); //trace($res); $xml = new CDataXML(); if ($xml->LoadString($res)) { $node = $xml->SelectNodes("/table"); $rows = $node->elementsByName("tr"); $akNames = array(); $akCodes = array(); $departures = array(); $arrivals = array(); $terminals = array(); foreach ($rows as $row) { if (strstr($row->getAttribute("class"), "finddata")) { $cells = $row->elementsByName("td"); $flightNumber = $cells[0]->elementsByName("div"); // Определяем код авиакомпании и номер рейса preg_match_all("/([A-Za-zА-Яа-я0-9]{2})([0-9]+)/", $flightNumber[0]->content, $flightNumber, PREG_PATTERN_ORDER); $terminal = $cells[1]->elementsByName("div"); $city = $cells[2]->elementsByName("div"); $plannedTime = $cells[3]->elementsByName("div"); $actualTime = $cells[4]->elementsByName("div"); $status = $cells[5]->elementsByName("span"); $result["FLIGHTS"][] = array("FLIGHT" => array("AK_CODE" => $flightNumber[1][0], "NUMBER" => $flightNumber[2][0]), "AK_NAME" => "", "DEPARTURE" => htmlspecialcharsEx($city[0]->content), "ARRIVAL" => htmlspecialcharsEx($city[0]->content), "STATUS" => CAirportBoard::GetStatusInfo($status[0]->content), "TIME" => array("PLANNED" => CAirportBoard::GetDateTimeArray($plannedTime[0]->content), "ESTIMATED" => "", "ACTUAL" => CAirportBoard::GetDateTimeArray($actualTime[0]->content)), "TERMINAL" => htmlspecialchars($terminal[0]->content)); // Формируем список уникальных терминалов и пунктов вылета и прилета для фильтра if (!in_array($flightNumber[1][0], $akCodes)) { $akCodes[] = $flightNumber[1][0]; } if (!in_array(htmlspecialcharsEx($city[0]->content), $departures)) { $departures[] = htmlspecialcharsEx($city[0]->content); } if (!in_array(htmlspecialcharsEx($city[0]->content), $arrivals)) { $arrivals[] = htmlspecialcharsEx($city[0]->content); } if (!in_array(htmlspecialcharsEx($terminal[0]->content), $terminals)) { $terminals[] = htmlspecialcharsEx($terminal[0]->content); } } } sort($akNames); sort($akCodes); sort($departures); sort($arrivals); sort($terminals); $result["AK"] = $akNames; $result["AK_CODES"] = $akCodes; $result["DEPARTURES"] = $departures; $result["ARRIVALS"] = $arrivals; $result["TERMINALS"] = $terminals; } } //trace($result); return $result; }
public function Update($table, $arFields, $WHERE = "", $error_position = "", $DEBUG = false, $ignore_errors = false, $additional_check = true) { $rows = 0; if (is_array($arFields)) { $ar = array(); foreach ($arFields as $field => $value) { if (strlen($value) <= 0) { $ar[] = "`" . $field . "` = ''"; } else { $ar[] = "`" . $field . "` = " . $value . ""; } } if (!empty($ar)) { $strSql = "UPDATE " . $table . " SET " . implode(", ", $ar) . " " . $WHERE; if ($DEBUG) { echo "<br>" . htmlspecialcharsEx($strSql) . "<br>"; } $w = $this->Query($strSql, $ignore_errors, $error_position); if (is_object($w)) { $rows = $w->AffectedRowsCount(); if ($DEBUG) { echo "affected_rows = " . $rows . "<br>"; } if ($rows <= 0 && $additional_check) { $w = $this->Query("SELECT 'x' FROM " . $table . " " . $WHERE, $ignore_errors, $error_position); if (is_object($w)) { if ($w->Fetch()) { $rows = $w->SelectedRowsCount(); } if ($DEBUG) { echo "num_rows = " . $rows . "<br>"; } } } } } } return $rows; }
"> <td class="bx-popup-label bx-width30"><?php echo htmlspecialcharsEx(ToUpper($propertyCode)); ?> <input type="hidden" name="PROPERTY[<?php echo $propertyIndex; ?> ][CODE]" value="<?php echo htmlspecialcharsEx(ToUpper($propertyCode)); ?> " />:</td> <td><input type="text" name="PROPERTY[<?php echo $propertyIndex; ?> ][VALUE]" value="<?php echo htmlspecialcharsEx($propertyValue); ?> " style="width:90%;"></td> </tr> <?php $propertyIndex++; } ?> <?php if ($bSearchExists) { ?> <tr class="empty"> <td colspan="2"><div class="empty"></div></td> </tr>
:</td> <td> <input type="text" name="filter_user_id" size="5" value="<?php echo htmlspecialcharsEx($filter_user_id); ?> "> </td> </tr> <tr> <td><?php echo GetMessage("SCA_USER_LOGIN"); ?> :</td> <td> <input type="text" name="filter_login" size="50" value="<?php echo htmlspecialcharsEx($filter_login); ?> "> </td> </tr> <tr> <td><?php echo GetMessage("SCA_ACTIVE"); ?> :</td> <td> <select name="filter_active"> <option value=""><?php echo htmlspecialcharsex("(" . GetMessage("SCA_ALL") . ")"); ?> </option>
function GetUserInfo($params) { global $USER; $user = CBlogMetaWeblog::DecodeParams($params[1]["#"]["value"][0]["#"]); $password = CBlogMetaWeblog::DecodeParams($params[2]["#"]["value"][0]["#"]); if (CBlogMetaWeblog::Authorize($user, $password)) { $result = ''; $userId = $USER->GetID(); $dbUser = CUser::GetByID($userId); if ($arUser = $dbUser->Fetch()) { $BlogUser = CBlogUser::GetByID($userId, BLOG_BY_USER_ID); if (strlen($BlogUser["ALIAS"]) > 0) { $nick = htmlspecialcharsEx($BlogUser["ALIAS"]); } else { $nick = htmlspecialcharsEx($arUser["LOGIN"]); } $result .= ' <value> <struct> <member> <name>nickname</name> <value>' . $nick . '</value> </member> <member> <name>email</name> <value>' . htmlspecialcharsEx($arUser["EMAIL"]) . '</value> </member> <member> <name>lastname</name> <value>' . htmlspecialcharsEx($arUser["LAST_NAME"]) . '</value> </member> <member> <name>firstname</name> <value>' . htmlspecialcharsEx($arUser["NAME"]) . '</value> </member> </struct> </value> '; } if (strlen($result) > 0) { return '<params> <param> <value> <array> <data>' . $result . '</data> </array> </value> </param> </params>'; } else { return '<fault> <value> <struct> <member> <name>faultCode</name> <value><int>4</int></value> </member> <member> <name>faultString</name> <value><string>User not found.</string></value> </member> </struct> </value> </fault>'; } } else { return '<fault> <value> <struct> <member> <name>faultCode</name> <value><int>3</int></value> </member> <member> <name>faultString</name> <value><string>' . $arAuthResult["MESSAGE"] . '</string></value> </member> </struct> </value> </fault>'; } }
echo GetMessage("SPS_ACT_SYSTEM"); ?> ----</option> <?php foreach ($arSystemPSActions as $val) { ?> <option value="<?php echo htmlspecialcharsbx($val["PATH"]); ?> "<?php if ($f_ACTION_FILE == $val["PATH"]) { echo " selected"; } ?> ><?php echo htmlspecialcharsEx($val["TITLE"]); ?> </option><?php } ?> </select> <div id="pay_sys_act_descr_<?php echo $arPersonType["ID"]; ?> "></div> </td> </tr> <tr> <td width="40%" align="right"><?php echo GetMessage("SPS_NEW_WINDOW"); ?>