<%@ 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-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>demo列表</title>
<link rel="stylesheet"
	href="${ pageContext.request.contextPath }/css/goodslist.css" />
<script type="text/javascript"
	src="${ pageContext.request.contextPath }/js/goodslist.js"></script>
<link href="${pageContext.request.contextPath}/css/Style1.css"
	rel="stylesheet" type="text/css" />
<!-- 引入Jquery -->
<script type="text/javascript"
	src="${ pageContext.request.contextPath }/static/js/jquery-2.1.1.min.js"></script>
<!-- 引入样式 -->
<link
	href="${ pageContext.request.contextPath }/static/bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<script
	src="'${ pageContext.request.contextPath }/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

	<script type="text/javascript">
		var basepath= '${APP_PATH}';

		function refresh(){
			window.location.href = "${pageContext.request.contextPath}/admin/adminDemo_findAllByPage.action?page=1";
		}

		function addDemo(){
			window.location.href = "${pageContext.request.contextPath}/demo/add.action";
		}
		function edit(did) {
			window.location.href = "${pageContext.request.contextPath}/demo/updateById.action?did="+did;
		}
		function deletecs(did) {
			var r=confirm("确定删除吗？");
			if (r==true){
				window.location.href = "${pageContext.request.contextPath}/demo/deleteById.action?did="+did;
			}
			else{
			}
		}
		function look(did) {
			window.location.href = "${pageContext.request.contextPath}/demo/findById.action?did="+did;
		}
function ret() {
	window.location.href = "${pageContext.request.contextPath}/demo/findAllByPage.action?page=1";
}
function refresh(){
	window.location.href = "${pageContext.request.contextPath}/demo/findAllByPage.action?page=1";
}
</script>

</head>
<body>
	<div class="a">
		<div class="b">
			<form method="post"
				action="${pageContext.request.contextPath}/demo/searchDemoByCondition.action">
				<input id="condition" name="condition" type="text" class="input1"
					value="请输入关键词" onfocus="this.value = '';"
					onblur="if (this.value == '') {this.value = '请输入关键词';}">&nbsp;&nbsp;
				<button type="submit"
					class="btn btn-primary btn-sm glyphicon glyphicon-search"
					onclick="validate()"></button>
			</form>
		</div>

		<div align="right" style="padding-right: 30px;">
			<input type="button" value="+添加demo" class="btn btn-primary"
				onclick="addDemo()" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button type="button" onclick="refresh()"
				class="btn glyphicon glyphicon-refresh"></button>
		</div>
	</div>

	<div class="d" style="width: 96%; margin-left: 25px;">
		<!-- 显示结果 -->
		<form style="margin-top: 20px;">
			<table width="100%" align="center"
				class="table table-hover table-striped" id="table"
				style="border: 1px solid #D0D0D0">
				<thead>
					<tr align="center" bgcolor="#93b6bd" height="33px;">
						<th scope="col" style="text-align: center;">demoID</th>
						<th scope="col" style="text-align: center;">demo名</th>
						<th scope="col" style="text-align: center;">备注</th>
						<th scope="col" style="text-align: center;">操作</th>
					</tr>
				</thead>
				<c:forEach items="${srList}" var="d" varStatus="status">
					<tr height="30">
						<td style="CURSOR: hand; HEIGHT: 22px" align="center" width="12%">${d.did}</td>
						<td style="CURSOR: hand; HEIGHT: 22px" align="center" width="17%">${d.dname }</td>
						<td style="CURSOR: hand; HEIGHT: 22px" align="center" width="17%">${d.comment}</td>
						<td>
							<button type="button"
								class="btn btn-primary btn-sm glyphicon glyphicon-pencil"
								onclick="edit(${d.did})"></button>&nbsp;
							<button type="button"
								class="btn btn-success btn-sm glyphicon glyphicon-asterisk"
								onclick="look(${d.did})"></button>
						</td>
					</tr>
				</c:forEach>
			</table>
		</form>
	</div>
</body>
</html>

