Example #1
0
$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;
    $db->query($query);
    $id = '';
    for ($i = 0; $i < count($db->value); $i++) {
        $id = $db->value[$i]['id'];
Example #2
0
<?php

$page_title = 'Удаление объекта из рубрики';
$errors = array();
$id = intval(get_request_variable('id', 0));
$rubric_id = intval(get_request_variable('rubric_id', 0));
$_REQUEST['callback'] = get_request_variable('callback', '');
$io_rubricator = new io_rubricator();
$io_rubricator->id_io_object = $id;
$io_rubricator->id_rubric = $rubric_id;
if ($id > 0) {
    $io_rubricator->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';