📄 search.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim rs,conn
If Request.Form.Count > 0 Then
Dim C
Dim StrWhere
StrWhere = ""
'Set conn=Server.CreateObject("ADODB.Connection")
'OpenDBCrm( conn )
'Set C = Server.CreateObject ("CMS2003.DBhandle")
'C.Init(conn)
'StrWhere = C.Search("Is")
if Request.Form("Isproductname") > 0 then
StrWhere = StrWhere & " and productname Like '%" & Request.Form("productname") & "%'"
end if
if Request.Form("Isbigclass") > 0 then
StrWhere = StrWhere & " and bigclass=" & Request.Form("bigclass")
end if
if Request.Form("Issmallclass") > 0 then
StrWhere = StrWhere & " and smallclass=" & Request.Form("smallclass")
end if
if Request.Form("Issupply") > 0 then
StrWhere = StrWhere & " and supply Like '%" & Request.Form("supply") & "%'"
end if
if Request.Form("Isshortname") > 0 then
StrWhere = StrWhere & " and shortname Like '%" & Request.Form("shortname") & "%'"
end if
if Request.Form("Isproarea") > 0 then
StrWhere = StrWhere & " and proarea Like '%" & Request.Form("proarea") & "%'"
end if
if Request.Form("Isproducer") > 0 then
StrWhere = StrWhere & " and producer Like '%" & Request.Form("producer") & "%'"
end if
if Request.Form("Isbarcode") > 0 then
StrWhere = StrWhere & " and barcode Like '%" & Request.Form("barcode") & "%'"
end if
Dim costprice1, costprice2
Dim marketprice1, marketprice2
Dim supplyprice1, supplyprice2
Dim CreateTime1, CreateTime2
if Request.Form("Iscostprice") > 0 then
if Request.Form("costprice1") = "" then
costprice1 = 0
else
costprice1 = CDbl(Request.Form("costprice1"))
end if
if Request.Form("costprice2") = "" then
costprice2 = 0
else
costprice2 = CDbl(Request.Form("costprice2"))
end if
StrWhere = StrWhere & " and costprice between '" & costprice1 & "' and '" & costprice2 & "' "
end if
if Request.Form("Ismarketprice") > 0 then
if Request.Form("marketprice1") = "" then
marketprice1 = 0
else
marketprice1 = CDbl(Request.Form("marketprice1"))
end if
if Request.Form("marketprice2") = "" then
marketprice2 = 0
else
marketprice2 = CDbl(Request.Form("marketprice2"))
end if
StrWhere = StrWhere & " and marketprice between '" & marketprice1 & "' and '" & marketprice2 & "' "
end if
if Request.Form("Issupplyprice") > 0 then
if Request.Form("supplyprice1") = "" then
supplyprice1 = 0
else
supplyprice1 = CDbl(Request.Form("supplyprice1"))
end if
if Request.Form("supplyprice2") = "" then
supplyprice2 = 0
else
supplyprice2 = CDbl(Request.Form("supplyprice2"))
end if
StrWhere = StrWhere & " and supplyprice between '" & supplyprice1 & "' and '" & supplyprice2 & "' "
end if
if Request.Form("IsCreateTime") > 0 then
if Request.Form("CreateTime1") = "" then
CreateTime1 = Date()
else
CreateTime1 = CDate(Request.Form("CreateTime1"))
end if
if Request.Form("CreateTime2") = "" then
CreateTime2 = Date()
else
CreateTime2 = CDate(Request.Form("CreateTime2"))
end if
StrWhere = StrWhere & " and CreateTime between '" & CreateTime1 & "' and '" & CreateTime2 & "' "
end if
'Response.Write "StrWhere=" & StrWhere
'Response.End
Response.Redirect "List.asp?W=" & Server.URLEncode(StrWhere)
'conn.Close
'Set conn = Nothing
End If
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
<!--读取分类字段赋给JS数组-->
dim count
Set conn=Server.CreateObject("ADODB.Connection")
OpenDBCrm( conn )
set rs=server.createobject("adodb.recordset")
rs.open "select * from T_CRM_Guest_industry",conn,1,1
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Gindustry"))%>","<%= rs("Gtype_ID")%>","<%= rs("ID")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Gindustry.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Gindustry.options[document.myform.Gindustry.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%
Sub Main
%>
<HTML><HEAD>
<form action="" method="post" name=myform>
</HEAD>
<BODY>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr align="middle">
<td width="15%">产品查询</td>
<td width="85%"> </td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isproductname value=1>产品名称</td>
<td><input class="Input" name="productname" Check="1" Show="产品名称" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isbigclass value=1>产品大类</td>
<td>
<%
Set rs = conn.Execute("select * from T_CRM_Guest_type")
if rs.eof and rs.bof then
Response.Write "请先添加产品大类信息"
else
%>
<select name="bigclass" style="width:133px" onChange="changelocation(document.myform.Gtype.options[document.myform.Gtype.selectedIndex].value)">
<option selected value="<%=rs("ID")%>"><%=trim(rs("Gtype"))%></option>
<%
dim selclass
selclass=rs("ID")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("ID")%>"><%=trim(rs("Gtype"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
</td>
</td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Issmallclass value=1>产品小类</td>
<td>
<%
rs.open "select * from T_CRM_Guest_industry where Gtype_ID="&Cint(selclass) ,conn,1,3
if rs.eof and rs.Bof then
response.Write "请先添加产品小类信息"
rs.close
else
%>
<select style="width:133px" name="smallclass">
<option value="<%=rs("ID")%>" selected><%=rs("Gindustry")%></option>
<%
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("ID")%>"><%=rs("Gindustry")%></option>
<%
rs.movenext
loop
end if
%>
</select>
</td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Issupply value=1>供应商</td>
<td><input class="Input" name="supply" Check="1" Show="供应商" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isshortname value=1>产品简称</td>
<td><input class="Input" name="shortname" Check="1" Show="产品简称" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isproarea value=1>产品产地</td>
<td><input class="Input" name="proarea" Check="1" Show="产品产地" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isproducer value=1>生产商</td>
<td><input class="Input" name="producer" Check="1" Show="生产商" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Isbarcode value=1>条形码</td>
<td><input class="Input" name="barcode" Check="1" Show="条形码" ></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Iscostprice value=1>成本价</td>
<td>从<input class=Input name="costprice1" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="成本价">至<input class="Input" name="costprice2" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="成本价"></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Ismarketprice value=1>市场价</td>
<td>从<input class=Input name="marketprice1" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="市场价">至<input class="Input" name="marketprice2" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="市场价"></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=Issupplyprice value=1>代理价</td>
<td>从<input class=Input name="supplyprice1" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="代理价">至<input class="Input" name="supplyprice2" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="代理价"></td>
</tr>
<tr class=Ltr >
<td align="left"><input type="checkbox" name=IsCreateTime value=1>增加时间</td>
<td>从<input class=Input name="CreateTime1" readonly onclick="InputDate(this)" style="HEIGHT: 22px; WIDTH: 80px" Check="1" Show="增加时间">至<input class="Input" name="CreateTime2" style="HEIGHT: 22px; WIDTH: 80px" Check="1" readonly Show="增加时间" onclick="InputDate(this)"></td>
</tr>
</table>
<table cellspacing=1 cellpadding=3>
<tr>
<td>
<input type="submit" name="Submit" class=Button value="提 交">
<input type="button" class=Button value="取 消" onclick="doList()" id=button1 name=button1></td>
<td></td>
</tr>
</table>
</FORM>
<%
End Sub
%>
<!-- #include virtual="Templet/Templet.asp" -->
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -