Esempio n. 1
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';
Esempio n. 2
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';
Esempio n. 3
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';
Esempio n. 4
0
$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();
    $db = db_class::get_instance();
    $query = 'SELECT id_io_object as id FROM ' . TABLE_IO_RUBRICATOR . ' WHERE id_rubric=' . $rubricator->id;
Esempio n. 5
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', '');
$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';
Esempio n. 6
0
$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(DISTINCT ID) as num from jGetOutCmds( ' . $cur_dls . ',\'' . db_class::escape_like($pattern) . '\', FALSE, FALSE, FALSE);';
} else {
    $query = 'SELECT count(DISTINCT ID) as num from jGetOutCmds(' . $cur_dls . ', NULL, FALSE, FALSE, FALSE);';
}
$db->query($query);
$all_num = $db->value[0]['num'];
$coms = array();
if ($all_num > 0) {
    if ($pattern != '' && $pattern_flag == true) {
        $query = 'SELECT DISTINCT * from jGetOutCmds(' . $cur_dls . ', \'' . db_class::escape_like($pattern) . '\', FALSE, FALSE, FALSE);';
    } else {
        $query = 'SELECT DISTINCT * from jGetOutCmds(' . $cur_dls . ', NULL, FALSE, FALSE, FALSE);';
    }
    $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);
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/view_out.php';
include SITE_FILE_ROOT . 'template/footer.php';
Esempio n. 7
0
    $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 jGetOutMsgs(' . $cur_dls . ',\'' . db_class::escape_like($pattern) . '\');';
} else {
    $query = 'select count(*) as num from jGetOutMsgs(' . $cur_dls . ', NULL);';
}
$db->query($query);
$all_num = $db->value[0]['num'];
$coms = array();
if ($all_num > 0) {
    if ($pattern != '' && $pattern_flag == true) {
        $query = 'SELECT * FROM jGetOutMsgs(' . $cur_dls . ', \'' . db_class::escape_like($pattern) . '\');';
    } else {
        $query = 'SELECT * FROM jGetOutMsgs( ' . $cur_dls . ', NULL )';
    }
    $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_out.php';