<?php $page_title = 'Редактирование атрибута'; $id = intval(get_request_variable('id', 0)); $rec_id = intval(get_request_variable('rec_id', 0)); $name = get_request_variable('name', ''); $save = get_request_variable('save', 0); $value = get_request_variable('value', ''); $set_empty = false; $_REQUEST['callback'] = get_request_variable('callback', ''); $io_object = new io_objects(); $io_object->id = $id; if ($id > 0) { if (!$io_object->Load()) { return; } } //echo "tst"; if ($rec_id > 0) { $table_name = $io_object->table_name; $column_name = $name; $query = 'SELECT ' . $name . ' AS value FROM ' . $table_name . ' WHERE id=' . $rec_id; //echo $query; $db->query($query); $val = $db->value[0]['value']; } else { if ($io_object->id > 0) { $query = 'SELECT * FROM ioinsertemptyrecord(' . $io_object->id . ',\'' . $io_object->table_name . '\');'; $db->query($query); //echo $query; $set_empty = true;
$table_name = get_request_variable('table_name', ''); $name = get_request_variable('name', ''); $information = get_request_variable('information', ''); $cat_id = intval(get_request_variable('cat_id', 0)); $jr_id = intval(get_request_variable('jr_id', 0)); $mac_id = intval(get_request_variable('mac_id', 0)); $date = get_request_variable('date', ''); $aut_id = intval(get_request_variable('aut_id', 0)); $is_system = get_request_variable('is_system', false); $date = parse_date('{Y}-{m}-{d}', $date, false); $description = get_request_variable('description', ''); $state_id = intval(get_request_variable('state_id', 0)); $save = get_request_variable('save', ''); $_REQUEST['callback'] = get_request_variable('callback', ''); $db = db_class::get_instance(); $io_object = new io_objects(); $io_object->id = $id; if ($cat_id > 0) { $io_object->id_io_category = $cat_id; } if ($id > 0) { if (!$io_object->Load()) { $io_object->id = 0; } } if ($save) { $io_object->id_io_category = $cat_id; $io_object->id_io_state = $state_id; $io_object->name = $name; if ($id > 0) { //echo "author ".$io_object->id_maclabel."<br>";
<?php $page_title = 'Удаление информационного объекта'; $errors = array(); $id = intval(get_request_variable('id', 0)); $_REQUEST['callback'] = get_request_variable('callback', ''); $io_object = new io_objects(); $io_object->id = $id; if ($id > 0) { if ($io_object->Load()) { $errors = $io_object->IsValidData(); if (!$errors) { $io_object->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';
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";
echo '<item child="' . ($childs ? 1 : 0) . '" id="foldercategory-' . $rubricator->id . '" text="' . escape($type_collection->_collection[$i]->name) . '" im0="folderOpen.gif" im1="folderOpen.gif" im2="folderClosed.gif">'; } else { 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) { //for rubric with id_category if ($rubricator->id_io_category > 0) { echo '<item child="0" id="category-' . $rubricator->id . '" text="Просмотреть рубрику" im0="../csh_books/leaf.gif" ></item>'; } else { $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++) { $name = ''; if ($agr_collection->_collection[$k]->id_io_object > 0) { $io = new io_objects(); $io->id = $agr_collection->_collection[$k]->id_io_object; if ($io->Load()) { $name = $io->name; } } echo '<item child="0" id="agreement-' . $agr_collection->_collection[$k]->id_io_object . '" text="' . escape($name) . '" im0="../csh_books/leaf.gif" ></item>'; } } } } echo '</item>'; } break; case 'agreement': break;