コード例 #1
1
ファイル: Crypt.php プロジェクト: carriercomm/jbs
function Crypt_Decode($String, $Key = HOST_ID)
{
    /****************************************************************************/
    $__args_types = array('string', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $String = Base64_Decode($String);
    #-----------------------------------------------------------------------------
    if (empty($String)) {
        return $String;
    }
    #-----------------------------------------------------------------------------
    if (Extension_Loaded('mcrypt')) {
        #---------------------------------------------------------------------------
        $Module =& Link_Get('Crypt');
        #---------------------------------------------------------------------------
        if (!Is_Resource($Module)) {
            #-------------------------------------------------------------------------
            $Module = @MCrypt_Module_Open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
            if (!Is_Resource($Module)) {
                return ERROR | @Trigger_Error('[Crypt_Decode]: не удалось открыть дескриптор');
            }
            #-------------------------------------------------------------------------
            $Iv = @MCrypt_Create_Iv(MCrypt_Enc_Get_Iv_Size($Module), MCRYPT_RAND);
            if (!$Iv) {
                return ERROR | @Trigger_Error('[Crypt_Decode]: не удалось создать IV');
            }
            #-------------------------------------------------------------------------
            $Key = SubStr($Key, 0, MCrypt_Enc_Get_Key_Size($Module));
            #Debug(SPrintF("[system/libs/auto/Crypt]: Decode Key = %s",$Key));
            #-------------------------------------------------------------------------
            $IsInit = @MCrypt_Generic_Init($Module, $Key, $Iv);
            if (!Is_Integer($IsInit)) {
                return ERROR | @Trigger_Error('[Crypt_Decode]: не удалось инициализовать модуль дешифрования');
            }
        }
        #---------------------------------------------------------------------------
        $String = @MDecrypt_Generic($Module, $String);
        if (!Is_String($String)) {
            return ERROR | @Trigger_Error('[Crypt_Decode]: не удалось дешифровать данные');
        }
        #---------------------------------------------------------------------------
        $String = Trim($String);
        #---------------------------------------------------------------------------
    }
    #-----------------------------------------------------------------------------
    return $String;
}
コード例 #2
0
ファイル: component_util.php プロジェクト: rasuldev/torino
 public static function PrepareVariables(&$arData)
 {
     unset($arData["NEW_COMPONENT_TEMPLATE"]);
     if ($arData["SEF_MODE"] == "Y") {
         unset($arData["VARIABLE_ALIASES"]);
         unset($arData["SEF_URL_TEMPLATES"]);
         foreach ($arData as $dataKey => $dataValue) {
             if (SubStr($dataKey, 0, strlen("SEF_URL_TEMPLATES_")) == "SEF_URL_TEMPLATES_") {
                 $arData["SEF_URL_TEMPLATES"][SubStr($dataKey, strlen("SEF_URL_TEMPLATES_"))] = $dataValue;
                 unset($arData[$dataKey]);
                 if (preg_match_all("'(\\?|&)(.+?)=#([^#]+?)#'is", $dataValue, $arMatches, PREG_SET_ORDER)) {
                     foreach ($arMatches as $arMatch) {
                         $arData["VARIABLE_ALIASES"][SubStr($dataKey, strlen("SEF_URL_TEMPLATES_"))][$arMatch[3]] = $arMatch[2];
                     }
                 }
             } elseif (SubStr($dataKey, 0, strlen("VARIABLE_ALIASES_")) == "VARIABLE_ALIASES_") {
                 unset($arData[$dataKey]);
             }
         }
     } else {
         unset($arData["VARIABLE_ALIASES"]);
         unset($arData["SEF_URL_TEMPLATES"]);
         foreach ($arData as $dataKey => $dataValue) {
             if (SubStr($dataKey, 0, strlen("SEF_URL_TEMPLATES_")) == "SEF_URL_TEMPLATES_") {
                 unset($arData[$dataKey]);
             } elseif (SubStr($dataKey, 0, strlen("VARIABLE_ALIASES_")) == "VARIABLE_ALIASES_") {
                 $arData["VARIABLE_ALIASES"][SubStr($dataKey, strlen("VARIABLE_ALIASES_"))] = $dataValue;
                 unset($arData[$dataKey]);
             }
         }
     }
 }
コード例 #3
0
 public function store(Request $request)
 {
     $this->validate($request, ['NMbl' => 'required', 'NHbl' => 'required']);
     $registrosmars = DB::table('mbls')->where('Nmbl', '=', $request->NMbl)->get();
     foreach ($registrosmars as $key) {
     }
     $pod = $key->POD;
     $data = $key->ETA;
     $ano = SubStr($data, 0, 4);
     $referencia = $key->registro;
     $id = $key->id;
     $os = 'OS' . $pod . $id . '/' . $ano;
     $cnee = $key->cnee;
     $mbl = $key->NMbl;
     $agenteId = DB::table('agentes')->where('nome', '=', $key->cnee)->get();
     foreach ($agenteId as $item) {
     }
     $valor = $item->valordesconsolmaritimo;
     Hbl::create(['ETA' => $data, 'NMbl' => $mbl, 'NHbl' => $request->NHbl, 'referencia' => $os, 'mbl_id' => $id, 'shipper' => $request->shipper, 'cnee' => $request->cnee, 'agente' => $cnee, 'vlrDesconsol' => $valor]);
     $hbl = DB::table('hbls')->where('NHbl', '=', $request->NHbl)->get();
     foreach ($hbl as $item) {
     }
     $hblid = $item->id;
     Faturamento::create(['documento' => $request->NHbl, 'data' => $data, 'hbl_id' => $hblid, 'referencia' => $referencia, 'OS' => $os]);
     return redirect('mbl');
 }
コード例 #4
0
 /**
  * @param int $Length
  * @throws AuthenticationException
  */
 public function Read($Length = 1400)
 {
     // GoldSource RCON has same structure as Query
     $this->Socket->Read();
     if ($this->Buffer->GetByte() !== SourceQuery::S2A_RCON) {
         return false;
     }
     $Buffer = $this->Buffer->Get();
     $Trimmed = Trim($Buffer);
     if ($Trimmed === 'Bad rcon_password.') {
         throw new AuthenticationException($Trimmed, AuthenticationException::BAD_PASSWORD);
     } else {
         if ($Trimmed === 'You have been banned from this server.') {
             throw new AuthenticationException($Trimmed, AuthenticationException::BANNED);
         }
     }
     $ReadMore = false;
     // There is no indentifier of the end, so we just need to continue reading
     // TODO: Needs to be looked again, it causes timeouts
     do {
         $this->Socket->Read();
         $ReadMore = $this->Buffer->Remaining() > 0 && $this->Buffer->GetByte() === SourceQuery::S2A_RCON;
         if ($ReadMore) {
             $Packet = $this->Buffer->Get();
             $Buffer .= SubStr($Packet, 0, -2);
             // Let's assume if this packet is not long enough, there are no more after this one
             $ReadMore = StrLen($Packet) > 1000;
             // use 1300?
         }
     } while ($ReadMore);
     $this->Buffer->Set(Trim($Buffer));
 }
コード例 #5
0
function QueryMinecraft($IP, $Port = 25565, $Timeout = 2)
{
    $Socket = Socket_Create(AF_INET, SOCK_STREAM, SOL_TCP);
    Socket_Set_Option($Socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => (int) $Timeout, 'usec' => 0));
    Socket_Set_Option($Socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => (int) $Timeout, 'usec' => 0));
    if ($Socket === FALSE || @Socket_Connect($Socket, $IP, (int) $Port) === FALSE) {
        return FALSE;
    }
    Socket_Send($Socket, "þ", 2, 0);
    $Len = Socket_Recv($Socket, $Data, 512, 0);
    Socket_Close($Socket);
    if ($Len < 4 || $Data[0] !== "ÿ") {
        return FALSE;
    }
    $Data = SubStr($Data, 3);
    // Strip packet header (kick message packet and short length)
    $Data = iconv('UTF-16BE', 'UTF-8', $Data);
    // Are we dealing with Minecraft 1.4+ server?
    if ($Data[1] === "§" && $Data[2] === "1") {
        $Data = Explode("", $Data);
        return array('HostName' => $Data[3], 'Players' => IntVal($Data[4]), 'MaxPlayers' => IntVal($Data[5]), 'Protocol' => IntVal($Data[1]), 'Version' => $Data[2]);
    }
    $Data = Explode("§", $Data);
    return array('HostName' => SubStr($Data[0], 0, -1), 'Players' => isset($Data[1]) ? IntVal($Data[1]) : 0, 'MaxPlayers' => isset($Data[2]) ? IntVal($Data[2]) : 0, 'Protocol' => 0, 'Version' => '1.3');
}
コード例 #6
0
ファイル: class.core.php プロジェクト: andyUA/kabmin-new
 static function loadBaseURL()
 {
     $absolute_plugin_folder = RealPath(self::$plugin_folder);
     if (StrPos($absolute_plugin_folder, ABSPATH) === 0) {
         self::$base_url = Get_Bloginfo('wpurl') . '/' . SubStr($absolute_plugin_folder, Strlen(ABSPATH));
     } else {
         self::$base_url = Plugins_Url(BaseName(self::$plugin_folder));
     }
     self::$base_url = Str_Replace("\\", '/', self::$base_url);
     # Windows Workaround
 }
コード例 #7
0
ファイル: FLAP.php プロジェクト: carriercomm/jbs
function FLAP_Explode($String)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    if (StrLen($String) < 6) {
        return FALSE;
    }
    #-----------------------------------------------------------------------------
    return array('Chanel' => Bytes_Get($String, 01), 'Number' => Bytes_Get($String, 02, 02), 'Data' => SubStr($String, 06));
}
コード例 #8
0
ファイル: SNAC.php プロジェクト: carriercomm/jbs
function SNAC_Explode($String)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = array('FamilyID' => Bytes_Get($String, 00, WORD), 'SubTypeID' => Bytes_Get($String, 02, WORD), 'Flag0' => Bytes_Get($String, 05, BUTE), 'Flag1' => Bytes_Get($String, 06, BUTE), 'RequestID' => Bytes_Get($String, 04, BUTE));
    #-----------------------------------------------------------------------------
    $Result['Data'] = SubStr($String, 11);
    # Сам пакет
    #-----------------------------------------------------------------------------
    return $Result;
}
コード例 #9
0
 /**
  * Gets data from buffer
  *
  * @param int $Length Bytes to read
  *
  * @return string
  */
 public function Get($Length = -1)
 {
     if ($Length === 0) {
         return '';
     }
     $Remaining = $this->Remaining();
     if ($Length === -1) {
         $Length = $Remaining;
     } else {
         if ($Length > $Remaining) {
             return '';
         }
     }
     $Data = SubStr($this->Buffer, $this->Position, $Length);
     $this->Position += $Length;
     return $Data;
 }
コード例 #10
0
 function __construct()
 {
     // Read base
     $this->base_url = get_bloginfo('wpurl') . '/' . Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH)));
     // Get ready to translate
     $this->Load_TextDomain();
     // Set Hooks
     if (Is_Admin()) {
         Add_Action('admin_menu', array($this, 'add_options_page'));
         Add_Action('admin_head', array($this, 'print_admin_header'));
     } else {
         Add_Action('wp_head', array($this, 'print_header'));
         Add_ShortCode('gallery', array($this, 'gallery_shortcode'));
     }
     // Add jQuery
     wp_enqueue_script('jquery');
 }
