<?php #------------------------------------------------------------------------------- $Enclosures = DB_Select('ContractsEnclosures', '*'); #------------------------------------------------------------------------------- switch (ValueOf($Enclosures)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #--------------------------------------------------------------------------- foreach ($Enclosures as $Enclosure) { #------------------------------------------------------------------------- if (@GzUnCompress($Enclosure['Document']) !== FALSE) { continue; } #------------------------------------------------------------------------- $IsUpdate = DB_Update('ContractsEnclosures', array('Document' => GzCompress($Enclosure['Document'])), array('ID' => $Enclosure['ID'])); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
} #------------------------------------------------------------------------- $TypeID = $ColumnsTypes[$ColumnID]['Type']; #------------------------------------------------------------------------- if (Preg_Match('/blob/', $TypeID)) { #----------------------------------------------------------------------- $Upload = Upload_Get($ColumnID); #----------------------------------------------------------------------- switch (ValueOf($Upload)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': $URow[$ColumnID] = GzCompress($Upload['Data']); break; default: return ERROR | @Trigger_Error(101); } #----------------------------------------------------------------------- } else { $URow[$ColumnID] = $Column; } } #--------------------------------------------------------------------------- $IsUpdate = DB_Update($TableID, $URow, array('ID' => $Row['ID'])); if (Is_Error($IsUpdate)) { #------------------------------------------------------------------------- $Link =& Link_Get('DB'); #-------------------------------------------------------------------------
#------------------------------------------------------------------------------- $NoTypesDB = TRUE; #------------------------------------------------------------------------------- $ClausesFiles = DB_Select('ClausesFiles', array('ID', 'FileData')); #------------------------------------------------------------------------------- switch (ValueOf($ClausesFiles)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': # No more... break; case 'array': #--------------------------------------------------------------------------- foreach ($ClausesFiles as $ClauseFile) { #------------------------------------------------------------------------- $FileData = $ClauseFile['FileData']; #------------------------------------------------------------------------- $FileData = GzCompress($FileData); #------------------------------------------------------------------------- $IsUpdate = DB_Update('ClausesFiles', array('FileData' => $FileData), array('ID' => $ClauseFile['ID'])); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } } break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------