customer_list.jsp
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. <%@ page contentType="text/html;charset=gb2312"%> 
  2. <%@include file="../include/checkadmin.jsp"%>
  3. <%@page import="java.sql.*"%>
  4. <%@include file="../include/db_conn.jsp"%>
  5. <%@include file="../include/const.jsp"%>
  6. <%@include file="../include/isNotInteger.jsp"%>
  7. <%!String keyword;%>
  8. <%
  9. keyword=request.getParameter("keyword");
  10. if(keyword==null){
  11. keyword="";
  12. }else{
  13. keyword=getGBString(keyword);
  14. }
  15. %>
  16. <HTML>
  17. <HEAD>
  18. <TITLE>+ + 翔鹭石化 + +</TITLE>
  19. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  20. <link href="../style.css" rel="stylesheet" type="text/css">
  21. </HEAD>
  22. <BODY BGCOLOR=#CFE7F3 vlink="#666666" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 >
  23. <table width="778" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  24.         <tr> 
  25.           <img src="../images/in1p_CRM1.gif" width="778" height="90"></td>
  26.         </tr>
  27.   <tr> 
  28.     <td width="26" height="26"><img src="../images/indl1.gif" width="26" height="26"></td>
  29.     <td width="165" height="26"><img src="../images/in1t2.gif" width="165" height="26"></td>
  30.     <td height="26" align="right"><img src="../images/in1tblk.gif" width="585" height="26"></td>
  31.   </tr>
  32.  
  33. </table>
  34. <table width="778" height="300" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  35.   <tr> 
  36.     <td>&nbsp;</td>
  37.     <td align="right" valign="top" bgcolor="f0f0f0">
  38. <!--子目录-->
  39. <%@include file="s2menu_admin.jsp"%>
  40. <!--子目录-->
  41.       <table width="100%" cellspacing="0" cellpadding="0" >
  42.         <tr> 
  43.           <td><img src="../images/in1left.gif" width="165" height="100">
  44.         </tr>
  45.       </table>
  46.   </td>      
  47.     <td align="center" valign="top">
  48.         <table width="80%">
  49.   <tr>
  50.     <td >
  51.   <p align="right"><strong><font size="+1"><font color="#0000FF">客 户 列 表</font></font></strong></p>
  52. </td>
  53.   </tr>
  54.   <form name="frm_search" action="customer_list.jsp" method="post">
  55.     <tr> 
  56.       <td align="left" bgcolor="#ffffff" height=20>请输入客户信息(名称或编号):<input type="text" name="keyword"> <input type="submit" name="s1" value="搜 索" style="width:60px;height:22px;"></td>
  57.     </tr>
  58.   </form>   
  59. </table>
  60.        <!--新闻列表-->
  61.        <% String column_id="3";
  62. String column_title;
  63. int intPageSize; //一页显示的记录数
  64. int intRowCount; //记录总数
  65. int intPageCount; //总页数
  66. int intPage; //待显示页码
  67. String strPage;
  68. int i;
  69. //版本控制
  70. intPageSize = 12; //设置一页显示的记录数
  71. strPage = request.getParameter("page"); //取得待显示页码
  72. if(isNotInteger(strPage)){//表明在QueryString中没有page这一个参数,此时显示第一页数据
  73. intPage = 1;
  74. }
  75. else{//将字符串转换成整型
  76. intPage = java.lang.Integer.parseInt(strPage);
  77. if(intPage<1) intPage = 1;
  78. }
  79. sql = "select c_id,KUNNR,NAME1,ERDAT,ERZET from ZSD_KNA1 ";
  80. sql = sql + " where me_ver='cn' order by KUNNR ";
  81.                    if(keyword.length()!=0)
  82.  {
  83. sql = "select c_id,KUNNR,NAME1,ERDAT,ERZET from ZSD_KNA1 ";
  84. sql = sql + " where((KUNNR LIKE '%"+keyword+"%')OR(NAME1 LIKE '%"+keyword+"%'))and(me_ver='cn')order by KUNNR ";
  85.  }
  86. // out.print(sql);
  87. rs=smt.executeQuery(sql);
  88. rs.last();
  89. intRowCount = rs.getRow(); //获取记录总数
  90. intPageCount = (intRowCount+intPageSize-1) / intPageSize; //记算总页数
  91. if(intPage>intPageCount) intPage = intPageCount; //调整待显示的页码
  92. %>
  93.        <table width="95%" cellspacing="0" cellpadding="0">
  94.  <%
  95. if(intPageCount>0){
  96. //将记录指针定位到待显示页的第一条记录上
  97. rs.absolute((intPage-1) * intPageSize + 1);
  98. //显示数据
  99. i = 0;
  100. while(i<intPageSize && !rs.isAfterLast()){
  101. %>        
  102.          <tr> 
  103.            <td height="25">
  104.            <img src="../images/dot01.gif" width="5" height="5"> 
  105.            <a href="x_customer_detail.jsp?c_id=<%=rs.getInt("c_id")%>" target="_blank">
  106.            <font color="#0033FF"><%=rs.getString("NAME1").trim()%>(客户编号:<%=rs.getString("KUNNR")%>)</font>
  107.            </a>  
  108. --最后更新时间:<%=rs.getDate("ERDAT")%> <%=rs.getTime("ERZET")%>
  109.            </td>
  110.          </tr>
  111.          <tr> 
  112.            <td height="1" bgcolor="f0f0f0"><img src="../images/spacer.gif" width="1" height="1"></td>
  113.          </tr>
  114.          <%
  115. rs.next();
  116. i++;
  117. }
  118. }
  119. rs.close();
  120. %>
  121. <!--新闻列表-->
  122.       </table>
  123.       <br>
  124.       <table width="100%" cellspacing="0" cellpadding="0">
  125.         <tr> 
  126.           <td align="right">
  127. <div align="center"> <strong>分页显示:</strong> <FONT color=red>第<%=intPage%>页 
  128.                           共<%=intPageCount%>页 | 总<%=intRowCount%>条</FONT> 
  129.                           <%@include file="../include/showpage.jsp"%>
  130.                           &nbsp;&nbsp; 转到第
  131.                           <input type="text" name="goto_page1" value=<%=intPage%> class=box1 size=3 maxlength=3>
  132.                           页 
  133.                           <input style="height:19;WIDTH: 42px;" class="s02" hideFocus type="button" value="Go" name="cmd_goto" onclick="javascript:viewPage(document.all.goto_page1.value);">
  134.                         </div>
  135.                         </span> <form action="customer_list.jsp" method=post name="frm_page">
  136.                           <input type="hidden" name="page">
  137.                           <input type="hidden" name="column_id" value=<%=column_id%>>
  138.                           <input type="hidden" name="keyword" value=<%=keyword%>>
  139.                         </form>
  140. </td>
  141.         </tr>
  142.       </table></td>
  143.   </tr>
  144. </table>
  145. <table width="778" align="center" cellpadding="0" cellspacing="0" bgcolor="#999999">
  146.   <tr> 
  147.     <td><img src="../images/spacer.gif" width="1" height="1"></td>
  148.   </tr>
  149. </table>
  150. <%@include file="../include/bottom02.jsp"%>
  151. </BODY>
  152. </HTML>