📄 intercourse_frame.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<jsp:directive.page import="com.captainli.dboperation.intercourseDA"/>
<jsp:directive.page import="com.captainli.struts.form.IntercourseForm"/>
<%
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>
<title>My JSP 'intercours_frame.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="../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 i_type = 0;//单位类型
String i_pinyin;//单位拼音
String i_name;//单位名称
if(request.getParameter("i_pinyin") != null){
i_pinyin = request.getParameter("i_pinyin").toString();
}else{
i_pinyin = "";
}
if(request.getParameter("i_name") != null){
i_name = new String(request.getParameter("i_name").getBytes("ISO-8859-1"),"GB2312");
}else{
i_name = "";
}
ArrayList arryIn = null;
if(request.getParameter("i_type") == null){//初始该页面时
arryIn = new intercourseDA().showIntercourse();//返回所有单位集合
}
if(request.getParameter("i_type") != null){
if(request.getParameter("i_type").toString().equals("0")){//如果单位选择传值为0
if(request.getParameter("i_pinyin") != null && request.getParameter("i_name") != null){
arryIn = new intercourseDA().showIntercourse();//返回所有单位集合
}
if(request.getParameter("i_pinyin") == null && request.getParameter("i_name") == null){
arryIn = new intercourseDA().showIntercourse();//返回所有单位集合
}
if(request.getParameter("i_pinyin") != null && request.getParameter("i_name") == null){
arryIn = new intercourseDA().showIntercourseByPinyin(i_pinyin);
}
if(request.getParameter("i_name") != null && request.getParameter("i_pinyin") == null){
arryIn = new intercourseDA().showIntercourseByName(i_name);
}
}else{
i_type = Integer.parseInt(request.getParameter("i_type"));
if(request.getParameter("i_pinyin") != null && request.getParameter("i_name") != null){
arryIn = new intercourseDA().showIntercourseByType(i_type);//按单位类型返回单位集合
}
if(request.getParameter("i_pinyin") == null && request.getParameter("i_name") == null){
arryIn = new intercourseDA().showIntercourseByType(i_type);//按单位类型返回单位集合
}
if(request.getParameter("i_pinyin") != null && request.getParameter("i_name") == null){
arryIn = new intercourseDA().showIntercourseByPinyin(i_pinyin, i_type);
}
if(request.getParameter("i_name") != null && request.getParameter("i_pinyin") == null){
arryIn = new intercourseDA().showIntercourseByName(i_name, i_type);
}
}
}
%>
<%
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 = arryIn.size();
//记算总页数
intPageCount = (intRowCount + intPageSize-1) / intPageSize;
int startNum = (intPage - 1) * intPageSize;//当前页起始索引
int endNum = startNum + intPageSize;//当前页结束索引
if(endNum >= arryIn.size()){
endNum = arryIn.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='intercourse_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="35%" height="30" class="category">往来单位名称</td>
<td width="35%" class="category">单位拼音</td>
<td width="13%" class="category">单位类型</td>
<td width="10%" class="category">修改</td>
<td width="7%" class="category">删除</td>
</tr>
<%
for(int i = startNum;i < endNum;i++){
IntercourseForm form = (IntercourseForm)arryIn.get(i);//一行
%>
<tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''" onDblClick="javascript:var win=window.open('intercourse_show.jsp?iid=<%= form.getI_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"><%= form.getI_name() %></td>
<td align="center"><%= form.getI_pinyin() %></td>
<td align="center"><%if(form.getI_type() == 1){ %>客户<%}else{ %>供应商<%} %></td>
<td align="center"><a href="intercourse_update.jsp?iid=<%= form.getI_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="<%= form.getI_id() %>" style="border:0"></td>
</tr>
<%} %>
<tr>
<td colspan="5" height="30" class="category"><table align="center">
<tr>
<td> 第<%= intPage%>页 共<%= intPageCount%>页
<% //以下是分页的“上一页”“下一页”,有上一页就有链接,没有就为文字,下一页同理 %>
<% if(intPage > 1){ %>
<a href="intercourse_frame.jsp?page=<%= intPage-1%>&i_type=<%= i_type %><%if(request.getParameter("i_pinyin") != null){ %>&i_pinyin=<%= i_pinyin %><%} %><%if(request.getParameter("i_name") != null){ %>&i_name=<%= i_name %><%} %>">上一页</a>
<% }else{ %>
上一页
<%}%>
<% if(intPage < intPageCount){ %>
<a href="intercourse_frame.jsp?page=<%= intPage+1%>&i_type=<%= i_type %><%if(request.getParameter("i_pinyin") != null){ %>&i_pinyin=<%= i_pinyin %><%} %><%if(request.getParameter("i_name") != null){ %>&i_name=<%= i_name %><%} %>">下一页</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 + -