コード例 #11
0
function QueryMinecraft($IP, $Port = 25565, $Timeout = 2)
{
    $Socket = Socket_Create(AF_INET, SOCK_STREAM, SOL_TCP);
    Socket_Set_Option($Socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => (int) $Timeout, 'usec' => 0));
    if ($Socket === FALSE || @Socket_Connect($Socket, $IP, (int) $Port) === FALSE) {
        return FALSE;
    }
    Socket_Send($Socket, "þ", 1, 0);
    $Len = Socket_Recv($Socket, $Data, 256, 0);
    Socket_Close($Socket);
    if ($Len < 4 || $Data[0] != "ÿ") {
        return FALSE;
    }
    $Data = SubStr($Data, 3);
    $Data = iconv('UTF-16BE', 'UTF-8', $Data);
    $Data = Explode("§", $Data);
    return array('HostName' => SubStr($Data[0], 0, -1), 'Players' => isset($Data[1]) ? IntVal($Data[1]) : 0, 'MaxPlayers' => isset($Data[2]) ? IntVal($Data[2]) : 0);
}
コード例 #12
0
ファイル: TVL.php プロジェクト: carriercomm/jbs
function TVL_Explode($String, &$Array = array())
{
    /****************************************************************************/
    $__args_types = array('string', 'array');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Length = HexDec(Bytes_Get($String, 02, WORD));
    #-----------------------------------------------------------------------------
    $Array[Bytes_Get($String, 00, WORD)] = SubStr($String, 04, $Length);
    #-----------------------------------------------------------------------------
    if (StrLen($String = SubStr($String, 04 + $Length)) > 0) {
        TVL_Explode($String, $Array);
    }
    #-----------------------------------------------------------------------------
    return $Array;
}
コード例 #13
0
ファイル: Update.comp.php プロジェクト: carriercomm/jbs
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Files = IO_Files(SPrintF('%s/core', SYSTEM_PATH));
if (Is_Error($Files)) {
    return SPrintF("---\n%s\n---\n", Implode("\n", Array_Slice($__SYSLOG, Count($__SYSLOG) - 20)));
}
#-------------------------------------------------------------------------------
foreach ($Files as $File) {
    #-------------------------------------------------------------------------------
    $MD5 = MD5_File($File);
    if (!$MD5) {
        return SPrintF("---\n%s\n---\n", Implode("\n", Array_Slice($__SYSLOG, Count($__SYSLOG) - 20)));
    }
    #-------------------------------------------------------------------------------
    $File = SubStr($File, StrLen(SYSTEM_PATH) + 1);
    #-------------------------------------------------------------------------------
    $Snapshot[SPrintF('MD5%s', MD5(SPrintF('%s-%s', $MD5, MD5($File))))] = $File;
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
echo "Запрос обновлений\n";
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Server = $Config['Update']['Server'];
#-------------------------------------------------------------------------------
$Answer = HTTP_Send('/GetUpdate', $Server, array('HostsIDs' => Implode(',', $HostsIDs)), array('Snapshot' => JSON_Encode($Snapshot)));
if (Is_Error($Answer)) {
    return "ERROR: не удалось выполнить запрос к серверу\n";
コード例 #14
0
ファイル: nodes.php プロジェクト: Kyberia/neo-kyberia
<?php

// starting timer for benchmarking purposes
$timer_start = Time() + SubStr(MicroTime(), 0, 8);
session_start();
// main config file with constants
require_once '../config/config.inc';
// error messges
require_once INCLUDE_DIR . 'error.inc';
// create a global PDO object $db
require_once INCLUDE_DIR . 'database.inc';
// database specific code ( all the SQL/whatever queries )
require_once BACKEND_DIR . '/' . DB_TYPE . '/backend.inc';
// set default node id if not specified
if (!empty($_GET['node_id'])) {
    $node_id = $_GET['node_id'];
    if (!is_numeric($node_id)) {
        $node_id = DEFAULT_NODE_ID;
    }
} else {
    $node_id = DEFAULT_NODE_ID;
}
if (!empty($_GET['template_id'])) {
    $template_id = $_GET['template_id'];
    if (!is_numeric($template_id)) {
        $template_id = false;
    }
} else {
    // get template_id from node settings later
    $template_id = false;
}
コード例 #15
0
ファイル: admin_lib.php プロジェクト: ASDAFF/open_bx
	function ShowTab($divName)
	{
		if (!$this->bInited)
			return False;

		foreach ($this->arEngines as $key => $value)
		{
			if (SubStr($divName, 0, StrLen($key."_")) == $key."_")
			{
				if (array_key_exists("ShowTab", $value))
					call_user_func_array($value["ShowTab"], array(SubStr($divName, StrLen($key."_")), $this->arArgs, $this->bVarsFromForm));
			}
		}
		return null;
	}
コード例 #16
0
ファイル: image.php プロジェクト: Kuludu/MCMotd
 function QueryMinecraft($IP, $Port)
 {
     $Socket = Socket_Create(AF_INET, SOCK_STREAM, SOL_TCP);
     Socket_Set_Option($Socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 2, 'usec' => 0));
     Socket_Set_Option($Socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 2, 'usec' => 0));
     if ($Socket === FALSE || @Socket_Connect($Socket, $IP, (int) $Port) === FALSE) {
         return FALSE;
     }
     Socket_Send($Socket, "�", 2, 0);
     $Len = Socket_Recv($Socket, $Data, 512, 0);
     Socket_Close($Socket);
     if ($Len < 4 || $Data[0] !== "�") {
         return FALSE;
     }
     $Data = SubStr($Data, 3);
     $Data = iconv('UTF-16BE', 'UTF-8', $Data);
     if ($Data[1] === "�" && $Data[2] === "1") {
         $Data = Explode("", $Data);
         return array('HostName' => $Data[3], 'Players' => IntVal($Data[4]), 'MaxPlayers' => IntVal($Data[5]), 'Protocol' => IntVal($Data[1]), 'Version' => $Data[2]);
     }
     $Data = Explode("�", $Data);
     return array('HostName' => SubStr($Data[0], 0, -1), 'Players' => isset($Data[1]) ? IntVal($Data[1]) : 0, 'MaxPlayers' => isset($Data[2]) ? IntVal($Data[2]) : 0, 'Protocol' => 0, 'Version' => '1.3');
 }
