Exemple #1
0
function get_io_id($id)
{
    if ($id > 0) {
        $rubrics = new collection();
        $rubrics->Load(TABLE_RUBRICATOR, false, $where);
        $rubrics = $rubrics->_collection;
        for ($i = 0; $i < count($rubrics); $i++) {
            if ($id == $rubrics[$i]->id) {
                if ($rubrics[$i]->id_io_object > 0) {
                    return $rubrics[$i]->id_io_object;
                } else {
                    if ($rubrics[$i]->id_parent > 0) {
                        return get_io_id($rubrics[$i]->id_parent);
                    } else {
                        return 0;
                    }
                }
            }
        }
        return 0;
    } else {
        return 0;
    }
}
Exemple #2
0
}
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();
    $db = db_class::get_instance();
    $query = 'SELECT id_io_object as id FROM ' . TABLE_IO_RUBRICATOR . ' WHERE id_rubric=' . $rubricator->id;
    $db->query($query);
    $id = '';
    for ($i = 0; $i < count($db->value); $i++) {
        $id = $db->value[$i]['id'];
        $where[] = " ID !=" . $id;
    }
    if ($rubricator->id_io_category > 0) {
        $where[] = 'id_io_category = ' . $rubricator->id_io_category . ' ';
    }
}
$contact_persons = new collection();
$contact_persons->Load(TABLE_OBJECTS, false, join(' AND ', $where), '"' . $sort . '" ' . $sort_dir);
$contact_persons = $contact_persons->_collection;
$additional_vars = ($letter != '' ? 'letter/' . urlencode($letter) . '/' : '') . ($pattern != '' ? 'letter/' . urlencode($pattern) . '/' : '') . 'callback/' . urlencode($_REQUEST['callback']);
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
Exemple #3
0
    if ($io_object->id > 0) {
        $query = 'SELECT * FROM ioinsertemptyrecord(' . $io_object->id . ',\'' . $io_object->table_name . '\');';
        $db->query($query);
        //echo $query;
        $set_empty = true;
    }
}
//echo "TYPE ATR: ".$type_attribute;
//types attributes
//id value description
//1 't' 'f' logical
//2 int4 element of list - use table_name and column_name - receive id
//3 int4 element of list - use table samesalfe
//4 date - ex 1999-01-08   YYYY-MM-DD
//5 timestamp - ex 1999-01-08 04:05:08
//6 float - ex 8.999
//7 dont do - infirm user!!!
//8 int4 - min int - max int
if ($save) {
    $db = db_class::get_instance();
    $db->begin();
    $query = 'UPDATE ' . $table_name . ' SET ' . $name . ' = \'' . $value . '\' WHERE id=' . $rec_id;
    $db->query($query);
    $db->commit();
}
$names = new collection();
$names->Load(TABLE_ATTRIBUTES, false, $where, 'name ASC');
$names = $names->_collection;
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';
Exemple #4
0
    $rubricator->id_search_template = $templ_id;
    if ($rubricator->id_parent === 0) {
        $rubricator->id_parent = null;
    }
    if ($rubricator->id_io_object === 0) {
        $rubricator->id_io_object = null;
    }
    if ($rubricator->id_io_category === 0) {
        $rubricator->id_io_category = null;
    }
    if ($rubricator->id_search_template === 0) {
        $rubricator->id_search_template = null;
    }
    $rubricator->name = $name;
    $rubricator->code = $code;
    $rubricator->description = $description;
    $errors = $rubricator->IsValidData();
    if (count($errors) == 0) {
        $rubricator->Save();
    }
} else {
    $categories = new collection();
    $categories->Load(TABLE_CATEGORIES, false, $where, 'name ASC');
    $categories = $categories->_collection;
    $templates = new collection();
    $templates->Load(TABLE_SEARCH_TEMPLATES, false, $where, 'name ASC');
    $templates = $templates->_collection;
}
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 = 'Выбор сотрудника';
include SITE_FILE_ROOT . 'template/simple_header.php';
$sort = 'name';
$sort_dir = 'asc';
$pattern = get_request_variable('pattern', '');
$letter = get_request_variable('letter', '');
$dept_id = get_request_variable('dept_id', '');
$_REQUEST['callback'] = get_request_variable('callback', '');
$where = array();
if ($pattern != '') {
    $where[] = '"name" LIKE \'%' . db_class::escape_like($pattern) . '%\'';
    $letter = '';
} elseif ($letter != '') {
    $where[] = '"name" LIKE \'' . db_class::escape_like($letter) . '%\'';
} elseif ($dept_id != '') {
    $where[] = '"department_id" = ' . $dept_id;
    $letter = '';
}
$where[] = '"active_flag"=\'yes\'';
$contact_persons = new collection();
$contact_persons->Load(TABLE_EMPLOYEE, false, join(' AND ', $where), '"' . $sort . '" ' . $sort_dir);
$contact_persons = $contact_persons->_collection;
$additional_vars = ($letter != '' ? 'letter/' . urlencode($letter) . '/' : '') . ($pattern != '' ? 'letter/' . urlencode($pattern) . '/' : '') . 'callback/' . urlencode($_REQUEST['callback']);
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
Exemple #6
0
<?php

