<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'list.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<link rel="stylesheet" href="<%=basePath%>/css/index_work.css" type="text/css"></link>
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.8.2.js"></script>
<script type="text/javascript">
var time = 0;
function toChecked(time){
if(time%2==0){
$(".ck").attr("checked",true);
}else{
$(".ck").attr("checked",false);
}
}
function del(id){
if(confirm("确认要删除吗")){
$.post(
"<%=basePath%>/manage/del.do",
{"mid":id},
function (message){
if(message==1){
alert("删除成功");
location="<%=basePath%>/manage/list.do";
}else{
alert("删除失败");
}
},"json"
);
}
}
function dels(){
var ids = "";
$(".ck").each(function (){
if($(this).attr("checked")){
ids+=","+$(this).val();
}
});
ids = ids.substring(1);
if(confirm("确认要删除吗")){
$.post(
"<%=basePath%>/manage/dels.do",
{"ids":ids},
function (message){
if(message>0){
alert("删除成功");
location="<%=basePath%>/manage/list.do";
}else{
alert("删除失败");
}
}
);
}
}
function gopage(cpage){
location="<%=basePath%>/manage/list.do?cpage="+cpage;
}
function changeOrder(){
var mid = $("[name='mid']").serialize();
alert(mid);
/* alert($("[name='morder']").serialize());"mid":$("[name='mid']").serialize(), */
$.post(
"<%=basePath%>/manage/changeOrder.do",
$("[name='morder']").serialize(),
function (data){
if(data>0){
alert("保存成功");
location="<%=basePath%>/manage/list.do";
}else{
alert("保存失败");
}
},"json"
);
}
</script>
</head>
<body>
<table>
<tr>
<th><input type="button" value="+添加栏目" onclick="location='<%=basePath%>/view/add.jsp'"></th>
<th colspan="5"></th>
</tr>
<tr>
<th><input type="checkbox" class="ch" onchange="toChecked(time++)">id</th>
<th>栏目名称</th>
<th>栏目路径</th>
<th>排列顺序</th>
<th>显示</th>
<th>操作</th>
</tr>
<c:forEach items="${manageList }" var="m">
<tr>
<th><input type="checkbox" class="ck" value="${m.mid }" ><input type="hidden" value="${m.mid }" name="mid">${m.mid }</th>
<th>${m.mname }</th>
<th>${m.mpath }</th>
<th><input type="text" value="${m.morder}" style="width: 30px" name="morder"></th>
<th>${m.mshow }</th>
<th><input type="button" value="修改" onclick="location='<%=basePath%>/view/update.jsp?mid=${m.mid }'">
<input type="button" value="删除" onclick="del(${m.mid })"></th>
</tr>
</c:forEach>
<tr>
<th colspan="6">
<button onclick="gopage(1)">首页</button>
<button onclick="gopage(${pu.prevPage})">上页</button>
<button onclick="gopage(${pu.nextPage})">下页</button>
<button onclick="gopage(${pu.totalPage})">末页</button>
</th>
</tr>
<tr>
<th><input type="button" value="保存排序" onclick="changeOrder()">
<input type="button" value="批量删除" onclick="dels()"></th>
<th colspan="5"></th>
</tr>
</table>
</body>
</html>
当一个人找不到出路的时候,最好的办法就是将当前能做好的事情做到极致,做到无人能及。
1511

被折叠的 条评论
为什么被折叠?



