if ($Settings['IsEvent']) { #------------------------------------------------------------------------------- $Event = array('Text' => $Message, 'PriorityID' => 'Error', 'IsReaded' => FALSE); $Event = Comp_Load('Events/EventInsert', $Event); if (!$Event) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- # просто удаляем тариф Debug(SPrintF('[comp/Tasks/GC/DomainCheckPriceList]: удаление тарифа отсутствующего у регистратора: %s/%s', $Registrator['Params']['Name'], $Odd)); #------------------------------------------------------------------------------- $IsDelete = DB_Delete('DomainSchemes', array('Where' => SPrintF('`ServerID` = %u AND `Name` = "%s"', $Registrator['ID'], $Odd))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
$Count = DB_Count('InvoicesOwners', array('Where' => SPrintF("`StatusID` = 'Payed' AND `UserID` = %u", $User['ID']))); if ($Count) { return new gException('USER_HAVE_PAYED_INVOICES', SPrintF('Пользователь [%s] не может быть удален, поскольку у него есть оплаченные счета', $User['Email'])); } #------------------------------------------------------------------------------- # проверяем наличие заказов $Count = DB_Count('OrdersOwners', array('Where' => SPrintF("`UserID` = %u", $User['ID']))); if ($Count) { return new gException('USER_HAVE_INVOICES', SPrintF('Пользователь [%s] не может быть удален, поскольку у него есть заказанные услуги', $User['Email'])); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- // удаляем события этого юзера $Where = SPrintF('`UserID` = %u', $User['ID']); #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Events', array('Where' => $Where)); if (Is_Error($IsDelete)) { return new gException('USERs_EVENTS_CAN_NOT_DELETED', SPrintF('Не удалось удалить события пользователя [%s]', $User['Email'])); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (!DeleteUploadedFile('Users', $User['ID'])) { return new gException('CANNOT_DELETE_FILE', 'Не удалось удалить связанный файл'); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Personal = DB_Select('Users', array('ID', 'Email'), array('UNIQ', 'ID' => $GLOBALS['__USER']['ID'])); #------------------------------------------------------------------------------- switch (ValueOf($Personal)) { case 'error': return ERROR | @Trigger_Error(500);
eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ $UpTimes = DB_Select('ServersUpTime', array('ServerID', 'Service', 'TestDate', 'Day', 'Month', 'Year', 'AVG(`UpTime`) as `UpTime`', 'Count(`UpTime`) as `Count`'), array('GroupBy' => array('ServerID', 'Service', 'Day', 'Month', 'Year'))); #------------------------------------------------------------------------------- switch (ValueOf($UpTimes)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more.. break; case 'array': #--------------------------------------------------------------------------- foreach ($UpTimes as $UpTime) { #------------------------------------------------------------------------- $IsDelete = DB_Delete('ServersUpTime', array('Where' => SPrintF("`Day` = %u AND `Month` = %u AND `Year` = %u AND `ServerID` = %u AND `Service` = '%s'", $UpTime['Day'], $UpTime['Month'], $UpTime['Year'], $UpTime['ServerID'], $UpTime['Service']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- $IPage = array('ServerID' => $UpTime['ServerID'], 'Service' => $UpTime['Service'], 'TestDate' => $UpTime['TestDate'], 'Day' => $UpTime['Day'], 'Month' => $UpTime['Month'], 'Year' => $UpTime['Year'], 'UpTime' => $UpTime['UpTime'], 'Count' => $UpTime['Count']); #----------------------------------------------------------------------- $IsInsert = DB_Insert('ServersUpTime', $IPage); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } } break; default: return ERROR | @Trigger_Error(500); }
#-------------------------------------------------------------------------------- #Debug(SPrintF('[comp/Tasks/GC/CleanTables]: ID = %s, ModeID = %s, RowID = %s',$History['ID'],$History['ModeID'],$History['RowID'])); #-------------------------------------------------------------------------------- $Keys[] = $Key; #-------------------------------------------------------------------------------- #-------------------------------------------------------------------------------- $Row = DB_Select($History['ModeID'], array('ID'), array('UNIQ', 'Where' => SPrintF("`ID` = %u", $History['RowID']))); #-------------------------------------------------------------------------------- switch (ValueOf($Row)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #-------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/GC/CleanTables]: orphaned row ID = %s, ModeID = %s, RowID = %s', $History['ID'], $History['ModeID'], $History['RowID'])); #-------------------------------------------------------------------------------- $IsDelete = DB_Delete('StatusesHistory', array('Where' => SPrintF('`ModeID` = "%s" AND `RowID` = %u', $History['ModeID'], $History['RowID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #-------------------------------------------------------------------------------- break; #-------------------------------------------------------------------------------- #-------------------------------------------------------------------------------- case 'array': #-------------------------------------------------------------------------------- break; #-------------------------------------------------------------------------------- #-------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); }
return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Tasks', array('ID' => 11)); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsInsert = DB_Insert('Tasks', array('ID' => 11, 'UserID' => 1, 'TypeID' => 'RecoveryServers', 'Params' => array(), 'IsActive' => TRUE)); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Tasks', array('ID' => 12)); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsInsert = DB_Insert('Tasks', array('ID' => 12, 'UserID' => 1, 'TypeID' => 'RecoveryUsers', 'Params' => array(), 'IsActive' => TRUE)); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $HostsIDs = Array_Reverse($GLOBALS['HOST_CONF']['HostsIDs']); #------------------------------------------------------------------------------- echo "\n\n-- Патчи базы данных\n\n"; #------------------------------------------------------------------------------- foreach ($HostsIDs as $HostID) {
#------------------------------------------------------------------------------- switch (ValueOf($Users)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #--------------------------------------------------------------------------- foreach ($Users as $User) { #------------------------------------------------------------------------- $Count = DB_Count('Contracts', array('Where' => SPrintF("`UserID` = %u AND `TypeID` != 'Default'", $User['ID']))); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- if ($Count) { #----------------------------------------------------------------------- $IsDelete = DB_Delete('Contracts', array('Where' => SPrintF("`UserID` = %u AND `TypeID` = 'Default'", $User['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } } } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- $Users = Is_Array($Users) ? $Users : array(); #------------------------------------------------------------------------------- $Config = Config(); #------------------------------------------------------------------------------- echo "Сканирование базы данных\n"; #------------------------------------------------------------------------------- foreach ($Users as $User) { #----------------------------------------------------------------------------- $Email = $User['Email']; #----------------------------------------------------------------------------- if ($IsDelete) { #--------------------------------------------------------------------------- echo SPrintF("Удаление пользователя (%s)\n", $Email); #--------------------------------------------------------------------------- $IsOk = DB_Delete('Users', array('Where' => SPrintF("`Email` = '%s' AND `ID` != 100", $Email))); if (Is_Error($IsOk)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------------------------------- continue; } else { echo SPrintF("Импорт пользователя (%s)\n", $Email); } #----------------------------------------------------------------------------- $dUser = DB_Select('Users', 'ID', array('Where' => SPrintF("`Email` = '%s'", $Email))); #----------------------------------------------------------------------------- switch (ValueOf($dUser)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception':
case 'array': #------------------------------------------------------------------------------- $Summ = 0; #------------------------------------------------------------------------------- foreach ($Basket as $Item) { #------------------------------------------------------------------------------- $Summ += $Item['Summ']; #------------------------------------------------------------------------------- $IItem = array('InvoiceID' => $InvoiceID, 'ServiceID' => $Item['ServiceID'], 'Comment' => $Item['Comment'], 'OrderID' => $Item['OrderID'], 'Amount' => $Item['Amount'], 'Summ' => $Item['Summ']); #------------------------------------------------------------------------------- $IsInsert = DB_Insert('InvoicesItems', $IItem); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Basket', array('ID' => $Item['ID'])); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if ($Summ) {
#------------------------------------------------------------------------------- $Notifies = $Config['Notifies']; #------------------------------------------------------------------------------- $Methods = $Notifies['Methods']; #------------------------------------------------------------------------------- foreach (Array_Keys($Methods) as $MethodID) { #------------------------------------------------------------------------------- $Types = $Notifies['Types']; #------------------------------------------------------------------------------- foreach (Array_Keys($Types) as $TypeID) { #------------------------------------------------------------------------------- $Where = SPrintF("`UserID` = %u AND `MethodID` = '%s' AND `TypeID` = '%s'", $__USER['ID'], $MethodID, $TypeID); #------------------------------------------------------------------------------- if (In_Array($TypeID, (array) @$Args[$MethodID])) { #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Notifies', array('Where' => $Where)); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- $Count = DB_Count('Notifies', array('Where' => $Where)); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- if (!$Count) { #------------------------------------------------------------------------------- $INotify = array('UserID' => $__USER['ID'], 'MethodID' => $MethodID, 'TypeID' => $TypeID); #-------------------------------------------------------------------------------
if ($result) { $sql = DB_Select("ticket_view", array("id" => "=" . $id)); $query = DB_Query($sql, $con); while ($row = DB_Fetch_Array($query)) { if ($row["uri"] != null) { toastup($row["uri"], "您的点歌「" . urldecode($row["name"]) . "」无法播放"); break; } } if ($location != "") { System_messagebox("操作成功!", "success", "/admin/index.php?mode=" . $location); } else { System_messagebox("操作成功!", "success", "/admin/index.php"); } } else { DB_PrintError(DB_Error($con)); } break; case "deletelost": $sql = DB_Delete("lostandfound", array("id" => "=" . $id)); $result = DB_Query($sql, $con); if ($result) { System_messagebox("操作成功!", "success", "/admin/lostandfound.php"); } else { DB_PrintError(DB_Error($con)); } break; default: System_messagebox("错误请求!", "message", "/admin/"); break; }
default: return ERROR | @Trigger_Error(101); } } #--------------------------------------------------------------------- $RowsIDs[] = $Row['ID']; break; default: return ERROR | @Trigger_Error(101); } } #--------------------------------------------------------------------------- $IsDelete = DB_Delete($TableID, array('Where' => $Where)); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------------------------------- $IsDelete = DB_Delete('StatusesHistory', array('Where' => array(SPrintF("`ModeID` = '%s'", $TableID), SPrintF('`RowID` IN (%s)', Implode(',', $Array))))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------------------------------- if (Is_Error(DB_Commit($TransactionID))) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------------------------------- return array('Status' => 'Ok'); default: return ERROR | @Trigger_Error(101); } #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- switch (ValueOf($iBasket)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #------------------------------------------------------------------------------- $Array = array(); #------------------------------------------------------------------------------- foreach ($iBasket as $Basket) { $Array[] = $Basket['ID']; } #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Basket', array('Where' => SPrintF('`ID` IN (%s)', Implode(',', $Array)))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- # выписываем счёт $Comp = Comp_Load('www/API/HostingOrderPay', array('HostingOrderID' => $HostingOrder['ID'], 'DaysPay' => $Settings['DaysPay'], 'IsUseBasket' => TRUE)); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500);
<?php #------------------------------------------------------------------------------- /** @author Великодный В.В. (Joonte Ltd.) */ /******************************************************************************/ /******************************************************************************/ $__args_list = array('ContractEnclosure'); /******************************************************************************/ eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ if (Is_Error(System_Load('libs/Upload.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('MotionDocuments', array('Where' => SPrintF("`UniqID` = 'Enclosure:%s'", $ContractEnclosure['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (!DeleteUploadedFile('ContractsEnclosures', $ContractEnclosure['ID'])) { return new gException('CANNOT_DELETE_FILE', 'Не удалось удалить связанный файл'); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
# проверяем наличие любых счетов $Count = DB_Count('InvoicesOwners', array('Where' => SPrintF("`ContractID` = %u", $Contract['ID']))); if ($Count) { return new gException('CONTRACT_HAVE_INVOICES', SPrintF('Договор #%s не может быть удален, поскольку на него есть счета на оплату', $Number)); } #------------------------------------------------------------------------------- # проверяем наличие оплаченных счетов $Count = DB_Count('InvoicesOwners', array('Where' => SPrintF("`StatusID` = 'Payed' AND `ContractID` = %u", $Contract['ID']))); if ($Count) { return new gException('CONTRACT_HAVE_PAYED_INVOICES', SPrintF('Договор #%s не может быть удален, поскольку на него есть оплаченные счета', $Number)); } #------------------------------------------------------------------------------- # проверяем наличие заказов $Count = DB_Count('OrdersOwners', array('Where' => SPrintF("`ContractID` = %u", $Contract['ID']))); if ($Count) { return new gException('CONTRACT_HAVE_INVOICES', SPrintF('Договор #%s не может быть удален, поскольку на нём есть заказанные услуги', $Number)); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('MotionDocuments', array('Where' => SPrintF('`ContractID` = %u', $Contract['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- if (!DeleteUploadedFile('Contracts', $Contract['ID'])) { return new gException('CANNOT_DELETE_FILE', 'Не удалось удалить связанный файл'); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
#--------------------------------------------------------------------- $WorksComplite = DB_Select('WorksComplite', $Columns, array('GroupBy' => array('ContractID', 'ServiceID', 'Comment', 'Cost', 'Discont'), 'Where' => SPrintF('`ContractID` = %u', $Contract['ID']))); #--------------------------------------------------------------------- switch (ValueOf($WorksComplite)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #---------------------------TRANSACTION--------------------------- if (Is_Error(DB_Transaction($TransactionID = UniqID('WorksComplite')))) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------- $IsDelete = DB_Delete('WorksComplite', array('Where' => SPrintF('`ContractID` = %u', $Contract['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------- foreach ($WorksComplite as $WorkComplite) { #--------------------------------------------------------------- $IsInsert = DB_Insert('WorksComplite', $WorkComplite); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } } #----------------------------------------------------------------- if (Is_Error(DB_Commit($TransactionID))) { return ERROR | @Trigger_Error(500); }
return ERROR | @Trigger_Error(500); } } break; case 'ContractEnclosure': #--------------------------------------------------------------------- $ID = $MotionDocument['Attribs']['ID']; #--------------------------------------------------------------------- $Count = DB_Count('ContractsEnclosures', array('ID' => $ID)); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------------------------- if (!$Count) { #------------------------------------------------------------------- $IsDelete = DB_Delete('MotionDocuments', array('ID' => $MotionDocument['ID'])); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } } break; default: # No more... } } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- return TRUE;
#------------------------------------------------------------------------------- switch (ValueOf($ServersGroups)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': break; case 'array': #------------------------------------------------------------------------------- foreach ($ServersGroups as $ServersGroup) { #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Servers', array('Where' => SPrintF('`ServersGroupID` = %u', $ServersGroup['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsDelete = DB_Delete('ServersGroups', array('ID' => $ServersGroup['ID'])); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- foreach ($HostingServersGroups as $HostingServersGroup) {
#------------------------------------------------------------------------- $Count += $Numbers; #------------------------------------------------------------------------- if (HOST_ID == 'joonte.com') { #----------------------------------------------------------------------- $Numbers = DB_Count('JBsOrdersOwners', array('Where' => SPrintF('`ContractID` = %u', $Contract['ID']))); if (Is_Error($Numbers)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------- $Count += $Numbers; #------------------------------------------------------------------------- if ($Count < 1) { #----------------------------------------------------------------------- $IsDelete = DB_Delete('Contracts', array('ID' => $Contract['ID'])); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------------- continue; } #------------------------------------------------------------------------- $Profiles = DB_Select('Profiles', '*', array('Where' => SPrintF("`UserID` = %u AND `TemplateID` = 'Natural'", $Contract['UserID']))); #------------------------------------------------------------------------- switch (ValueOf($Profiles)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #--------------------------------------------------------------------- $Template = System_XML('profiles/Natural.xml');
$Config = $Config['XML']; #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- $Config = array(); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (isset($Config['Tasks']['Types']['CheckEmail']['CheckEmailLogin'])) { #------------------------------------------------------------------------------- $CheckEmail = $Config['Tasks']['Types']['CheckEmail']; Debug(SPrintF('[patches/hosting/files/1000014.php]: CheckEmail = %s', print_r($CheckEmail, true))); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Servers', array('Where' => '`TemplateID` = "EmailClient"')); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Server = array('TemplateID' => 'EmailClient', 'IsActive' => TRUE, 'IsDefault' => TRUE, 'Protocol' => isset($CheckEmail['UseSSL']) ? $CheckEmail['UseSSL'] ? 'ssl' : 'tcp' : 'ssl', 'Address' => isset($CheckEmail['CheckEmailServer']) ? $CheckEmail['CheckEmailServer'] : 'pop.yandex.ru', 'Port' => 110, 'Login' => isset($CheckEmail['CheckEmailLogin']) ? $CheckEmail['CheckEmailLogin'] : '', 'Password' => isset($CheckEmail['CheckEmailPassword']) ? $CheckEmail['CheckEmailPassword'] : '', 'Params' => array('Method' => isset($CheckEmail['CheckEmailProtocol']) ? $CheckEmail['CheckEmailProtocol'] : 'pop3'), 'AdminNotice' => 'Используется учётная запись от которой шлёт сообщения биллинг (пользователь с идентификатором 100)', 'SortID' => 100000, 'Monitoring' => "POP3=110\nPOP3S=995\nIMAP4=143\nIMAP4S=993"); #------------------------------------------------------------------------------- $IsInsert = DB_Insert('Servers', $Server); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- unset($Config['Tasks']['Types']['CheckEmail']['UseSSL']); unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailServer']);
$Config = $Config['XML']; #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- $Config = array(); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (isset($Config['Notifies']['Settings']['JabberClient']['Password'])) { #------------------------------------------------------------------------------- $JabberClient = $Config['Notifies']['Settings']['JabberClient']; Debug(SPrintF('[patches/hosting/files/1000016.php]: JabberClient = %s', print_r($JabberClient, true))); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsDelete = DB_Delete('Servers', array('Where' => '`TemplateID` = "Jabber"')); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Server = array('TemplateID' => 'Jabber', 'IsActive' => TRUE, 'IsDefault' => TRUE, 'Protocol' => 'ssl', 'Address' => isset($JabberClient['Server']) ? $JabberClient['Server'] : 'jabber.isp.su', 'Port' => 5222, 'Login' => $JabberClient['JabberID'], 'Password' => isset($JabberClient['Password']) ? $JabberClient['Password'] : '', 'SortID' => 100000, 'Monitoring' => 'Jabber=5222'); #------------------------------------------------------------------------------- $IsInsert = DB_Insert('Servers', $Server); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- unset($Config['Notifies']['Settings']['JabberClient']); #-------------------------------------------------------------------------------
#Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: OrdersOwners Count = %s',$Count)); #------------------------------------------------------------------------------- if ($Count) { continue; } #------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: Изменено число оставшихся дней (%u->%u) для заказa OrderID = %s; юзер = %s', $OrderConsider['SumDaysRemainded'], $Settings['ResetDaysTo'], $OrderID, $UserID)); #------------------------------------------------------------------------------- #----------------------------------TRANSACTION---------------------------------- if (Is_Error(DB_Transaction($TransactionID = UniqID('ResetOrdersDays')))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # удаляем весь учёт для заказа, где скидка 100% или цена 0 $IsDelete = DB_Delete('OrdersConsider', array('Where' => SPrintF('`OrderID` = %u', $OrderID))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- # втыкаем новый учёт, на нужное число дней $IOrdersConsider = array('OrderID' => $OrderID, 'DaysReserved' => IntVal($Settings['ResetDaysTo']), 'Cost' => 0); #------------------------------------------------------------------------------- $OrdersConsiderID = DB_Insert('OrdersConsider', $IOrdersConsider); if (Is_Error($OrdersConsiderID)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsUpdate = DB_Update('OrdersConsider', array('DaysConsidered' => 0), array('ID' => $OrdersConsiderID)); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500);
case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #--------------------------------------------------------------------- foreach ($MotionDocuments as $MotionDocument) { $Statuses[$MotionDocument['UniqID']] = array($MotionDocument['StatusID'], $MotionDocument['StatusDate']); } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------- $IsDelete = DB_Delete('MotionDocuments', array('Where' => SPrintF("`ContractID` = %u AND `TypeID` = 'WorksCompliteAct'", $Contract['ID']))); if (Is_Error($IsDelete)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- $Acts = DB_Select('WorksCompliteActs', 'Month', array('Where' => SPrintF("`ContractID` = %u", $Contract['ID']))); #------------------------------------------------------------------------- switch (ValueOf($Acts)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #--------------------------------------------------------------------- foreach ($Acts as $Act) {