录入公司列表的展示
方法/步骤
1、<%@pagecontentType="text/html;charset=UTF-8"language="java"%><%@taglibprefix="c"uri="http://java.sun.com/jsp/jstl/core"%><html><head><title>公司列表</title><scriptsrc="${pageContext.request.contextPath}/resources/page.js"></script>
2、</head><body>&盟敢势袂lt;divclass="container媪青怍牙"><jsp:includepage="inc.jsp"/><tableclass="tabletable-striped"><thead><trclass="danger"><th></th><th>名称</th><th>负责人</th><th>联系电话</th><th>公司图片</th><th>地址</th><th>email</th><th>操作</th></tr></thead>
3、<tbody><c:for苇质缵爨Eachitems="${list}"var=&q锇栀劐箨uot;product"><tr><td><inputtype="checkbox"value=${product.id}class="comId"/></td><tdid="base">${product.name}</td><td>${product.person}</td><td>${product.phone}</td><td>${product.img}</td><td>${product.adress}</td><td>${product.email}</td><td><ahref="${pageContext.request.contextPath}/admin/company/${product.id}">详情</a></td>
4、</tr></c:forEach></tbody></table><inputid='pageNo'value='${page.pageNo}'hidden="hidden"/>${page.pageHtml}操作:<aclass="btnbtn-danger"role="button"href="${pageContext.request.contextPath}/admin/company/add">添加产品</a>
5、<aid="deleteBtn"class="btnbtn-danger"role="button">删除产品</a></div></body><scripttype="text/javascript">$(function(){$('#pageUlli').each(function(i){varno=$(this).children().text();varpageNo=$('#pageNo').val();if(pageNo==no){$(this).addClass("active")}});})
6、</script><scripttype="text/javascript">$(function(){$("#deleteBtn").on("click",function(){varcheckedArray=[];$("input[class='comId']:checked").each(function(){checkedArray.push($(this).val());});if(checkedArray.length==0){alert("请至少选择一个");}else{$.post("${pageContext.request.contextPath}/admin/company/delete",{
7、"ids":checkedArray},function(data){if(data.success){alert("删除用户成功!");location.href="${pageContext.request.contextPath}/admin/company/showList/1";}});}});})</script></html>