if ($category->deleteCategory($c_id)) { admin_redirect('category.php', '删除成功!', 3); } else { admin_redirect('category.php', '删除失败!' . $res, 3); } } else { admin_redirect('category.php', '不能删除商品分类!因为' . $res, 3); } } else { if ($act == 'edit') { $c_id = isset($_GET['id']) ? $_GET['id'] : 0; if ($c_id == 0) { admin_redirect('category.php', '没有要编辑的商品分类!', 3); } $category = new Category(); if (!($cat = $category->getCategoryByParentId($c_id))) { admin_redirect('category.php', '编辑失败!', 3); } $categories = $category->getAllCategories($c_id); include_once ADMIN_TEMP . '/category_edit.html'; } else { if ($act = 'update') { $c_name = isset($POST['category_name']) ? $_POST['category_name'] : ''; $c_parent_id = isset($POST['c_parent_id']) ? $_POST['c_parent_id'] : 0; $c_sort = isset($POST['c_sort']) ? $_POST['c_sort'] : 50; $c_id = isset($POST['c_id']) ? $_POST['c_id'] : 0; if ($c_id == 0) { //没有要更新的数据 admin_redirect('category.php', '没有要更新的商品分类信息!', 3); } if (empty($c_name)) {