$UserIDs[] = $TargetUser['TargetUserID']; } #--------------------------------------------------------------- break; default: return ERROR | @Trigger_Error(101); } #--------------------------------------------------------------- } #--------------------------------------------------------------- #--------------------------------------------------------------- foreach ($Employers as $Employer) { $UserIDs[] = $Employer['ID']; } #--------------------------------------------------------------- ASort($UserIDs); #--------------------------------------------------------------- $UserIDs = Array_Unique($UserIDs); #--------------------------------------------------------------- Debug(SPrintF("[comp/www/Administrator/PersonalStatistics]: найдено %s сотрудников", SizeOf($UserIDs))); break; default: return ERROR | @Trigger_Error(101); } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Table = array();
$NewSchemes[] = $NewScheme['Name']; } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- # сравниваем список от регистратора со списокм в биллинге $RegList = Array_Keys($Prices); #------------------------------------------------------------------------------- ASort($NewSchemes); #------------------------------------------------------------------------------- ASort($RegList); #------------------------------------------------------------------------------- $DomainsOdd = Array_Diff($NewSchemes, $RegList); #------------------------------------------------------------------------------- if (SizeOf($DomainsOdd)) { #------------------------------------------------------------------------------- foreach ($DomainsOdd as $Odd) { #------------------------------------------------------------------------------- # проверяем наличие заказов по этому тарифу $Count = DB_Count('DomainOrdersOwners', array('Where' => array(SPrintF('`ServerID` = %u', $Registrator['ID']), SPrintF('`Name` = "%s"', $Odd)))); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- if ($Count) { #-------------------------------------------------------------------------------
$Template = System_XML(SPrintF('servers/%s.xml', $Value)); if (Is_Error($Template)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Array1[$Value] = $Template; #------------------------------------------------------------------------------- if (isset($Template['ServiceID'])) { $ServiceIDs[] = $Template['ServiceID']; } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # кастыли, для красивой сортировки списка ASort($ServiceIDs); #------------------------------------------------------------------------------- # добавляем шаблоны с указанным сервисом, сортировка по номеру сервиса foreach ($ServiceIDs as $ServiceID) { foreach (Array_Keys($Array1) as $Key) { if (isset($Array1[$Key]['ServiceID'])) { if ($ServiceID == $Array1[$Key]['ServiceID']) { $Templates[$Key] = $Array1[$Key]; } } } } #------------------------------------------------------------------------------- # удаляем из исходного массива то что уже добавили foreach (Array_Keys($Array1) as $Key) { if (isset($Templates[$Key])) {
#------------------------------------------------------------------------------- foreach ($Servers as $Server) { if ($Server['Params']['ServerAttrib']) { if (!isset($Array[$Server['Params']['ServerAttrib']])) { $Array[$Server['Params']['ServerAttrib']] = $Server['Params']['ServerAttrib']; } } } #------------------------------------------------------------------------------- if (SizeOf($Array) < 2 || IntVal($HostingScheme['HardServerID']) > 0) { #------------------------------------------------------------------------------- $DOM->AddAttribs('Body', array('onload' => 'Order("Hosting");')); #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- ASort($Array); #------------------------------------------------------------------------------- $Options = array('0' => 'Всё равно') + $Array; #------------------------------------------------------------------------------- $Comp = Comp_Load('Form/Select', array('name' => 'ServerAttrib', 'style' => 'width: 100%;'), $Options); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Table[] = array('Дополнительный параметр', $Comp); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Comp = Comp_Load('Form/Input', array('type' => 'button', 'onclick' => SPrintF("ShowWindow('/HostingOrder',{HostingSchemeID:%u,Domain:'%s'});", $HostingScheme['ID'], $Domain), 'value' => 'Изменить домен/тариф')); if (Is_Error($Comp)) {
#------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'array': #------------------------------------------------------------------------------- # строим массив доменов из биллинга $BillDomains = array(); #------------------------------------------------------------------------------- foreach ($Domains as $Domain) { $BillDomains[] = Mb_StrToLower($Domain['Domain'], 'UTF-8'); } #------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/GC/DomainFindOddg]: [%s] доменов у регистратора %s, в биллинге %s', $NowReg['Params']['Name'], SizeOf($RegDomains['Domains']), SizeOf($BillDomains))); #------------------------------------------------------------------------------- # сортируем массивы ASort($RegDomains['Domains']); ASort($BillDomains); #------------------------------------------------------------------------------- # лишние у регистратора $DomainsOdd = Array_Diff($RegDomains['Domains'], $BillDomains); #------------------------------------------------------------------------------- if (SizeOf($DomainsOdd) > 0) { #------------------------------------------------------------------------------- foreach ($DomainsOdd as $DomainOdd) { #------------------------------------------------------------------------------- # ищщем этот домен в биллинге, безотносительно его статуса, но у того же регистратора $Where = array(SPrintF('CONCAT(`DomainOrdersOwners`.`DomainName`,".",`DomainSchemes`.`Name`) = "%s"', $DomainOdd), SPrintF('`DomainOrdersOwners`.`ServerID` = %u', $NowReg['ID']), '`DomainSchemes`.`ID` = `SchemeID`'); $Count = DB_Count(array('DomainOrdersOwners', 'DomainSchemes'), array('Where' => $Where)); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } #-------------------------------------------------------------------------------
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) { #----------------------------------------------------------------------- $NodeName = new Tag('P', array('class' => 'NodeName'), new Tag('IMG', array('align' => 'left', 'src' => 'SRC:{Images/Icons/Node.gif}'))); #----------------------------------------------------------------------- $NodeName->AddChild(new Tag('A', array('href' => SPrintF("javascript:ConfigSwitch('%s');", $ID)), $ElementName)); #----------------------------------------------------------------------- $Node->AddChild($NodeName); #----------------------------------------------------------------------- $Node->AddChild(new Tag('DIV', array('id' => $ID, 'style' => 'display:none;'), $Result)); } } else { #----------------------------------------------------------------------- $Params = isset($ElementPrompt) ? array('onMouseOver' => SPrintF('PromptShow(event,\'%s\',this);', $ElementPrompt)) : array(); #----------------------------------------------------------------------- $Node->AddChild(new Tag('P', array('class' => 'NodeParam'), new Tag('SPAN', $Params, SPrintF('%s: ', $ElementName)), $Comp)); #----------------------------------------------------------------------- unset($ElementPrompt); #----------------------------------------------------------------------- } #----------------------------------------------------------------------- } #----------------------------------------------------------------------------- return Count($Node->Childs) ? $Node : FALSE; }