<?php if (Tools::G('delete') > 0) { $attributeGroup = new AttributeGroup(Tools::G('delete')); if (Validate::isLoadedObject($attributeGroup)) { $attributeGroup->delete(); } if (is_array($attributeGroup->_errors) and count($attributeGroup->_errors) > 0) { $errors = $attributeGroup->_errors; } else { UIAdminAlerts::conf('商品特征已删除'); } } elseif (Tools::isSubmit('delSelected')) { $select_cat = Tools::P('itemsBox'); $attributeGroup = new AttributeGroup(); if ($attributeGroup->deleteMulti($select_cat)) { UIAdminAlerts::conf('商品特征已删除'); } } /** 初始化表格 */ echo UIAdminDndTable::loadHead(); $table = new UIAdminDndTable('attribute_group', 'AttributeGroup', 'id_attribute_group'); $table->addAttribte('id', 'feature'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_attribute_group', 'title' => 'ID', 'filter' => 'string', 'rule' => 'attribute'), array('name' => 'name', 'title' => '名称', 'filter' => 'string', 'rule' => 'attribute'), array('name' => 'position', 'title' => '排序'), array('sort' => false, 'title' => '操作', 'width' => '120px', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'position'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'asc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = AttributeGroup::loadData($p, $limit, $orderBy, $orderWay, $filter); /** 错误处理 */