本文整理匯總了PHP中DB_Insert函數的典型用法代碼示例。如果您正苦於以下問題:PHP DB_Insert函數的具體用法?PHP DB_Insert怎麽用?PHP DB_Insert使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DB_Insert函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Sort
}
#-------------------------------------------------------------------------------
Sort($PatchesIDs);
#-------------------------------------------------------------------------------
$LastPatchDB = DB_Select('Config', 'Value', array('UNIQ', 'Where' => SPrintF("`Param` = 'LastPatchDB' AND `HostID` = '%s'", $HostID)));
#-------------------------------------------------------------------------------
switch (ValueOf($LastPatchDB)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
#-------------------------------------------------------------------------------
$LastPatchDB = IntVal(End($PatchesIDs));
#-------------------------------------------------------------------------------
echo SPrintF("Установка максимального патча базы данных (%u) хоста (%s)\n", $LastPatchDB, $HostID);
#-------------------------------------------------------------------------------
$InInsert = DB_Insert('Config', array('HostID' => $HostID, 'Param' => 'LastPatchDB', 'Value' => $LastPatchDB));
if (Is_Error($InInsert)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
case 'array':
#-------------------------------------------------------------------------------
$LastPatchDB = IntVal($LastPatchDB['Value']);
#-------------------------------------------------------------------------------
echo SPrintF("Последний патч базы данных хоста (%s) (%u)\n", $HostID, $LastPatchDB);
#-------------------------------------------------------------------------------
foreach ($PatchesIDs as $PatchID) {
#-------------------------------------------------------------------------------
示例2: Debug
#-------------------------------------------------------------------------------
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']);
unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailLogin']);
unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailPassword']);
unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailProtocol']);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$File = IO_Write($ConfigPath, To_XML_String($Config), TRUE);
示例3: DB_Delete
#----------------------------------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);
}
#-------------------------------------------------------------------------------
# снимаем галку про автопродление
$IsUpdate = DB_Update('Orders', array('IsAutoProlong' => FALSE), array('ID' => $OrderID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
示例4: DB_Count
$Rating = (int) @$Args['Rating'];
#-------------------------------------------------------------------------------
$Count = DB_Count('Clauses', array('ID' => $ClauseID));
if (Is_Error($Count)) {
return ERROR | Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (!$Count) {
return new gException('CLAUSE_NOT_FOUND', 'Указанная статья не найдена');
}
#-------------------------------------------------------------------------------
if ($Rating < 1 || $Rating > 5) {
return new gException('WRONG_RATTING', 'Неверный рейтинг');
}
#-------------------------------------------------------------------------------
$IsInsert = DB_Insert('ClausesRating', array('ClauseID' => $ClauseID, 'IP' => $_SERVER['REMOTE_ADDR'], 'Rating' => $Rating));
if (Is_Error($IsInsert)) {
return ERROR | Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$ClauseRating = DB_Select('ClausesRating', array('AVG(`Rating`) as `Rating`'), array('UNIQ', 'Where' => SPrintF('`ClauseID` = %u', $ClauseID), 'GroupBy' => 'ClauseID'));
#-------------------------------------------------------------------------------
switch (ValueOf($ClauseRating)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
return array('Status' => 'Ok', 'Rating' => SPrintF('%01.2f', $ClauseRating['Rating']));
default:
return ERROR | @Trigger_Error(101);
示例5: switch
#---------------------------------------------------------------------------
switch (ValueOf($Upload)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
break;
case 'array':
#-----------------------------------------------------------------------
$IEdeskMessage['FileName'] = $Upload['Name'];
break;
default:
return ERROR | @Trigger_Error(101);
}
#---------------------------------------------------------------------------
$MessageID = DB_Insert('EdesksMessages', $IEdeskMessage);
if (Is_Error($MessageID)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
if (isset($IEdeskMessage['FileName'])) {
if (!SaveUploadedFile('EdesksMessages', $MessageID, $Upload['Data'])) {
return new gException('CANNOT_SAVE_UPLOADED_FILE', 'Не удалось сохранить загруженный файл');
}
}
#---------------------------------------------------------------------------
$Users = DB_Select('Users', 'ID', array('Where' => SPrintF('`ID` != %u AND `ID` > 50', $__USER['ID'])));
#---------------------------------------------------------------------------
switch (ValueOf($Users)) {
case 'error':
return ERROR | @Trigger_Error(500);
示例6: gException
#-------------------------------------------------------------------------------
if (!$MinDaysPay) {
return new gException('MIN_DAYS_PAY_NOT_DEFINED', 'Минимальное кол-во дней оплаты не указано');
}
#-------------------------------------------------------------------------------
if ($MinDaysProlong > $MinDaysPay) {
return new gException('WRONG_MIN_DAYS_PROLONG', 'Минимальное число дней продления не может быть больше минимального числа дней оплаты');
}
#-------------------------------------------------------------------------------
if ($MinDaysPay > $MaxDaysPay) {
return new gException('WRONG_MIN_DAYS_PAY', 'Минимальное кол-во дней оплаты не можеть быть больше максимального');
}
#-------------------------------------------------------------------------------
$IHostingScheme = array('GroupID' => $GroupID, 'UserID' => $UserID, 'Name' => $Name, 'PackageID' => $PackageID, 'CostDay' => $CostDay, 'CostMonth' => $CostMonth, 'ServersGroupID' => $ServersGroupID, 'HardServerID' => $HardServerID, 'Comment' => $Comment, 'IsReselling' => $IsReselling, 'IsActive' => $IsActive, 'IsProlong' => $IsProlong, 'IsSchemeChangeable' => $IsSchemeChangeable, 'IsSchemeChange' => $IsSchemeChange, 'MinDaysPay' => $MinDaysPay, 'MinDaysProlong' => $MinDaysProlong, 'MaxDaysPay' => $MaxDaysPay, 'MaxOrders' => $MaxOrders, 'MinOrdersPeriod' => $MinOrdersPeriod, 'SortID' => $SortID, 'QuotaDisk' => $QuotaDisk, 'QuotaEmail' => $QuotaEmail, 'QuotaDomains' => $QuotaDomains, 'QuotaFTP' => $QuotaFTP, 'QuotaParkDomains' => $QuotaParkDomains, 'QuotaSubDomains' => $QuotaSubDomains, 'QuotaDBs' => $QuotaDBs, 'QuotaTraffic' => $QuotaTraffic, 'QuotaEmailAutoResp' => $QuotaEmailAutoResp, 'QuotaEmailLists' => $QuotaEmailLists, 'QuotaEmailForwards' => $QuotaEmailForwards, 'QuotaUsers' => $QuotaUsers, 'IsShellAccess' => $IsShellAccess, 'IsSSLAccess' => $IsSSLAccess, 'IsCGIAccess' => $IsCGIAccess, 'IsDnsControll' => $IsDnsControll, 'QuotaWWWDomains' => $QuotaWWWDomains, 'QuotaEmailDomains' => $QuotaEmailDomains, 'QuotaUsersDBs' => $QuotaUsersDBs, 'QuotaCPU' => $QuotaCPU, 'MaxExecutionTime' => $MaxExecutionTime, 'QuotaMEM' => $QuotaMEM, 'QuotaPROC' => $QuotaPROC, 'QuotaMPMworkers' => $QuotaMPMworkers, 'mysqlquerieslimit' => $mysqlquerieslimit, 'mysqlupdateslimit' => $mysqlupdateslimit, 'mysqlconnectlimit' => $mysqlconnectlimit, 'mysqluserconnectlimit' => $mysqluserconnectlimit, 'mailrate' => $mailrate, 'IsSSIAccess' => $IsSSIAccess, 'IsPHPModAccess' => $IsPHPModAccess, 'IsPHPCGIAccess' => $IsPHPCGIAccess, 'IsPHPFastCGIAccess' => $IsPHPFastCGIAccess, 'IsPHPSafeMode' => $IsPHPSafeMode, 'QuotaAddonDomains' => $QuotaAddonDomains, 'QuotaWebUsers' => $QuotaWebUsers, 'QuotaEmailBox' => $QuotaEmailBox, 'QuotaEmailGroups' => $QuotaEmailGroups, 'QuotaWebApp' => $QuotaWebApp, 'IsCreateDomains' => $IsCreateDomains, 'IsManageHosting' => $IsManageHosting, 'IsManageQuota' => $IsManageQuota, 'IsManageSubdomains' => $IsManageSubdomains, 'IsChangeLimits' => $IsChangeLimits, 'IsManageLog' => $IsManageLog, 'IsManageCrontab' => $IsManageCrontab, 'IsManageAnonFtp' => $IsManageAnonFtp, 'IsManageWebapps' => $IsManageWebapps, 'IsManageMaillists' => $IsManageMaillists, 'IsManageDrWeb' => $IsManageDrWeb, 'IsMakeDumps' => $IsMakeDumps, 'IsSiteBuilder' => $IsSiteBuilder, 'IsRemoteInterface' => $IsRemoteInterface, 'IsManagePerformance' => $IsManagePerformance, 'IsCpAccess' => $IsCpAccess, 'IsManageDomainAliases' => $IsManageDomainAliases, 'IsManageIISAppPool' => $IsManageIISAppPool, 'IsDashBoard' => $IsDashBoard, 'IsStdGIU' => $IsStdGIU, 'IsManageDashboard' => $IsManageDashboard, 'IsManageSubFtp' => $IsManageSubFtp, 'ISManageSpamFilter' => $ISManageSpamFilter, 'IsLocalBackups' => $IsLocalBackups, 'IsFtpBackups' => $IsFtpBackups, 'IsAnonimousFTP' => $IsAnonimousFTP, 'IsPHPAccess' => $IsPHPAccess, 'IsSpamAssasing' => $IsSpamAssasing, 'IsCatchAll' => $IsCatchAll, 'IsSystemInfo' => $IsSystemInfo, 'field1' => $field1, 'field2' => $field2, 'field3' => $field3);
#-------------------------------------------------------------------------------
if ($HostingSchemeID) {
#-----------------------------------------------------------------------------
$IsUpdate = DB_Update('HostingSchemes', $IHostingScheme, array('ID' => $HostingSchemeID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
} else {
#-----------------------------------------------------------------------------
$IsInsert = DB_Insert('HostingSchemes', $IHostingScheme);
if (Is_Error($IsInsert)) {
return ERROR | @Trigger_Error(500);
}
}
#-------------------------------------------------------------------------------
return array('Status' => 'Ok');
#-------------------------------------------------------------------------------
示例7: DB_Delete
# 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);
}
#-----------------------------------------------------------------
break;
default:
return ERROR | @Trigger_Error(101);
}
break;
default:
示例8: array
$Answer = array('Status' => 'Ok');
#------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Clause = array('GroupID' => $GroupID, 'PublicDate' => $PublicDate, 'Partition' => $Partition, 'Title' => $Title, 'IsXML' => $IsXML, 'IsDOM' => $IsDOM, 'IsPublish' => $IsPublish, 'Text' => $Text);
#-------------------------------------------------------------------------------
if ($ClauseID) {
#-----------------------------------------------------------------------------
$Clause['ChangedDate'] = Time();
$Clause['EditorID'] = $__USER['ID'];
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('Clauses', $Clause, array('ID' => $ClauseID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Clause['AuthorID'] = $__USER['ID'];
#-------------------------------------------------------------------------------
$ClauseID = DB_Insert('Clauses', $Clause);
if (Is_Error($ClauseID)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Answer['ClauseID'] = $ClauseID;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Answer;
#-------------------------------------------------------------------------------
示例9: gException
#-------------------------------------------------------------------------------
if (!$MinDaysPay) {
return new gException('MIN_DAYS_PAY_NOT_DEFINED', 'Минимальное кол-во дней оплаты не указано');
}
#-------------------------------------------------------------------------------
if ($MinDaysProlong > $MinDaysPay) {
return new gException('WRONG_MIN_DAYS_PROLONG', 'Минимальное число дней продления не может быть больше минимального числа дней оплаты');
}
#-------------------------------------------------------------------------------
if ($MinDaysPay > $MaxDaysPay) {
return new gException('WRONG_MIN_DAYS_PAY', 'Минимальное кол-во дней оплаты не можеть быть больше максимального');
}
#-------------------------------------------------------------------------------
$IVPSScheme = array('GroupID' => $GroupID, 'UserID' => $UserID, 'Name' => $Name, 'PackageID' => $PackageID, 'CostDay' => $CostDay, 'CostMonth' => $CostMonth, 'CostInstall' => $CostInstall, 'ServersGroupID' => $ServersGroupID, 'Comment' => $Comment, 'IsReselling' => $IsReselling, 'IsActive' => $IsActive, 'IsProlong' => $IsProlong, 'IsSchemeChangeable' => $IsSchemeChangeable, 'IsSchemeChange' => $IsSchemeChange, 'MinDaysPay' => $MinDaysPay, 'MinDaysProlong' => $MinDaysProlong, 'MaxDaysPay' => $MaxDaysPay, 'MaxOrders' => $MaxOrders, 'MinOrdersPeriod' => $MinOrdersPeriod, 'SortID' => $SortID, 'vdslimit' => $vdslimit, 'disklimit' => $disklimit, 'maxdesc' => $maxdesc, 'blkiotune' => $blkiotune, 'isolimitsize' => $isolimitsize, 'isolimitnum' => $isolimitnum, 'snapshot_limit' => $snapshot_limit, 'maxswap' => $maxswap, 'traf' => $traf, 'chrate' => $chrate, 'QuotaUsers' => $QuotaUsers, 'cpu' => $cpu, 'ncpu' => $ncpu, 'mem' => $mem, 'bmem' => $bmem, 'proc' => $proc, 'ipalias' => $ipalias, 'extns' => $extns, 'limitpvtdns' => $limitpvtdns, 'limitpubdns' => $limitpubdns, 'backup' => $backup);
#-------------------------------------------------------------------------------
if ($VPSSchemeID) {
#-----------------------------------------------------------------------------
$IsUpdate = DB_Update('VPSSchemes', $IVPSScheme, array('ID' => $VPSSchemeID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
} else {
#-----------------------------------------------------------------------------
$IsInsert = DB_Insert('VPSSchemes', $IVPSScheme);
if (Is_Error($IsInsert)) {
return ERROR | @Trigger_Error(500);
}
}
#-------------------------------------------------------------------------------
return array('Status' => 'Ok');
#-------------------------------------------------------------------------------
示例10: foreach
#-------------------------------------------------------------------------------
if (isset($Config['Domains']['Registrators'])) {
#-----------------------------------------------------------------------------
$Registrators = $Config['Domains']['Registrators'];
#-----------------------------------------------------------------------------
foreach (Array_Keys($Registrators) as $TypeID) {
#---------------------------------------------------------------------------
$Type = $Registrators[$TypeID];
#---------------------------------------------------------------------------
if (!$Type['Login']) {
continue;
}
#---------------------------------------------------------------------------
$Http = $Type['Http'];
#---------------------------------------------------------------------------
$IRow = array('Name' => $TypeID, 'TypeID' => $TypeID, 'Address' => $Http['Address'], 'Port' => $Http['Port'], 'Protocol' => $Http['Protocol'], 'Login' => $Type['Login'], 'Password' => $Type['Password']);
#---------------------------------------------------------------------------
$RegistratorID = DB_Insert('Registrators', $IRow);
if (Is_Error($RegistratorID)) {
return ERROR | Trigger_Error(500);
}
#---------------------------------------------------------------------------
$IsUpdate = DB_Update('DomainsSchemes', array('RegistratorID' => $RegistratorID), array('Where' => SPrintF("`RegistratorID` = '%s'", $TypeID)));
if (Is_Error($IsUpdate)) {
return ERROR | Trigger_Error(500);
}
}
}
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
示例11: DB_Insert
default:
return ERROR | @Trigger_Error(101);
}
}
#-------------------------------------------------------------------------------
$OrderID = DB_Insert('Orders', array('ContractID' => $Contract['ID'], 'ServiceID' => $Server['ServiceID'], 'ServerID' => $Server['ID'], 'Params' => array('ViewArea' => $ViewArea)));
if (Is_Error($OrderID)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Login = SPrintF('%s%s', $Server['Params']['Prefix'], $OrderID);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IDNSmanagerOrder = array('OrderID' => $OrderID, 'SchemeID' => $DNSmanagerScheme['ID'], 'Login' => $Login, 'Password' => $Password);
#-------------------------------------------------------------------------------
$DNSmanagerOrderID = DB_Insert('DNSmanagerOrders', $IDNSmanagerOrder);
if (Is_Error($DNSmanagerOrderID)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'DNSmanagerOrders', 'StatusID' => 'Waiting', 'RowsIDs' => $DNSmanagerOrderID, 'Comment' => $Comment ? $Comment : 'Заказ создан и ожидает оплаты'));
#-------------------------------------------------------------------------------
switch (ValueOf($Comp)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $Comp;
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
示例12: gException
return new gException('WRONG_MIN_DAYS_PROLONG', 'Минимальное число дней продления не может быть больше минимального числа дней оплаты');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($MinDaysPay > $MaxDaysPay) {
return new gException('WRONG_MIN_DAYS_PAY', 'Минимальное кол-во дней оплаты не можеть быть больше максимального');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IDSScheme = array('GroupID' => $GroupID, 'UserID' => $UserID, 'Name' => $Name, 'PackageID' => $PackageID, 'CostDay' => $CostDay, 'CostMonth' => $CostMonth, 'CostInstall' => $CostInstall, 'ServerID' => $ServerID, 'IsActive' => $IsActive, 'IsBroken' => $IsBroken, 'IsProlong' => $IsProlong, 'MinDaysPay' => $MinDaysPay, 'MinDaysProlong' => $MinDaysProlong, 'MaxDaysPay' => $MaxDaysPay, 'MaxOrders' => $MaxOrders, 'MinOrdersPeriod' => $MinOrdersPeriod, 'SortID' => $SortID, 'CPU' => $CPU, 'ram' => $ram, 'raid' => $raid, 'disks' => $disks, 'chrate' => $chrate, 'trafflimit' => $trafflimit, 'traffcorrelation' => $traffcorrelation, 'OS' => $OS, 'Switch' => $Switch, 'UserNotice' => $UserNotice, 'AdminNotice' => $AdminNotice);
#-------------------------------------------------------------------------------
if ($DSSchemeID) {
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('DSSchemes', $IDSScheme, array('ID' => $DSSchemeID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$IsInsert = DB_Insert('DSSchemes', $IDSScheme);
if (Is_Error($IsInsert)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok');
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例13: gException
return new gException('WRONG_MIN_DAYS_PROLONG', 'Минимальное число дней продления не может быть больше минимального числа дней оплаты');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($MinDaysPay > $MaxDaysPay) {
return new gException('WRONG_MIN_DAYS_PAY', 'Минимальное кол-во дней оплаты не можеть быть больше максимального');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IDNSmanagerScheme = array('GroupID' => $GroupID, 'UserID' => $UserID, 'Name' => $Name, 'PackageID' => $PackageID, 'CostDay' => $CostDay, 'CostMonth' => $CostMonth, 'ServersGroupID' => $ServersGroupID, 'HardServerID' => $HardServerID, 'Comment' => $Comment, 'IsReselling' => $IsReselling, 'IsActive' => $IsActive, 'IsProlong' => $IsProlong, 'IsSchemeChangeable' => $IsSchemeChangeable, 'IsSchemeChange' => $IsSchemeChange, 'MinDaysPay' => $MinDaysPay, 'MinDaysProlong' => $MinDaysProlong, 'MaxDaysPay' => $MaxDaysPay, 'MaxOrders' => $MaxOrders, 'MinOrdersPeriod' => $MinOrdersPeriod, 'SortID' => $SortID, 'Reseller' => $Reseller, 'ViewArea' => $ViewArea, 'DomainLimit' => $DomainLimit);
#-------------------------------------------------------------------------------
if ($DNSmanagerSchemeID) {
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('DNSmanagerSchemes', $IDNSmanagerScheme, array('ID' => $DNSmanagerSchemeID));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$IsInsert = DB_Insert('DNSmanagerSchemes', $IDNSmanagerScheme);
if (Is_Error($IsInsert)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok');
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例14: DB_Insert
break;
default:
return ERROR | @Trigger_Error(101);
}
}
#---------------------------------------------------------------
$OrderID = DB_Insert('Orders', array('ContractID' => $Contract['ID'], 'ServerID' => $Server['ID'], 'Params' => array('DiskTemplate' => $DiskTemplate), 'ServiceID' => 30000));
if (Is_Error($OrderID)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------
$Login = SPrintF('%s%s', $Server['Params']['Prefix'], $OrderID);
#---------------------------------------------------------------
$IVPSOrder = array('OrderID' => $OrderID, 'SchemeID' => $VPSScheme['ID'], 'Login' => $Login, 'Password' => $Password, 'Domain' => SPrintF('%s.%s', $Login, $Server['Params']['Domain']));
#---------------------------------------------------------------
$VPSOrderID = DB_Insert('VPSOrders', $IVPSOrder);
if (Is_Error($VPSOrderID)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------
$Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'VPSOrders', 'StatusID' => 'Waiting', 'RowsIDs' => $VPSOrderID, 'Comment' => $Comment ? $Comment : 'Заказ создан и ожидает оплаты'));
#---------------------------------------------------------------
switch (ValueOf($Comp)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
#return ERROR | @Trigger_Error(400);
return $Comp;
case 'array':
#-----------------------------------------------------------
$Event = array('UserID' => $Contract['UserID'], 'PriorityID' => 'Billing', 'Text' => SPrintF('Сформирована заявка на заказ VPS логин (%s), тариф (%s)', $Login, $VPSScheme['Name']));
示例15: array
$Epoches = 3;
#-------------------------------------------------------------------------------
$Incomes = array();
#-------------------------------------------------------------------------------
$Orders = DB_Select(array('VPSOrders', 'Orders', 'Contracts'), array('ContractID', 'Balance', 'OrderID', 'Customer', 'Login', 'Domain', '(UNIX_TIMESTAMP() + `DaysRemainded`*86400) as `ExpirationDate`', '(SELECT `MinDaysPay` FROM `VPSSchemes` WHERE `VPSSchemes`.`ID` = `VPSOrders`.`SchemeID`) as `MinDaysPay`', '(SELECT `CostDay` FROM `VPSSchemes` WHERE `VPSSchemes`.`ID` = `VPSOrders`.`SchemeID`) as `CostDay`'), array('Where' => SPrintF('(UNIX_TIMESTAMP() + `DaysRemainded`*86400) < %u AND `Orders`.`ID` = `VPSOrders`.`OrderID` AND `Contracts`.`ID` = `Orders`.`ContractID`', MkTime(0, 0, 1, Date('n') + $Epoches)), 'SortOn' => 'ExpirationDate'));
#-------------------------------------------------------------------------------
switch (ValueOf($Orders)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $Result;
case 'array':
#---------------------------------------------------------------------------
foreach ($Orders as $Order) {
#-------------------------------------------------------------------------
$IsInsert = DB_Insert($UniqID, $Order);
if (Is_Error($IsInsert)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------
$Incomes[$Order['OrderID']] = $Order;
}
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$sMonth = Date('Y') * 12 + Date('n');
#-------------------------------------------------------------------------------
$Head = array(new Tag('TD', array('class' => 'Head'), 'Клиент'), new Tag('TD', array('class' => 'Head'), 'Логин'), new Tag('TD', array('class' => 'Head'), 'Домен'));
#-------------------------------------------------------------------------------