Ejemplo n.º 1
0
         $DOM->AddChild('Into', isset($Comp['DOM']) ? $Comp['DOM'] : new Tag('P', 'Статистика недоступна.'));
     }
 }
 #-----------------------------------------------------------------------------
 if (!Count($DOM->Links['Into']->Childs)) {
     return '<P style="color:#990000;">Статистика не сформирована</P>';
 }
 #-----------------------------------------------------------------------------
 $IsWrite = IO_Write(SPrintF('%s/index.html', $Folder), $DOM->Build(), TRUE);
 if (Is_Error($IsWrite)) {
     return ERROR | @Trigger_Error(500);
 }
 #-----------------------------------------------------------------------------
 echo '<P style="color:#6F9006;">Статистика сформирована</P>';
 #-----------------------------------------------------------------------------
 $PDF = HTMLDoc_CreatePDF('Statistics', $DOM, $Folder);
 #-----------------------------------------------------------------------------
 switch (ValueOf($PDF)) {
     case 'error':
         # No more...
     # No more...
     case 'exception':
         echo '<P style="color:#990000;">Ошибка формирования PDF</P>';
         break;
     case 'string':
         #-------------------------------------------------------------------------
         $IsWrite = IO_Write(SPrintF('%s/Statistics.pdf', $Folder), $PDF, TRUE);
         if (Is_Error($IsWrite)) {
             return ERROR | @Trigger_Error(500);
         }
         #-------------------------------------------------------------------------
Ejemplo n.º 2
0
     #-------------------------------------------------------------------------------
     $File = SPrintF('VerifyReport%s.csv', Md5($_SERVER['REMOTE_ADDR']));
     #-------------------------------------------------------------------------------
     $IsWrite = IO_Write(SPrintF('%s/files/%s', $Tmp, $File), $CSV, TRUE);
     if (Is_Error($IsWrite)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     return array('Status' => 'Ok', 'Location' => SPrintF('/GetTemp?File=%s&Name=VerifyReport%s.csv&Mime=application/csv', $File, $Number));
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'PDF':
     #-------------------------------------------------------------------------------
     $DOM->Delete('Rubbish');
     #-------------------------------------------------------------------------------
     $PDF = HTMLDoc_CreatePDF('VerifyReport', $DOM);
     #-------------------------------------------------------------------------------
     switch (ValueOf($PDF)) {
         case 'error':
             return ERROR | @Trigger_Error(500);
         case 'exception':
             return ERROR | @Trigger_Error(400);
         case 'string':
             break;
         default:
             return ERROR | @Trigger_Error(101);
     }
     #-------------------------------------------------------------------------------
     $Tmp = System_Element('tmp');
     if (Is_Error($Tmp)) {
         return ERROR | @Trigger_Error(500);
     $DOM->AddChild('Stamp', new Tag('IMG', array('src' => 'SRC:{Images/Stamp.bmp}')));
 }
 #-------------------------------------------------------
 $Document = $DOM->Build();
 if (Is_Error($Document)) {
     return ERROR | @Trigger_Error(500);
 }
 #-------------------------------------------------------
 foreach (Array_Keys($Replace) as $LinkID) {
     #-----------------------------------------------------
     $Text = (string) $Replace[$LinkID];
     #-----------------------------------------------------
     $Document = Str_Replace(SPrintF('%%%s%%', $LinkID), $Text ? $Text : '-', $Document);
 }
 #-------------------------------------------------------
 $PDF = HTMLDoc_CreatePDF('WorksCompliteReport', $Document);
 #-------------------------------------------------------
 switch (ValueOf($PDF)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'string':
         #---------------------------------------------------
         $Comp = Comp_Load('Formats/WorkComplite/Report/Number', $ContractID, $Month);
         if (Is_Error($Comp)) {
             return ERROR | @Trigger_Error(500);
         }
         #---------------------------------------------------
         $Tmp = System_Element('tmp');
         if (Is_Error($Tmp)) {
Ejemplo n.º 4
0
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# генерим PDF
$File = GetUploadedFile('Contracts', $Contract['ID']);
$PDF = HTMLDoc_CreatePDF('Contract', $File['Data']);
#-------------------------------------------------------------------------------
switch (ValueOf($PDF)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'string':
        #-------------------------------------------------------------------------------
        $Comp = Comp_Load('Formats/Contract/Number', $Contract['ID']);
        if (Is_Error($Comp)) {
            return ERROR | @Trigger_Error(500);
        }
        #-------------------------------------------------------------------------------
        $Tmp = System_Element('tmp');
        if (Is_Error($Tmp)) {
Ejemplo n.º 5
0
 $Out = $DOM->Build();
 #-----------------------------------------------------------------------
 if (Is_Error($Out)) {
     return ERROR | @Trigger_Error(500);
 }
 #-----------------------------------------------------------------------
 $Replace = Array_ToLine($Replace);
 #-----------------------------------------------------------------------
 foreach (Array_Keys($Replace) as $LinkID) {
     #---------------------------------------------------------------------
     $Text = (string) $Replace[$LinkID];
     #---------------------------------------------------------------------
     $Out = Str_Replace(SPrintF('%%%s%%', $LinkID), $Text ? $Text : '-', $Out);
 }
 #-----------------------------------------------------------------------
 $PDF = HTMLDoc_CreatePDF('Envelope', $Out);
 #-----------------------------------------------------------------------
 switch (ValueOf($PDF)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'string':
         #-------------------------------------------------------------------
         UnLink($Image);
         #-------------------------------------------------------------------
         $Tmp = System_Element('tmp');
         if (Is_Error($Tmp)) {
             return ERROR | @Trigger_Error(500);
         }
         #-------------------------------------------------------------------
Ejemplo n.º 6
0
 $DOM->AddChild('Logo', new Tag('IMG', array('src' => 'SRC:{Images/Logo.bmp}')));
 #-----------------------------------------------------------------------
 if ($IsStamp) {
     #---------------------------------------------------------------------
     $DOM->AddChild('dSign', new Tag('IMG', array('src' => 'SRC:{Images/dSign.bmp}')));
     $DOM->AddChild('aSign', new Tag('IMG', array('src' => 'SRC:{Images/aSign.bmp}')));
     $DOM->AddChild('Stamp', new Tag('IMG', array('src' => 'SRC:{Images/Stamp.bmp}')));
 }
 #-----------------------------------------------------------------------
 $Out = $DOM->Build();
 if (Is_Error($Out)) {
     return ERROR | @Trigger_Error(500);
 }
 #-----------------------------------------------------------------------
 #Debug(print_r($Out,true));
 $File = HTMLDoc_CreatePDF('Invoice', $Out);
 #-----------------------------------------------------------------------
 switch (ValueOf($File)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'string':
         #-------------------------------------------------------------------
         if ($IsTIFF) {
             #-----------------------------------------------------------------
             $Tmp = System_Element('tmp');
             if (Is_Error($Tmp)) {
                 return ERROR | @Trigger_Error(500);
             }
             #-----------------------------------------------------------------
Ejemplo n.º 7
0
if (Is_Error($DOM->Load('Standard'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$DOM->AddText('Title', $Title = $Comp['Title']);
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Comp['DOM']);
#-------------------------------------------------------------------------------
$DOM->Delete('ClauseTrash');
#-------------------------------------------------------------------------------
$Out = $DOM->Build();
if (Is_Error($Out)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$PDF = HTMLDoc_CreatePDF('Clause', $Out);
#-------------------------------------------------------------------------------
switch (ValueOf($PDF)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'string':
        #---------------------------------------------------------------------------
        $Tmp = System_Element('tmp');
        if (Is_Error($Tmp)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------
        $File = SPrintF('Clause%s.pdf', Md5($_SERVER['REMOTE_ADDR']));
        #---------------------------------------------------------------------------
switch (ValueOf($Permission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$File = GetUploadedFile('ContractsEnclosures', $ContractEnclosureID);
$PDF = HTMLDoc_CreatePDF('ContractEnclosure', $File['Data']);
#-------------------------------------------------------------------------------
switch (ValueOf($PDF)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'string':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Formats/Contract/Number', $ContractEnclosure['ContractID']);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);