Exemple #1
0
function smarty_function_table($params, $smarty)
{
    $tableName = $params['name'];
    if (!$tableName) {
        return "";
    }
    $DOM = new DOM();
    $Links =& Links();
    # Коллекция ссылок
    $Links['DOM'] =& $DOM;
    $comp = Comp_Load('Tables/Super', $tableName);
    if (Is_Error($comp)) {
        return ERROR | @Trigger_Error(500);
    }
    $DOM->Object = $comp;
    $Out = $DOM->Build();
    if (Is_Error($Out)) {
        return ERROR | @Trigger_Error(500);
    }
    return $Out;
}
Exemple #2
0
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('type' => 'button', 'onclick' => 'form.submit();', 'value' => 'Сформировать'));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table[] = $Comp;
#-------------------------------------------------------------------------------
$Table[] = new Tag('IFRAME', array('height' => 120, 'width' => '100%', 'name' => 'Statistics'), 'Загрузка...');
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Standard', $Table);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form = new Tag('FORM', array('target' => 'Statistics', 'method' => 'POST', 'onsubmit' => 'return false;'), $Comp);
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('type' => 'hidden', 'name' => 'IsCreate', 'value' => 'yes'));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form->AddChild($Comp);
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Form);
#-------------------------------------------------------------------------------
$Out = $DOM->Build();
#-------------------------------------------------------------------------------
return $Out;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Div->AddChild($Comp);
#-------------------------------------------------------------------------------
$Table[] = $Div;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Standard', $Table);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form = new Tag('FORM', array('name' => 'DSSchemeEditForm', 'onsubmit' => 'return false;'), $Comp);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => 'DSSchemeID', 'type' => 'hidden', 'value' => $DSSchemeID));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form->AddChild($Comp);
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Form);
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Build(FALSE))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok', 'DOM' => $DOM->Object);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
    $Table[] = $Div;
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('type' => 'button', 'onclick' => "if(PasswordCheck(this.form,'Password')) UserRegister();", 'value' => 'Регистрация'));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table[] = $Comp;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Standard', $Table);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form->AddChild($Comp);
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Form);
#-------------------------------------------------------------------------------
$Out = $DOM->Build(!XML_HTTP_REQUEST);
#-------------------------------------------------------------------------------
if (Is_Error($Out)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return XML_HTTP_REQUEST ? array('Status' => 'Ok', 'DOM' => $DOM->Object) : $Out;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
     #-----------------------------------------------------
     $DOM->AddText($LinkID, $Text ? $Text : '-', TRUE);
 }
 #-------------------------------------------------------
 if ($IsStamp) {
     #-----------------------------------------------------
     @($DOM->Links['Sign']->Childs = array());
     #-----------------------------------------------------
     $DOM->AddChild('Sign', new Tag('IMG', array('src' => 'SRC:{Images/dSign.bmp}')));
     #-----------------------------------------------------
     @($DOM->Links['Stamp']->Childs = array());
     #-----------------------------------------------------
     $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':
Exemple #6
0
                #-------------------------------------------------------------------------------
            #-------------------------------------------------------------------------------
            default:
                return ERROR | @Trigger_Error(101);
        }
        #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    default:
        return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Standard', $Table);
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Form->AddChild($Comp);
#-------------------------------------------------------------------------------
$DOM->AddChild('Into', $Form);
#-------------------------------------------------------------------------------
$Out = $DOM->Build(FALSE);
#-------------------------------------------------------------------------------
if (Is_Error($Out)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('Status' => 'Ok', 'DOM' => $DOM->Object);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
        foreach (Array_Keys($Send) as $ParamID) {
            #-------------------------------------------------------------------------------
            $Comp = Comp_Load('Form/Input', array('name' => $ParamID, 'type' => 'hidden', 'value' => $Send[$ParamID]));
            if (Is_Error($Comp)) {
                return ERROR | @Trigger_Error(500);
            }
            #-------------------------------------------------------------------------------
            $Form->AddChild($Comp);
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
        if ($IsRemote) {
            #-------------------------------------------------------------------------------
            $Out = $Document->Build();
            #-------------------------------------------------------------------------------
            if (Is_Error($Out)) {
                return ERROR | @Trigger_Error(500);
            }
            #-------------------------------------------------------------------------------
            return array('Status' => 'Ok', 'Document' => $Out, 'Cpp' => $PaymentSystem['Cpp'], 'Send' => $Send);
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
        $Div->AddChild($Form);
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------