<?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;
<?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="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; /*case 'category':