include SITE_FILE_ROOT . 'template/header.php';
$enable_sort_fields = array('id_role', 'name');
$from = intval(get_request_variable('from', 0));
$sort = get_request_variable('sort', 'name');
$sort_dir = get_request_variable('sort_dir', 'asc');
if (array_search($sort, $enable_sort_fields) === false) {
    $sort = 'name';
}
if (array_search($sort_dir, $convert_sort_dirs) === false) {
    $sort_dir = 'asc';
}
$additional_vars = 'sort/' . urlencode($sort) . '/sort_dir/' . urlencode($sort_dir);
$roles = new collection();
$all_num = $roles->Load(TABLE_ROLE, true, '', '"' . $sort . '" ' . $sort_dir, $from, LIMIT_ROLES_ON_PAGE);
$page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_ROLES_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';
Exemple #7
0
    $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();
                $type_coll->Load(TABLE_CATEGORIES, false, 'id=' . $child, 'name ASC');
                for ($j = 0; $j < count($type_coll->_collection); $j++) {
                    echo '<item child="0" id="' . $type_coll->_collection[$j]->id . '" text="' . escape($type_coll->_collection[$j]->name) . '" >';
                    echo '</item>';
                }
            }
        }
        if ($id == 0) {
            echo '</item>';
        }
    }
    echo '</tree>' . "\n";
}
Exemple #8
0
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 io_objects WHERE date(insert_time) =  \'' . db_class::escape_like($pattern) . '\';';
} else {
    $query = 'SELECT COUNT(*) AS num  FROM io_objects;';
}
//echo $query;
$db->query($query);
$all_num = $db->value[0]['num'];
$coms = array();
if ($all_num > 0) {
    if ($pattern != '' && $pattern_flag == true) {
        $query = 'SELECT * FROM io_objects WHERE date(insert_time) = \'' . db_class::escape_like($pattern) . '\' ORDER BY "' . $sort . '" ' . $sort_dir . ' LIMIT ' . LIMIT_COMPANY_ON_PAGE . ';';
    } else {
        $query = 'SELECT * FROM io_objects ORDER BY "' . $sort . '" ' . $sort_dir . ' LIMIT ' . LIMIT_COMPANY_ON_PAGE . ' OFFSET ' . $from . ';';
    }
    $db->query($query);
    $coms = $db->value;
}
$cats = new collection();
$cats->Load(TABLE_CATEGORIES, false, $where, 'name ASC');
$cats = $cats->_collection;
$users = new collection();
$users->Load(TABLE_USERS, false, $where, 'fio ASC');
$users = $users->_collection;
$page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_COMPANY_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars);
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/view.php';
include SITE_FILE_ROOT . 'template/footer.php';
Exemple #9
0
    $where[] = 'employee_id IN (' . join(',', $arr) . ')';
}
$report_employees = array_flip($report_employees);
$arr = array_flip($arr);
if (count($where) > 0) {
    $query = 'SELECT COUNT(*) AS num FROM `' . TABLE_COMANDIROVKA . '`';
    $query .= ' WHERE ' . join(' AND ', $where);
} else {
    $query = 'SELECT COUNT(*) AS num FROM `' . TABLE_COMANDIROVKA . '`';
}
$db->query($query);
$all_num = $db->value[0]['num'];
$coms = array();
if ($all_num > 0) {
    if (count($where) > 0) {
        $query = 'SELECT * FROM `' . TABLE_COMANDIROVKA . '`';
        $query .= ' WHERE ' . join(' AND ', $where);
        $query .= ' ORDER BY ' . $sort . ' ' . $sort_dir;
        $query .= ' LIMIT ' . $from . ',' . LIMIT_COMPANY_ON_PAGE;
    } else {
        $query = 'SELECT * FROM `' . TABLE_COMANDIROVKA . '`  ORDER BY `' . $sort . '` ' . $sort_dir . ' LIMIT ' . $from . ',' . LIMIT_COMPANY_ON_PAGE;
    }
    $db->query($query);
    $coms = $db->value;
}
$page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_COMPANY_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars);
$all_employees = new collection();
$all_employees->Load(TABLE_EMPLOYEE, false, 'active_flag=\'yes\'');
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/footer.php';
Exemple #10
0
$_REQUEST['callback'] = get_request_variable('callback', '');
$department = new department();
$department->id_department = $id;
if ($id > 0) {
    if (!$department->Load()) {
        $department->id_department = 0;
    }
}
$department->parent_id = $parent_id;
if ($save) {
    $department->head_id = $head_id;
    if ($department->parent_id === 0) {
        $department->parent_id = null;
    }
    if ($department->head_id === 0) {
        $department->head_id = null;
    }
    $department->name = $name;
    $department->prefix = $prefix;
    $department->description = $description;
    $errors = $department->IsValidData();
    if (count($errors) == 0) {
        $department->Save();
    }
}
$employees = new collection();
$employees->Load(TABLE_EMPLOYEE, false, '', 'name ASC');
$employees = $employees->_collection;
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';
Exemple #11
0
    case 'folder':
        $type_collection = new collection();
        $type_collection->Load(TABLE_RUBRICATOR, false, $type_id > 0 ? 'id_parent=' . $type_id : 'id_parent IS NULL AND id_io_object IS NULL', 'name ASC');
        $rubricator = new rubricator();
        for ($i = 0; $i < count($type_collection->_collection); $i++) {
            $rubricator->id = $type_collection->_collection[$i]->id;
            $rubricator->Load();
            $childs = $rubricator->ObjectExists();
            if (!$childs) {
                $childs = $rubricator->ChildExists();
            }
            echo '<item child="' . ($childs ? 1 : 0) . '" id="folder-' . $rubricator->id . '" text="' . escape($type_collection->_collection[$i]->name) . '" im0="folderOpen.gif" im1="folderOpen.gif" im2="folderClosed.gif">';
            if ($rubricator->ObjectExists()) {
                if ($type_id > 0) {
                    $agr_collection = new collection();
                    $agr_collection->Load(TABLE_IO_RUBRICATOR, false, 'id_rubric=' . $rubricator->id, 'id_rubric ASC');
                    for ($k = 0; $k < count($agr_collection->_collection); $k++) {
                        $io_object = new io_objects();
                        $io_object->id = $agr_collection->_collection[$k]->id_io_object;
                        $io_object->Load();
                        echo '<item child="0" id="agreement-' . $agr_collection->_collection[$k]->id_io_object . '" text="' . escape($io_object->name) . '"  im0="../csh_books/leaf.gif"   ></item>';
                    }
                }
            }
            echo '</item>';
        }
        break;
    case 'agreement':
        break;
}
echo '</tree>' . "\n";
Exemple #12
0
<?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', '');
$where = array();
if ($pattern != '') {
    $where[] = '"name" LIKE \'%' . db_class::escape_like($pattern) . '%\'';
    $letter = '';
} else {
    if ($letter != '') {
        $where[] = '"name" LIKE \'' . db_class::escape_like($letter) . '%\'';
    }
}
$offices = new collection();
$offices->Load(TABLE_OFFICE, false, join(' AND ', $where), '"' . $sort . '" ' . $sort_dir);
$offices = $offices->_collection;
$additional_vars = ($letter != '' ? 'letter/' . urlencode($letter) . '/' : '') . ($pattern != '' ? 'letter/' . urlencode($pattern) . '/' : '') . 'callback/' . urlencode($_REQUEST['callback']);
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
Exemple #13
0
<?php

