⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 具有计划、任务、通告、公文、员工档案、等网络办公功能
💻 ASP
字号:

<%
	'////////////////////////////////////////////////////////////////
	'/////文 件 名:综合查询模块
	'/////程序名称:dbdisp/search.asp
	'/////程序描述:
	'/////所属模块:公共
	'/////逻辑结构:
	'/////创建日期:
	'/////修改日期:
	'/////创 建 人:熊伟
	'////////////////////////////////////////////////////////////////
%>

<!-- #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('数字型字段不允许进行包含或不包含操作!')
		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=<%=Session("vtablebordercolor")%>>
        <tr bgcolor=<%=Session("vtabletitlebackcolor")%>> 
            <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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -