本文整理汇总了PHP中Is_Null函数的典型用法代码示例。如果您正苦于以下问题:PHP Is_Null函数的具体用法?PHP Is_Null怎么用?PHP Is_Null使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Is_Null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_top_panel
function smarty_function_top_panel($params, $smarty)
{
if (isset($GLOBALS['__USER'])) {
$__USER = $GLOBALS['__USER'];
if (Is_Null($__USER)) {
return ERROR | @Trigger_Error(400);
}
$menuPath = SPrintF('%s/TopPanel', $__USER['InterfaceID']);
$items = Styles_Menu($menuPath);
if (Is_Error($items)) {
return ERROR | @Trigger_Error(500);
}
$items =& $items['Items'];
//return print_r(array_values($items));
$smarty->assign('items', array_values($items));
$__USER = $GLOBALS['__USER'];
$smarty->assign('userName', $__USER['Name']);
$smarty->display('TopPanel/User.tpl');
} else {
$smarty->display('TopPanel/Logon.tpl');
}
}
示例2: array
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Rows = array();
#-------------------------------------------------------------------------------
$ServersGroupName = UniqID();
#-------------------------------------------------------------------------------
foreach ($Servers as $Server) {
#-------------------------------------------------------------------------------
$Row = array();
#-------------------------------------------------------------------------------
if ($Server['ServersGroupName'] != $ServersGroupName) {
#-------------------------------------------------------------------------------
$ServersGroupName = !Is_Null($Server['ServersGroupName']) ? $Server['ServersGroupName'] : '-';
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Formats/String', !Is_Null($Server['ServersGroupComment']) ? $Server['ServersGroupComment'] : '-', 40);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Rows[] = new Tag('TR', new Tag('TD', array('colspan' => 5, 'class' => 'Separator'), new Tag('SPAN', array('style' => 'font-size:16px;'), SPrintF('%s |', $ServersGroupName)), new Tag('SPAN', $Comp)));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Notice', 'Servers', $Server['ID'], $Server['AdminNotice']);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Row[] = new Tag('TD', $Comp);
示例3: DB_Select
if (Is_Null($UserID)) {
$UserID = 1;
}
#-------------------------------------------------------------------------------
$User = DB_Select('Users', array('ID', 'GroupID', 'Email', 'Name'), array('UNIQ', 'ID' => $UserID));
#-------------------------------------------------------------------------------
switch (ValueOf($User)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#---------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#---------------------------------------------------------------------------
if (Is_Null($UniqID)) {
$UniqID = UniqID('ID');
}
#---------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => $UniqID, 'onfocus' => "value='';", 'onclick' => SPrintF("AutoComplite(this,GetPosition(this),'/Administrator/AutoComplite/UserID',function(Text,Value){form.%s.value = Text;form.%s.value = Value;});", $UniqID, $Name), 'type' => 'text', 'value' => SPrintF('%s (%s)', $User['Email'], $User['Name']), 'prompt' => $Prompt ? $Prompt : 'Для поиска пользователя введите первые буквы его имени или email адреса', 'style' => 'width:100%'));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
if ($IsDisabled) {
$Comp->AddAttribs(array('disabled' => TRUE));
}
#---------------------------------------------------------------------------
if ($User['GroupID'] != 4000000) {
$Comp->AddAttribs(array('value' => SPrintF('%s (%s)', $User['Email'], $User['Name'])));
}
示例4: array
<?php
#-------------------------------------------------------------------------------
/** @author Alex Keda, for www.host-food.ru */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Args');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
if (Is_Null($Args)) {
if (Is_Error(System_Load('modules/Authorisation.mod', 'classes/DOM.class.php'))) {
return ERROR | @Trigger_Error(500);
}
}
#-------------------------------------------------------------------------------
$Args = isset($Args) ? $Args : Args();
#-------------------------------------------------------------------------------
$ExtraIPOrderID = (int) @$Args['ExtraIPOrderID'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Columns = array('*', '(SELECT `Name` FROM `ExtraIPSchemes` WHERE `ExtraIPSchemes`.`ID` = `ExtraIPOrdersOwners`.`SchemeID`) as `Scheme`', '(SELECT `IsAutoProlong` FROM `Orders` WHERE `ExtraIPOrdersOwners`.`OrderID`=`Orders`.`ID`) AS `IsAutoProlong`', '(SELECT `UserNotice` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `ExtraIPOrdersOwners`.`OrderID`) AS `UserNotice`', '(SELECT `AdminNotice` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `ExtraIPOrdersOwners`.`OrderID`) AS `AdminNotice`', '(SELECT `Customer` FROM `Contracts` WHERE `Contracts`.`ID` = `ExtraIPOrdersOwners`.`ContractID`) AS `Customer`', '(SELECT (SELECT `Code` FROM `Services` WHERE `Orders`.`ServiceID` = `Services`.`ID`) FROM `Orders` WHERE `ExtraIPOrdersOwners`.`OrderID` = `Orders`.`ID`) AS `Code`');
#-------------------------------------------------------------------------------
$ExtraIPOrder = DB_Select('ExtraIPOrdersOwners', $Columns, array('UNIQ', 'ID' => $ExtraIPOrderID));
#-------------------------------------------------------------------------------
switch (ValueOf($ExtraIPOrder)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
示例5: Debug
if (SizeOf($Array) < 1) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersQuestioning]: все сервера опрошены'));
#-------------------------------------------------------------------------------
return Time() + 1800;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersQuestioning]: необходимо опросить серверов: %u', SizeOf($Array)));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo'] = array();
#-------------------------------------------------------------------------------
$Server = Current($Array);
#-------------------------------------------------------------------------------
if (Is_Null($Server['Name'])) {
$Server['Name'] = 'NoGroup';
}
#-------------------------------------------------------------------------------
if (!isset($GLOBALS['TaskReturnInfo'][$Server['Name']])) {
$GLOBALS['TaskReturnInfo'][$Server['Name']] = array();
}
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo'][$Server['Name']][] = $Server['Address'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$ClassName = SPrintF('%sServer', $Server['Code']);
#-------------------------------------------------------------------------------
$ClassServer = new $ClassName();
#-------------------------------------------------------------------------------
$IsSelected = $ClassServer->Select((int) $Server['ID']);
示例6: array
<?php
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('TemplateID', 'Length');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Config = Config();
#-------------------------------------------------------------------------------
$Templates = $Config['Profiles']['Templates'];
#-------------------------------------------------------------------------------
$Result = $Templates[$TemplateID]['Name'];
#-------------------------------------------------------------------------------
if (!Is_Null($Length)) {
#-----------------------------------------------------------------------------
$Result = Comp_Load('Formats/String', $Result, $Length);
if (Is_Error($Result)) {
return ERROR | @Trigger_Error(500);
}
}
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
示例7: eval
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
#Debug(SPrintF('[comp/Triggers/GLOBAL]: ModeID = %s; StatusID = %s; Order = %s',$Order['ModeID'],$Order['StatusID'],print_r($Order['Row'],true)));
#-------------------------------------------------------------------------------
if (!isset($Order['Row']['ServerID'])) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Triggers/GLOBAL]: Для (%s->%s) не задан сервер', $Order['ModeID'], $Order['StatusID']));
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (Is_Null($Order['Row']['ServerID'])) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Triggers/GLOBAL]: Для (%s->%s) сервер = NULL', $Order['ModeID'], $Order['StatusID']));
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($Order['Row']['ServerID'] < 1) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Triggers/GLOBAL]: Для (%s->%s) ServerID = 0', $Order['ModeID'], $Order['StatusID']));
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
}
示例8: Debug
case 'false':
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/SMS]: Неудачно, ошибка: "%s"', $SMS->error));
#-------------------------------------------------------------------------------
if ($Config['Notifies']['Methods']['SMS']['IsEvent']) {
#-------------------------------------------------------------------------------
#$Event = Array('UserID' => $UserID,'PriorityID' => 'Error','Text' => SPrintF('Не удалось отправить SMS сообщение для (%s), %s', $Mobile, 'шлюз временно недоступен.'));
$Event = array('UserID' => $UserID, 'PriorityID' => 'Error', 'Text' => SPrintF('Не удалось отправить SMS сообщение для (%s), причина (%s)', $Mobile, $SMS->error));
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
if (Is_Null($Task)) {
return 'Пожалуйста, попробуйте повторить попытку позже';
}
#-------------------------------------------------------------------------------
unset($Links[$LinkID]);
return 3600;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
case 'true':
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/SMS]: Отправка успешна, ответ шлюза: %s', $SMS->success));
#-------------------------------------------------------------------------------
if (!$ChargeFree && isset($After)) {
#------------------------------TRANSACTION--------------------------------------
if (Is_Error(DB_Transaction($TransactionID = UniqID('PostingSMS')))) {
return ERROR | @Trigger_Error(500);
示例9: DB_Select
$Bonuses = DB_Select('BonusesOwners', $Columns, array('Where' => $Where, 'GroupBy' => array('ServiceID', 'Discont')));
#-------------------------------------------------------------------------------
switch (ValueOf($Bonuses)) {
case 'array':
#-------------------------------------------------------------------------------
foreach ($Bonuses as $Bonus) {
#-------------------------------------------------------------------------------
$Percent = $Bonus['Discont'] * 100;
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Notes/User/Bonuses]: Code = %s; Percent = %s', $Bonus['Code'], $Percent));
#-------------------------------------------------------------------------------
if ($Percent < $Settings['Percent']) {
continue;
}
#-------------------------------------------------------------------------------
if (Is_Null($Bonus['NameShort'])) {
#-------------------------------------------------------------------------------
$Bonus['NameShort'] = 'Любой сервис';
$Bonus['Code'] = 'Hosting';
$Bonus['Measure'] = 'шт.';
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Params = array('Bonus' => $Bonus, 'Percent' => $Percent);
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
$NoBody->AddHTML(TemplateReplace('Notes.User.Bonuses', $Params));
$Result[] = $NoBody;
unset($NoBody);
#-------------------------------------------------------------------------------
}
示例10: Debug
#-------------------------------------------------------------------------------
#Debug(SPrintF('[comp/Tasks/ServersAutoBalance]: Servers = %s',print_r($Servers,true)));
#-------------------------------------------------------------------------------
if (SizeOf($Servers) < 1) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersAutoBalance]: group #%u (%s) not have servers with enabled AutoBalance', $ServersGroup['ID'], $ServersGroup['Name']));
#-------------------------------------------------------------------------------
continue 2;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# убираем из массива сервера, у которых не 100% аптайм
foreach (Array_Keys($Servers) as $Key) {
#-------------------------------------------------------------------------------
if (Is_Null($Servers[$Key]['IsOK']) || $Servers[$Key]['IsOK'] != 100) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersAutoBalance]: сервер %s исключён из автобалансировки, аптайм = %s%%', $Servers[$Key]['Address'], $Servers[$Key]['IsOK']));
#-------------------------------------------------------------------------------
unset($Servers[$Key]);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersAutoBalance]: Servers = %s', print_r($Servers, true)));
#-------------------------------------------------------------------------------
if (SizeOf($Servers) < 1) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/ServersAutoBalance]: group #%u (%s) not have servers with 100%% uptime', $ServersGroup['ID'], $ServersGroup['Name']));
#-------------------------------------------------------------------------------
示例11: array
<?php
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Attribs');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Default = array('name' => 'Summ', 'size' => 6, 'style' => 'text-align:right', 'type' => 'text', 'value' => '0.00');
#-------------------------------------------------------------------------------
if (!Is_Null($Attribs)) {
Array_Union($Default, $Attribs);
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', $Default);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Div = new Tag('NOBODY', $Comp);
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Div->AddChild(new Tag('SPAN', $Config['Executor']['Currency']['Name']));
#-------------------------------------------------------------------------------
return $Div;
#-------------------------------------------------------------------------------
示例12:
#-------------------------------------------------------------------------------
$Result[Implode(':', $KeyID)] = $Scheme;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!Is_Null($UniqID)) {
#-------------------------------------------------------------------------------
$IsQuery = DB_Query(SPrintF('SHOW COLUMNS FROM `%s`', $TableID));
if (Is_Error($IsQuery)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Rows = MySQL::Result($IsQuery);
if (Is_Error($Rows)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (Count($Rows) < 1) {
return ERROR | @Trigger_Error(400);
}
#-------------------------------------------------------------------------------
示例13: Tag
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#-------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#-------------------------------------------------------------------------------
$Params['DomainOrder'] = $DomainOrder;
#-------------------------------------------------------------------------
if (In_Array($DomainOrder['Name'], array('ru', 'su', 'рф'))) {
#-------------------------------------------------------------------------------
$NoBody->AddHTML(TemplateReplace('Notes.User.NoticeOrders.ForTransfer.USSR', $Params));
#-------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------
if (Is_Null($DomainOrder['ProfileID']) && !$DomainOrder['PersonID']) {
#-------------------------------------------------------------------------
# надо сказать чтобы определил владельца домена
$NoBody->AddHTML(TemplateReplace('Notes.User.NoticeOrders.ForTransfer.SetOwner', $Params));
#-------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------
# два варианта - зависит от наличия AuthInfo
if ($DomainOrder['AuthInfo']) {
#-------------------------------------------------------------------------
$Summ = Comp_Load('Formats/Currency', $DomainOrder['CostTransfer']);
if (Is_Error($Summ)) {
return ERROR | @Trigger_Error(500);
}
#------------------------------------------------------------------------------
$Params['Summ'] = $Summ;
示例14: array
<?php
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('TemplateID', 'Pattern');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Template = array('IsSession' => FALSE, 'Columns' => array('SelectID' => array('Hidden' => '')), 'Query' => array('InPage' => 5), 'Appearance' => array('IsSorted' => FALSE, 'IsDataMode' => FALSE), 'Cut' => array('Comps' => array('Before' => '', 'After' => '')), 'Comps' => array('Before' => array(), 'After' => array('Rows' => array('Comp' => 'Tables/Forms/Data', 'Args' => array('DataModeID' => 'Vertical')))));
#-------------------------------------------------------------------------------
if (!Is_Null($Pattern)) {
Array_Union($Template, $Pattern);
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Super', $TemplateID, $Template);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
return $Comp;
#-------------------------------------------------------------------------------
示例15: SPrintF
# Коллекция ссылок
$Links['DOM'] =& $DOM;
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Load('Window'))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DOM->AddText('Title', SPrintF('Сервер %s', $Server['Address']));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Table = array('Общие параметры');
#-------------------------------------------------------------------------------
$Table[] = array('Сервис', Is_Null($Server['ServiceName']) ? '-' : $Server['ServiceName']);
#-------------------------------------------------------------------------------
$Table[] = array('Группа серверов', Is_Null($Server['GroupName']) ? '-' : $Server['GroupName']);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Formats/Logic', $Server['IsActive']);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table[] = array('Активен', $Comp);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Formats/Logic', $Server['IsDefault']);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------