init
This commit is contained in:
157
web/admin/admin.jsp
Normal file
157
web/admin/admin.jsp
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"
|
||||
pageEncoding="utf-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>锋迷网-后台主页</title>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<title>锋迷网-后台主页</title>
|
||||
<style>
|
||||
@media ( min-width :768px ) {
|
||||
#left_tab {
|
||||
width: 250px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
height: 640px;
|
||||
}
|
||||
.mysearch {
|
||||
margin: 10px;
|
||||
}
|
||||
.page_main {
|
||||
margin-left: 255px;
|
||||
}
|
||||
.dv_content{
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<c:if test="${adminuser==null }">
|
||||
<c:redirect url="login.jsp"></c:redirect>
|
||||
</c:if>
|
||||
<!--导航 -->
|
||||
<div style="width: 80%;margin-left: 10%;">
|
||||
<nav class="navbar navbar-default navbar-static-top">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#left_tab,#top_right">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="#" class="navbar-brand">网站后台管理</a>
|
||||
</div>
|
||||
<ul id="top_right" class="collapse navbar-collapse nav navbar-nav navbar-right" style="margin-right: 20px;">
|
||||
<li>
|
||||
<a href="#">
|
||||
<span class="badge" style="background-color: red;"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="userloginout?t=1">
|
||||
<span class="glyphicon glyphicon-off"></span>注销
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!--左侧边栏 -->
|
||||
<div id="left_tab" style="margin-top: 70px;" class="collapse navbar-default navbar-collapse">
|
||||
<ul class="nav panel-group" id="myPanel">
|
||||
<!--栏目-->
|
||||
<li class="panel">
|
||||
<a href="#sub1" data-toggle="collapse" data-parent="#myPanel"> 用户管理
|
||||
<span class="glyphicon glyphicon-triangle-bottom pull-right"></span>
|
||||
</a>
|
||||
<ul id="sub1" class="nav collapse panel-collapse">
|
||||
<li>
|
||||
<a href="#" id="showUser">
|
||||
<span class="glyphicon glyphicon-user"></span> <b>会员管理</b>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="panel">
|
||||
<a href="#sub2" data-toggle="collapse" data-parent="#myPanel"> 商品类型管理
|
||||
<span class="glyphicon glyphicon-triangle-bottom pull-right"></span>
|
||||
</a>
|
||||
<ul id="sub2" class="nav panel-collapse collapse">
|
||||
<li>
|
||||
<a href="#" id="showGoodsType">
|
||||
<span class="glyphicon glyphicon-record"></span> 查看商品分类
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" id="addGoodsType">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加商品分类
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="panel">
|
||||
<a href="#sub3" data-toggle="collapse" data-parent="#myPanel"> 商品管理
|
||||
<span class="glyphicon glyphicon-triangle-bottom pull-right"></span>
|
||||
</a>
|
||||
<ul id="sub3" class="nav panel-collapse collapse">
|
||||
<li>
|
||||
<a href="#" id="showGoods" >
|
||||
<span class="glyphicon glyphicon-record"></span> 查看商品
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" id="addGoods">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加商品
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="panel">
|
||||
<a href="#sub4" data-toggle="collapse" data-parent="#myPanel"> 订单管理
|
||||
<span class="glyphicon glyphicon-triangle-bottom pull-right"></span>
|
||||
</a>
|
||||
<ul id="sub4" class="nav panel-collapse collapse">
|
||||
<li>
|
||||
<a href="#" id="showOrder">
|
||||
<span class="glyphicon glyphicon-record"></span> 查看订单
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<!--右侧部分-->
|
||||
<div class="page_main">
|
||||
<script type="text/javascript">
|
||||
$("#showUser").click(function(){
|
||||
$(".dv_content").attr("src","userList.jsp");
|
||||
})
|
||||
$("#showGoodsType").click(function(){
|
||||
$(".dv_content").attr("src","${pageContext.request.contextPath}/getGoodsType?type=show");
|
||||
})
|
||||
$("#addGoodsType").click(function(){
|
||||
$(".dv_content").attr("src","${pageContext.request.contextPath}/goodstypeshowadd");
|
||||
/* $(".dv_content").attr("src","${pageContext.request.contextPath}/getGoodsType?type=add"); */
|
||||
})
|
||||
$("#showGoods").click(function(){
|
||||
$(".dv_content").attr("src","${pageContext.request.contextPath}/getGoodsList");
|
||||
})
|
||||
$("#addGoods").click(function(){
|
||||
$(".dv_content").attr("src","${pageContext.request.contextPath}/toAddGoods");
|
||||
})
|
||||
$("#showOrder").click(function(){
|
||||
$(".dv_content").attr("src","${pageContext.request.contextPath}/getAllOrder");
|
||||
})
|
||||
</script>
|
||||
<iframe class="dv_content" frameborder="0" scrolling="no"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
29
web/admin/invalidUser.jsp
Normal file
29
web/admin/invalidUser.jsp
Normal file
@@ -0,0 +1,29 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<title>锋迷网-无效会员</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" style="width:98%;margin-left: 1%;margin-top: 5px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
已停用会员列表
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table id="tb_list" class="table table-striped table-hover table-bordered">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
70
web/admin/login.jsp
Normal file
70
web/admin/login.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
|
||||
<!-- Bootstrap -->
|
||||
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<title>锋迷网-后台登录</title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#eye").click(function(){
|
||||
if($("#password").attr("type")=="password"){
|
||||
$("#password").attr("type","text");
|
||||
$("#eye").attr("class","glyphicon glyphicon-eye-close");
|
||||
}else{
|
||||
$("#password").attr("type","password");
|
||||
$("#eye").attr("class","glyphicon glyphicon-eye-open");
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style type="text/css">
|
||||
#main{
|
||||
position: absolute;
|
||||
width: 400px;
|
||||
height: 300px;
|
||||
left:50%;
|
||||
top:40%;
|
||||
margin-left: -200px;
|
||||
margin-top: -100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main" class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">
|
||||
锋迷网-后台登录
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="${pageContext.request.contextPath }/adminLogin" method="post">
|
||||
<div class="form-group">
|
||||
<label>用户名:</label>
|
||||
<input type="text" name="username" id="" class="form-control" placeholder="请输入用户名……"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>密 码:</label>
|
||||
<div class="input-group">
|
||||
<input type="password" name="password" id="password" class="form-control" placeholder="请输入密码……"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-eye-open" id="eye"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<input type="submit" value="登录" class="btn btn-primary">
|
||||
<input type="reset" value="重置" class="btn btn-default">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
107
web/admin/showAllOrder.jsp
Normal file
107
web/admin/showAllOrder.jsp
Normal file
@@ -0,0 +1,107 @@
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"
|
||||
pageEncoding="utf-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>锋迷网-订单管理</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css">
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function sendOrder(id){
|
||||
location.href = "${pageContext.request.contextPath}/sendOrder?oid="+id;
|
||||
}
|
||||
$(function(){
|
||||
$("#search").click(function(){
|
||||
var username = $("input[name='username']").val();
|
||||
var status = $("select[name='orderStatus'] option:selected").val();
|
||||
location.href="${pageContext.request.contextPath}/selectOrderByNameAndFlag?username="+username+"&status="+status;
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" style="width:98%;margin-left: 1%;margin-top: 5px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
订单管理
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>用户姓名</span>
|
||||
<input type="text" name="username" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>订单状态</span>
|
||||
<select name="orderStatus" class="form-control">
|
||||
<option value="0">----------</option>
|
||||
<option value="1">未支付</option>
|
||||
<option value="2">已支付,待发货</option>
|
||||
<option value="3">已发货,待收货</option>
|
||||
<option value="4">已收货,未评价</option>
|
||||
<option value="5">完成订单</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
||||
<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<table id="tb_list" class="table table-striped table-hover table-bordered table-condensed">
|
||||
<tr>
|
||||
<td>序号</td>
|
||||
<td>订单编号</td>
|
||||
<td>总金额</td>
|
||||
<td>订单状态</td>
|
||||
<td>订单时间</td>
|
||||
<td>用户姓名</td>
|
||||
<td>操作</td>
|
||||
</tr>
|
||||
<c:forEach items="${orderList}" var="order" varStatus="i">
|
||||
<tr>
|
||||
<td>${i.count}</td>
|
||||
<td>${order.id}</td>
|
||||
<td>${order.money}</td>
|
||||
<td>
|
||||
<c:if test="${order.flag eq 1}">
|
||||
未支付
|
||||
</c:if>
|
||||
<c:if test="${order.flag eq 2}">
|
||||
已支付,待发货
|
||||
</c:if>
|
||||
<c:if test="${order.flag eq 3}">
|
||||
已发货,待收货
|
||||
</c:if>
|
||||
<c:if test="${order.flag eq 4}">
|
||||
已收货,未评价
|
||||
</c:if>
|
||||
<c:if test="${order.flag eq 5}">
|
||||
订单完成
|
||||
</c:if>
|
||||
</td>
|
||||
<td>${order.createtime}</td>
|
||||
<td>${order.username}</td>
|
||||
<td>
|
||||
<c:if test="${order.flag eq 2}">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="sendOrder('${order.id}')">发货</button>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
98
web/admin/showGoods.jsp
Normal file
98
web/admin/showGoods.jsp
Normal file
@@ -0,0 +1,98 @@
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/DatePicker.js"></script>
|
||||
<script type="text/javascript">
|
||||
function deleteGoods(id){
|
||||
location.href = "${pageContext.request.contextPath}/goodsDeleteById?id="+id;
|
||||
}
|
||||
</script>
|
||||
<title>锋迷网-商品列表</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" style="width:98%;margin-left: 1%;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
商品列表
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>商品名称</span>
|
||||
<input type="text" name="name" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>上架时间</span>
|
||||
<input type="text" readonly="readonly" name="pubdate" class="form-control" onclick="setday(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
||||
<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 400px;overflow: scroll;">
|
||||
<table id="tb_list" class="table table-striped table-hover table-bordered">
|
||||
<tr>
|
||||
<td>序号</td>
|
||||
<td>商品名称</td>
|
||||
<td>价格</td>
|
||||
<td>图片</td>
|
||||
<td>上架时间</td>
|
||||
<td>类型</td>
|
||||
<td>操作</td>
|
||||
</tr>
|
||||
<c:forEach items="${goodsList}" var="goods" varStatus="i">
|
||||
<tr>
|
||||
<td>${i.count}</td>
|
||||
<td>${goods.name}</td>
|
||||
<td>${goods.price}</td>
|
||||
<td><img src="./fmwimages/${goods.picture}" width="40px" height="40px"/></td>
|
||||
<td>${goods.pubdate}</td>
|
||||
<td>${goods.typeName}</td>
|
||||
<td><button onclick="deleteGoods('${goods.id}')">删除</button>
|
||||
<a tabindex="0" id="example${goods.id}" class="btn btn-primary btn-xs"
|
||||
role="button" data-toggle="popover"
|
||||
data-trigger="focus"
|
||||
data-placement="left"
|
||||
data-content="${goods.intro}">描述</a>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#example${goods.id}").popover();
|
||||
})
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//条件查询
|
||||
$(function(){
|
||||
//给查询按钮 添加 点击事件
|
||||
$("#search").click(function(){
|
||||
var pubdate = $("input[name='pubdate']").val();
|
||||
var name = $("input[name='name']").val();
|
||||
location.href = "${pageContext.request.contextPath}/selectByNameAndPub?pubdate="+pubdate+"&name="+name;
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
93
web/admin/showGoodsType.jsp
Normal file
93
web/admin/showGoodsType.jsp
Normal file
@@ -0,0 +1,93 @@
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<title>锋迷网-商品类型</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" style="width:98%;margin-left: 1%;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
商品类型
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>商品类型等级</span>
|
||||
<input type="text" name="flag" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
||||
<div class="form-group form-inline">
|
||||
<span>商品类型名称</span>
|
||||
<input type="text" name="name" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
||||
<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search">搜索</span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 400px;overflow: scroll;">
|
||||
<table id="tb_list" class="table table-striped table-hover table-bordered">
|
||||
<tr>
|
||||
<td>序号</td>
|
||||
<td>类型</td>
|
||||
<td>等级</td>
|
||||
<td>所属类型</td>
|
||||
<td>操作</td>
|
||||
</tr>
|
||||
<c:forEach items="${gtlist}" var="gtype" varStatus="i">
|
||||
<tr>
|
||||
<td>${i.count}</td>
|
||||
<td>${gtype.name}</td>
|
||||
<td>${gtype.level}</td>
|
||||
<td>${gtype.parentName}</td>
|
||||
<td>
|
||||
<!-- <button>修改</button> --><button onclick="deleteGoodsType(${gtype.id})">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
//条件查询
|
||||
$(function(){
|
||||
//给查询按钮 添加 点击事件
|
||||
$("#search").click(function(){
|
||||
var flag = $("input[name='flag']").val();
|
||||
var name = $("input[name='name']").val();
|
||||
location.href = "${pageContext.request.contextPath}/selectByNameAndFlag?flag="+flag+"&name="+name;
|
||||
})
|
||||
})
|
||||
//连接servlet 获取 数据
|
||||
function deleteGoodsType(count){
|
||||
$.ajax({
|
||||
url:"${pageContext.request.contextPath}/deleteGoodsType",
|
||||
method:"get",
|
||||
data:{"count":count},
|
||||
success:function(data){
|
||||
location.href = "${pageContext.request.contextPath}/getGoodsType";
|
||||
},
|
||||
error:function(XMLHttpRequest,textStatus,errorThrown){
|
||||
alert("失败"+XMLHttpRequest.status+":"+textStatus+":"+errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
143
web/admin/userList.jsp
Normal file
143
web/admin/userList.jsp
Normal file
@@ -0,0 +1,143 @@
|
||||
<%@page import="java.util.List"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>锋迷网-会员列表</title>
|
||||
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
loadUser();
|
||||
})
|
||||
//连接servlet 获取 数据
|
||||
function loadUser(){
|
||||
$.ajax({
|
||||
url:"${pageContext.request.contextPath}/userlist",
|
||||
method:"get",
|
||||
success:function(data){
|
||||
showMsg(data);
|
||||
},
|
||||
error:function(XMLHttpRequest,textStatus,errorThrown){
|
||||
alert("失败"+XMLHttpRequest.status+":"+textStatus+":"+errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
//显示用户信息
|
||||
function showMsg(list){
|
||||
$("#tb_list").html("<tr class='tr_head'><td>编号</td><td>邮箱</td><td>姓名</td><td>性别</td><td>类别</td><td>操作</td></tr>");
|
||||
var i = 1;
|
||||
for(var u in list){
|
||||
//声明 tr td 对象
|
||||
var tr = $("<tr></tr>");
|
||||
var td1 = $("<td>"+(i++)+"</td>");
|
||||
var td2 = $("<td>"+list[u].email+"</td>");
|
||||
var td3 = $("<td>"+list[u].username+"</td>");
|
||||
var td4 = $("<td>"+list[u].gender+"</td>");
|
||||
var td5 = $("<td>"+(list[u].role==0?"管理员":"会员")+"</td>");
|
||||
var td6 = $("<td><a href='javascript:delUser("+list[u].id+")' class='btn btn-primary btn-xs'>删除</a></td>");
|
||||
//将td 添加到tr中
|
||||
tr.append(td1);
|
||||
tr.append(td2);
|
||||
tr.append(td3);
|
||||
tr.append(td4);
|
||||
tr.append(td5);
|
||||
tr.append(td6);
|
||||
$("#tb_list").append(tr);
|
||||
}
|
||||
}
|
||||
//删除用户
|
||||
function delUser(id){
|
||||
if(confirm("确认要删除吗?")){
|
||||
$.ajax({
|
||||
url:"${pageContext.request.contextPath}/userdel?id="+id,
|
||||
method:"get",
|
||||
success:function(data){
|
||||
if(data>0){
|
||||
loadUser();
|
||||
}
|
||||
},
|
||||
error:function(XMLHttpRequest,textStatus,errorThrown){
|
||||
alert("失败"+XMLHttpRequest.status+":"+textStatus+":"+errorThrown);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
//条件查询
|
||||
$(function(){
|
||||
//给查询按钮 添加 点击事件
|
||||
$("#search").click(function(){
|
||||
var username = $("input[name='username']").val();
|
||||
var genders = $("input[name='gender']");
|
||||
var gender = "";
|
||||
for(var i=0;i<genders.length;i++){
|
||||
if(genders[i].checked){
|
||||
gender += genders[i].value;
|
||||
}
|
||||
}
|
||||
//使用ajax 进行异步交互
|
||||
$.ajax({
|
||||
url:"${pageContext.request.contextPath}/usersearch?username="+username+"&gender="+gender,
|
||||
method:"post",
|
||||
success:function(data){
|
||||
if(data==0){
|
||||
alert("未找到指定内容");
|
||||
$("input[name='username']").val("");
|
||||
$("input[name='gender']").removeAttr("checked");
|
||||
}else{
|
||||
showMsg(data);
|
||||
}
|
||||
},
|
||||
error:function(XMLHttpRequest,textStatus,errorThrown){
|
||||
alert("失败"+XMLHttpRequest.status+":"+textStatus+":"+errorThrown);
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" style="width: 100%;">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">会员列表</div>
|
||||
<div class="panel-body">
|
||||
<!-- 条件查询 -->
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
|
||||
<div class="form-group form-inline">
|
||||
<span>用户名</span>
|
||||
<input type="text" name="username" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<div class="form-group form-inline">
|
||||
<span>性别</span>
|
||||
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="gender" value="男"> 男
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio"name="gender" value="女"> 女
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表显示 -->
|
||||
<table id="tb_list" class="table table-striped table-hover table-bordered">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user