当前位置: 首页>>代码示例>>PHP>>正文


PHP collection::Load方法代码示例

本文整理汇总了PHP中collection::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::Load方法的具体用法?PHP collection::Load怎么用?PHP collection::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在collection的用法示例。


在下文中一共展示了collection::Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_io_id

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;
    }
}
开发者ID:YuriyRusinov,项目名称:reper,代码行数:24,代码来源:edit.php

示例2: rubricator

}
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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:select-object.php

示例3: ioinsertemptyrecord

    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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:edit_tables.php

示例4: collection

    $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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:edit.php

示例5: array

<?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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:27,代码来源:select-employee.php

示例6: array

<?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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:19,代码来源:view.php

示例7: collection

    $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";
}
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:tree.php

示例8: COUNT

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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:view.php

示例9: IN

    $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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:report.php

示例10: department

$_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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:edit.php

示例11: collection

    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";
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:tree.php

示例12: array

<?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';
开发者ID:YuriyRusinov,项目名称:reper,代码行数:24,代码来源:select-office.php

示例13: intval

<?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";
}
开发者ID:YuriyRusinov,项目名称:reper,代码行数:27,代码来源:tree.php

示例14: intval

    $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;
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:tree.php

示例15: variable

        $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();
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:edit.php


注:本文中的collection::Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。