コード例 #17
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
                    $redirectPath .= "?user_settings_id=" . $newID;
                } else {
                    $redirectPath .= "&user_settings_id=" . $newID;
                }
                LocalRedirect($redirectPath);
            }
        } else {
            $arResult["ShowStep"] = 1;
            $arResult["Templates"] = array();
            foreach ($arUserTemplatesList as $arUserTemplate) {
                $arUserTemplate["LINK"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("user_template_id=" . $arUserTemplate["NAME"], array("user_template_id")));
                if (StrLen($arUserTemplate["TITLE"]) <= 0) {
                    $arUserTemplate["TITLE"] = $arUserTemplate["NAME"];
                }
                $arResult["Templates"][] = $arUserTemplate;
            }
            $arResult["Settings"] = array();
            $dbUserOptionsList = CUserOptions::GetList(array("ID" => "ASC"), array("USER_ID_EXT" => $GLOBALS["USER"]->GetID(), "CATEGORY" => $userSettingsCategory));
            while ($arUserOptionTmp = $dbUserOptionsList->Fetch()) {
                $val = unserialize($arUserOptionTmp["VALUE"]);
                if ($val["IBLOCK_ID"] != $iblockId || $val["TASK_TYPE"] != $taskType || $val["OWNER_ID"] != $ownerId) {
                    continue;
                }
                $id = IntVal(SubStr($arUserOptionTmp["NAME"], $userSettingsNamePartLength));
                $arResult["Settings"][] = array("ID" => $id, "TITLE" => HtmlSpecialCharsbx($val["TITLE"]), "LINK" => htmlspecialcharsbx($APPLICATION->GetCurPageParam("user_template_id=" . $val["TEMPLATE"] . "&user_settings_id=" . $id, array("user_template_id", "user_settings_id"))));
            }
        }
    }
    $arResult["arSocNetFeaturesSettings"] = CSocNetAllowed::GetAllowedFeatures();
}
$this->IncludeComponentTemplate();
コード例 #18
0
 if (count($arParams["USER_FIELDS_MAIN"]) > 0 || count($arParams["USER_FIELDS_CONTACT"]) > 0 || count($arParams["USER_FIELDS_PERSONAL"]) > 0) {
     foreach ($arResult["User"] as $userFieldName => $userFieldValue) {
         if (in_array($userFieldName, $arParams["USER_FIELDS_MAIN"]) || in_array($userFieldName, $arParams["USER_FIELDS_CONTACT"]) || in_array($userFieldName, $arParams["USER_FIELDS_PERSONAL"])) {
             $val = $userFieldValue;
             $strSearch = "";
             switch ($userFieldName) {
                 case 'EMAIL':
                     if (StrLen($val) > 0) {
                         $val = '<a href="mailto:' . $val . '">' . $val . '</a>';
                     }
                     break;
                 case 'PERSONAL_WWW':
                 case 'WORK_WWW':
                     if (StrLen($val) > 0) {
                         $valLink = $val;
                         if (StrToLower(SubStr($val, 0, StrLen("http://"))) != "http://") {
                             $valLink = "http://" . $val;
                         }
                         $val = '<noindex><a href="' . $valLink . '" target="_blank" rel="nofollow">' . $val . '</a></noindex>';
                     }
                     break;
                 case 'PERSONAL_COUNTRY':
                 case 'WORK_COUNTRY':
                     if (StrLen($val) > 0) {
                         if (in_array($userFieldName, $arParams["SONET_USER_FIELDS_SEARCHABLE"])) {
                             $strSearch = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($userFieldName) . "=" . UrlEncode($val);
                         }
                         $val = GetCountryByID($val);
                     }
                     break;
                 case 'PERSONAL_ICQ':
コード例 #19
0
ファイル: Import.comp.php プロジェクト: carriercomm/jbs
if (Is_Error(System_Load('modules/Authorisation.mod', 'libs/Upload.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Upload = Upload_Get('DataImport');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return 'Файл базы данных не был загружен';
    case 'array':
        #---------------------------------------------------------------------------
        $Data = $Upload['Data'];
        #---------------------------------------------------------------------------
        if ($gZip = @GzInflate(SubStr($Upload['Data'], 10))) {
            #-------------------------------------------------------------------------
            echo "Файл базы данных является сжатым файлом gzip\n";
            #-------------------------------------------------------------------------
            $Data = $gZip;
        } else {
            echo "Файл базы данных не является сжатым файлом gzip\n";
        }
        #---------------------------------------------------------------------------
        $File = rTrim($Upload['Name'], '.gz');
        #---------------------------------------------------------------------------
        $File = PathInfo($File);
        #---------------------------------------------------------------------------
        switch (StrToLower($File['extension'])) {
            case 'xml':
                #-----------------------------------------------------------------------
コード例 #20
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
            $arParams["ORDER_DIR_" . $i] = StrToUpper($arParams["ORDER_DIR_" . $i]) == "ASC" ? "ASC" : "DESC";
            $arOrderBy[$orderBy] = $arParams["ORDER_DIR_" . $i];
        }
    }
    if (Count($arOrderBy) <= 0) {
        $arOrderBy["NAME"] = "ASC";
        $arOrderBy["ID"] = "DESC";
    }
    $arFilter = array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y");
    if (Is_Array($arParams["FILTER"])) {
        foreach ($arParams["FILTER"] as $key => $value) {
            $op = "";
            $opTmp = SubStr($key, 0, 1);
            if (In_Array($opTmp, array("!", "<", ">"))) {
                $op = $opTmp;
                $key = SubStr($key, 1);
            }
            if (Array_Key_Exists($key, $arResult["ALLOWED_FIELDS"]) && $arResult["ALLOWED_FIELDS"][$key]["FILTERABLE"]) {
                $arFilter[$op . $key] = $value;
            }
        }
    }
}
if (StrLen($arResult["FatalError"]) <= 0) {
    $arNavStartParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bShowAll" => false, "bDescPageNumbering" => false);
    $arNavigation = CDBResult::GetNavParams($arNavStartParams);
    $arSelectFields = array("IBLOCK_ID");
    foreach ($arResult["ALLOWED_FIELDS"] as $key => $value) {
        $arSelectFields[] = $key;
    }
    $arResult["MEETINGS_LIST"] = array();
コード例 #21
0
ファイル: editor_utils.php プロジェクト: Satariall/izurit
 function _RenderAllComponents($arParams, $bLPA)
 {
     global $APPLICATION, $USER;
     $s = '';
     $arPHP = PHPParser::ParseFile($arParams['source']);
     $l = count($arPHP);
     if ($l > 0) {
         $new_source = '';
         $end = 0;
         $comp_count = 0;
         ob_start();
         for ($n = 0; $n < $l; $n++) {
             //Trim php tags
             $src = $arPHP[$n][2];
             if (SubStr($src, 0, 5) == "<?" . "php") {
                 $src = SubStr($src, 5);
             } else {
                 $src = SubStr($src, 2);
             }
             $src = SubStr($src, 0, -2);
             $comp2_begin = '$APPLICATION->INCLUDECOMPONENT(';
             if (strtoupper(substr($src, 0, strlen($comp2_begin))) != $comp2_begin) {
                 continue;
             }
             $arRes = PHPParser::CheckForComponent2($arPHP[$n][2]);
             if ($arRes) {
                 $comp_name = CMain::_ReplaceNonLatin($arRes['COMPONENT_NAME']);
                 $template_name = CMain::_ReplaceNonLatin($arRes['TEMPLATE_NAME']);
                 $arParams = $arRes['PARAMS'];
                 $arParams['BX_EDITOR_RENDER_MODE'] = 'Y';
                 if ($bLPA) {
                     $arPHPparams = array();
                     CMain::LPAComponentChecker($arParams, $arPHPparams);
                     $len = count($arPHPparams);
                 }
                 $br = "\r\n";
                 $code = '$APPLICATION->IncludeComponent(' . $br . "\t" . '"' . $comp_name . '",' . $br . "\t" . '"' . $template_name . '",' . $br;
                 // If exist at least one parameter with php code inside
                 if (count($arParams) > 0) {
                     // Get array with description of component params
                     $arCompParams = CComponentUtil::GetComponentProps($comp_name);
                     $arTemplParams = CComponentUtil::GetTemplateProps($comp_name, $template_name, $template);
                     $arParameters = array();
                     if (isset($arCompParams["PARAMETERS"]) && is_array($arCompParams["PARAMETERS"])) {
                         $arParameters = $arParameters + $arCompParams["PARAMETERS"];
                     }
                     if (is_array($arTemplParams)) {
                         $arParameters = $arParameters + $arTemplParams;
                     }
                     if ($bLPA) {
                         // Replace values from 'DEFAULT'
                         for ($e = 0; $e < $len; $e++) {
                             $par_name = $arPHPparams[$e];
                             $arParams[$par_name] = isset($arParameters[$par_name]['DEFAULT']) ? $arParameters[$par_name]['DEFAULT'] : '';
                         }
                     }
                     foreach ($arParams as $key => $val) {
                         if ($key != addslashes($key)) {
                             unset($arParams[$key]);
                         } else {
                             $arParams[$key] = addslashes($val);
                         }
                     }
                     //ReturnPHPStr
                     $params = PHPParser::ReturnPHPStr2($arParams, $arParameters);
                     $code .= "\t" . 'Array(' . $br . "\t" . $params . $br . "\t" . ')';
                 } else {
                     $code .= "\t" . 'Array()';
                 }
                 $parent_comp = CMain::_ReplaceNonLatin($arRes['PARENT_COMP']);
                 $arExParams_ = $arRes['FUNCTION_PARAMS'];
                 $bEx = isset($arExParams_) && is_array($arExParams_) && count($arExParams_) > 0;
                 if (!$parent_comp || strtolower($parent_comp) == 'false') {
                     $parent_comp = false;
                 }
                 if ($parent_comp) {
                     if ($parent_comp == 'true' || intVal($parent_comp) == $parent_comp) {
                         $code .= ',' . $br . "\t" . $parent_comp;
                     } else {
                         $code .= ',' . $br . "\t\"" . $parent_comp . '"';
                     }
                 }
                 if ($bEx) {
                     if (!$parent_comp) {
                         $code .= ',' . $br . "\tfalse";
                     }
                     $arExParams = array();
                     foreach ($arExParams_ as $k => $v) {
                         $k = CMain::_ReplaceNonLatin($k);
                         $v = CMain::_ReplaceNonLatin($v);
                         if (strlen($k) > 0 && strlen($v) > 0) {
                             $arExParams[$k] = $v;
                         }
                     }
                     $exParams = PHPParser::ReturnPHPStr2($arExParams);
                     $code .= ',' . $br . "\tArray(" . $exParams . ')';
                 }
                 $code .= $br . ');';
                 echo '#BX_RENDERED_COMPONENT_' . $comp_count . '#';
                 eval($code);
                 echo '#BX_RENDERED_COMPONENT_' . $comp_count . '#';
             }
             $comp_count++;
         }
         $s = ob_get_contents();
         ob_end_clean();
     }
     return $s;
 }
コード例 #22
0
ファイル: sisdoc_char.php プロジェクト: bireme/proethos
function format_fld($zq1, $zq2)
{
    global $hd, $LANG;
    $zqr = '';
    if (strlen($zq2) > 0) {
        if (substr($zq2, 0, 1) == '(') {
            $zqr = substr($zq2, strpos($zq2, $zq1 . ':') + 2, 100);
            //					echo '['.strpos($zq2,$zq1.':').']';
            if (strpos($zqr, '&') > 0) {
                $zqr = substr($zqr, 0, strpos($zqr, '&'));
            }
            $zqr = $zq1 . '-' . $zqr;
        }
        ////////////////////// $
        if ($zq2 == 'M') {
            $zqr = msg($zq1);
        }
        if ($zq2 == '$') {
            $zqr = Number_format($zq1 / 100, 2);
        }
        ////////////////////// $R
        if ($zq2 == '$R' or $zq2 == '2') {
            $zqr = Number_format($zq1, 2);
            if ($LANG == 'en_US') {
                $zqr = $zqr;
            }
            if ($LANG == 'pt_BR' or $zq2 == '2') {
                $zqr = troca(troca(troca($zqr, '.', '#'), ',', '.'), '#', '.');
            }
        }
        ////////////////////// C
        if (substr($zq2, 0, 1) == 'C') {
            $zqr = '<CENTER>';
            $zqr = $zqr . $zq1;
        }
        ////////////////////// #
        if (substr($zq2, 0, 1) == '#') {
            $zqr = '<CENTER>';
            $zqr = $zqr . $zq1;
        }
        ////////////////////// @
        if ($zq2 == 'SHORT') {
            $zqr = $zqr . SubStr($zq1, 0, 1) . LowerCase(SubStr($zq1, 1, strpos($zq1, ' ')));
        }
        if ($zq2 == '@') {
            $zqr = UpperCase(SubStr($zq1, 0, 1));
            if (substr($zq1, 1, 1) == ' ') {
                $zqr = $zqr . '&nbsp;';
            }
            $zqr = $zqr . LowerCase(SubStr($zq1, 1, 200));
        }
        ////////////////////// Bold
        if ($zq2 == 'B') {
            $zqr = $zqr . '<B>' . $zq1 . '</B>';
        }
        ////////////////////// CB
        if ($zq2 == 'CB') {
            $varf = $vars[$varf];
            $vvvt = '';
            $vvvt = $vars['chk' . $zq1];
            if ($vvvt == "1") {
                $vvvt = "checked";
            }
            $zqr = $zqr . '<input type="checkbox" name="chk' . $zq1 . '" ' . $vvvt . ' value="1">';
        }
        ////////////////////// CEP
        if ($zq2 == 'CEP') {
            $xxcep = sonumero($zq1);
            if (strlen($xxcep) == 8) {
                $xxcep = substr($xxcep, 0, 2) . '.' . substr($xxcep, 2, 3) . '-' . substr($xxcep, 5, 3);
            }
            $zqr = $zqr . $xxcep;
        }
        ////////////////////// D
        if ($zq2 == 'D') {
            $zqr = '<CENTER>';
            $dta = trim($zq1);
            if ($dta == '19000101') {
                $zqr = $zqr . '-';
            } else {
                $zqr = $zqr . stodbr($zq1);
            }
        }
        ////////////////////// DR
        if ($zq2 == 'DR') {
            $zqr = '<CENTER>';
            $dta = trim($zq1);
            if ($dta == '19000101') {
                $zqr = $zqr . '-';
            } else {
                $zqr = $zqr . substr(stodbr($zq1), 0, 5);
            }
        }
        ////////////////////// H
        if (substr($zq2, 0, 1) == 'H' and $zq2 != 'H1' and $zq2 != 'H2') {
            $zqr = '';
            if ($hd != trim($zq1)) {
                $zq1v = $zq1;
                if (substr($zq2, 1, 1) == 'D') {
                    $zq1v = stodbr($zq1);
                }
                //					$zqr .= '<TR><TD colspan="15" height="1" bgcolor="#c0c0c0"></TD></TR>';
                $zqr .= '<TR><TD  bgcolor="#FFFFFF" colspan="15" class="lt2" align="left"><HR size="1"><B>' . $zq1v . '</TD></TR>';
                $hd = trim($zq1);
                $zqr = $zqr . '<TR><TD></TD>';
            }
        }
        if ($zq2 == 'H1') {
            $zqr = $zqr . '<h1>' . $zq1 . '</h1>';
        }
        if ($zq2 == 'H2') {
            $zqr = $zqr . '<h2>' . $zq1 . '</h2>';
        }
        ////////////////////// Italic
        if ($zq2 == 'I') {
            $zqr = $zqr . '<I>' . $zq1 . '</I>';
        }
        if (${$zq2} == 'NL') {
            $zqr = $zqr . '<TR ' . $xcol . '><TD><TD>' . $linkv . $zq1;
        }
        if ($zq2 == 'SHORT') {
            $zqr = $zqr . LowerCase(SubStr($zq1, 1, strpos($zq1, ' ')));
        }
        ////////////////////// SN
        if ($zq2 == 'SN') {
            $zqr = '<CENTER>';
            $dta = trim($zq1);
            if ($dta == '1' or $dta == true or $dta == 'S') {
                $zqr = $zqr . 'SIM';
            } else {
                $zqr = $zqr . 'NAO';
            }
        }
        ////////////////////// C
        if (substr($zq2, 0, 2) == 'OB') {
            $zqr = '<CENTER>';
            if ($zq1 == '1') {
                $zqr .= msg('yes');
            } else {
                $zqr .= msg('no');
            }
        }
        if ($zq2 == 'Z') {
            $zqr = '<CENTER>';
            $zqr = $zqr . strzero($zq1, '0' . substr($zq2, 1, 2));
        }
    } else {
        $zqr = $zq1;
    }
    return $zqr;
}
コード例 #23
0
                    echo ' class="' . $sSefClass . '"';
                }
                ?>
>
		<td class="bx-width50 bx-popup-label"><?php 
                echo htmlspecialcharsbx($prop["NAME"]) . ":";
                ?>
</td>
		<td>
<?php 
            }
            if (!array_key_exists($ID, $arValues)) {
                if (SubStr($ID, 0, StrLen("SEF_URL_TEMPLATES_")) == "SEF_URL_TEMPLATES_" && is_array($arValues["SEF_URL_TEMPLATES"]) && array_key_exists(SubStr($ID, StrLen("SEF_URL_TEMPLATES_")), $arValues["SEF_URL_TEMPLATES"])) {
                    $arValues[$ID] = $arValues["SEF_URL_TEMPLATES"][SubStr($ID, StrLen("SEF_URL_TEMPLATES_"))];
                } elseif (SubStr($ID, 0, StrLen("VARIABLE_ALIASES_")) == "VARIABLE_ALIASES_" && is_array($arValues["VARIABLE_ALIASES"]) && array_key_exists(SubStr($ID, StrLen("VARIABLE_ALIASES_")), $arValues["VARIABLE_ALIASES"])) {
                    $arValues[$ID] = $arValues["VARIABLE_ALIASES"][SubStr($ID, StrLen("VARIABLE_ALIASES_"))];
                }
            }
            if (!array_key_exists($ID, $arValues) && isset($prop["DEFAULT"])) {
                $arValues[$ID] = $prop["DEFAULT"];
            }
            if ($arValues["SEF_FOLDER"] == "") {
                $arValues["SEF_FOLDER"] = GetDirPath($_GET["src_page"]);
            }
            if ($prop["MULTIPLE"] == 'Y' && !is_array($arValues[$ID])) {
                if (isset($arValues[$ID])) {
                    $val = array($arValues[$ID]);
                } else {
                    $val = array();
                }
            } elseif ($prop["TYPE"] == "LIST" && !is_array($arValues[$ID])) {
コード例 #24
0
 function DrawBars()
 {
     if ($this->data_type != "text-data") {
         $this->DrawError('Bar plots must be text-data: use function SetDataType("text-data")');
     }
     $xadjust = $this->records_per_group * $this->record_bar_width / 4;
     reset($this->data_values);
     while (list($j, $row) = each($this->data_values)) {
         $color_index = 0;
         $colbarcount = 0;
         $x_now = $this->xtr($j + 0.5);
         while (list($k, $v) = each($row)) {
             if ($k == 0) {
                 //Draw Data Labels
                 $xlab = SubStr($v, 0, $this->x_datalabel_maxlength);
                 $this->DrawXDataLabel($xlab, $x_now);
             } else {
                 // Draw Bars ($v)
                 $x1 = $x_now - $this->data_group_space + ($k - 1) * $this->record_bar_width;
                 $x2 = $x1 + $this->record_bar_width * $this->bar_width_adjust;
                 if ($v < $this->x_axis_position) {
                     $y1 = $this->ytr($this->x_axis_position);
                     $y2 = $this->ytr($v);
                 } else {
                     $y1 = $this->ytr($v);
                     $y2 = $this->ytr($this->x_axis_position);
                 }
                 if ($color_index >= count($this->ndx_data_color)) {
                     $color_index = 0;
                 }
                 if ($colbarcount >= count($this->ndx_data_border_color)) {
                     $colbarcount = 0;
                 }
                 $barcol = $this->ndx_data_color[$color_index];
                 $bordercol = $this->ndx_data_border_color[$colbarcount];
                 if (strval($v) != "") {
                     //Allow for missing Y data
                     if ($this->shading > 0) {
                         for ($i = 0; $i < $this->shading; $i++) {
                             //Shading set in SetDefaultColors
                             ImageFilledRectangle($this->img, $x1 + $i, $y1 - $i, $x2 + $i, $y2 - $i, $this->ndx_i_light);
                         }
                     }
                     ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $barcol);
                     ImageRectangle($this->img, $x1, $y1, $x2, $y2, $bordercol);
                     if ($this->draw_data_labels == '1') {
                         //ajo
                         $y1 = $this->ytr($this->label_scale_position * $v);
                         //$this->DrawDataLabel($v,$j + .5,$v*$this->label_scale_position);
                         $this->DrawText($this->x_label_ttffont, $this->x_label_angle, $x1 + $this->record_bar_width / 2, $y1, $this->ndx_label_color, $this->x_label_ttffont_size, $v, 'center', 'top');
                     }
                 }
                 $color_index++;
                 $colbarcount++;
             }
         }
     }
 }
コード例 #25
0
ファイル: ykcee.php プロジェクト: orangeal2o3/pukiwiki-plugin
 function DrawXTitles()
 {
     if (StrLen($this->title_axis_x) > 0) {
         $string_size = $this->TTFStringSize($this->axis_font_size, 0, $this->font, $this->title_axis_x);
         $string_height = $string_size[1] * 2;
         $ypos = $this->image_height - $this->image_height * 0.03;
         $ypos -= $string_height / 0.7;
     } else {
         $ypos = $this->image_height - $this->image_height * 0.03;
     }
     $left_offset = $this->chart_area[0];
     $width = $this->chart_area[2] - $this->chart_area[0];
     $step = $width / $this->record_count_group;
     $corr = $step / 2;
     $string_size = $this->TTFStringSize($this->axis_font_size, 90, $this->font, "AjxÜ");
     $string_width = $string_size[0];
     $corr = $step / 2 - $string_width / 2;
     $i = $step;
     foreach ($this->data_values as $row) {
         $string = SubStr($row[0], 0, $this->max_string_size);
         $xpos = $i + $left_offset - $corr;
         ImageTTFText($this->img, $this->axis_font_size, 90, $xpos, $ypos, $this->font_color, $this->font, $string);
         $i += $step;
     }
     return true;
 }
コード例 #26
0
ファイル: update_client.php プロジェクト: webgksupport/alpina
 function Update($_1314299381 = "")
 {
     @$GLOBALS['____467353288'][1004](160 * 2 - 320);
     $GLOBALS['____467353288'][1005](___1498308727(2138), ___1498308727(2139));
     $GLOBALS['____467353288'][1006](true);
     $_2114031822 = ___1498308727(2140);
     $_1314299381 = Trim($_1314299381);
     if (StrLen($_1314299381) <= 168 * 2 - 336 || $_1314299381 == ___1498308727(2141)) {
         $_984440988 = CUpdateControllerSupport::CheckUpdates();
         if ($_984440988[1060 / 2 - 530] == ___1498308727(2142)) {
             $_2114031822 = ___1498308727(2143) . $_984440988[round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)];
         } elseif ($_984440988[164 * 2 - 328] == ___1498308727(2144)) {
             $_2114031822 = ___1498308727(2145);
         } elseif ($_984440988[794 - 2 * 397] == ___1498308727(2146)) {
             $_2114031822 = ___1498308727(2147);
         } elseif ($_984440988[min(170, 0, 56.666666666667)] == ___1498308727(2148)) {
             $_2114031822 = ___1498308727(2149) . $_984440988[round(0 + 1)];
         } else {
             $_2114031822 = ___1498308727(2150) . ___1498308727(2151);
         }
     } else {
         if ($_1314299381 == ___1498308727(2152)) {
             $_1988918678 = CUpdateControllerSupport::UpdateUpdate();
             if ($_1988918678 == ___1498308727(2153)) {
                 $_2114031822 = ___1498308727(2154);
             } else {
                 $_2114031822 = ___1498308727(2155) . $_1988918678;
             }
         } elseif (SubStr($_1314299381, 782 - 2 * 391, round(0 + 0.75 + 0.75 + 0.75 + 0.75)) == ___1498308727(2156)) {
             $_1595259486 = SubStr($_1314299381, round(0 + 3));
             if ($_1595259486 == ___1498308727(2157)) {
                 $_1988918678 = CUpdateControllerSupport::UpdateModules();
                 if ($_1988918678 == ___1498308727(2158)) {
                     $_2114031822 = ___1498308727(2159) . ___1498308727(2160);
                 } elseif (SubStr($_1988918678, min(180, 0, 60), round(0 + 1.5 + 1.5)) == ___1498308727(2161)) {
                     $_2114031822 = ___1498308727(2162) . SubStr($_1988918678, round(0 + 1 + 1 + 1));
                 } elseif (SubStr($_1988918678, 974 - 2 * 487, round(0 + 0.6 + 0.6 + 0.6 + 0.6 + 0.6)) == ___1498308727(2163)) {
                     $_2114031822 = ___1498308727(2164) . ___1498308727(2165) . ___1498308727(2166) . SubStr($_1988918678, round(0 + 0.75 + 0.75 + 0.75 + 0.75));
                 } else {
                     $_2114031822 = ___1498308727(2167) . ___1498308727(2168);
                 }
             } elseif ($_1595259486 == ___1498308727(2169)) {
                 $_1988918678 = CUpdateControllerSupport::UpdateModules();
                 if ($_1988918678 == ___1498308727(2170)) {
                     $_2114031822 = ___1498308727(2171);
                 } elseif (SubStr($_1988918678, 1052 / 2 - 526, round(0 + 0.75 + 0.75 + 0.75 + 0.75)) == ___1498308727(2172)) {
                     $_2114031822 = ___1498308727(2173) . SubStr($_1988918678, round(0 + 1.5 + 1.5));
                 } elseif (SubStr($_1988918678, 151 * 2 - 302, round(0 + 1.5 + 1.5)) == ___1498308727(2174)) {
                     $_2114031822 = ___1498308727(2175) . ___1498308727(2176) . ___1498308727(2177) . SubStr($_1988918678, round(0 + 0.75 + 0.75 + 0.75 + 0.75));
                 } else {
                     $_2114031822 = ___1498308727(2178) . ___1498308727(2179);
                 }
             } elseif ($_1595259486 == ___1498308727(2180)) {
                 $_1988918678 = CUpdateControllerSupport::UpdateLangs();
                 if ($_1988918678 == ___1498308727(2181)) {
                     $_2114031822 = ___1498308727(2182);
                 } elseif (SubStr($_1988918678, 199 * 2 - 398, round(0 + 0.6 + 0.6 + 0.6 + 0.6 + 0.6)) == ___1498308727(2183)) {
                     $_2114031822 = ___1498308727(2184) . SubStr($_1988918678, round(0 + 1 + 1 + 1));
                 } elseif (SubStr($_1988918678, 200 * 2 - 400, round(0 + 1.5 + 1.5)) == ___1498308727(2185)) {
                     $_2114031822 = ___1498308727(2186) . ___1498308727(2187) . ___1498308727(2188) . SubStr($_1988918678, round(0 + 1.5 + 1.5));
                 } else {
                     $_2114031822 = ___1498308727(2189) . ___1498308727(2190);
                 }
             } else {
                 $_2114031822 = ___1498308727(2191) . ___1498308727(2192);
             }
         } else {
             $_2114031822 = ___1498308727(2193) . ___1498308727(2194);
         }
     }
     if ($_2114031822 == ___1498308727(2195)) {
         CUpdateControllerSupport::Finish();
     }
     return $_2114031822;
 }
コード例 #27
0
ファイル: BansController.php プロジェクト: DmitriyS/CS-Bans
 public function actionMotd($sid, $adm = 0, $lang = 'ru')
 {
     $this->layout = FALSE;
     $sid = (int) SubStr($sid, 1);
     $model = Bans::model()->findByPk($sid);
     if ($model === null) {
         Yii::app()->end('Error!');
     }
     $this->render('motd', array('model' => $model, 'show_admin' => $adm == 1 ? TRUE : FALSE));
 }
コード例 #28
0
 private function WriteData($Command, $Append = "")
 {
     $Command = Pack('c*', 0xfe, 0xfd, $Command, 0x1, 0x2, 0x3, 0x4) . $Append;
     $Length = StrLen($Command);
     if ($Length !== FWrite($this->Socket, $Command, $Length)) {
         throw new MinecraftQueryException("Failed to write on socket.");
     }
     $Data = FRead($this->Socket, 2048);
     if ($Data === false) {
         throw new MinecraftQueryException("Failed to read from socket.");
     }
     if (StrLen($Data) < 5 || $Data[0] != $Command[2]) {
         return false;
     }
     return SubStr($Data, 5);
 }
コード例 #29
0
ファイル: Statistics.comp.php プロジェクト: carriercomm/jbs
foreach ($HostsIDs as $HostID) {
    #-----------------------------------------------------------------------------
    $Path = SPrintF('%s/hosts/%s/comp/Statistics', SYSTEM_PATH, $HostID);
    #-----------------------------------------------------------------------------
    if (!File_Exists($Path)) {
        continue;
    }
    #-----------------------------------------------------------------------------
    $Files = IO_Scan($Path);
    if (Is_Error($Files)) {
        return ERROR | @Trigger_Error(500);
    }
    #-----------------------------------------------------------------------------
    foreach ($Files as $File) {
        #---------------------------------------------------------------------------
        $StatisticID = SubStr($File, 0, StriPos($File, '.'));
        #---------------------------------------------------------------------------
        $Comp = Comp_Load(SPrintF('Statistics/%s', $StatisticID), $IsCreate);
        if (Is_Error($Comp)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------
        $Input = Comp_Load('Form/Input', array('type' => 'checkbox', 'name' => 'StatisticsIDs[]', 'value' => $StatisticID, 'id' => $StatisticID));
        if (Is_Error($Input)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------
        $Table[] = array(new Tag('SPAN', array('style' => 'cursor:pointer;', 'onclick' => SPrintF('ChangeCheckBox(\'%s\'); return false;', $StatisticID)), $Comp['Title']), $Input);
    }
}
#-------------------------------------------------------------------------------
コード例 #30
0
     $wa = '#WORK_AREA#';
     for ($n = 0; $n < $l; $n++) {
         $start = $arPHP[$n][0];
         $s_cont = substr($old_content, $end, $start - $end);
         $end = $arPHP[$n][1];
         if ($n == 0) {
             continue;
         }
         $src = $arPHP[$n][2];
         if (strpos($s_cont, $wa) !== false) {
             $s2 = substr($s_cont, strpos($s_cont, $wa) + strlen($wa)) . $src;
             continue;
         }
         //Trim php tags
         $src = SubStr($src, SubStr($src, 0, 5) == "<?" . "php" ? 5 : 2);
         $src = SubStr($src, 0, -2);
         $comp2_begin = '$APPLICATION->INCLUDECOMPONENT(';
         $usrc = unifyPHPfragment($src);
         if ($usrc == unifyPHPfragment('$APPLICATION->ShowPanel()') || strtoupper(substr($src, 0, strlen($comp2_begin))) == $comp2_begin) {
             // component 2.0 or another predefined fragment
             continue;
         }
         $arPHPscripts[] = $src;
     }
     $s1 = $arPHP[0][2];
 }
 // Ok, so we already have array of php scripts lets check our new content
 // LPA-users CAN delete PHP fragments and swap them but CAN'T add new or modify existent:
 while (preg_match('/#PHP\\d{4}#/i', $CONTENT, $res_php, PREG_OFFSET_CAPTURE)) {
     $php_begin = $res_php[0][1];
     $php_fr_num = intval(substr($CONTENT, $php_begin + 4, 4)) - 1;