<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "tree.RowSetPage"%>
<%@ page import = "tree.PagedStatement"%>
<%@ page import="tree.MyDbBean" %>
<%@ page import="java.sql.*" %>
<%
String kehuNo=request.getParameter("kehuNo");
String kehuName=request.getParameter("kehuName");
if(kehuNo==null)
{
kehuNo="";
}
if(kehuName==null)
{
kehuName="";
}
String sql="SELECT * FROM bj_kh_info";
PagedStatement pst=new PagedStatement(sql,1,5);
RowSetPage kehu_list=null;
ResultSet kehu_rst=null;
int rowCount=0;
int pageCount=0;
int pageSize=0;
int avacount=1;
int currentPage=0;
try{
  kehu_list=pst.executeQuery();
  currentPage=kehu_list.getCurrentPageNo();
  kehu_rst=kehu_list.getRowSet();
  rowCount=kehu_list.getTotalSize();
  pageCount=kehu_list.getTotalPageCount();
  pageSize=kehu_list.getPageSize();
}catch(Exception e)
{
  e.printStackTrace();
}
%>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="css/oa.css">
    <LINK rel="stylesheet" type="text/css" href="css/dcs2.css">
	<LINK rel="stylesheet" type="text/css" href="css/window.css">
  <script language="JavaScript" src="page.js" type=""></script>
  <script language="javascript1.2">
  function deleteUser(){
 	if(isClickEditor()==true){
		document.navigator.submit();
	}
	else alert("对不起,您未选择您要删除的用户!");
}

function isClickEditor()
{
    //判断点击了哪个checkbox
  var rowCount = document.all("rowCount").innerText;
  for(var i = 1; i <= rowCount; i++){
 	if(document.all("checkbox_"+i).checked == true){
             return true;
    }
 }
   return false;
}
function check_All(size)
 {
 for(var i = 1; i <= size; i++){
 	document.all("checkbox_"+i).checked = true;
  }
 }

 function query() {
   document.navigator.action="kehu_List.jsp"
   document.navigator.submit();
 }
