?? search.asp
字號:
<%
'////////////////////////////////////////////////////////////////
'/////文 件 名:綜合查詢模塊
'/////程序名稱:dbdisp/search.asp
'/////程序描述:
'/////所屬模塊:公共
'/////邏輯結(jié)構(gòu):
'/////創(chuàng)建日期:
'/////修改日期:
'/////創(chuàng) 建 人:熊偉
'////////////////////////////////////////////////////////////////
%>
<!-- #include file="../inc/css.asp" -->
<%
dim t1,t2,t3
t1=split(Request.Form("sFileds"),",")
t2=split(Request.Form("sFiledsCaptions"),",")
for i=0 to uBound(t1)
t3=t3+vbcrlf+"<option value='"+t1(i)+"'>"+t2(i)+"</option>"
next
%>
<script language=JavaScript>
function setcond()//添加查詢條件
{
var temp=document.all.s1.value.toString().split('^');
if( document.all.s3.value==''){
alert('請輸入完整查詢條件!');
return false;
}
if(temp[0]=='n' && document.all.s2.value.toString().indexOf('LIKE')>0){
alert('數(shù)字型字段不允許進(jìn)行包含或不包含操作!')
return false;
}
var iValue=temp[1];
iValue+=' ' ;
iValue+=document.all.s2.value;
iValue+=' ';
if(temp[0]=='c')iValue+="'" ;
if(document.all.s2.value.toString().indexOf('LIKE')>0)iValue+="%" ;
iValue+=document.all.s3.value ;
if(document.all.s2.value.toString().indexOf('LIKE')>0)iValue+="%" ;
if(temp[0]=='c')iValue+="'" ;
if(temp[1].indexOf('(')>0)iValue+=")" ;
iText=document.all.s1.options(document.all.s1.selectedIndex).text
iText+=' ';
iText+=document.all.s2.options(document.all.s2.selectedIndex).text
iText+=' ';
iText+=document.all.s3.value
var namesel=window.Option.create(iText,iValue);
document.all.Condlist.add(namesel);
}
function removecond()
{ if(document.all.Condlist.selectedIndex>=0)
{
document.all.Condlist.remove(document.all.Condlist.selectedIndex)
};
}
function CountValue()//合并查詢條件并提交
{
document.all.mCond2.value='';
for(i=document.all.Condlist.options.length-1;i>=0;i--)
{
if(document.all.mCond2.value!='')document.all.mCond2.value+=' and ';
document.all.mCond2.value+=' ';
document.all.mCond2.value+=document.all.Condlist.options(i).value.toString().replace('[','<').replace(']','>');
}
document.all.d.submit();
}
</script>
<%
dim title,image
title=Request.Form("sTitle")
image="../images/search.gif"
%>
<body onLoad=self.focus()>
<!-- #include file="../inc/title.asp" -->
<form name="d" method="post" action="../dbdisp/disp.asp" class=vtext>
<input type="hidden" name="dp" value="1" >
<table width="95%" border="0" cellspacing="1" cellpadding="0" class=vtext align="center" bgcolor=#49A7F4>
<tr bgcolor=#49A7F4>
<td colspan="2" height="40"> <img src="../images/tip.gif" width="10" height="8">
<%=Request.Form("sTitle")%></td>
</tr>
<tr bgcolor="<%=Session("vcolcolor")%>" style="display:tnone">
<td width="80" height="19" align="center">查詢條件</td>
<td height="19" width="436" bgcolor="<%=Session("vcolcolor")%>">
<select name="s1" style="width:100" >
<%=t3%>
</select>
<select name="s2" style="width:60" >
<option value="]">大于</option>
<option value="[">小于</option>
<option value="=">等于</option>
<option value=' LIKE ' selected>包含</option>
<option value='[]'>不等于</option>
<option value=' NOT LIKE '>不包含</option>
</select>
<input type="text" class=vinputtext name="s3" onKeyDown=gonext("Submit22")>
<input type="button" class=vinputbutton name="Submit22" value="添加" onClick="javascript:setcond()" >
<input type="button" class=vinputbutton name="Submit222" value="刪除" onClick="javascript:removecond()" >
</td>
</tr>
<tr bgcolor="<%=Session("vcolcolor")%>" style="display:tnone">
<td width="80" height="20" align="center"> </td>
<td height="20" width="436" bgcolor="<%=Session("vcolcolor")%>">
<select name="Condlist" size="8" style="width:100%">
</select>
</td>
</tr>
<input type="hidden" name="tiaojian" value=mCond2.value >
<tr bgcolor="<%=Session("vcolcolor")%>">
<td width="80" height="40" align="center"></td>
<td height="40" width="436">
<button class=vinputbutton style="height=24" onClick="javascript:CountValue()"><img src="../dbdisp/images/search.gif" align="absmiddle"> 查詢</button>
</td>
</tr>
</table>
<input type="hidden" name="mCond2" >
<input type="hidden" name="LinkFlag" value="000100">
<input type="hidden" name="EnabledAddNew" value="no">
<input type="hidden" name="mFiledsCount" value="<%=Request.Form("MmFiledsCount")%>">
<input type="hidden" name="mFileds" value="<%=Request.Form("MmFileds")%>">
<input type="hidden" name="mFiledsCaptions" value="<%=Request.Form("MmFiledsCaptions")%>">
<input type="hidden" name="mFiledsWidths" value="<%=Request.Form("MmFiledsWidths")%>">
<input type="hidden" name="mSortBy2" value="<%=Request.Form("MmSortBy2")%>">
<input type="hidden" name="DispFile" value="<%=Request.Form("MDispFile")%>">
<input type="hidden" name="mTable" value="<%=Request.Form("MmTable")%>">
<input type="hidden" name="mTitle" value="<%=Request.Form("MmTitle")%>">
<input type="hidden" name="mImage" value="../images/search.gif">
<input type="hidden" name="mBack" value="self">
</form>
</body>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -