} if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new ImageType($id); } if (Tools::P('imageTypeSaveType') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); if ($obj->update() && Tools::P('reloadImages') == 1) { $obj->reloadImages(); } } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('图片类型已更新'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '图片类别', 'href' => 'index.php?rule=image_type')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=image_type', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-image-type', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript"> $("#save-image-type").click(function(){
UIAdminAlerts::conf('页面已创建'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new Onepage($id); } if (Tools::P('saveOnepage') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('页面已更新'); } } /** 错误处理 */ if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('href' => 'index.php?rule=brand', 'title' => '单面管理')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=onepage', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-onepage-form', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?>
UIAdminAlerts::conf('已添加属性组'); } } if (isset($_GET['id'])) { $id = (int) Tools::G('id'); $obj = new AttributeGroup($id); } if (Tools::Q('saveAttributeGroup') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('已更新属性组'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '属性组', 'href' => 'index.php?rule=attribute_group')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=attribute_group', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-attribute-group', 'class' => 'btn-success', 'icon' => 'saved')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript"> $("#save-attribute-group").click(function(){
} } elseif (Tools::isSubmit('subDelete')) { $select_cat = Tools::getRequest('cmsBox'); $cms = new CMS(); if (is_array($select_cat)) { if ($cms->deleteSelection($select_cat)) { UIAdminAlerts::conf('文章已删除'); } } } elseif (Tools::isSubmit('subActiveON') or Tools::isSubmit('subActiveOFF')) { $select_cat = Tools::P('itemBox'); $action = Tools::isSubmit('subActiveON') ? 1 : 0; $object = new CMS(); if (is_array($select_cat)) { if ($object->statusSelection($select_cat, $action)) { UIAdminAlerts::conf('文章已更新'); } } } $table = new UIAdminTable('cms', 'CMS', 'id_cms'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemBox[]'), array('name' => 'id_cms', 'title' => 'ID', 'filter' => 'string'), array('name' => 'title', 'title' => '名称', 'filter' => 'string'), array('name' => 'rewrite', 'title' => '静态链接', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('name' => 'is_top', 'title' => '置顶', 'filter' => 'bool'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'view', 'delete'))); $filter = $table->initFilter(); $filter['id_cms_category'] = isset($_GET['id_cms_category']) ? intval($_GET['id_cms_category']) : 1; $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_cms'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = CMS::loadData($p, $limit, $orderBy, $orderWay, $filter); //导航 $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home();
UIAdminAlerts::conf('国家已添加'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new Country($id); } if (Tools::P('saveCountry') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('国家已更新'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '国家', 'href' => 'index.php?rule=country')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=country', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-country-form', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript">
} if (isset($_GET['id'])) { $id = (int) Tools::G('id'); $obj = new User($id); } if (Tools::P('saveUser') == 'edit') { if (Tools::P('email') != $obj->email && User::userExists(Tools::P('email'))) { $obj->_errors[] = '邮箱地址已存在!'; } elseif (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('用户已更新'); } } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '用户', 'active' => true)); $bread = $breadcrumb->draw(); $btn_groups = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=user', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-user-form', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_groups), 'breadcrumb'); if (isset($errors)) { UIAdminAlerts::MError($errors); } ?> <script language="javascript"> $("#save-user-form").click(function(){ $("#user-form").submit();
if (Tools::G('delete') > 0) { $feature = new Feature(Tools::G('delete')); if (Validate::isLoadedObject($feature)) { $feature->delete(); } if (is_array($feature->_errors) and count($feature->_errors) > 0) { $errors = $feature->_errors; } else { UIAdminAlerts::conf('商品特征已删除'); } } elseif (Tools::isSubmit('delSelected')) { $select_cat = Tools::P('itemsBox'); $feature = new Feature(); if ($feature->deleteMulti($select_cat)) { UIAdminAlerts::conf('商品特征已删除'); } } echo UIAdminDndTable::loadHead(); $table = new UIAdminDndTable('feature', 'Feature', 'id_feature'); $table->addAttribte('id', 'feature'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_feature', 'title' => 'ID', 'filter' => 'string', 'rule' => 'feature_value'), array('name' => 'name', 'title' => '名称', 'filter' => 'string', 'rule' => 'feature_value'), 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 = Feature::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); }
if (intval(Tools::getRequest('delete')) > 0) { $object = new Address(intval(Tools::getRequest('delete'))); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('已删除地址'); } } elseif (Tools::isSubmit('subDelete')) { $select_cat = Tools::getRequest('categoryBox'); $address = new Address(); if ($address->deleteSelection($select_cat)) { UIAdminAlerts::conf('已删除选中地址'); } } $table = new UIAdminTable('address', 'Address', 'id_address'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]', 'name' => 'id_address'), array('name' => 'id_address', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '昵称', 'filter' => 'string'), array('name' => 'country', 'title' => '国家', 'filter' => 'string'), array('name' => 'state', 'title' => '省/州', 'filter' => 'string'), array('name' => 'postcode', 'title' => '邮编', 'filter' => 'string'), array('name' => 'city', 'title' => '城市', 'filter' => 'string'), array('name' => 'phone', 'title' => '城市', 'filter' => 'string'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_address'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = Address::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home();
<?php if (intval(Tools::getRequest('delete')) > 0) { $object = new ImageType(intval(Tools::getRequest('delete'))); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('图片类别已删除'); } } $table = new UIAdminTable('image_type', 'ImageType', 'id_image_type'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemrBox[]'), array('name' => 'id_image_type', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '名称', 'filter' => 'string'), array('name' => 'width', 'title' => '宽度'), array('name' => 'height', 'title' => '高度'), array('name' => 'type', 'title' => '所属'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_image_type'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = ImageType::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '图片类别', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '新类别', 'href' => 'index.php?rule=image_type_edit', 'class' => 'btn-success', 'icon' => 'plus')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); echo UIViewBlock::area(array('title' => '图片类别', 'table' => $table, 'result' => $result), 'table');
UIAdminAlerts::conf('定单状态已添加'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new OrderStatus($id); } if (Tools::P('saveOrderStatus') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('定单状态已更新'); } } /** 错误处理 */ if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '定单状态', 'href' => 'index.php?rule=order_status')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=order_status', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-ordder-status-form', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?>
} //product page $result = Db::getInstance()->getAll('SELECT rule_link AS link FROM `' . DB_PREFIX . 'rule` WHERE `entity`="Product"'); foreach ($result as $row) { $xmlString .= ' <url> <loc>' . $link->getLink($row['link']) . '</loc> <lastmod>' . date('c') . '</lastmod> <changefreq>daily</changefreq> <priority>0.6</priority> </url>'; } $xmlString .= ' </urlset>'; if (file_exists($s_file) && is_writable($s_file) && file_put_contents($s_file, $xmlString)) { UIAdminAlerts::conf('Sitemap已更新'); } else { $errors[] = 'sitemap.xml文件不存在,sitemap.xml或者文件不可写,请创建或更改权限后重试!'; } } /** 错误处理 */ if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '系统设置', 'active' => true)); $breadcrumb->add(array('title' => 'Sitemap', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'button', 'title' => '更新', 'id' => 'save-sitemap-form', 'class' => 'btn-success', 'icon' => 'save'));
$id_attribute_group = Tools::P('id_attribute_group'); } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $attribute = new Attribute($id); $id_attribute_group = $attribute->id_attribute_group; } if (Tools::P('saveAttribute') == 'edit') { if (Validate::isLoadedObject($attribute)) { $attribute->copyFromPost(); $attribute->update(); } if (is_array($attribute->_errors) and count($attribute->_errors) > 0) { $errors = $attribute->_errors; } else { UIAdminAlerts::conf('属性值已更新'); } } if (!isset($id_attribute_group)) { $errors[] = '属性组未指定'; } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '属性组', 'href' => 'index.php?rule=attribute_group')); $breadcrumb->add(array('title' => '属性值', 'href' => 'index.php?rule=attribute&id=' . (int) $id_attribute_group)); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=attribute&id=' . (int) $id_attribute_group, 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-attribute', 'class' => 'btn-success', 'icon' => 'saved'));
UIAdminAlerts::conf('创建对象成功'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new Color($id); } if (Tools::P('saveColor') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('更新对象成功'); } } $colors = Color::getEntitys(); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '颜色', 'href' => 'index.php?rule=color')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=color', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-color', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <link href="<?php
} else { UIAdminAlerts::conf('省/州已删除'); } } elseif (Tools::isSubmit('deleteItems')) { $select_cat = Tools::getRequest('categoryBox'); $state = new State(); if ($state->deleteSelection($select_cat)) { UIAdminAlerts::conf('省/州已删除'); } } elseif (Tools::isSubmit('openSelected') or Tools::isSubmit('closeSelected')) { $select_cat = Tools::P('categoryBox'); $action = Tools::isSubmit('subActiveON') ? 1 : 0; $object = new State(); if (is_array($select_cat)) { if ($object->statusSelection($select_cat, $action)) { UIAdminAlerts::conf('省/州已更新'); } } } $table = new UIAdminTable('state', 'State', 'id_state'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]', 'name' => 'id_state'), array('name' => 'id_state', 'title' => 'ID', 'filter' => 'string'), array('name' => 'country', 'title' => '国家', 'filter' => 'string'), array('name' => 'name', 'title' => '省/州', 'filter' => 'string'), array('name' => 'iso_code', 'title' => 'ISO代码', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_state'; $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 = State::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb();
$select_cat = Tools::P('categoryBox'); if (Validate::isLoadedObject($category) and is_array($select_cat)) { $category->deleteSelection($select_cat); } if (is_array($category->_errors) and count($category->_errors) > 0) { $errors = $category->_errors; } else { echo '<div class="conf">删除分类成功</div>'; } } elseif (Tools::isSubmit('subActiveON') or Tools::isSubmit('subActiveOFF')) { $select_cat = Tools::getRequest('categoryBox'); $action = Tools::isSubmit('subActiveON') ? 1 : 0; $object = new CMSCategory(); if (is_array($select_cat)) { if ($object->statusSelection($select_cat, $action)) { UIAdminAlerts::conf('分类已更新'); } } } echo UIAdminDndTable::loadHead(); $table = new UIAdminDndTable('cms_category', 'CMSCategory', 'id_cms_category'); $table->addAttribte('id', 'cms_category'); $table->parent = 'id_parent'; $table->child = true; $table->header = array(array('sort' => false, 'isCheckAll' => 'categoryBox[]'), array('name' => 'id_cms_category', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '名称', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('name' => 'position', 'title' => '排序'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'view', '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 = $category->getSubCMSCategories($limit, $p, $orderBy, $orderWay, $filter);
$id_feature = Tools::P('id_feature'); } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new FeatureValue($id); $id_feature = $obj->id_feature; } if (Tools::P('saveFeatureValue') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('商品特征值已更新'); } } if (!isset($id_feature)) { $errors[] = '商品特征未指定'; } /** 输出错误信息 */ if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '商品特征', 'href' => 'index.php?rule=feature_edit&id=' . $id_feature)); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw();
<?php if (Tools::G('delete') > 0) { $object = new Employee(Tools::G('delete')); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('管理员已删除'); } } $table = new UIAdminTable('employee', 'Employee', 'id_employee'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]', 'name' => 'id_employee'), array('name' => 'id_employee', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '昵称', 'filter' => 'string'), array('name' => 'email', 'title' => 'Email', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('name' => 'upd_date', 'title' => '最后登录'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_employee'; $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 = Employee::loadData($p, $limit, $orderBy, $orderWay, $filter); $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '管理员', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '新管理员', 'href' => 'index.php?rule=employee_edit', 'class' => 'btn-success', 'icon' => 'plus')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); echo UIViewBlock::area(array('title' => '管理员列表', 'table' => $table, 'result' => $result, 'limit' => $limit), 'table');
UIAdminAlerts::conf('配送商已添加'); $_GET['id'] = $carrier->id; } if (is_array($carrier->_errors) and count($carrier->_errors) > 0) { $errors = $carrier->_errors; } } if (isset($_GET['id'])) { $id = (int) Tools::G('id'); $obj = new Carrier($id); } if (Tools::P('saveCarrier') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); if ($obj->update() && $obj->updateLogo()) { UIAdminAlerts::conf('配送商已更新'); } } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } } if (isset($errors)) { UIAdminAlerts::MError($errors); } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '物流', 'active' => true));
if (Tools::G('delete') > 0) { $object = new Currency(intval(Tools::G('delete'))); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('货币已删除'); } } if (Tools::isSubmit('saveDefault')) { if ($id_currency_default = Tools::P('ID_CURRENCY_DEFAULT')) { Configuration::updateValue('ID_CURRENCY_DEFAULT', $id_currency_default); UIAdminAlerts::conf('默认货币已更新'); } } echo UIAdminDndTable::loadHead(); $table = new UIAdminDndTable('currency', 'Currency', 'id_currency'); $table->addAttribte('id', 'currency'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_currency', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '名称', 'filter' => 'string'), array('name' => 'conversion_rate', 'title' => '汇率', 'filter' => 'string'), array('name' => 'iso_code', 'title' => 'ISO代码', 'filter' => 'string'), array('name' => 'sign', 'title' => '货币符号', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('name' => 'position', 'title' => '排序'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', '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 = Currency::loadData($p, $limit, $orderBy, $orderWay, $filter); /** 输出错误信息 */ if (isset($errors)) { UIAdminAlerts::MError($errors);
UIAdminAlerts::conf('地址已添加'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new Address($id); } if (isset($_POST['sveAddress']) && Tools::getRequest('sveAddress') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('地址已更新'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '地址', 'href' => 'index.php?rule=address')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=address', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-address', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script type="text/javascript"> $(document).ready(function(){
$id = (int) $_GET['id']; $obj = new Employee($id); } if (Tools::P('saveEmployee') == 'edit') { if (Tools::P('passwd') != Tools::P('passwd_conf')) { $obj->_errors[] = '两次输入的密码不一样!'; } elseif (Tools::P('email') != $obj->email && Employee::employeeExists(Tools::getRequest('email'))) { $obj->_errors[] = '邮箱地址已存在!'; } elseif (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('管理员已更新'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '管理员', 'href' => 'index.php?rule=employee')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=employee', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-employee-form', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript"> $("#save-employee-form").click(function(){
if (intval(Tools::getRequest('delete')) > 0) { $object = new Color(intval(Tools::getRequest('delete'))); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('颜色已删除'); } } elseif (Tools::isSubmit('subDelete')) { $select_cat = Tools::P('itemsBox'); $color = new Color(); if ($color->deleteSelection($select_cat)) { UIAdminAlerts::conf('颜色已删除'); } } echo UIAdminDndTable::loadHead(); $table = new UIAdminDndTable('color', 'Color', 'id_color'); $table->addAttribte('id', 'color-table'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_color', 'title' => 'ID'), array('name' => 'name', 'title' => '名称'), array('name' => 'code', 'title' => '颜色', 'color' => true), array('name' => 'position', 'title' => '排序'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'position'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'asc'; $result = Color::loadData($orderBy, $orderWay); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '颜色', 'active' => true));
UIAdminAlerts::conf('CMS标签已添加'); } } if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new CMSTag($id); } if (Tools::P('saveCMSTag') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('CMS标签已更新'); } } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => 'CMS标签', 'href' => 'index.php?rule=cms_tag')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw(); $btn_groups = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=cms_tag', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-cms-tag-form', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_groups), 'breadcrumb'); if (isset($errors)) { UIAdminAlerts::MError($errors); } ?> <script language="javascript"> $("#save-cms-tag-form").click(function(){
if (Tools::G('delete') > 0) { $object = new CMSTag(Tools::G('delete')); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('标签已删除'); } } elseif (Tools::isSubmit('subDelete')) { $select_cat = Tools::P('categoryBox'); $cmstag = new CMSTag(); if ($cmstag->deleteSelection($select_cat)) { UIAdminAlerts::conf('标签已删除'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $table = new UIAdminTable('cms_tag', 'CMSTag', 'id_cms_tag'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]', 'name' => 'id_cms_tag'), array('name' => 'id_cms_tag', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '名称', 'filter' => 'string'), array('name' => 'rewrite', 'title' => 'URL', 'filter' => 'string'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_cms_tag'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = CMSTag::loadData($p, $limit, $orderBy, $orderWay, $filter); $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home();
UIAdminAlerts::conf('品牌已更新'); } if (is_array($brand->_errors) and count($brand->_errors) > 0) { $errors = $brand->_errors; } } if (isset($_GET['id'])) { $id = (int) Tools::G('id'); $obj = new Brand($id); } if (isset($_POST['sveBrand']) && Tools::P('sveBrand') == 'edit') { if (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); if ($obj->update() && $obj->updateLogo()) { if (!isset($_FILES['qqfile']['name']) || isset($_FILES['qqfile']['name']) && $obj->updateLogo()) { UIAdminAlerts::conf('品牌已更新'); } } } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } } if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('href' => 'index.php?rule=brand', 'title' => '品牌')); $breadcrumb->add(array('title' => '编辑', 'active' => true)); $bread = $breadcrumb->draw();
} } elseif (Tools::isSubmit('subDelete')) { $select_cat = Tools::getRequest('categoryBox'); $coupon = new Coupon(); if ($coupon->deleteSelection($select_cat)) { UIAdminAlerts::conf('优惠码已删除'); } } elseif (intval(Tools::getRequest('toggleStatus')) > 0) { $object = new Coupon(intval(Tools::getRequest('toggleStatus'))); if (Validate::isLoadedObject($object)) { $object->toggleStatus(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('优惠码已更新'); } } $table = new UIAdminTable('coupon', 'Coupon', 'id_coupon'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_coupon', 'title' => 'ID', 'width' => '80px', 'filter' => 'string'), array('name' => 'id_user', 'title' => '状态码', 'filter' => 'string'), array('name' => 'off', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'amount', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'active', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'add_date', 'title' => '状态信息', 'filter' => 'string'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_coupon'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = Coupon::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home();
<?php if (Tools::G('delete') > 0) { $object = new Onepage(Tools::G('delete')); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('页面已删除'); } } $table = new UIAdminTable('onepage', 'Onepage', 'id_onepage'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_onepage', 'title' => 'ID', 'filter' => 'string'), array('name' => 'view_name', 'title' => '示图名', 'filter' => 'string'), array('name' => 'meta_title', 'title' => 'Meta标题', 'filter' => 'string'), array('name' => 'rewrite', 'title' => 'URL', 'filter' => 'string'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_onepage'; $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 = Onepage::loadData($p, $limit, $orderBy, $orderWay, $filter); /** 错误处理 */ if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '系统设置', 'active' => true)); $breadcrumb->add(array('title' => '单面管理', 'active' => true)); $bread = $breadcrumb->draw();
if (Tools::P('delete') > 0) { $object = new Cart(Tools::P('delete')); if (Validate::isLoadedObject($object)) { $object->delete(); } if (is_array($object->_errors) and count($object->_errors) > 0) { $errors = $object->_errors; } else { UIAdminAlerts::conf('购物车已删除'); } } elseif (Tools::isSubmit('delSelected')) { $select_cat = Tools::P('itemsBox'); $cart = new Cart(); if ($cart->deleteMulti($select_cat)) { UIAdminAlerts::conf('购物车已删除'); } } $table = new UIAdminTable('cart', 'Cart', 'id_cart'); $table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_cart', 'title' => 'ID', 'width' => '80px', 'filter' => 'string'), array('name' => 'name', 'title' => '用户', 'filter' => 'string'), array('sort' => false, 'name' => 'total_display', 'title' => '金额', 'width' => '80px'), array('name' => 'carrier', 'title' => '物流', 'filter' => 'string'), array('sort' => 'shipping', 'name' => 'shipping_display', 'title' => '运费'), array('sort' => 'status', 'name' => 'status_label', 'title' => '状态', 'color' => true), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete'))); $filter = $table->initFilter(); $orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'id_cart'; $orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'desc'; $limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50'; $p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1; $result = Cart::loadData($p, $limit, $orderBy, $orderWay, $filter); if (isset($errors)) { UIAdminAlerts::MError($errors); } $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home();
if ($smtp_server = Tools::P('TM_MAIL_SERVER')) { Configuration::updateValue('TM_MAIL_SERVER', $smtp_server); } if ($smtp_user = Tools::P('TM_MAIL_USER')) { Configuration::updateValue('TM_MAIL_USER', $smtp_user); } if ($smtp_passwd = Tools::P('TM_MAIL_PASSWD')) { Configuration::updateValue('TM_MAIL_PASSWD', $smtp_passwd); } if ($smtp_encryption = Tools::P('TM_MAIL_SMTP_ENCRYPTION')) { Configuration::updateValue('TM_MAIL_SMTP_ENCRYPTION', $smtp_encryption); } if ($smtp_port = Tools::P('TM_MAIL_SMTP_PORT')) { Configuration::updateValue('TM_MAIL_SMTP_PORT', $smtp_port); } UIAdminAlerts::conf('配置已更新'); } if (isset($errors)) { UIAdminAlerts::MError($errors); } /** 导航 */ $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '系统设置', 'active' => true)); $breadcrumb->add(array('title' => '邮件设置', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'button', 'title' => '保存', 'id' => 'save-email-form', 'class' => 'btn-success', 'icon' => 'save')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript"> $("#save-email-form").click(function(){
} if (isset($_GET['id'])) { $id = (int) $_GET['id']; $obj = new Category($id); } if (isset($_POST['sveCategory']) && Tools::getRequest('sveCategory') == 'edit') { if (Tools::getRequest('id_parent') == $obj->id) { $obj->_errors[] = '父分类不能为当前分类!'; } elseif (Validate::isLoadedObject($obj)) { $obj->copyFromPost(); $obj->update(); } if (is_array($obj->_errors) and count($obj->_errors) > 0) { $errors = $obj->_errors; } else { UIAdminAlerts::conf('更新分类成功'); } } if (isset($errors)) { UIAdminAlerts::MError($errors); } //导航 $breadcrumb = new UIAdminBreadcrumb(); $breadcrumb->home(); $breadcrumb->add(array('title' => '分类', 'active' => true)); $bread = $breadcrumb->draw(); $btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=category', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-category', 'class' => 'btn-success', 'icon' => 'saved')); echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb'); ?> <script language="javascript">