📄 list_corpinfo.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="cs_conn.inc.asp"-->
<%
if not session("userClass")>=1 then
response.redirect "login.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>企业列表</title>
<link href="css/allsty.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a {
font-size: 12px;
font-weight: bold;
color: #000000;
text-decoration: none;
}
a:hover {
font-size: 12px;
font-weight: bold;
color: #FF0000;
text-decoration: underline;
}
.corptdbg {
color: #000000;
text-decoration: none;
background-color: #FFFFFF;
}
-->
</style>
</head>
<body>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" class="maintd" style="border-collapse: collapse">
<tr>
<td width="100%" valign="top">
<%
dim rs,sql
dim page,maxPerPage
maxPerPage=50 '每页显示的记录数
marketKeyword=Request("marketKeyword")
fovo_key=Request("fovo_key")
fovo_type=Request("fovo_type")
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="list_corpinfo.asp?marketKeyword="&marketKeyword
session("oldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select corp_info.*,calling_info.*,corp_info.id as corp_info_id from corp_info,calling_info where calling_info.corp_calling=corp_info.corp_calling "
if trim(request("corp_calling"))<>"" then
if trim(request("search_type"))<>"" then
sql=sql&" and corp_info.corp_calling='"&trim(request("corp_calling"))&"' and corp_info."&trim(request("search_type"))&" like '%"&marketKeyword&"%'"
else
sql=sql&" and corp_info.corp_calling='"&trim(request("corp_calling"))&"' and (corp_info.CorpName like '%"&marketKeyword&"%' or corp_info.corp_province like '%"&marketKeyword&"%' or corp_info.corp_linkman like '%"&marketKeyword&"%' or corp_info.corp_address like '%"&marketKeyword&"%' or corp_info.username like '%"&marketKeyword&"%') "
end if
else
if trim(request("search_type"))<>"" then
sql=sql&" and corp_info."&trim(request("search_type"))&" like '%"&marketKeyword&"%'"
else
sql=sql&" and (corp_info.CorpName like '%"&marketKeyword&"%' or corp_info.corp_province like '%"&marketKeyword&"%' or corp_info.corp_linkman like '%"&marketKeyword&"%' or corp_info.corp_address like '%"&marketKeyword&"%' or corp_info.username like '%"&marketKeyword&"%') "
end if
end if
sql=sql&" order by corp_info.id desc"
'response.write sql
'response.end
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<script language=Javascript>
<!--
function jumpTo(i){
if(i==1){
this.document.location='<%=thisUrl%>&search_type=<%=trim(request("search_type"))%>&corp_calling=<%=trim(request("corp_calling"))%>';}
if(i==2){
this.document.location='<%=thisUrl%>&page=<%=page-1%>&search_type=<%=trim(request("search_type"))%>&corp_calling=<%=trim(request("corp_calling"))%>';}
if(i==3){
this.document.location='<%=thisUrl%>&page=<%=page+1%>&search_type=<%=trim(request("search_type"))%>&corp_calling=<%=trim(request("corp_calling"))%>';}
if(i==4){
this.document.location='<%=thisUrl%>&page=<%=rs.pageCount%>&search_type=<%=trim(request("search_type"))%>&corp_calling=<%=trim(request("corp_calling"))%>';}
}
//-->
</script> <div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="770" style="border-collapse: collapse">
<tr>
<td valign="top">
<div align="center">
<table width="98%" border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td width="10%">查询方式: </td>
<form name="form1" action="list_corpinfo.asp" method="post">
<td width="90%" align="right">
<select name="corp_calling" class="fmsty1">
<option value="">所有</option>
<%
set rs_hangye=conn.execute("select * from calling_info")
do while not rs_hangye.eof
%>
<option <%
response.write "value='"&rs_hangye("corp_calling")&"'"
if trim(request("corp_calling"))=rs_hangye("corp_calling") then
response.write " selected"
end if
%>><%=rs_hangye("calling_Name")%></option>
<% rs_hangye.movenext
loop
rs_hangye.close:set rs_hangye=nothing
%>
</select>
<select name="search_type" class="fmsty1">
<option value="" >所有</option>
<option value="CorpName" <% if trim(request("search_type"))="CorpName" then response.write "selected"%> >企业名称</option>
<option value="corp_province" <% if trim(request("search_type"))="corp_province" then response.write "selected"%>>省份</option>
<option value="corp_linkman" <% if trim(request("search_type"))="corp_linkman" then response.write "selected"%>>联系人</option>
<option value="corp_address" <% if trim(request("search_type"))="corp_address" then response.write "selected"%>>地址</option>
<option value="username" <% if trim(request("search_type"))="username" then response.write "selected"%>>录入人</option>
<option value="">请选择</option>
</select>
<input name="marketKeyword" type="text" class="fmsty1" value="<%=marketKeyword%>" size="15">
<input name="Submit" type="submit" class="fmsty1" value="搜索">
</td>
</form>
</tr>
</table>
</div>
<table width="760" border="0" bordercolordark=#ffffff bordercolorlight=#FF6D00 cellspacing="0" cellpadding="2" align="center">
<tr>
<td width="82%" align="center">
<form method="post" action="list_corpinfo.asp" name="form1">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr>
<td width="23" align="center" class="corptdbg"><strong>ID</strong></td>
<td width="181" align="center" class="corptdbg"><strong>企业名称</strong></td>
<td width="27" align="center" class="corptdbg"><strong>省份</strong></td>
<td width="32" align="center" class="corptdbg"><strong>行业</strong></td>
<td width="39" align="center" class="corptdbg"><strong>重点</strong></td>
<td align="center" class="corptdbg"><strong>联系人</strong></td>
<td width="26" align="center" class="corptdbg" ><strong>电话</strong></td>
<td width="196" align="center" class="corptdbg"><strong>地址</strong></td>
<td width="42" align="center" class="corptdbg"><strong>邮编</strong></td>
<td width="43" align="center" class="corptdbg"><strong>录入人</strong></td>
<td width="58" align="center" class="corptdbg"><strong>录入时间</strong></td>
<td width="37" align="center" class="corptdbg"><strong>编辑</strong></td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
%>
<tr>
<td align="center" class="corptdbg"> <%=rs("corp_info_id")%></td>
<td class="corptdbg"><a href='view_corpinfo.asp?id=<%=rs("corp_info_id")%>' target=_blank><%=rs("CorpName")%></a></td>
<td align="center" class="corptdbg"><%=rs("corp_province")%></td>
<td align="center" class="corptdbg"><%'=rs("corp_calling")%>
<%
'#########################################################
'### 修改意见:如果你需要现在原始的行业名称,而不是用你下面的简单说明 就只要 response.write rs("calling_Name") 就可以了
'### 这样的好处是 不管你的行业以后将改什么名字,显示的结果都会跟这你的修改而修改,但是用你下面的方法,就是固定死了,要修改,就得人工修改,这样就违背了你在设计数据库的思想了,,因为你的行业名称是用代号显示,这样设计的好处就是为了防止改变行业名称的时候,而企业信息一起改变,这是我的一点看法,顺便说一下,我给你写的这个查询方式,是我独创的,很有代表性,也有很大的扩充性,你想查什么就可以查什么,而且语句非常简单,哈哈 希望以后你能多用组合查方式
'#########################################################
'response.write rs("calling_Name")
dim Corpcalling
Corpcalling=rs("corp_calling")
select case Corpcalling
case"1"
response.Write("罐头")
case"2"
response.Write("水产品")
case"3"
response.Write("肉制品")
case"4"
response.Write("茶叶")
case"5"
response.Write("肠衣")
case"6"
response.Write("蜂产品")
case"7"
response.Write("蛋制品")
case"8"
response.Write("速冻脱水果蔬")
case"9"
response.Write("糖类")
case"10"
response.Write("乳及乳制品")
case"11"
response.Write("饮料")
case"12"
response.Write("酒类")
case"13"
response.Write("花生干果")
case"14"
response.Write("粮食及面")
case"15"
response.Write("糖制品")
case"16"
response.Write("食用油脂")
case"17"
response.Write("调味品")
case"18"
response.Write("速冻方便简单")
case"19"
response.Write("功能简单")
case"20"
response.Write("简单添加剂)")
case else
response.Write("其他")
end select
%>
</td>
<td align="center" class="corptdbg"> <%
if rs("corp_quality")=1 then
response.Write("<font color=red><b>重点</b></font>")
else
response.Write("<font color=#666666>一般</font>")
end if
%>
</td>
<td align="center" class="corptdbg">
<%
if rs("corp_linkman")=" " then
response.Write("<font color=#222222>负责人</font>")
else if rs("corp_linkman")="" then
response.Write("<font color=#333333>负责人</font>")
else
response.Write(rs("corp_linkman"))
end if
end if
%> </td>
<td align="center" class="corptdbg"><%=rs("corp_telcom")%></td>
<td class="corptdbg"><%=rs("corp_address")%></td>
<td align="center" class="corptdbg"><%=rs("post_code")%></td>
<td align="center" class="corptdbg"><%=rs("username")%></td>
<td align="center" class="corptdbg"><%=rs("DateAndTime")%></td>
<td align="center" class="corptdbg"><a href="edit_corpinfo.asp?id=<%=rs("corp_info_id")%>" target="_blank">修改</a></td>
</tr>
<%
i=i+1
if i>maxPerPage then exit do
rs.moveNext
loop
%>
<tr>
<td colspan="12" class="corptdbg"> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td> <div align="right"><%=rs.recordCount%>
项 第<%=page%>/<%=rs.pageCount%> 页
<%if page>1 then%>
<input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上页" onClick="Javascript:jumpTo(2)">
<%else%>
<input type="button" name="Submit3" value="首页" disabled>
<input type="submit" name="Submit4" value="上页" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
<input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)">
<%else%>
<input type="submit" name="Submit5" value="下页" disabled>
<input type="submit" name="Submit6" value="末页" disabled>
<%end if%>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><a href="http://www.crescent.net.cn/">新月网络工作室</a> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -