<?php $page_title = 'Выбор информационного объекта'; include SITE_FILE_ROOT . 'template/simple_header.php'; $sort = 'name'; $sort_dir = 'asc'; $pattern = get_request_variable('pattern', ''); $letter = get_request_variable('letter', ''); $_REQUEST['callback'] = get_request_variable('callback', ''); $_REQUEST['cat_id'] = get_request_variable('cat_id', ''); $io_id = get_request_variable('io_id', ''); $save = get_request_variable('save', ''); $where = array(); if ($pattern != '') { $where[] = '"name" LIKE \'%' . db_class::escape_like($pattern) . '%\''; $letter = ''; } elseif ($letter != '') { $where[] = '"name" LIKE \'' . db_class::escape_like($letter) . '%\' OR "name" LIKE \'' . db_class::escape_like(_strtoupper($letter)) . '%\' '; } if ($save) { if ($_REQUEST['io_id'] > 0 && $_REQUEST['cat_id'] > 0) { $io_rub = new io_rubricator(); $io_rub->id_rubric = $_REQUEST['cat_id']; $io_rub->id_io_object = $io_id; $io_rub->Save(); } } if ($_REQUEST['cat_id'] > 0) { $rubricator = new rubricator(); $rubricator->id = $_REQUEST['cat_id']; $rubricator->Load();
<?php $page_title = 'Перенос каталогов/файлов'; $source = preg_replace('/[\\/]{2,}/', '/', get_request_variable('source', '')); $source_win1251 = mb_convert_encoding($source, 'windows-1251', 'utf-8'); $destination = preg_replace('/[\\/]{2,}/', '/', get_request_variable('destination', '') . '/'); $destination_win1251 = mb_convert_encoding($destination, 'windows-1251', 'utf-8'); $errors = array(); if (file_exists(SITE_PROJECT_FILE_ROOT . $source_win1251)) { $file = new file(); if (is_file(SITE_PROJECT_FILE_ROOT . $source_win1251)) { if ($file->LoadByCrc(crc($source))) { $file->path = $destination; $file->Save(); } } else { $file->MoveSource($source, $destination); } smart_move($source_win1251, $destination_win1251, true); } include SITE_FILE_ROOT . 'template/simple_header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/simple_footer.php';
<?php $date = get_request_variable('date', ''); $id = get_request_variable('id', 0); $news_conf = new news_config(); $news_conf->id = 1; $news_conf->Load(); $am_news = $news_conf->am_news; //количество новостей $PreLengthC = $news_conf->PreLengthC; //размер предпросмотра - число символов. $tab_width = $news_conf->tab_width; //ширина таблицы с новостями $p_time = $news_conf->p_time; //показывать время новости $p_date = $news_conf->p_date; //показывать дату новости $img_height = $news_conf->img_height; //высота для миникартинки новости define('LIMIT_NEWS_ON_PAGE', $am_news); if ($id > 0) { $news = new news(); $news->news_id = $id; $news->Load(); include SITE_FILE_ROOT . 'template/header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '-id.php'; include SITE_FILE_ROOT . 'template/footer.php'; } else { if ($date) { $linedate = parse_date('{Y}-{m}-{d}', $date, true); } else {
<?php $id = intval(get_request_variable('id', 0)); include SITE_FILE_ROOT . 'template/header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/rubrics.php'; include SITE_FILE_ROOT . 'template/footer.php';
<?php $enable_sort_fields = array('name', 'stop_date', 'priority', 'responsible_name'); $from = get_request_variable('from', 0); $sort = get_request_variable('sort', null); $sort_dir = get_request_variable('sort_dir', null); if (is_null($sort)) { $sort = $default_sort; } if (is_null($sort_dir)) { $sort_dir = $default_sort_dir; } $ajax_request = get_request_variable('ajax-request', 0); if ($ajax_request) { $from = 0; $limit = 5; } $db = db_class::get_instance(); $query = 'SELECT ' . VIEW_TASK . '.*'; $query .= ' FROM ' . VIEW_TASK; if (isset($join) && is_array($join)) { $query .= ' ' . join(' ', $join); } if (is_array($where) && count($where) > 0) { $query .= ' WHERE ' . join(' AND ', $where); } $query_count = str_replace('SELECT ' . VIEW_TASK . '.*', 'SELECT COUNT(*) AS num', $query); $query_count = $db->query($query_count); $all_num = $db->value[0]['num']; if ($show_get_in_work_check) { if (isset($show_spent_hour) && $show_spent_hour) {
<?php $page_title = 'Редактирование рубрики'; $id = intval(get_request_variable('id', '')); $parent_id = intval(get_request_variable('parent_id', 0)); $io_id = intval(get_request_variable('io_id', 0)); $kio = get_request_variable('kio', ''); $code = get_request_variable('code', ''); $description = get_request_variable('description', ''); $name = get_request_variable('name', ''); $save = get_request_variable('save', ''); $_REQUEST['callback'] = get_request_variable('callback', ''); $cat_id = intval(get_request_variable('cat_id', 0)); $templ_id = intval(get_request_variable('templ_id', 0)); $rubricator = new rubricator(); $rubricator->id = $id; if ($id > 0) { if (!$rubricator->Load()) { $rubricator->id = 0; } } /*$io_rubric = new collection(); if($rubricator->id > 0) { $io_rubric->Load(TABLE_IO_RUBRICATOR, false, 'id_rubric = '.$rubricator->id); $io_rubric = $io_rubric->_collection; //add new io object to rubrics if($io_id > 0) { $io_rub = new io_rubricator();
<?php $page_title = 'Удаление каталогов/файлов'; $source = preg_replace('/[\\/]{2,}/', '/', get_request_variable('source', '')); $source_win1251 = mb_convert_encoding($source, 'windows-1251', 'utf-8'); $source_win1251 = SITE_PROJECT_FILE_ROOT . $source_win1251; $source_win1251 = str_replace('..', '', $source_win1251); $errors = array(); if (file_exists($source_win1251)) { if (is_dir($source_win1251)) { rmdir($source_win1251); } else { unlink($source_win1251); $file = new file(); if ($file->LoadByCrc(crc($source))) { $file->Delete(); } } } include SITE_FILE_ROOT . 'template/simple_header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/simple_footer.php';
<?php $enable_sort_fields = array('id', 'date'); $from = intval(get_request_variable('from', 0)); $sort = get_request_variable('sort', 'date'); $cur_dls = $_SESSION['PST']; $sort_dir = get_request_variable('sort_dir', 'asc'); if (array_search($sort, $enable_sort_fields) === false) { $sort = 'date'; } if (array_search($sort_dir, $convert_sort_dirs) === false) { $sort_dir = 'asc'; } $additional_vars = 'sort/' . urlencode($sort) . '/sort_dir/' . urlencode($sort_dir); $pattern = get_request_variable('pattern', ''); $pattern_flag = true; //ГГГГ-ММ-ДД if (empty($pattern_flag)) { $pattern_flag = false; } if (!ereg("[0-9]{4}-[0-9]{2}-[0-9]{2}", $pattern)) { $pattern_flag = false; } if ($pattern != '' && $pattern_flag == true) { $query = 'select count(*) as num from jGetMsgsEx(date(NOW()) -7, date(NOW()));'; } else { $query = 'select count(*) as num from jGetMsgsEx(date(NOW()) - 7, date(NOW()));'; } //echo $query; $db->query($query); $all_num = $db->value[0]['num'];
<?php $page_title = 'Удаление события'; $errors = array(); $id = intval(get_request_variable('id', 0)); $_REQUEST['callback'] = get_request_variable('callback', ''); $date = get_request_variable('date', 0); $event = new calendar_event(); $event->id_event = $id; if ($id > 0) { $event->Delete(); } header('Location:' . SITE_HTTP_ROOT . $STORAGE['module'] . '/' . $_REQUEST['callback'] . '/date/' . $date . '/');
<?php $ajax_request = intval(get_request_variable('ajax-request', 0)) === 1 ? true : false; $include_header_footer = !$ajax_request; $enable_sort_fields = array('id_employee', 'active_flag', 'photo_flag', 'name', 'department', 'post', 'email', 'office_phone', 'room'); $from = intval(get_request_variable('from', 0)); $sort = get_request_variable('sort', 'department'); $sort_dir = get_request_variable('sort_dir', 'asc'); $department_id = get_request_variable('department', 0); $parent = $department_id != 0; if (array_search($sort, $enable_sort_fields) === false) { $sort = 'department'; } if (array_search($sort_dir, $convert_sort_dirs) === false) { $sort_dir = 'asc'; } $additional_vars = 'department/' . $department_id . '/sort/' . urlencode($sort) . '/sort_dir/' . urlencode($sort_dir) . '/'; if ($parent) { $query = 'SELECT COUNT(*) AS num FROM ' . VIEW_EMPLOYEE . ' WHERE department_id=' . $department_id; } else { $query = 'SELECT COUNT(*) AS num FROM ' . VIEW_EMPLOYEE; } $db->query($query); $all_num = $db->value[0]['num']; $employees = array(); if ($sort != 'department' && $all_num > 0) { if ($parent) { $query = 'SELECT * FROM "' . VIEW_EMPLOYEE . '" WHERE department_id=' . $department_id . ' ORDER BY "' . $sort . '" ' . $sort_dir . ' LIMIT ' . $from . ',' . LIMIT_EMPLOYEE_ON_PAGE; } else { $query = 'SELECT * FROM "' . VIEW_EMPLOYEE . '" ORDER BY "' . $sort . '" ' . $sort_dir . ' LIMIT ' . $from . ',' . LIMIT_EMPLOYEE_ON_PAGE; }
<?php $page_title = 'Добавление директории'; $destination = get_request_variable('destination', ''); $name = get_request_variable('dir', ''); $destination_win1251 = mb_convert_encoding($destination, 'windows-1251', 'utf-8'); $destination_win1251 = $destination_win1251; $destination_win1251 = str_replace('..', '', $destination_win1251); $name_win1251 = mb_convert_encoding($name, 'windows-1251', 'utf-8'); $name_win1251 = $name_win1251; $name_win1251 = str_replace('..', '', $name_win1251); $source_win1251 = SITE_PROJECT_FILE_ROOT . $destination_win1251 . '/' . $name_win1251; $errors = array(); if (!file_exists($source_win1251)) { mkdir($source_win1251); } include SITE_FILE_ROOT . 'template/simple_header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/simple_footer.php';
<?php $include_header_footer = intval(get_request_variable('ajax-request', 0)) === 1 ? false : true; $item_id = intval(get_request_variable('id', 0)); $type = get_request_variable('type', ''); $db = db_class::get_instance(); $legend_title = 'Файлы'; $enable = false; if ($item_id > 0 && $type == 'project') { $legend_title = 'Файлы проекта'; $project = new project(); $project->id_project = $item_id; if ($project->Load() && $project->CheckActionEnable($STORAGE, 'file')) { $enable = true; } $obj2attach =& $project; } if ($item_id > 0 && $type == 'stage') { $legend_title = 'Файлы этапа'; $stage = new stage(); $stage->id_stage = $item_id; if ($stage->Load() && $stage->CheckActionEnable($STORAGE, 'file')) { $enable = true; } $obj2attach =& $stage; } if ($item_id > 0 && $type == 'task') { $legend_title = 'Файлы задачи'; $task = new task(); $task->id_task = $item_id; if ($task->Load() && $task->CheckActionEnable($STORAGE, 'file')) {
<?php $save = get_request_variable('save', 0); $news_conf = new news_config(); $news_conf->id = 1; $news_conf->Load(); if ($save) { $am_news = intval(get_request_variable('am_news', 10)); $PreLengthC = intval(get_request_variable('PreLengthC', 100)); $tab_width = get_request_variable('tab_width', '100%'); $p_time = intval(get_request_variable('p_time', 1)); $p_date = intval(get_request_variable('p_date', 1)); $img_height = intval(get_request_variable('img_height', 20)); $news_conf->am_news = $am_news; $news_conf->PreLengthC = $PreLengthC; $news_conf->tab_width = $tab_width; $news_conf->p_time = $p_time; $news_conf->p_date = $p_date; $news_conf->img_height = $img_height; $errors = $news_conf->IsValidData(); if (count($errors) == 0) { $db->begin(); $news_conf->Save(); $db->commit(); } } include SITE_FILE_ROOT . 'template/header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/footer.php';
<?php $page_title = 'Установка прав доступа'; $destination = get_request_variable('destination', ''); $destination = preg_replace('/[\\/]{2,}/', '/', $destination); $enabled_file_roles = get_request_variable('enabled_file_roles', array()); $save = get_request_variable('save', ''); $_REQUEST['callback'] = get_request_variable('callback', ''); $destination_win1251 = mb_convert_encoding($destination, 'windows-1251', 'utf-8'); $destination_win1251 = SITE_PROJECT_FILE_ROOT . str_replace('..', '', $destination_win1251); $file = new file(); if (!$file->LoadByCrc(crc($destination))) { if (file_exists($destination_win1251) && is_file($destination_win1251)) { $file->name = basename($destination); $file->path = dirname($destination); $file->Save(); } else { $errors[] = 'Файл не найден'; } } $errors = array(); if ($save) { if (!$enabled_file_roles) { $errors[] = 'Укажите доступные роли'; } if (!$errors) { $db = db_class::get_instance(); $db->begin(); $file->DeleteFileRoles(); reset($enabled_file_roles); $file_role = new file_role();
<?php include SITE_FILE_ROOT . 'template/header.php'; $enable_sort_fields = array('id_variable', 'order', 'name', 'show_name', 'module'); $from = intval(get_request_variable('from', 0)); $sort = get_request_variable('sort', 'show_name'); $sort_dir = get_request_variable('sort_dir', 'asc'); if (array_search($sort, $enable_sort_fields) === false) { $sort = 'show_name'; } if (array_search($sort_dir, $convert_sort_dirs) === false) { $sort_dir = 'asc'; } $additional_vars = 'sort/' . urlencode($sort) . '/sort_dir/' . urlencode($sort_dir); $variables = new collection(); $all_num = $variables->Load(TABLE_VARIABLE, true, '', '"' . $sort . '" ' . $sort_dir, $from, LIMIT_VARIABLES_ON_PAGE); $page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_VARIABLES_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars); include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/footer.php';
<?php header("Content-type:text/xml"); $id = get_request_variable('id', 'root'); if ($id != 'root') { $id = intval($id); } $db = db_class::get_instance(); if ($id === 0) { echo '<?xml version="1.0" ?>' . "\n"; } if ($id === 'root') { $categories = new io_categories(); $categories->id = null; $childs = $categories->ChildExists(); echo '<tree id="root">' . "\n"; echo '<item text="ККС СИТО" id="0" child="' . ($childs ? 1 : 0) . '"></item>'; echo '</tree>' . "\n"; } else { $type_collection = new collection(); $type_collection->Load(TABLE_CATEGORIES, false, $id > 0 ? 'id=' . $id . ' AND is_main=TRUE' : 'is_main=TRUE', ' name ASC'); echo '<tree id="' . $id . '">' . "\n"; for ($i = 0; $i < count($type_collection->_collection); $i++) { $childs = $type_collection->_collection[$i]->ChildExists(); if ($id == 0) { echo '<item child="' . ($childs ? 1 : 0) . '" id="' . $type_collection->_collection[$i]->id . '" text="' . escape($type_collection->_collection[$i]->name) . '" im0="folderOpen.gif" im1="folderOpen.gif" im2="folderClosed.gif">'; } if ($childs == true) { $child = $type_collection->_collection[$i]->id_child; if ($child > 0 && $id > 0) { $type_coll = new collection();
<?php $date = get_request_variable('date', date('Y-m-d')); $stop_day = strtotime('this Sunday', strtotime($date)); $stop_date = date('Y-m-d', $stop_day); $start_day = strtotime('last Monday', $stop_day); $start_date = date('Y-m-d', $start_day); $calendar = new calendar(); $calendar->loadDefault($STORAGE['current_employee']->login); $ids = calendar::getIdsForEmployee($STORAGE['current_employee']->login); $ids = join(',', $ids); $where = array(); $where[] = '"calendar_id" in (' . $ids . ')'; $where[] = '"start_date"<=\'' . $stop_date . '\' AND "stop_date">=\'' . $start_date . '\''; $where[] = '"start_date" <> "stop_date"'; $query = 'SELECT * FROM ' . TABLE_CALENDAR_EVENT . ' WHERE ' . join(' AND ', $where) . ' ORDER BY start_date,start_time,id_event '; $db->query($query); $week_events = $db->value; $where = array(); $where[] = '"calendar_id" in (' . $ids . ')'; $where[] = '"start_date"="stop_date"'; $where[] = '"start_date"<=\'' . $stop_date . '\' AND "stop_date">=\'' . $start_date . '\''; $query = 'SELECT * FROM ' . TABLE_CALENDAR_EVENT . ' WHERE ' . join(' AND ', $where) . ' ORDER BY start_date,start_time,id_event '; $db->query($query); $time_events = $db->value; include SITE_FILE_ROOT . 'template/header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/footer.php';
$event->completed = get_request_variable('completed', 'no'); $event->notice = get_request_variable('notice', 'no'); $event->mark = get_request_variable('mark', 'no'); $event->start_date = parse_date('{Y}-{m}-{d}', $start_date, false); if (!trim($stop_date)) { $stop_date = $start_date; } $event->stop_date = parse_date('{Y}-{m}-{d}', $stop_date, false); $wholeday = get_request_variable('wholeday', ''); if ($wholeday) { $event->start_time = null; $event->stop_time = null; } else { $start_time = get_request_variable('start_time', date('H:i')); $event->start_time = parse_time('{H}:{i}', $start_time); $stop_time = get_request_variable('stop_time', date('H:i')); $event->stop_time = parse_time('{H}:{i}', $stop_time); } $errors = $event->IsValidData(); if (count($errors) == 0) { $event->start_date = parse_date('{Y}-{m}-{d}', $start_date, true); $event->stop_date = parse_date('{Y}-{m}-{d}', $stop_date, true); $db->begin(); $event->Save(); $db->commit(); } } if ($event->id_event == 0) { $event->start_date = $start_date; $event->stop_date = $stop_date; }
$save = get_request_variable('save', ''); $_REQUEST['callback'] = get_request_variable('callback', ''); $rows_conf = new rows_conf(); $rows_conf->id_employee = $STORAGE['current_employee']->id_employee; $rows_conf->table_name = 'employee'; $rows_conf->Load(); if ($save) { $id = get_request_variable('id', 'no'); $active_flag = get_request_variable('active_flag', 'no'); $photo = get_request_variable('photo', 'no'); $name = get_request_variable('name', 'no'); $department = get_request_variable('department', 'no'); $post = get_request_variable('post', 'no'); $email = get_request_variable('email', 'no'); $office_phone = get_request_variable('office_phone', 'no'); $room = get_request_variable('room', 'no'); $columns = ''; if ($id == 'no') { $columns = $columns . 'id'; $columns = $columns . ','; } if ($active_flag == 'no') { $columns = $columns . 'active_flag'; $columns = $columns . ','; } if ($photo == 'no') { $columns = $columns . 'photo'; $columns = $columns . ','; } if (false) { $columns = $columns . 'name';