⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stock_index.jsp

📁 《JSP数据库系统开发完全手册》配套关盘
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<%@ page import="com.zh.conpool.Condata"%>
<% request.setCharacterEncoding("gb2312"); %>
<%@ page import="com.zh.util.Stockupdate"%> 
<%
	String sess=(String)session.getAttribute("username");
	if(sess==null||sess.equals("")){
		response.sendRedirect("../main.jsp");
	}else{
		swing.Rous rou=new swing.Rous();
		boolean maybe=rou.toInt(sess,"row124");
		if(!maybe){
			response.sendRedirect("../notrous.jsp");
		}
	}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../css/style1.css" rel="stylesheet">
</head>

<%
 	com.zh.util.Stockupdate stock=new com.zh.util.Stockupdate();
	Condata con=new Condata();
	String id=request.getParameter("id");
%>

<table width="100%" height="25" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#F9FFF4">
  <tr>
    <td> &nbsp;&nbsp;<img src="../images/Manual14.gif" width="16" height="16">客户管理&nbsp;&gt;&gt;&nbsp;<img src="../images/Manual54.gif" width="16" height="16"><a href="Stock_Index_Add.jsp?id=<%=id%>" target="mainName">添加采购记录</a>      <hr color="#006699" size="1">
  &nbsp;&nbsp;<img src="../images/icon_group.gif" width="15" height="15"><a href="Client_Index_Sql.jsp?id=<%=id%>&&tag=1">客户信息</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="../images/Manual54.gif" width="16" height="16"><a href="Stock_Index.jsp?id=<%=id%>">采购记录</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="../images/Manual65.gif" width="16" height="16"><a href="Follow_Index.jsp?id=<%=id%>">跟进记录</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="../images/Manual1.gif" width="16" height="16"><a href="Call_Index.jsp?id=<%=id%>">回访记录</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="../images/Manual11.gif" width="16" height="16"><a href="Demand_Index.jsp?id=<%=id%>">需求表</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="../images/icon_go_left.gif" width="15" height="15"><a href="Client_Index.jsp">返回</a>
    <hr color="#cccccc" size="1">    </td>
  </tr>
</table>
<table width="100%" height="80" border="1" cellpadding="0" cellspacing="0" bordercolor="#Eff2fb" bordercolordark="#F9F9FB" bordercolorlight="#Eff2fb">
   <tr align="center" bgcolor="#Eff2fb">
   		<td width="16%" height="26" bgcolor="#Eff2fb">采购日期</td>
 		<td width="31%" height="26">采购项目</td>
    	<td width="22%" height="26">采购金额</td>
  		<td width="11%" height="26">备注</td>
	    <td width="11%">操作</td>
   </tr>
<%
	ResultSet rs=null;
	String sql="select * from tb_Stcokadd where ClientId='"+id+"' order by Id Desc";
	String tab;
	int pagecount=0;
	int showpage=1;
	int pagesize=4;
	int rowcount=0;
	try{
		con.getConnection();
	}catch(Exception e){
	}
	rs=con.executeQuery(sql);
	//int num=0;
	if(!rs.next()){
		out.println("数据库没有记录");
	}else{
		rs.last();
		rowcount=rs.getRow();
		pagecount=(((rowcount%pagesize)==0)?(rowcount/pagesize):(rowcount/pagesize+1));
		String topage=request.getParameter("topage");
		if(topage==null){
			showpage=1;
		}else{
			showpage=Integer.parseInt(topage);
		}
		if(showpage>pagecount){
			showpage=pagecount;
		}
		if(showpage<=0){
			showpage=1;
		}
		rs.absolute((showpage-1)*pagesize+1);
		for(int i=1;i<=pagesize;i++){
			tab=rs.getString(1);
			//num++;
%>
   <tr align="center">
     <td height="26"><%=rs.getDate(3)%></td>
     <td height="26"><%=rs.getString(4)%></td>
     <td height="26"><%=rs.getString(5)%></td>
     <td height="26"><%=rs.getString(6)%></td>
     <td height="26"><a href="Stock_Index_Update.jsp?tab=<%=tab%>&&id=<%=id%>"><img src="../images/ico/a_delete.gif" width="52" height="16" border="0"></a></td>
  </tr>

<%
	if(!rs.next())
	break;
	}
	}
	try{
		con.close();
		con=null;
	}catch(Exception e){
		e.getMessage();
	}
%>
   <tr align="center">
     <td height="26" colspan="6" bgcolor="#EFF3FF"><a href="Stock_Index.jsp?topage=<%=showpage-1%>&&id=<%=id%>"><img src="../images/1-prev.gif" width="36" height="11" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Stock_Index.jsp?topage=<%=showpage+1%>&&id=<%=id%>"><img src="../images/1-next.gif" width="36" height="11" border="0"></a></td>
   </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -