Beispiel #1
0
function aCreateDocITO($date, $doc = 'odt')
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_meta.php';
    $objResponse = new xajaxResponse();
    if (!hasPermissions('sbr')) {
        return $objResponse;
    }
    $period = array(0 => date('Y-m-01', strtotime($date)), 1 => date('Y-m-t', strtotime($date)));
    $doc_ito = sbr_meta::generateDocITO($period, true, $doc);
    $date_create_id = 'date_create_' . date('Yn', strtotime($date));
    $file_name_id = 'file_name_' . date('Yn', strtotime($date));
    $link = WDCPREFIX . "/{$doc_ito->path}{$doc_ito->name}";
    $objResponse->assign($date_create_id, 'innerHTML', date('d.m.Y H:i'));
    $objResponse->script("\$('{$file_name_id}').setProperty('href', '{$link}')");
    return $objResponse;
}
Beispiel #2
0
$menu_item = 4;
$rpath = '../../';
$css_file = array('moderation.css', 'new-admin.css');
$js_file = array('zeroclipboard/ZeroClipboard.js', 'user_search.js', 'admin_log.js', 'banned.js');
$header = $rpath . 'header.php';
$inner_page = "index_inner.php";
$content = '../content22.php';
$footer = $rpath . 'footer.html';
$template = 'template2.php';
$cmd = __paramInit('string', 'cmd', 'cmd', '');
if ($cmd == 'generate') {
    $month = __paramInit('integer', 'month', 'month', 1);
    $year = __paramInit('integer', 'year', 'year', date('Y'));
    $period = array(0 => date('Y-m-01', mktime(0, 0, 0, $month, 1, $year)), 1 => date('Y-m-t', mktime(0, 0, 0, $month, 1, $year)));
    $doc = __paramInit('string', 'doc', 'doc', '');
    if (sbr_meta::generateDocITO($period, false, $doc)) {
        header_location_exit("/siteadmin/sbr_ito/");
    }
}
if ($cmd == 'upload') {
    $login = '******';
    $dir = "users/" . substr($login, 0, 2) . "/{$login}/upload/";
    $doc_id = intval($_POST['doc_id']);
    if (is_array($_FILES['attachedfiles_file']) && !$_FILES['attachedfiles_file']['error'] && $doc_id > 0) {
        $fname = $_FILES['attachedfiles_file']['name'];
        $ext = substr(strrchr($fname, "."), 1);
        if ($ext != 'odt' && $ext != 'xlsx') {
            ?>
            <script>
                alert('‘ормат загружаемого файла должен быть xlsx или odt');
                window.top.document.body.style.cursor = 'default';