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

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.  String c01="";
  10.  int i01;
  11.  i01 = 0;
  12.  
  13. keyword=request.getParameter("keyword");
  14. if(keyword==null){
  15. keyword="";
  16. }else{
  17. keyword=getGBString(keyword);
  18. }
  19. String admin_username;
  20.  String customer_name="";
  21.  //获取客户名称
  22.  admin_username = (String)session.getAttribute("admin_username");
  23.  sql="SELECT NAME1 FROM ZSD_KNA1 where KUNNR="+admin_username;
  24.  //out.print(sql);
  25.   rs=smt.executeQuery(sql);
  26. while(rs.next()){
  27. customer_name =rs.getString("NAME1");
  28. }
  29. %>
  30. <HTML>
  31. <HEAD>
  32. <TITLE>+ + 翔鹭石化 + +</TITLE>
  33. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  34. <link href="../style.css" rel="stylesheet" type="text/css">
  35. </HEAD>
  36. <BODY BGCOLOR=#CFE7F3 vlink="#666666" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 >
  37. <table width="778" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  38.         <tr> 
  39.           <img src="../images/in1p_CRM1.gif" width="778" height="90"></td>
  40.         </tr>
  41.   <tr> 
  42.     <td width="26" height="26"><img src="../images/indl1.gif" width="26" height="26"></td>
  43.     <td width="165" height="26"><img src="../images/in1t2.gif" width="165" height="26"></td>
  44.     <td height="26" align="right"><img src="../images/in1tblk.gif" width="585" height="26"></td>
  45.   </tr>
  46.  
  47. </table>
  48. <table width="778" height="300" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  49.   <tr> 
  50.     <td>&nbsp;</td>
  51.     <td align="right" valign="top" bgcolor="f0f0f0">
  52. <!--子目录-->
  53. <%@include file="s2menu.jsp"%>
  54. <!--子目录-->
  55.       <table width="100%" cellspacing="0" cellpadding="0" >
  56.         <tr> 
  57.           <td><img src="../images/in1left.gif" width="165" height="100">
  58.         </tr>
  59.       </table>
  60.   </td>      
  61.     <td align="center" valign="top">
  62.         <table width="80%">
  63.   <tr>
  64.     <td >
  65.   <p align="center"><strong><font size="+2"><%=customer_name%></font></strong></p>
  66. </td>
  67.   </tr>
  68.   <tr>
  69.     <td >
  70.   <p align="center"><strong><font size="3">承运商运费</font></strong></p>
  71. </td>
  72.   </tr>
  73.   <form name="frm_search" action="c_customer_yf_list.jsp" method="post">
  74.     <tr> 
  75.       <td align="left" bgcolor="#ffffff" height=20>请输入查询年度:<input type="text" name="keyword"> <input type="submit" name="s1" value="搜 索" style="width:60px;height:22px;"></td>
  76.     </tr>
  77.   </form>   
  78. </table>
  79.        <!--新闻列表-->
  80.        <%
  81.                 String column_id="3";
  82. String column_title;
  83. int intPageSize; //一页显示的记录数
  84. int intRowCount; //记录总数
  85. int intPageCount; //总页数
  86. int intPage; //待显示页码
  87. String strPage;
  88. int i;
  89. //版本控制
  90. intPageSize = 12; //设置一页显示的记录数
  91. strPage = request.getParameter("page"); //取得待显示页码
  92. if(isNotInteger(strPage)){//表明在QueryString中没有page这一个参数,此时显示第一页数据
  93. intPage = 1;
  94. }
  95. else{//将字符串转换成整型
  96. intPage = java.lang.Integer.parseInt(strPage);
  97. if(intPage<1) intPage = 1;
  98. }
  99. sql = "select c_id,KUNNR,ZYEAR,ZMONTH,FKIMG,KBETR,NETWR,ERDAT,ERZET from ZSD_YF ";
  100. sql = sql + " where (kunnr='"+admin_username+"')and(me_ver='cn') order by ZYEAR DESC,ZMONTH DESC ";
  101.                    if(keyword.length()!=0)
  102.  {
  103.                     sql = "select c_id,KUNNR,ZYEAR,ZMONTH,FKIMG,KBETR,NETWR,ERDAT,ERZET from ZSD_YF ";
  104.        sql = sql + " where (ZYEAR like '%"+keyword+"%')and(kunnr='"+admin_username+"')and(me_ver='cn') order by ZYEAR DESC,ZMONTH DESC ";
  105.                      }
  106.      rs=smt.executeQuery(sql);
  107. rs.last();
  108. intRowCount = rs.getRow(); //获取记录总数
  109. intPageCount = (intRowCount+intPageSize-1) / intPageSize; //记算总页数
  110. if(intPage>intPageCount) intPage = intPageCount; //调整待显示的页码
  111. %>
  112.        <table border="1" cellpadding="2" cellspacing="0" class="p9" bordercolor="#cccccc" bordercolordark="#FFFFFF" bordercolorlight="#cccccc" width="95%">
  113.          <tr> 
  114.    <td height="25" width="55" align="center"><strong><font color="#0000FF">客户编号</font></strong></td>
  115.    <td width="28" align="center"><strong><font color="#0000FF">年度</font></strong></td>
  116.    <td width="28" align="center"><strong><font color="#0000FF">月份</font></strong></td>
  117.    <td width="90" align="center"><strong><font color="#0000FF">销售数量(TON)</font></strong></td>
  118.    <td width="90" align="center"><strong><font color="#0000FF">运费单价(RMB)</font></strong></td>
  119.    <td width="90" align="center"><strong><font color="#0000FF">运费总额(RMB)</font></strong></td>
  120.    <td width="115" align="center"><strong><font color="#0000FF">最后更新时间</font></strong></td>
  121.          </tr>               
  122.  <%
  123. if(intPageCount>0){
  124. //将记录指针定位到待显示页的第一条记录上
  125. rs.absolute((intPage-1) * intPageSize + 1);
  126. //显示数据
  127. i = 0;
  128. while(i<intPageSize && !rs.isAfterLast()){
  129. %>        
  130.          <tr> 
  131.    <td height="25" width="55"  align="center"><%=rs.getString("KUNNR")%></td>
  132.    <td align="center"><%=rs.getString("ZYEAR")%></td>
  133.    <td align="center"><%=rs.getString("ZMONTH")%></td>
  134.    <td align="center"><%=rs.getString("FKIMG")%></td>
  135.    <td align="center">
  136.    <%
  137.    c01=rs.getString("KBETR");
  138.    i01=rs.getInt("KBETR");
  139.    %>
  140.    <% if(i01==0){%>
  141.    --
  142.    <%}
  143.    else {
  144.    %>
  145.    <%=c01%>
  146.    <% }%></td>
  147.    <td align="center"><font color="#ff6600">
  148.    <% if(i01==0){%>
  149.    --
  150.    <%}
  151.    else {
  152.    %>
  153.    <%=rs.getString("NETWR")%>%
  154.    <% }%>
  155.    </font></td>
  156.    <td width="115" align="center"><%=rs.getDate("ERDAT")%> <%=rs.getTime("ERZET")%></td>
  157.          </tr>
  158.          <%
  159. rs.next();
  160. i++;
  161. }
  162. }
  163. rs.close();
  164. %>
  165. <!--新闻列表-->
  166.       </table>
  167.       <br>
  168.       <table width="100%" cellspacing="0" cellpadding="0">
  169.         <tr> 
  170.           <td align="right">
  171. <div align="center"> <strong>分页显示:</strong> <FONT color=red>第<%=intPage%>页 
  172.                           共<%=intPageCount%>页 | 总<%=intRowCount%>条</FONT> 
  173.                           <%@include file="../include/showpage.jsp"%>
  174.                           &nbsp;&nbsp; 转到第
  175.                           <input type="text" name="goto_page1" value=<%=intPage%> class=box1 size=3 maxlength=3>
  176.                           页 
  177.                           <input style="height:19;WIDTH: 42px;" class="s02" hideFocus type="button" value="Go" name="cmd_goto" onclick="javascript:viewPage(document.all.goto_page1.value);">
  178.                         </div>
  179.                         </span> <form action="c_customer_yf_list.jsp" method=post name="frm_page">
  180.                           <input type="hidden" name="page">
  181.                           <input type="hidden" name="column_id" value=<%=column_id%>>
  182.                           <input type="hidden" name="keyword" value=<%=keyword%>>
  183.                         </form>
  184. </td>
  185.         </tr>
  186.       </table></td>
  187.   </tr>
  188. </table>
  189. <table width="778" align="center" cellpadding="0" cellspacing="0" bgcolor="#999999">
  190.   <tr> 
  191.     <td><img src="../images/spacer.gif" width="1" height="1"></td>
  192.   </tr>
  193. </table>
  194. <%@include file="../include/bottom02.jsp"%>
  195. </BODY>
  196. </HTML>