Example #1
0
function Upload_Get($Name, $Hash = FALSE)
{
    /****************************************************************************/
    #$__args_types = Array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Args = Args();
    #-----------------------------------------------------------------------------
    $Hash = isset($Args[$Name]) ? $Args[$Name] : $Hash;
    #-----------------------------------------------------------------------------
    if (!$Hash) {
        return new gException('HASH_IS_EMPTY', 'Хешь файла загрузки пуст');
    }
    #-----------------------------------------------------------------------------
    $Tmp = System_Element('tmp');
    if (Is_Error($Tmp)) {
        return ERROR | @Trigger_Error('[Upload_Get]: не удалось получить путь до временной директории');
    }
    #-----------------------------------------------------------------------------
    $Uploads = SPrintF('%s/uploads', $Tmp);
    #-----------------------------------------------------------------------------
    if (!File_Exists($Uploads)) {
        return new gException('HASH_IS_EMPTY', 'Директория файлов загрузки не создана');
    }
    #-----------------------------------------------------------------------------
    $Path = SPrintF('%s/%s', $Uploads, $Hash);
    #-----------------------------------------------------------------------------
    if (!File_Exists($Path)) {
        return new gException('FILE_NOT_FOUND', 'Файл не найден на сервере');
    }
    #-----------------------------------------------------------------------------
    $Data = IO_Read($Path);
    if (Is_Error($Data)) {
        return ERROR | @Trigger_Error('[Upload_Get]: не удалось прочитать файл');
    }
    #-----------------------------------------------------------------------------
    $Names = IO_Read(SPrintF('%s/names.txt', $Uploads));
    if (Is_Error($Names)) {
        return ERROR | @Trigger_Error('[Upload_Get]: не удалось прочитать файл имен');
    }
    #-----------------------------------------------------------------------------
    $Names = JSON_Decode($Names, TRUE);
    #-----------------------------------------------------------------------------
    $Name = isset($Names[$Hash]) ? $Names[$Hash] : 'Default';
    #-----------------------------------------------------------------------------
    return array('Name' => $Name, 'Data' => $Data);
}
Example #2
0
<?php

#-------------------------------------------------------------------------------
/** @author Бреславский А.В.-Лапшин С.М. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Args = Args();
#-------------------------------------------------------------------------------
$IsCreate = (bool) @$Args['IsCreate'];
$StartDate = (int) @$Args['StartDate'];
$FinishDate = (int) @$Args['FinishDate'];
$StatisticsIDs = (array) @$Args['StatisticsIDs'];
$Details = (array) @$Args['Details'];
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('modules/Authorisation.mod', 'classes/DOM.class.php', 'libs/HTMLDoc.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
# Формирование отчетов
#-------------------------------------------------------------------------------
if ($IsCreate) {
    #-----------------------------------------------------------------------------
    $DOM = new DOM();
    #-----------------------------------------------------------------------------
    $Links =& Links();
    #-----------------------------------------------------------------------------
    $Links['DOM'] =& $DOM;
    #-----------------------------------------------------------------------------
Example #3
0
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('LinkID', 'ColumnID');
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Links =& Links();
# Коллекция ссылок
$Template =& $Links[$LinkID];
/******************************************************************************/
/******************************************************************************/
$Args =& Args();
#-------------------------------------------------------------------------------
$Date1 = (int) @$Args[SPrintF('%s1', $ColumnID)];
#-------------------------------------------------------------------------------
if (!$Date1) {
    $Date1 = MkTime(0, 0, 0, 1, 1, 2006);
}
#-------------------------------------------------------------------------------
$Where = SPrintF('%u < `%s`', MkTime(0, 0, 0, Date('n', $Date1), Date('j', $Date1), Date('Y', $Date1)), $ColumnID);
#-------------------------------------------------------------------------------
$Template['Source']['Adding']['Where'][] = $Where;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Date2 = (int) @$Args[SPrintF('%s2', $ColumnID)];
#-------------------------------------------------------------------------------
if ($Date2) {
Example #4
0
<?php

#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Args = isset($Args) ? $Args : Args();
#-------------------------------------------------------------------------------
$Eval = (string) @$Args['Eval'];
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('classes/DOM.class.php', 'libs/Server.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (isset($GLOBALS['__USER'])) {
    #-------------------------------------------------------------------------------
    $__USER = $GLOBALS['__USER'];
    #-------------------------------------------------------------------------------
    if (!SetCookie('OwnerID', $__USER['ID'])) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $_COOKIE['OwnerID'] = $__USER['ID'];
    #-------------------------------------------------------------------------------
    if (!SetCookie('IsManaged', 'yes')) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------