📄 produit_frame.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<jsp:directive.page import="java.util.ArrayList"/>
<jsp:directive.page import="com.captainli.dboperation.ProduitDA"/>
<jsp:directive.page import="com.captainli.bean.ProduitBean"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../css/sys.css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
}
a:link {
color: #1A438E;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: underline;
}
.style1 { color: #1A438E;
font-size: 12px;
}
.style2 { color:#FF0000;
font-size: 12px;
}
-->
</style>
<script type="text/javascript" language="javascript">
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
</script>
</head>
<%
int p_bc_id = 0;//大类
int p_sc_id = 0;//小类
ArrayList arryPro = null;
if(request.getParameter("p_bc_id") != null){//大类传值了
if(request.getParameter("p_bc_id").toString().equals("0")){//如果传的是0
arryPro = new ProduitDA().showProduit();
}else{
if(request.getParameter("p_sc_id") != null){//小类传值了
if(request.getParameter("p_sc_id").toString().equals("0")){//小类没有选择。通过大类ID返回所有产品的arraylist
p_bc_id = Integer.parseInt(request.getParameter("p_bc_id"));
arryPro = new ProduitDA().showProduitBc(p_bc_id);
}else{
p_sc_id = Integer.parseInt(request.getParameter("p_sc_id"));
arryPro = new ProduitDA().showProduitSc(p_sc_id);
}
}else{//小类没传值,通过大类ID返回所有产品的arraylist
p_bc_id = Integer.parseInt(request.getParameter("p_bc_id"));
arryPro = new ProduitDA().showProduitBc(p_bc_id);
}
}
}else{//大类没传值
arryPro = new ProduitDA().showProduit();
}
%>
<%
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount;//总页数
int intPage; //待显示页码
String strPage; //请求页码
//设置一页显示的记录数
intPageSize = 10;
//取得显示的页码
strPage = request.getParameter("page");
if(strPage == null){//刚打开网页的时候,表明没有参数,此时显示第1页数据
intPage = 1;
}
else{//将字符串转换成整型
intPage = Integer.parseInt(strPage);
//if(intPage <= 1)
// intPage = 1;
}
//获取记录总数
intRowCount = arryPro.size();
//记算总页数
intPageCount = (intRowCount + intPageSize-1) / intPageSize;
int startNum = (intPage - 1) * intPageSize;//当前页起始索引
int endNum = startNum + intPageSize;//当前页结束索引
if(endNum >= arryPro.size()){
endNum = arryPro.size();
}
%>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/system/r_1.gif" alt="" width="6" height="27" /></td>
<td width="100%" background="../images/system/r_0.gif"><table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td> <span class="style1">修改 / 删除药品资料</span></td>
<td align="right"><input type="button" value="添加药品资料" onClick="javascript:parent.location.href='produit_add.jsp'" class="button"></td>
</tr>
</table></td>
<td><img src="../images/system/r_2.gif" alt="" width="6" height="27" /></td>
</tr>
<tr>
<td></td>
<td><form name="form1" action="user_del.jsp">
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr align="center">
<td width="37%" height="30" class="category">药品全名</td>
<td width="20%" class="category">所属药品大类</td>
<td width="20%" class="category">所属药品小类</td>
<td width="10%" class="category">计量单位</td>
<td width="8%" class="category">修改</td>
<td width="5%" class="category">删除</td>
</tr>
<%
for(int i = startNum;i < endNum;i++){
ProduitBean bean = (ProduitBean)arryPro.get(i);//一行
%>
<tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''" onDblClick="javascript:var win=window.open('produit_show.jsp?pid=<%= bean.getP_id() %>','药品详细信息','width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus()">
<td align="center" height="25"><%= bean.getP_name() %></td>
<td align="center"><%= bean.getBc_name() %></td>
<td align="center"><%= bean.getSc_name() %></td>
<td align="center"><%= bean.getP_unit() %></td>
<td align="center"><a href="produit_update.jsp?pid=<%= bean.getP_id() %>" target="right"><img src="../images/system/res.gif" width="25" height="19" hspace="2" border="0" align="absmiddle">修改</a></td>
<td align="center"><input type="checkbox" name="shanchu" id="shanchu" value="<%= bean.getP_id() %>" style="border:0"></td>
</tr>
<%} %>
<tr>
<td colspan="6" height="30" class="category"><table align="center">
<tr>
<td> 第<%= intPage%>页 共<%= intPageCount%>页
<% //以下是分页的“上一页”“下一页”,有上一页就有链接,没有就为文字,下一页同理 %>
<% if(intPage > 1){ %>
<a href="produit_frame.jsp?page=<%= intPage-1%>&p_bc_id=<%= p_bc_id %>&p_sc_id=<%= p_sc_id %>">上一页</a>
<% }else{ %>
上一页
<%}%>
<% if(intPage < intPageCount){ %>
<a href="produit_frame.jsp?page=<%= intPage+1%>&p_bc_id=<%= p_bc_id %>&p_sc_id=<%= p_sc_id %>">下一页</a>
<% }else{ %>
下一页
<%}%>
</td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td align="left" class="style2">双击每行可查看药品详细资料</td>
<td align="right"><input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0">
全选
<input type="submit" value="删 除" class="button" onClick="return confirm('此操作无法恢复!!!请慎重!!!\n\n确定要删除员工吗?')">
</td>
</tr>
</table></td>
</tr>
</table>
</form></td>
<td></td>
</tr>
<tr>
<td><img src="../images/system/r_4.gif" alt="" width="6" height="6" /></td>
<td></td>
<td><img src="../images/system/r_3.gif" alt="" width="6" height="6" /></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -