<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
action=request("action"):WS_Teid=request("WS_Teid"):searchtype=request("searchtype"):keywords=request("keywords"):searchmode=request("searchmode"):HX_Conn Dir:ColumnName="":Tablename="HX_Telsearch"
select case action
  case "search"
    Orderby=" where 1=1"
    if searchmode=1 then
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_Companyname like '%"&keywords&"%'"
	  else
	    Orderby=Orderby&" and WS_Telphone like '%"&keywords&"%'"
	  end if
	else
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_Companyname='"&keywords&"'"
	  else
	    Orderby=Orderby&" and WS_Telphone='"&keywords&"'"
	  end if
	end if
  case else
    Orderby=" ORDER BY WS_Teid DESC"
end select
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)   
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>常用电话查询</title>
<link rel=stylesheet type=text/css href="../HXinclude/HX_Style.css">
<script src="../hxinclude/HX_function.js"></script>
</head>
<body topmargin="20" leftmargin="0" bottommargin="25">
<table width="596"  border="0" cellspacing="1" cellpadding="0" align=center bgcolor="#613c25">
  <tr>
    <td colspan="2" bgcolor=FFFBE8><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="25" background="../hximages/titleline.gif"><font class="fontmenu">常用电话查询</font></td>
  </tr>
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor=613c25>
   <tr bgcolor="FFFBE8">
     <td height="24"><table width="100%"  border="0" cellspacing="1" cellpadding="2" bgcolor="#BF9B73">
       <tr bgcolor="#FFFBE8">
         <td width="14%"><div align="center">序号</div></td>
         <td width="52%" bgcolor="#FFFBE8"><div align="center">单位名称</div></td>
         <td width="34%" bgcolor="#FFFBE8"><div align="center">电话号码</div></td>
       </tr>
	<%if rs.recordcount<=0 then
	   response.Write "<tr><td colspan=3 height=25 bgcolor=FFFBE8 align=center><font color=red>暂 无 数 据!</font></td></tr>"
	else
    rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	ii=0
	do while not rs.EOF
	   %>
       <tr <%if ii mod 2=0 then response.write "bgcolor='#FFFBE8'" else response.write "bgcolor='#FFFBE8'"%>>
         <td align=center><%=rs("WS_Teid")%></td>
         <td><%=rs("WS_Companyname")%></td>
         <td><%=rs("WS_Telphone")%></td>
       </tr>
	   <%
	   ii=ii+1
	  if ii>=rs.PageSize then Exit Do
	  rs.movenext
      loop
      call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",3)
	   end if
	  call WS_S.HX_RSClose(rs) 
	   %>
       <form name="form1" method="post" action="?action=search"><tr bgcolor="#FFFBE8">
         <td colspan="4">查询：<select name="searchtype">
           <option value="1" selected>单位名称</option>
           <option value="2">电话号码</option>
         </select>
             <input name="keywords" type="text" size="25" maxlength="50">           
             <input type="radio" name="searchmode" value="1" id="mh" class="radio" checked><label for=mh>模糊</label>
			 <input type="radio" name="searchmode" value="2" id="jq" class="radio"><label for=jq>精确</label>
             <input type="submit" name="Submit2" value=" 搜 索 ">
</td>
         </tr></form>
     </table></td>
   </tr>
   <tr bgcolor="#FFFBE8">
    <td width="100%" height="24" align="right"><input type="button" name="Submit" value="打 印"></td>
    </tr> 
</table></td>
  </tr>
</table>