</script>
<title>报价系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<style type="text/css">
<!--
.style1 {color: #0033FF}
-->
</style>
<link href="../css/oa.css" rel="stylesheet" type="text/css">
<link href="../css/dcs2.css" rel="stylesheet" type="text/css">
<link href="../css/window.css" rel="stylesheet" type="text/css">
</head>
<body class="avidmPageBody" >

<form name="navigator" action="deleteCustomer.jsp" method="POST">
  <input type="hidden" name="folderIID" value="" />
  <TABLE width=100% class="location">
  <TBODY>
    <TR>
      <TD width="451" height=19>您的位置： 客户列表</TD>
        <TD width="116" height=19 align=right>&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<table width="100%" border="0" align="center">
    <tr>
      <td width="54" nowrap ><A HREF="add_kehu.jsp"> <img src="../images/icons/join.gif" width="16" height="16" border="0" >增加</a></td>
      <td width="15" >|</td>
	  <td width="54" nowrap> <A HREF="kehu_delete.jsp"><img src="../images/icons/delete_icon.gif" width="16" height="16" border="0" >删除</a> </td>
      <td width="15" >|</td>
	  <td width="54" nowrap><a href="kehu_list.jsp"> <img src="../images/icons/find.gif" width="16" height="16" border="0" >查询</a></td>
	  <td nowrap>&nbsp;</td>
    </tr>
    <%
  //  RowSetPage empPage = (RowSetPage)request.getAttribute("empPage");
  //  if (empPage == null ) empPage = RowSetPage.EMPTY_PAGE;
    %>
  </table>
  <table>
    <tr>
      <td>客户编号：<input type="text" name="kehuNO" class="avidmTextFieldSmall" value=""></td>
      <td>客户名称:<input type="text" name="kehuName" class="avidmTextFieldSmall" value=""></td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="100%" class="avidmListTable" align="center">
    <tr>
      <td width="3%" align="center" nowrap  class="avidmTableHeader"><input type = 'checkbox' name = 'checkAll' id = "checkAll"  onClick = "check_All('')"></td>
      <td width="5%" align="center" nowrap  class="avidmTableHeader">客户编号</td>
      <td width="13%" align="center" nowrap class="avidmTableHeader">客户姓名</td>
      <td width="13%" align="center" nowrap  class="avidmTableHeader">客户地址</td>
      <td width="10%" align="center" nowrap  class="avidmTableHeader">联系电话1</td>
      <td width="10%" align="center" nowrap  class="avidmTableHeader">联系电话2</td>
      <td width="20%" align="center" nowrap  class="avidmTableHeader">详细信息</td>
      <!--
	  <td width="7%" align="center" class="avidmTableHeader">浏览文件</td>
      -->
      <td width="7%" align="center" class="avidmTableHeader">修改</td>
    </tr>
    <%
   // javax.sql.RowSet empRS = (javax.sql.RowSet) empPage.getRowSet();
   // if (empRS!=null) while (empRS.next() ) {
     int i=1;
     do
     {

    %>
    <tr id="user_list_<%=i%>" <%if(i>5){%>style="DISPLAY: none"<%}%>>
      <td class="avidmTableData" align="center" nowrap>
      <input type = 'checkbox' onClick="checkSomeBox(this)" id="checkbox_" name="checkbox_" value="" class="avidmCheckBox"></td>
      <td class="avidmTableData" align="center" nowrap><%= kehu_rst.getString("kh_bianhao")%></td>
      <td class="avidmTableData" align="center" nowrap><%= kehu_rst.getString("kh_name")%></td>
      <td class="avidmTableData" align="center" nowrap><%= kehu_rst.getString("kh_address")%></td>
      <td class="avidmTableData" align="center" nowrap><%= kehu_rst.getString("kh_dianhua1")%></td>
      <td class="avidmTableData" align="center" nowrap><%= kehu_rst.getString("kh_dianhua2")%></td>
      <td class="avidmTableData" align="center" nowrap><a href="kehu_info.jsp" class="style1">详细信息</a>
          <!--
      <td class="avidmTableData" align="center" nowrap width="7%"><a href="modifyCustomer.jsp?cstIID="><img src="../images/sysadm/edit_icon.gif" alt="修改" name="Image6" width="16" height="16" border="0" ></a></td>
      -->
    <td class="avidmTableData" align="center" nowrap><a href="add_kehu.jsp?cstIID="><img src="../images/sysadm/edit_icon.gif" alt="修改" name="Image6" width="16" height="16" border="0" ></a></td>
    <%
      i++;}
      while(kehu_rst.next());
      %>
<script language="javascript" src="../javascript/page.js" type=""></script>
       <tr>
<%
    //显示总页数和当前页数(pageno)以及分页代码。
    //此处doQuery为页面上提交查询动作的javascript函数名， pageno为标识当前页码的参数名
%>
         <!--   <td colspan=4><%= kehu_list.getHTML("query","pageno")%></td>-->

        </tr>
      </table>
      <table width="100%" border="0" class="avidmTableBottom">
 	 <tr>
   	 <td align="left">
    	  每页显示
     	   <select name="selectPageSize"  width=7 class="avidmComboBoxLittle" onchange="changePageSize('user_list_',this,document.forms[0].selectCurrentPage)">
     	     <option value="5">5
     	     <option value="10">10
       	   <option value="15">15
           <option value="20">20
        </select>
      条记录
    </td>
     <td>
      <div id="user_list_pageSize" style="DISPLAY: none" align="center">5</div>
    </td>
    <td>
      <div align="right">共有</div>
    </td>
    <td>
      <div align="center" id="user_list_rowCount"><%=rowCount%></div>
    </td>
    <td>
      <div align="left">条记录</div>
    </td>
    <td>&nbsp;</td>
    <td>
      <div align="right">第</div>
    </td>
    <td>
      <div align="center" id="user_list_currentPage"><%=currentPage%></div>
    </td>
    <td>
      <div align="center">/</div>
    </td>
   <td>
      <div align="center" id="user_list_pageCount"><%= pageCount%></div>
    </td>
    <td>
      <div align="left">页</div>
    </td>
    <td>&nbsp;</td>
    <td><a href="javascript:first('user_list_')" class="avidmTabLink">首页</a></td>
    <td>&nbsp;</td>
    <td><a href="javascript:previse('user_list_')" class="avidmTabLink">前一页</a></td>
    <td>&nbsp;</td>
    <td><a href="javascript:next('user_list_')" class="avidmTabLink">后一页</a></td>
    <td>&nbsp;</td>
    <td><a href="javascript:last('user_list_')" class="avidmTabLink">尾页</a></td>
    <td>&nbsp;</td>
    <td align="right">
    跳转到
      <select name="selectCurrentPage" class="avidmComboBoxLittle" onchange="goPage('user_list_',this)">
        <%
          for(i = 1; i <= pageCount; i++) {
        %>
        <option value="<%=i%>"><%=i%>
        <%
          }
        %>
      </select>
    页
    </td>
  </tr>
</table>
</form>
</body>
</html>