header("Content-type:text/xml");
$id = get_request_variable('id', 'root');
if ($id != 'root') {
    $id = intval($id);
}
$db = db_class::get_instance();
echo '<?xml version="1.0" ?>' . "\n";
if ($id === 'root') {
    $department = new department();
    $department->id_department = null;
    $childs = $department->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_DEPARMENT, false, $id > 0 ? 'parent_id=' . $id : 'parent_id IS NULL', 'name ASC');
    echo '<tree id="' . $id . '">' . "\n";
    for ($i = 0; $i < count($type_collection->_collection); $i++) {
        $childs = $type_collection->_collection[$i]->ChildExists();
        echo '<item child="' . ($childs ? 1 : 0) . '" id="' . $type_collection->_collection[$i]->id_department . '" text="' . escape($type_collection->_collection[$i]->name) . '" im0="folderOpen.gif" im1="folderOpen.gif" im2="folderClosed.gif">';
        echo '</item>';
    }
    echo '</tree>' . "\n";
}
Exemple #14
0
    $type_id = 0;
}
$type_id = intval($type_id);
$db = db_class::get_instance();
echo '<?xml version="1.0" ?>' . "\n";
echo '<tree id="' . $id . '">' . "\n";
switch ($type) {
    case 'root':
        $categories = new io_categories();
        $categories->id = null;
        $childs = true;
        echo '<item text="Категории и шаблоны:" id="folder-0" child="' . ($childs ? 1 : 0) . '"></item>';
        break;
    case 'folder':
        $type_collection = new collection();
        $type_collection->Load(TABLE_CATEGORIES, false, $type_id > 0 ? 'id=' . $type_id : 'is_main = TRUE', 'name ASC');
        $cat = new io_categories();
        for ($i = 0; $i < count($type_collection->_collection); $i++) {
            if ($type_id <= 0) {
                $cat->id = $type_collection->_collection[$i]->id;
            } else {
                $cat->id = $type_collection->_collection[$i]->id_child;
            }
            $cat->Load();
            $childs = $cat->ChildExists();
            if ($cat->id > 0) {
                echo '<item child="' . ($childs ? 1 : 0) . '" id="folder-' . $cat->id . '" text="' . escape($cat->name) . '" im0="folderOpen.gif" im1="folderOpen.gif" im2="folderClosed.gif">';
                echo '</item>';
            }
        }
        break;
Exemple #15
0
        $role_actions = array_flip($role_actions);
        $role_variables = $role->GetRoleVariablesId();
        $role_variables = array_flip($role_variables);
    }
}
// Получаем все типы дополнительных полей и сами поля
$variable = new variable();
$variable_modules = $variable->GetModules();
reset($variable_modules);
$variables = array();
while (list($variable_module, $variable_module_name) = each($variable_modules)) {
    $variable_modules[$variable_module] = array();
    $variable_modules[$variable_module]['name'] = $variable_module_name;
    $variable_modules[$variable_module]['vars'] = array();
    $variables = new collection();
    $variables->Load(TABLE_VARIABLE, false, '"module"=\'' . db_class::str2base($variable_module) . '\'', '"name" ASC');
    $variable_modules[$variable_module]['vars'] = $variables->_collection;
}
// Получаем все модули и все операции, связанные с ними
$modules = new collection();
$modules->Load(TABLE_MODULE, false, '', '"name" ASC');
$modules = $modules->_collection;
$module_actions = array();
for ($i = 0; $i < count($modules); $i++) {
    $module_action_collection = new collection();
    $module_action_collection->Load(TABLE_MODULE_ACTION, false, 'module_id=' . $modules[$i]->id_module . ' AND public_flag=\'yes\'', '"name" ASC');
    $module_actions[$modules[$i]->id_module] = $module_action_collection->_collection;
    unset($module_action_collection);
}
if ($save) {
    $role_actions = array();
Exemple #16
0
}
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', '');
if ($pattern != '') {
    $query = 'SELECT COUNT(*) AS num FROM iogetlog(' . $id . ') WHERE date(insert_time) \'' . db_class::escape_like($pattern) . '\';';
} else {
    $query = 'SELECT COUNT(*) AS num  FROM iogetlog(' . $id . ');';
}
$db->query($query);
$all_num = $db->value[0]['num'];
$coms = array();
if ($all_num > 0) {
    if ($pattern != '') {
        $query = 'SELECT * FROM iogetlog(' . $id . ') WHERE date(insert_time) = \'' . db_class::escape_like($pattern) . '\';';
    } else {
        $query = 'SELECT * FROM iogetlog(' . $id . ') ;';
    }
    $db->query($query);
    $coms = $db->value;
}
//TO DO - load operation type from bd
$cats = new collection();
$cats->Load(TABLE_CATEGORIES, false, $where, 'name ASC');
$cats = $cats->_collection;
$page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_COMPANY_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars);
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/logs.php';
include SITE_FILE_ROOT . 'template/footer.php';
Exemple #17
0
    }
}
for ($i = 0; $i < count($STORAGE['menu']); $i++) {
    if (strpos($STORAGE['menu'][$i]['path'], 'category') !== false) {
        $menulevel = $STORAGE['menu'][$i];
        break;
    }
}
$STORAGE['site_path'][] = array('name' => $menulevel['name'], 'path' => $menulevel['path']);
$menulevel = $menulevel['childs'][0];
$STORAGE['site_path'][] = array('name' => $menulevel['name'], 'path' => $menulevel['path']);
if ($save) {
    $menulevel = $menulevel['childs'][0];
    $STORAGE['site_path'][] = array('name' => $menulevel['name'], 'path' => $menulevel['path']);
    header('Location:' . SITE_HTTP_ROOT . $STORAGE['site_path'][count($STORAGE['site_path']) - 1]['path']);
} else {
    $cats = new collection();
    $cats->Load(TABLE_CATEGORIES, false, $where, 'name ASC');
    $cats = $cats->_collection;
    $childs = new collection();
    $childs->Load(TABLE_CATEGORIES, false, "is_main = FALSE", 'name ASC');
    $childs = $childs->_collection;
    $menulevel = $menulevel['childs'][0];
    $STORAGE['site_path'][] = array('name' => $menulevel['name'], 'path' => $menulevel['path']);
    $path_name = 'Редактировать';
    $STORAGE['site_path'][] = array('name' => $path_name, 'path' => $STORAGE['request_uri']);
    $page_title = $path_name;
    include SITE_FILE_ROOT . 'template/header.php';
    include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
    include SITE_FILE_ROOT . 'template/footer.php';
}
Exemple #18
0
        $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();
        $file_role->file_id = $file->id_file;
        while (list(, $role_id) = each($enabled_file_roles)) {
            $file_role->role_id = $role_id;
            $file_role->Save();
        }
        $db->commit();
    }
} else {
    $enabled_file_roles = $file->GetFileRoleIds();
}
$enabled_file_roles = array_flip($enabled_file_roles);
$roles = new collection();
$roles->Load(TABLE_ROLE, false, '', 'name ASC');
$roles = $roles->_collection;
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';
Exemple #19
0
<?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';
Exemple #20
0
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'];
$coms = array();
if ($all_num > 0) {
    if ($pattern != '' && $pattern_flag == true) {
        $query = 'SELECT * FROM jGetMsgsEx( \'' . db_class::escape_like($pattern) . '\', date(NOW()));';
    } else {
        $query = 'SELECT * FROM jGetMsgsEx( date(NOW())-7, date(NOW()))';
    }
    $db->query($query);
    $coms = $db->value;
}
$empl = new collection();
$empl->Load(TABLE_DLS, false, $where, 'name ASC');
$empl = $empl->_collection;
$cats = new collection();
$cats->Load(TABLE_OBJECTS, false, $where, 'name ASC');
$cats = $cats->_collection;
$page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_COMPANY_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars);
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/view.php';
include SITE_FILE_ROOT . 'template/footer.php';
Exemple #21
0
    }
} else {
    $enabled_employee_roles = $employee->GetEmployeeRolesId();
}
$department_name = '---';
if ($employee->department_id > 0) {
    $department = new department();
    $department->id_department = $employee->department_id;
    if ($department->Load()) {
        $department_name = $department->name;
    }
}
$enabled_employee_roles = array_flip($enabled_employee_roles);
$where = '';
//if ($employee->id_employee>0) $where = 'id_employee<>'.$employee->id_employee;
$employees = new collection();
$employees->Load(TABLE_EMPLOYEE, false, $where, 'name ASC');
$employees = $employees->_collection;
$where = '';
if (!check_current_employee_admin($STORAGE)) {
    $where = '"super_user"=\'no\'';
}
$roles = new collection();
$roles->Load(TABLE_ROLE, false, $where, 'name ASC');
$roles = $roles->_collection;
$offices = new collection();
$offices->Load(TABLE_OFFICE, false, '', 'name ASC');
$offices = $offices->_collection;
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';