当前位置: 首页>>代码示例>>PHP>>正文


PHP Current函数代码示例

本文整理汇总了PHP中Current函数的典型用法代码示例。如果您正苦于以下问题:PHP Current函数的具体用法?PHP Current怎么用?PHP Current使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Current函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  *	Generates a new instance of this form
  *	@param	Zend_Config		options		(Optional) Zend_Form Configuration options
  *	@return void
  */
 public function __construct($options = null)
 {
     parent::__construct($options);
     if (is_array($options) && count($options)) {
         $this->_defaults = Current($options);
         parent::__construct(array());
     } else {
         parent::__construct($options);
     }
     $this->view = Zend_Registry::getInstance()->get('view');
     $this->setName('Default_Form');
     $this->setAction('');
     $this->setDisableLoadDefaultDecorators(true);
     $this->clearDecorators();
     $this->_fields = (object) array();
     return $this;
 }
开发者ID:aldimol,项目名称:zf-sample,代码行数:22,代码来源:Forms.php

示例2: SUM

        $DomainsOrders->AddChild($DomainOrder);
    }
    #-----------------------------------------------------------------------------
    $Contract->AddChild($DomainsOrders);
    #-----------------------------------------------------------------------------
    $Result = $Link->Query(SPrintF("SELECT SUM(`bonus`) as `Balance` FROM `partner` WHERE `userid` = %u", $dUser['ID']));
    if (Is_Error($Result)) {
        return $Link->GetError();
    }
    #-----------------------------------------------------------------------------
    $dBonuses = MySQL::Result($Result);
    if (Is_Error($dBonuses)) {
        return ERROR | @Trigger_Error(500);
    }
    #-----------------------------------------------------------------------------
    $dBonuse = Current($dBonuses);
    #-----------------------------------------------------------------------------
    $Contract->AddChild(new Tag('Balance', Round($Result['Balance'] * $Course)));
    #-----------------------------------------------------------------------------
    $Contracts->AddChild($Contract);
    #-----------------------------------------------------------------------------
    $User->AddChild($Contracts);
    #-----------------------------------------------------------------------------
    $Users->AddChild($User);
}
#-------------------------------------------------------------------------------
$Dump = $Users->ToXMLString();
#-------------------------------------------------------------------------------
$IsWrite = IO_Write('/work/ClientExec.xml.gz', GzEncode($Dump), TRUE);
if (Is_Error($IsWrite)) {
    return ERROR | @Trigger_Error(500);
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ClientExec.comp.php

示例3: DB_Select

 #-------------------------------------------------------------------------------
 $Orders = DB_Select('OrdersOwners', array('ID', 'UserID', 'StatusID'), array('Where' => $Where));
 #-------------------------------------------------------------------------------
 switch (ValueOf($Orders)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'array':
         break;
     default:
         return ERROR | @Trigger_Error(101);
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Order = Current($Orders);
 #-------------------------------------------------------------------------------
 $UserID = $Order['UserID'];
 #-------------------------------------------------------------------------------
 # если сотрудник или исключение - ничего не делаем
 if (In_Array($UserID, $ExcludeIDs)) {
     continue;
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Array = array();
 #-------------------------------------------------------------------------------
 foreach ($Orders as $Order) {
     #-------------------------------------------------------------------------------
     if ($Order['StatusID'] == 'Suspended') {
         #-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ResetOrdersDays.comp.php

示例4: Args

}
#-------------------------------------------------------------------------------
$Session =& $Template['Session'];
#-------------------------------------------------------------------------------
if (isset($Session['PatternOutID'])) {
    $PatternOutID = $Session['PatternOutID'];
}
#-------------------------------------------------------------------------------
$Args = Args();
#-------------------------------------------------------------------------------
if (isset($Args['PatternOutID'])) {
    $PatternOutID = $Args['PatternOutID'];
}
#-------------------------------------------------------------------------------
if (!isset($Patterns[$PatternOutID])) {
    $PatternOutID = Current(Array_Keys($Patterns));
}
#-------------------------------------------------------------------------------
$Session['PatternOutID'] = $PatternOutID;
#-------------------------------------------------------------------------------
$Where = $Patterns[$PatternOutID]['Where'];
#-------------------------------------------------------------------------------
if ($Where) {
    #-----------------------------------------------------------------------------
    $AddingWhere =& $Template['Source']['Adding']['Where'];
    #-----------------------------------------------------------------------------
    $AddingWhere[] = $Where;
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Select', array('name' => 'PatternOutID', 'onchange' => 'TableSuperSetIndex();'), $Options, $PatternOutID);
if (Is_Error($Comp)) {
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:PatternOut.comp.php

示例5: RuCenter_Domain_Register

function RuCenter_Domain_Register($Settings, $DomainName, $DomainZone, $Years, $Ns1Name, $Ns1IP, $Ns2Name, $Ns2IP, $Ns3Name, $Ns3IP, $Ns4Name, $Ns4IP, $IsPrivateWhoIs, $ContractID = '')
{
    /****************************************************************************/
    $__args_types = array('array', 'string', 'string', 'integer', 'string', 'string', 'string', 'string', 'string', 'string', 'string', 'string', 'boolean', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $HTTP = array('Address' => $Settings['Address'], 'Port' => $Settings['Port'], 'Host' => $Settings['Address'], 'Protocol' => $Settings['Protocol'], 'Charset' => 'KOI8-R', 'IsLogging' => $Settings['Params']['IsLogging']);
    #-----------------------------------------------------------------------------
    $Domain = SPrintF('%s.%s', $DomainName, $DomainZone);
    #-----------------------------------------------------------------------------
    $ContractItem = Explode(':', $ContractID);
    #-----------------------------------------------------------------------------
    $ContractID = Current($ContractItem);
    #-----------------------------------------------------------------------------
    $Query = array();
    #-----------------------------------------------------------------------------
    $RequestID = UniqID('ID');
    #-----------------------------------------------------------------------------
    $Query[] = 'lang: ru';
    $Query[] = 'request: order';
    $Query[] = 'operation: create';
    $Query[] = SPrintF('login: %s', $Settings['Login']);
    $Query[] = SPrintF('password: %s', $Settings['Password']);
    $Query[] = SPrintF('subject-contract: %s', $ContractID);
    $Query[] = SPrintF('request-id: %s', $RequestID);
    #-----------------------------------------------------------------------------
    $Query[] = '';
    #-----------------------------------------------------------------------------
    $Query[] = '[order-item]';
    $Query[] = 'check-ns: off';
    #-----------------------------------------------------------------------------
    switch ($DomainZone) {
        case 'ru':
            $Query[] = 'service: domain_ru';
            $Query[] = 'template: client_ru';
            break;
        case 'su':
            $Query[] = 'service: domain_su';
            $Query[] = 'template: client_ru';
            break;
        case 'рф':
            $Query[] = 'service: domain_rf';
            $Query[] = 'template: domain_rf';
            // Convert the domain
            $IDNAConverter = new IDNAConvert();
            $Domain = $IDNAConverter->encode($Domain);
            break;
        case 'msk.ru':
            $Query[] = 'service: domain_msk_ru';
            $Query[] = 'template: client_ru';
            break;
        case 'msk.su':
            $Query[] = 'service: domain_msk_su';
            $Query[] = 'template: client_ru';
            break;
        case 'spb.ru':
            $Query[] = 'service: domain_spb_ru';
            $Query[] = 'template: client_ru';
            break;
        case 'spb.su':
            $Query[] = 'service: domain_spb_su';
            $Query[] = 'template: client_ru';
            break;
        default:
            #-------------------------------------------------------------------------
            if (Count($ContractItem) < 2) {
                #-----------------------------------------------------------------------
                $Query = array();
                #-----------------------------------------------------------------------
                $RequestID = UniqID('ID');
                #-----------------------------------------------------------------------
                $Query[] = 'lang: ru';
                $Query[] = 'request: contract';
                $Query[] = 'operation: get';
                $Query[] = SPrintF('login: %s', $Settings['Login']);
                $Query[] = SPrintF('password: %s', $Settings['Password']);
                $Query[] = SPrintF('subject-contract: %s', $ContractID);
                $Query[] = SPrintF('request-id: %s', $RequestID);
                #-----------------------------------------------------------------------
                $Result = HTTP_Send('/dns/dealer', $HTTP, array(), array('SimpleRequest' => Implode("\n", $Query)));
                if (Is_Error($Result)) {
                    return ERROR | @Trigger_Error('[RuCenter_Domain_Register]: не удалось выполнить запрос к серверу');
                }
                #-----------------------------------------------------------------------
                if (Preg_Match('/HTTP\\/1.0\\s502/i', $Result['Heads'])) {
                    return false;
                }
                #-----------------------------------------------------------------------
                $Result = Trim($Result['Body']);
                #-----------------------------------------------------------------------
                if (Preg_Match('/State:\\s([0-9]+)\\s/', $Result, $CodeID)) {
                    #---------------------------------------------------------------------
                    $CodeID = Next($CodeID);
                    #---------------------------------------------------------------------
                    switch ($CodeID) {
                        case '200':
                            #-----------------------------------------------------------------
                            if (Preg_Match_All('/([a-z\\-])+\\:(.+)/', $Result, $Matches)) {
//.........这里部分代码省略.........
开发者ID:carriercomm,项目名称:jbs,代码行数:101,代码来源:RuCenter.php

示例6: array

 $Finded = array();
 #-----------------------------------------------------------------------------
 foreach ($Files as $File) {
     #---------------------------------------------------------------------------
     if (Preg_Match('/\\/others\\//', $File)) {
         continue;
     }
     #---------------------------------------------------------------------------
     $Sourse = IO_Read($File);
     if (Is_Error($Sourse)) {
         return ERROR | @Trigger_Error(500);
     }
     #---------------------------------------------------------------------------
     if (Preg_Match_All('/#[a-zA-F0-9]{6}/', $Sourse, $Matches) > 1) {
         #-------------------------------------------------------------------------
         foreach (Current($Matches) as $Match) {
             $Finded[Md5($Match)] = Mb_SubStr($Match, 1);
         }
     }
 }
 #-----------------------------------------------------------------------------
 if (Count($Finded) < 1) {
     continue;
 }
 #-----------------------------------------------------------------------------
 $Tr = new Tag('TR');
 #-----------------------------------------------------------------------------
 foreach ($Finded as $Color) {
     #---------------------------------------------------------------------------
     if (In_Array($Color, $Colors)) {
         continue;
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Palette.comp.php

示例7: Tag

    $Script = new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Widget.js}'));
    #-----------------------------------------------------------------------------
    $DOM->AddChild('Head', $Script);
}
#-------------------------------------------------------------------------------
$Table = new Tag('TABLE', array('id' => $WidgetID, 'class' => 'Widget', 'cellspacing' => 5, 'cellpadding' => 0));
#-------------------------------------------------------------------------------
$lPosition = 0;
$rPosition = 0;
$IsOpened = TRUE;
#-------------------------------------------------------------------------------
if (isset($_COOKIE[$WidgetID])) {
    #-----------------------------------------------------------------------------
    $Settings = Explode(':', $_COOKIE[$WidgetID]);
    #-----------------------------------------------------------------------------
    $lPosition = (int) Current($Settings);
    $rPosition = (int) Next($Settings);
    #-----------------------------------------------------------------------------
    $IsOpened = (bool) Next($Settings);
}
#-------------------------------------------------------------------------------
$Table->AddAttribs($lPosition && $rPosition ? array('style' => SPrintF('position:absolute;left:%u;top:%u;', $lPosition, $rPosition)) : array('style' => 'display:inline-table;'));
#-------------------------------------------------------------------------------
$Move = new Tag('IMG', array('class' => 'Button', 'alt' => 'Переместить', 'width' => 16, 'height' => 16, 'onmousedown' => SPrintF("WidgetInit(event,'%s');document.body.onmouseup = function(){ document.body.onmousemove = null;document.body.onmouseup = null;WidgetRender('%s'); };document.body.onmousemove = function(event){ WidgetMove(event,'%s'); };", $WidgetID, $WidgetID, $WidgetID), 'src' => 'SRC:{Images/Icons/WidgetMove.gif}'));
#-------------------------------------------------------------------------------
$Switch = new Tag('IMG', array('class' => 'Button', 'alt' => 'Показать (скрыть)', 'width' => 16, 'height' => 16, 'onclick' => SPrintF("WidgetSwitch('%s');", $WidgetID), 'src' => 'SRC:{Images/Icons/WidgetSwitch.gif}'));
#-------------------------------------------------------------------------------
$Dock = new Tag('IMG', array('class' => 'Button', 'alt' => 'Закрепить', 'width' => 16, 'height' => 16, 'onclick' => SPrintF("WidgetDock('%s');", $WidgetID), 'src' => 'SRC:{Images/Icons/WidgetDock.gif}'));
#-------------------------------------------------------------------------------
$Panel = new Tag('TR', array('height' => 16), new Tag('TD', array('width' => 16), $Move), new Tag('TD', $Title), new Tag('TD', array('width' => 16), $Switch), new Tag('TD', array('width' => 16, 'align' => 'right'), $Dock));
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Widget.comp.php

示例8: Explode

     }
     #-------------------------------------------------------------------------------
     break;
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'Select':
     #-------------------------------------------------------------------------------
     $Options = Explode("\n", $ServiceField['Options']);
     #-------------------------------------------------------------------------------
     $Alternatives = array();
     #-------------------------------------------------------------------------------
     foreach ($Options as $Option) {
         #-------------------------------------------------------------------------------
         $Option = Explode("=", $Option);
         #-------------------------------------------------------------------------------
         $Alternatives[] = Current($Option);
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     if (!In_Array($Value, $Alternatives)) {
         return new gException('OPTION_NOT_EXISTS', SPrintF('Не верное значение (%s) поля (%s)', $Value, $ServiceField['Name']));
     }
     #-------------------------------------------------------------------------------
     if ($ServiceField['IsKey']) {
         $Keys[] = $Value;
     }
     #-------------------------------------------------------------------------------
     break;
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 default:
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServiceOrderEdit.comp.php

示例9: Translit

 $Attribs['pCity'] = $Attribs['City'];
 $Attribs['CityEn'] = Translit($Attribs['City']);
 #-------------------------------------------------------------------------
 $Attribs['jAddress'] = Trim(Preg_Replace('/(ул|пр)\\./iu', '', $Attribs['jAddress']));
 $Attribs['pAddress'] = Trim(Preg_Replace('/(ул|пр)\\./iu', '', $Attribs['jAddress']));
 $Attribs['AddressEn'] = Translit($Attribs['jAddress']);
 #-------------------------------------------------------------------------
 $Attribs['jIndex'] = $Attribs['PostIndex'];
 $Attribs['pIndex'] = $Attribs['PostIndex'];
 #-------------------------------------------------------------------------
 #-------------------------------------------------------------------------
 $CompanyName = $Attribs['CompanyName'];
 #-------------------------------------------------------------------------
 $CompanyName = Preg_Split('/\\s+/', $CompanyName);
 #-------------------------------------------------------------------------
 $Attribs['Form'] = Current($CompanyName);
 #-------------------------------------------------------------------------
 unset($CompanyName[0]);
 #-------------------------------------------------------------------------
 $CompanyName = Implode(' ', $CompanyName);
 #-------------------------------------------------------------------------
 if (Preg_Match('/(общество\\sс\\sограниченной\\sответственностью)\\s(.+)/ui', $CompanyName, $Matches)) {
     #-----------------------------------------------------------------------
     $Attribs['Form'] = 'ООО';
     #-----------------------------------------------------------------------
     $CompanyName = $Matches[2];
     #-----------------------------------------------------------------------
 } elseif (Preg_Match('/(закрытое\\sакционерное\\sобщество)\\s(.+)/ui', $CompanyName, $Matches)) {
     #-----------------------------------------------------------------------
     $Attribs['Form'] = 'ЗАО';
     #-----------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:1000024.php

示例10: array

 #-------------------------------------------------------------------------------
 if (!isset($GLOBALS['TaskReturnInfo'][$Server['GroupName']])) {
     $GLOBALS['TaskReturnInfo'][$Server['GroupName']] = array();
 }
 #-------------------------------------------------------------------------------
 $GLOBALS['TaskReturnInfo'][$Server['GroupName']][] = $Server['Address'];
 #-------------------------------------------------------------------------------
 if (StrLen($Server['Monitoring']) > 3) {
     #-------------------------------------------------------------------------------
     $Services = Preg_Split('/\\n+/', $Server['Monitoring']);
     #-------------------------------------------------------------------------------
     foreach ($Services as $Service) {
         #-------------------------------------------------------------------------------
         $Service = Explode('=', $Service);
         #-------------------------------------------------------------------------------
         $ServiceName = Current($Service);
         #-------------------------------------------------------------------------------
         $Port = IntVal(Next($Service));
         #-------------------------------------------------------------------------------
         #Debug(SPrintF('[comp/Tasks/ServersUpTime]: connect to %s:%u',$Server['Address'],$Port));
         #-------------------------------------------------------------------------------
         $Socket = @FsockOpen($Server['Address'], $Port, $nError, $sError, $Settings['SocketTimeout']);
         #-------------------------------------------------------------------------------
         if (!Is_Resource($Socket)) {
             #-------------------------------------------------------------------------------
             #Debug(SPrintF('[comp/Tasks/ServersUpTime]: cannot connect %s:%u with error: %s (%s)',$Server['Address'],$Port,$sError,$nError));
             #-------------------------------------------------------------------------------
         }
         #-------------------------------------------------------------------------------
         $IPage = array('TestDate' => Time(), 'ServerID' => $Server['ID'], 'Service' => Trim($ServiceName), 'UpTime' => Is_Resource($Socket) ? 100 : 0, 'Day' => Date('d'), 'Month' => Date('m'), 'Year' => Date('Y'));
         #-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServersUpTime.comp.php

示例11: gException

                        return ERROR | @Trigger_Error(500);
                    case 'exception':
                        return ERROR | @Trigger_Error(400);
                    case 'false':
                        return new gException('USER_MANAGMENT_DISABLED', 'Управление пользователем запрещено');
                    case 'true':
                        Array_UnShift($UsersIDs, $UserID);
                        break;
                    default:
                        return ERROR | @Trigger_Error(101);
                }
            } else {
                #-----------------------------------------------------------------------
                $Temp = $UsersIDs[$Index = Array_Search($UserID, $UsersIDs)];
                #-----------------------------------------------------------------------
                $UsersIDs[$Index] = Current($UsersIDs);
                $UsersIDs[0] = $Temp;
            }
            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
} else {
    #-----------------------------------------------------------------------------
    $UserID = $Session->Data['RootID'];
    #-----------------------------------------------------------------------------
    $UsersIDs = array($UserID);
}
#-------------------------------------------------------------------------------
if (!SetCookie(Md5($__USER['ID']), @$_SERVER['HTTP_REFERER'], Time() + 86400, '/')) {
    return ERROR | @Trigger_Error(500);
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:UserSwitch.comp.php

示例12: String_XML_Parse

$XML = String_XML_Parse($Response['Body']);
if (Is_Exception($XML)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$XML = $XML->ToArray('Valute');
#-------------------------------------------------------------------------------
$Courses = (array) $XML['ValCurs'];
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$cPaymentSystems = $Config['Invoices']['PaymentSystems'];
#-------------------------------------------------------------------------------
$HostsIDs = $GLOBALS['HOST_CONF']['HostsIDs'];
#-------------------------------------------------------------------------------
$Config = System_XML('config/Config.xml', Current($HostsIDs));
if (Is_Error($Config)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (!isset($Config['Invoices'])) {
    $Config['Invoices'] = array();
}
#-------------------------------------------------------------------------------
$Invoices =& $Config['Invoices'];
#-------------------------------------------------------------------------------
if (!isset($Invoices['PaymentSystems'])) {
    $Invoices['PaymentSystems'] = array();
}
#-------------------------------------------------------------------------------
$PaymentSystems =& $Invoices['PaymentSystems'];
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:CourseUpdate.comp.php

示例13: array

            #-------------------------------------------------------------------------
            if (Count($Options)) {
                #-----------------------------------------------------------------------
                $Array = array();
                #-----------------------------------------------------------------------
                foreach ($Options as $Option) {
                    #---------------------------------------------------------------------
                    $Option = Explode("=", $Option);
                    #---------------------------------------------------------------------
                    if (Count($Option) < 3) {
                        $Option[] = 0;
                    }
                    #--------------------------------------------------------------------
                    Reset($Option);
                    #---------------------------------------------------------------------
                    $Array[] = SPrintF('%s=%s=%01.2f', Trim(Current($Option)), Trim(Next($Option)), Trim(Next($Option)));
                }
                #-----------------------------------------------------------------------
                $Options = Implode("\n", $Array);
                #-----------------------------------------------------------------------
                $IsUpdate = DB_Update('ServicesFields', array('Options' => $Options), array('ID' => $ServiceField['ID']));
                if (Is_Error($IsUpdate)) {
                    return ERROR | @Trigger_Error(500);
                }
            }
        }
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:1000054.php

示例14: Config_Read

function Config_Read($Array, $Path = array(), $Level = 1)
{
    #-------------------------------------------------------------------------------
    # ASort added by lissyara for test purpose, 2014-01-16 in 15:22 MSK
    ASort($Array);
    #-------------------------------------------------------------------------------
    $TmpArray = array();
    #-------------------------------------------------------------------------------
    $Names = array('Name', 'IsActive', 'IsEvent', 'Valute', 'Course', 'Measure', 'IsCourseUpdate', 'MinimumPayment', 'MaximumPayment');
    #-------------------------------------------------------------------------------
    foreach ($Names as $Name) {
        #-------------------------------------------------------------------------------
        if (isset($Array[$Name])) {
            #-------------------------------------------------------------------------------
            $TmpArray[$Name] = $Array[$Name];
            #-------------------------------------------------------------------------------
            unset($Array[$Name]);
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    $Array = $TmpArray + $Array;
    #-------------------------------------------------------------------------------
    #-----------------------------------------------------------------------------
    static $Index = 1;
    #-----------------------------------------------------------------------------
    $Links =& Links();
    #-----------------------------------------------------------------------------
    $ConfigNames =& $Links['ConfigNames'];
    #-----------------------------------------------------------------------------
    $Node = new Tag('DIV', array('class' => 'Node'));
    #-----------------------------------------------------------------------------
    foreach (Array_Keys($Array) as $ElementID) {
        #---------------------------------------------------------------------------
        $Element = $Array[$ElementID];
        #---------------------------------------------------------------------------
        $ID = SPrintF('ID%06u', $Index++);
        #---------------------------------------------------------------------------
        $StringPath = Implode('/', $CurrentPath = Array_Merge($Path, array($ElementID)));
        #---------------------------------------------------------------------------
        if (isset($ConfigNames[$ElementID])) {
            #-------------------------------------------------------------------------
            $Item = Explode('|', $ConfigNames[$ElementID]);
            #-------------------------------------------------------------------------
            if (isset($ConfigNames[SPrintF('Prompt.%s', $ElementID)])) {
                $ElementPrompt = $ConfigNames[SPrintF('Prompt.%s', $ElementID)];
            }
            #-------------------------------------------------------------------------
        } else {
            #-------------------------------------------------------------------------
            if (!isset($ConfigNames[$StringPath])) {
                continue;
            }
            #-------------------------------------------------------------------------
            $Item = Explode('|', $ConfigNames[$StringPath]);
            #-------------------------------------------------------------------------
            if (isset($ConfigNames[SPrintF('Prompt.%s', $StringPath)])) {
                $ElementPrompt = $ConfigNames[SPrintF('Prompt.%s', $StringPath)];
            }
            #-------------------------------------------------------------------------
        }
        #---------------------------------------------------------------------------
        $ElementName = Current($Item);
        #---------------------------------------------------------------------------
        if (Count($Item) > 1) {
            #-------------------------------------------------------------------------
            $Type = Next($Item);
            #-------------------------------------------------------------------------
            switch ($Type) {
                case 'select':
                    #---------------------------------------------------------------------
                    $Select = array();
                    #---------------------------------------------------------------------
                    $Options = Explode(',', Next($Item));
                    #---------------------------------------------------------------------
                    foreach ($Options as $Option) {
                        #-------------------------------------------------------------------
                        $Option = Explode('=', $Option);
                        #-------------------------------------------------------------------
                        $Select[Next($Option)] = Prev($Option);
                    }
                    #---------------------------------------------------------------------
                    $Comp = Comp_Load('Form/Select', array('onchange' => SPrintF("ConfigChange('%s',this.value);", $StringPath)), $Select, $Element);
                    if (Is_Error($Comp)) {
                        return ERROR | @Trigger_Error(500);
                    }
                    break;
                default:
                    return ERROR | @Trigger_Error(101);
            }
        } else {
            $Comp = new Tag('SPAN', array('class' => 'NodeParam', 'onclick' => SPrintF("Value = prompt('Значение1:',this.innerHTML.XMLUnEscape());if(Value != null){ ConfigChange('%s',Value); this.innerHTML = Value; }", $StringPath)), Is_Array($Element) ? '[EMPTY]' : ($Element == '' ? '[EMPTY]' : $Element));
        }
        #---------------------------------------------------------------------------
        if (Is_Array($Element) && Count($Element)) {
            #-------------------------------------------------------------------------
            $Result = Config_Read($Element, $CurrentPath, $Level + 1);
            #-------------------------------------------------------------------------
            if ($Result) {
//.........这里部分代码省略.........
开发者ID:carriercomm,项目名称:jbs,代码行数:101,代码来源:Config.comp.php

示例15: DB_Select

#-------------------------------------------------------------------------------
if (In_Array('ByQuarter', $Details)) {
    #-----------------------------------------------------------------------------
    $VPSOrders = DB_Select(array('Orders', 'VPSOrders'), array('OrderID', 'COUNT(*) as `Count`', 'GET_QUARTER_FROM_TIMESTAMP(`OrderDate`) as `Quarter`', 'OrderDate', 'YEAR(FROM_UNIXTIME(`OrderDate`)) as Year'), array('Where' => '`VPSOrders`.`OrderID` = `Orders`.`ID` AND ' . $Where, 'GroupBy' => array('Quarter', 'Year'), 'SortOn' => 'OrderDate'));
    #-----------------------------------------------------------------------------
    switch (ValueOf($VPSOrders)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            # No more...
            break;
        case 'array':
            #--------------------------------------------------------------------------
            $Table = array(array(new Tag('TD', array('class' => 'Head'), 'Квартал'), new Tag('TD', array('class' => 'Head'), 'Кол-во')));
            #-------------------------------------------------------------------------
            $Order = Current($VPSOrders);
            $sQuarter = $Order['Quarter'] + $Order['Year'] * 4;
            #-------------------------------------------------------------------------
            $Order = End($VPSOrders);
            $eQuarter = $Order['Quarter'] + $Order['Year'] * 4;
            #-------------------------------------------------------------------------
            $Quarters = array();
            #-------------------------------------------------------------------------
            foreach ($VPSOrders as $Order) {
                $Quarters[$Order['Quarter'] + $Order['Year'] * 4] = $Order;
            }
            #-------------------------------------------------------------------------
            $Labels = $Line = array();
            #-------------------------------------------------------------------------
            $CurrentYear = 0;
            #-------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:VPSOrders.comp.php


注:本文中的Current函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。