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


PHP get_request_variable函数代码示例

本文整理汇总了PHP中get_request_variable函数的典型用法代码示例。如果您正苦于以下问题:PHP get_request_variable函数的具体用法?PHP get_request_variable怎么用?PHP get_request_variable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_request_variable

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

示例2: preg_replace

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

示例3: get_request_variable

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

示例4: intval

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

示例5: array

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

示例6: intval

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

示例7: preg_replace

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

示例8: array

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

示例9: array

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

示例10: intval

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

示例11: get_request_variable

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

示例12: intval

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

示例13: get_request_variable

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

示例14: get_request_variable

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

示例15: header

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


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